rack-handlers 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: 97fb1f3567cdeaa4b70c22b96cfc47f859b97d53
4
+ data.tar.gz: b65abcf06838ad66c1a398ed1a609379240061c8
5
+ !binary "U0hBNTEy":
6
+ metadata.gz: 0f867ed4d07d1b4a9fae63475b83e76680227e9204a507f6a64da8a83fc4243c0c814dbedf65316ff69d7236b518bcb67c5c02548ae8a41a28ed6479d8309bd2
7
+ data.tar.gz: 3bff97ba81c9d1a88c4dde2c25a8f60df0981227051a718025fdd865a31f62ba15f892f929fcb9c1b3cebd607cf8a6b57b6f430c8c6d283a7dcb3f0492cfddbd
data/CHANGES.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # CHANGES
2
2
 
3
+ ## rack-handlers 0.5.6 -- 2013-04-01
4
+
5
+ * [rails server] Don't hack Rack. Instead, always try to look up
6
+ default config path. If there's nothing, then don't load the config.
7
+
3
8
  ## rack-handlers 0.5.5 -- 2012-08-23
4
9
 
5
10
  * Fix an error from running simply `rails`.
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ desc 'Generate gemspec'
8
8
  task 'gem:spec' do
9
9
  Gemgem.spec = Gemgem.create do |s|
10
10
  s.name = 'rack-handlers'
11
- s.version = '0.5.5'
11
+ s.version = '0.5.6'
12
12
 
13
13
  %w[rack].each{ |g| s.add_runtime_dependency(g) }
14
14
  end
@@ -3,21 +3,9 @@ if ARGV[0] && ARGV[0] == 'server'[0, ARGV[0].size] && ARGV[1] !~ /^\w+/
3
3
  server = %w[zbatery rainbows unicorn puma thin].find do |s|
4
4
  begin
5
5
  require s
6
-
7
- require 'rack/server'
8
- class ::Rack::Server
9
- alias_method :old_default_options, :default_options
10
- end
11
-
12
- ::Rack::Server.module_eval <<-RUBY
13
- def default_options
14
- old_default_options.merge(:config_file => "config/#{s}.rb")
15
- end
16
- RUBY
17
-
18
6
  true
19
-
20
7
  rescue LoadError
8
+ false
21
9
  end
22
10
  end
23
11
 
@@ -8,9 +8,12 @@ class Rack::Handler::Unicorn
8
8
  end
9
9
 
10
10
  def self.run app, options
11
+ config_path = "config/#{name.downcase}.rb"
12
+ config_file = config_path if File.exist?(config_path)
13
+
11
14
  server = server_class.new(app,
12
15
  :listeners => "#{options[:Host]}:#{options[:Port]}",
13
- :config_file => options[:config_file])
16
+ :config_file => config_file)
14
17
 
15
18
  yield(server) if block_given?
16
19
 
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rack-handlers"
5
- s.version = "0.5.5"
5
+ s.version = "0.5.6"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Lin Jen-Shin (godfat)"]
9
- s.date = "2012-08-23"
9
+ s.date = "2013-04-01"
10
10
  s.description = "Some Rack handlers which are not included in Rack distribution."
11
11
  s.email = ["godfat (XD) godfat.org"]
12
12
  s.files = [
@@ -20,16 +20,15 @@ Gem::Specification.new do |s|
20
20
  "lib/rack/handler/unicorn.rb",
21
21
  "lib/rack/handler/zbatery.rb",
22
22
  "rack-handlers.gemspec",
23
- "task/.git",
24
23
  "task/.gitignore",
25
24
  "task/gemgem.rb"]
26
25
  s.homepage = "https://github.com/godfat/rack-handlers"
27
26
  s.require_paths = ["lib"]
28
- s.rubygems_version = "1.8.24"
27
+ s.rubygems_version = "2.0.0"
29
28
  s.summary = "Some Rack handlers which are not included in Rack distribution."
30
29
 
31
30
  if s.respond_to? :specification_version then
32
- s.specification_version = 3
31
+ s.specification_version = 4
33
32
 
34
33
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
35
34
  s.add_runtime_dependency(%q<rack>, [">= 0"])
data/task/gemgem.rb CHANGED
@@ -32,7 +32,8 @@ module Gemgem
32
32
  }
33
33
  @readme ||=
34
34
  if path
35
- ps = File.read(path).scan(/#+[^\n]+\n\n.+?(?=\n\n#+[^\n]+\n)/m)
35
+ ps = "##{File.read(path)}".
36
+ scan(/((#+)[^\n]+\n\n.+?(?=\n\n\2[^#\n]+\n))/m).map(&:first)
36
37
  ps.inject({'HEADER' => ps.first}){ |r, s, i|
37
38
  r[s[/\w+/]] = s
38
39
  r
@@ -61,12 +62,13 @@ module Gemgem
61
62
  end
62
63
 
63
64
  def ann_md
64
- "##{readme['HEADER'].sub(/([\w\-]+)/, "[\\1](#{spec.homepage})")}\n\n" \
65
+ "#{readme['HEADER'].sub(/([\w\-]+)/, "[\\1](#{spec.homepage})")}\n\n" \
65
66
  "##{readme['DESCRIPTION'][/[^\n]+\n\n[^\n]+/]}\n\n" \
66
67
  "### CHANGES:\n\n" \
67
68
  "###{changes}\n\n" \
68
69
  "##{readme['INSTALLATION']}\n\n" +
69
- if readme['SYNOPSIS'] then "##{readme['SYNOPSIS']}" else '' end
70
+ if readme['SYNOPSIS'] then "##{readme['SYNOPSIS'][/[^\n]+\n\n[^\n]+/]}"
71
+ else '' end
70
72
  end
71
73
 
72
74
  def ann_html
@@ -113,7 +115,7 @@ module Gemgem
113
115
 
114
116
  def all_files
115
117
  @all_files ||= find_files(Pathname.new(dir)).map{ |file|
116
- if file.to_s =~ %r{\.git/}
118
+ if file.to_s =~ %r{\.git/|\.git$}
117
119
  nil
118
120
  else
119
121
  file.to_s
@@ -177,7 +179,7 @@ namespace :gem do
177
179
 
178
180
  desc 'Install gem'
179
181
  task :install => [:build] do
180
- sh("#{Gem.ruby} -S gem install pkg/#{Gemgem.gem_tag}")
182
+ sh("#{Gem.ruby} -S gem install pkg/#{Gemgem.gem_tag}.gem")
181
183
  end
182
184
 
183
185
  desc 'Build gem'
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-handlers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
5
- prerelease:
4
+ version: 0.5.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - Lin Jen-Shin (godfat)
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-08-23 00:00:00.000000000 Z
11
+ date: 2013-04-01 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rack
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
@@ -44,32 +41,29 @@ files:
44
41
  - lib/rack/handler/unicorn.rb
45
42
  - lib/rack/handler/zbatery.rb
46
43
  - rack-handlers.gemspec
47
- - task/.git
48
44
  - task/.gitignore
49
45
  - task/gemgem.rb
50
46
  homepage: https://github.com/godfat/rack-handlers
51
47
  licenses: []
48
+ metadata: {}
52
49
  post_install_message:
53
50
  rdoc_options: []
54
51
  require_paths:
55
52
  - lib
56
53
  required_ruby_version: !ruby/object:Gem::Requirement
57
- none: false
58
54
  requirements:
59
55
  - - ! '>='
60
56
  - !ruby/object:Gem::Version
61
57
  version: '0'
62
58
  required_rubygems_version: !ruby/object:Gem::Requirement
63
- none: false
64
59
  requirements:
65
60
  - - ! '>='
66
61
  - !ruby/object:Gem::Version
67
62
  version: '0'
68
63
  requirements: []
69
64
  rubyforge_project:
70
- rubygems_version: 1.8.24
65
+ rubygems_version: 2.0.0
71
66
  signing_key:
72
- specification_version: 3
67
+ specification_version: 4
73
68
  summary: Some Rack handlers which are not included in Rack distribution.
74
69
  test_files: []
75
- has_rdoc:
data/task/.git DELETED
@@ -1 +0,0 @@
1
- gitdir: /Users/godfat/project/godfat/rack-handlers/.git/modules/task