1. 19 1月, 2016 15 次提交
  2. 18 1月, 2016 15 次提交
  3. 17 1月, 2016 9 次提交
    • K
      Don't bother looking up the types. · eb4ec664
      Kasper Timm Hansen 提交于
      If they aren't symbols, then they aren't likely to be in the set anyway.
      eb4ec664
    • K
      Replace class attribute with SET constant. · b1dcfa78
      Kasper Timm Hansen 提交于
      We'll be using this to map over to Action Dispatch's Mime::Set.
      b1dcfa78
    • K
      Remove register abstraction. · c10bb299
      Kasper Timm Hansen 提交于
      The template types is a private abstraction to fill in basic blanks from Action Dispatch's
      mime types. As such we can modify the data structure ourselves.
      c10bb299
    • K
      Replace delegate calls with standard method defs. · bb295be3
      Kasper Timm Hansen 提交于
      Spares a to_sym call by aliasing to_sym to ref.
      
      Then the delegate felt meager for one method; ditch and define method ourselves.
      bb295be3
    • K
      Spare to_sym call in `==`. · f48098bd
      Kasper Timm Hansen 提交于
      The @symbol has already been converted to a symbol in initialize, so no need to call to_sym
      when comparing it.
      
      Ditch early return for a simple unless statement.
      f48098bd
    • K
      Make ref return the internal symbol. · 41ebb556
      Kasper Timm Hansen 提交于
      We delegate to_sym to the internal symbol, which we've already called to_sym on in
      initialize, so we don't need to do that.
      
      We also know to_sym will never return a falsy value, so we'll never hit to_s.
      
      Just return the symbolized symbol.
      41ebb556
    • P
      Checked in changes to Gemfile.lock on latest master · 330469e7
      Prathamesh Sonpatki 提交于
      - Eventmachine version gets updated when `bundle` is run locally.
      330469e7
    • E
      Remove literal? check to fix issue with prefixed optionals · 5d1b7c3b
      eileencodes 提交于
      In commit d993cb36 `build_path` was changed from using `grep` to
      `find_all` to save array allocations.
      
      This change was a little too aggressive in that when the dash comes
      before the symbol like `/omg-:song` the symbol is skipped.
      
      Removing the check for `n.right.left.literal?` fixes this issue, but
      does add back some allocations. The number of allocations are still well
      less than before.
      
      I've added a regression test to test this behavior for the future.
      
      Fixes #23069.
      
      Array allocations as of d993cb36:
      
      ```
      {:T_SYMBOL=>11}
      {:T_REGEXP=>17}
      {:T_STRUCT=>6500}
      {:T_MATCH=>12004}
      {:T_OBJECT=>91009}
      {:T_DATA=>100088}
      {:T_HASH=>114013}
      {:T_STRING=>159637}
      {:T_ARRAY=>321056}
      {:T_IMEMO=>351133}
      ```
      
      Array allocations after this change:
      
      ```
      {:T_SYMBOL=>11}
      {:T_REGEXP=>1017}
      {:T_STRUCT=>6500}
      {:T_MATCH=>12004}
      {:T_DATA=>84092}
      {:T_OBJECT=>87009}
      {:T_HASH=>110015}
      {:T_STRING=>166152}
      {:T_ARRAY=>322056}
      {:T_NODE=>343558}
      ```
      5d1b7c3b
    • E
      Merge pull request #23008 from tawan/avoid-multiple-default-paths · cbb7f7d0
      Eileen M. Uchitelle 提交于
      Avoid multiple default paths to server.pid file
      cbb7f7d0
  4. 16 1月, 2016 1 次提交
    • T
      Avoid multiple default paths to server.pid file · 221b4aea
      Tawan Sierek 提交于
      Fix bug (#22811) that occurs when rails server is started in daemon mode
      and optional path to the `server.pid` file is omitted. Store default path
      in a constant instead of evaluating it multiple time using `File.expand_path`.
      
      The bug in detail: The server startup procedure crashes, since it tries to
      open a file at `/tmp/pids/server.pid` instead of
      `<path to project>/tmp/pids/server.pid`. This bug was introduced in 51211a94
      when Rack was upgraded from version 1.x to 2.x. Since version 2.x,
      Rack does not memoize the options hash [1], and as a consequence
      `Rails::Server#default_options` will be evaluated multiple times.
      The hash returned by `Rails::Server#default_options` holds the default path
      to the `server.pid` file. The path is generated with the method
      `File.expand_path`. However, the return value of this method depends on the
      current working directory [2], which changes once `Process.daemon` is invoked
      by `Rack::Server#daemonize_app` and the process is detached from the current
      shell.
      
      Close #22811
      
      [1]https://git.io/vzen2
      [2]http://ruby-doc.org/core-2.1.5/File.html#method-c-expand_path
      221b4aea