sinatra-contrib 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,42 +4,14 @@ module Sinatra
4
4
  VERSION
5
5
  end
6
6
 
7
- module VERSION
8
- extend Comparable
7
+ SIGNATURE = [1, 3, 1]
8
+ VERSION = SIGNATURE.join('.')
9
9
 
10
- MAJOR = 1
11
- MINOR = 3
12
- TINY = 0
13
- SIGNATURE = [MAJOR, MINOR, TINY]
14
- STRING = SIGNATURE.join '.'
15
-
16
- def self.major; MAJOR end
17
- def self.minor; MINOR end
18
- def self.tiny; TINY end
19
- def self.to_s; STRING end
20
-
21
- def self.hash
22
- STRING.hash
23
- end
24
-
25
- def self.<=>(other)
26
- other = other.split('.').map { |i| i.to_i } if other.respond_to? :split
27
- SIGNATURE <=> Array(other)
28
- end
29
-
30
- def self.inspect
31
- STRING.inspect
32
- end
33
-
34
- def self.respond_to?(meth, *)
35
- return true if super
36
- meth.to_s !~ /^__|^to_str$/ and STRING.respond_to? meth
37
- end
38
-
39
- def self.method_missing(meth, *args, &block)
40
- return super unless STRING.respond_to?(meth)
41
- STRING.send(meth, *args, &block)
42
- end
10
+ VERSION.extend Comparable
11
+ def VERSION.<=>(other)
12
+ other = other.split('.').map { |i| i.to_i } if other.respond_to? :split
13
+ SIGNATURE <=> Array(other)
43
14
  end
44
15
  end
45
16
  end
17
+
@@ -333,14 +333,14 @@ module Sinatra
333
333
 
334
334
  # Indicates with a +glob+ which files should be reloaded if they
335
335
  # have been modified. It can be called several times.
336
- def also_reload(glob)
337
- Dir[glob].each { |path| Watcher::List.for(self).watch_file(path) }
336
+ def also_reload(*glob)
337
+ Dir[*glob].each { |path| Watcher::List.for(self).watch_file(path) }
338
338
  end
339
339
 
340
340
  # Indicates with a +glob+ which files should not be reloaded even if
341
341
  # they have been modified. It can be called several times.
342
- def dont_reload(glob)
343
- Dir[glob].each { |path| Watcher::List.for(self).ignore(path) }
342
+ def dont_reload(*glob)
343
+ Dir[*glob].each { |path| Watcher::List.for(self).ignore(path) }
344
344
  end
345
345
 
346
346
  private
@@ -1,7 +1,7 @@
1
1
  # Run `rake sinatra-contrib.gemspec` to update the gemspec.
2
2
  Gem::Specification.new do |s|
3
3
  s.name = "sinatra-contrib"
4
- s.version = "1.3.0"
4
+ s.version = "1.3.1"
5
5
  s.description = "Collection of useful Sinatra extensions"
6
6
  s.homepage = "http://github.com/sinatra/sinatra-contrib"
7
7
  s.summary = s.description
@@ -56,6 +56,7 @@ Gem::Specification.new do |s|
56
56
  "sinatra-contrib.gemspec",
57
57
  "spec/capture_spec.rb",
58
58
  "spec/config_file/key_value.yml",
59
+ "spec/config_file/key_value_override.yml",
59
60
  "spec/config_file/missing_env.yml",
60
61
  "spec/config_file/with_envs.yml",
61
62
  "spec/config_file/with_nested_envs.yml",
@@ -0,0 +1,2 @@
1
+ ---
2
+ foo: foo
@@ -41,4 +41,13 @@ describe Sinatra::ConfigFile do
41
41
  config_file('missing_env.yml') { set :foo => 42, :environment => :test }
42
42
  settings.foo.should == 42
43
43
  end
44
+
45
+ it 'should prioritize settings in latter files' do
46
+ # first let's check the test is actually working properly
47
+ config_file 'key_value.yml'
48
+ settings.foo.should == 'bar'
49
+ # now test it
50
+ config_file 'key_value_override.yml'
51
+ settings.foo.should == 'foo'
52
+ end
44
53
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-contrib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -19,7 +19,7 @@ date: 2011-10-01 00:00:00.000000000Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: sinatra
22
- requirement: &2153294180 !ruby/object:Gem::Requirement
22
+ requirement: &2153005720 !ruby/object:Gem::Requirement
23
23
  none: false
24
24
  requirements:
25
25
  - - ~>
@@ -27,10 +27,10 @@ dependencies:
27
27
  version: 1.3.0
28
28
  type: :runtime
29
29
  prerelease: false
30
- version_requirements: *2153294180
30
+ version_requirements: *2153005720
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: backports
33
- requirement: &2153293160 !ruby/object:Gem::Requirement
33
+ requirement: &2153005140 !ruby/object:Gem::Requirement
34
34
  none: false
35
35
  requirements:
36
36
  - - ! '>='
@@ -38,10 +38,10 @@ dependencies:
38
38
  version: '2.0'
39
39
  type: :runtime
40
40
  prerelease: false
41
- version_requirements: *2153293160
41
+ version_requirements: *2153005140
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: tilt
44
- requirement: &2153292040 !ruby/object:Gem::Requirement
44
+ requirement: &2153004220 !ruby/object:Gem::Requirement
45
45
  none: false
46
46
  requirements:
47
47
  - - ~>
@@ -49,10 +49,10 @@ dependencies:
49
49
  version: '1.3'
50
50
  type: :runtime
51
51
  prerelease: false
52
- version_requirements: *2153292040
52
+ version_requirements: *2153004220
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: rack-test
55
- requirement: &2153290380 !ruby/object:Gem::Requirement
55
+ requirement: &2153003320 !ruby/object:Gem::Requirement
56
56
  none: false
57
57
  requirements:
58
58
  - - ! '>='
@@ -60,10 +60,10 @@ dependencies:
60
60
  version: '0'
61
61
  type: :runtime
62
62
  prerelease: false
63
- version_requirements: *2153290380
63
+ version_requirements: *2153003320
64
64
  - !ruby/object:Gem::Dependency
65
65
  name: rack-protection
66
- requirement: &2153270140 !ruby/object:Gem::Requirement
66
+ requirement: &2153002460 !ruby/object:Gem::Requirement
67
67
  none: false
68
68
  requirements:
69
69
  - - ! '>='
@@ -71,10 +71,10 @@ dependencies:
71
71
  version: '0'
72
72
  type: :runtime
73
73
  prerelease: false
74
- version_requirements: *2153270140
74
+ version_requirements: *2153002460
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: eventmachine
77
- requirement: &2153269580 !ruby/object:Gem::Requirement
77
+ requirement: &2153002020 !ruby/object:Gem::Requirement
78
78
  none: false
79
79
  requirements:
80
80
  - - ! '>='
@@ -82,10 +82,10 @@ dependencies:
82
82
  version: '0'
83
83
  type: :runtime
84
84
  prerelease: false
85
- version_requirements: *2153269580
85
+ version_requirements: *2153002020
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: rspec
88
- requirement: &2153268720 !ruby/object:Gem::Requirement
88
+ requirement: &2153001220 !ruby/object:Gem::Requirement
89
89
  none: false
90
90
  requirements:
91
91
  - - ~>
@@ -93,10 +93,10 @@ dependencies:
93
93
  version: '2.3'
94
94
  type: :development
95
95
  prerelease: false
96
- version_requirements: *2153268720
96
+ version_requirements: *2153001220
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: haml
99
- requirement: &2153268300 !ruby/object:Gem::Requirement
99
+ requirement: &2153000680 !ruby/object:Gem::Requirement
100
100
  none: false
101
101
  requirements:
102
102
  - - ! '>='
@@ -104,10 +104,10 @@ dependencies:
104
104
  version: '0'
105
105
  type: :development
106
106
  prerelease: false
107
- version_requirements: *2153268300
107
+ version_requirements: *2153000680
108
108
  - !ruby/object:Gem::Dependency
109
109
  name: erubis
110
- requirement: &2153267840 !ruby/object:Gem::Requirement
110
+ requirement: &2152999920 !ruby/object:Gem::Requirement
111
111
  none: false
112
112
  requirements:
113
113
  - - ! '>='
@@ -115,10 +115,10 @@ dependencies:
115
115
  version: '0'
116
116
  type: :development
117
117
  prerelease: false
118
- version_requirements: *2153267840
118
+ version_requirements: *2152999920
119
119
  - !ruby/object:Gem::Dependency
120
120
  name: slim
121
- requirement: &2153267240 !ruby/object:Gem::Requirement
121
+ requirement: &2152999280 !ruby/object:Gem::Requirement
122
122
  none: false
123
123
  requirements:
124
124
  - - ! '>='
@@ -126,10 +126,10 @@ dependencies:
126
126
  version: '0'
127
127
  type: :development
128
128
  prerelease: false
129
- version_requirements: *2153267240
129
+ version_requirements: *2152999280
130
130
  - !ruby/object:Gem::Dependency
131
131
  name: rake
132
- requirement: &2153266600 !ruby/object:Gem::Requirement
132
+ requirement: &2152998780 !ruby/object:Gem::Requirement
133
133
  none: false
134
134
  requirements:
135
135
  - - ! '>='
@@ -137,7 +137,7 @@ dependencies:
137
137
  version: '0'
138
138
  type: :development
139
139
  prerelease: false
140
- version_requirements: *2153266600
140
+ version_requirements: *2152998780
141
141
  description: Collection of useful Sinatra extensions
142
142
  email:
143
143
  - konstantin.mailinglists@googlemail.com
@@ -177,6 +177,7 @@ files:
177
177
  - sinatra-contrib.gemspec
178
178
  - spec/capture_spec.rb
179
179
  - spec/config_file/key_value.yml
180
+ - spec/config_file/key_value_override.yml
180
181
  - spec/config_file/missing_env.yml
181
182
  - spec/config_file/with_envs.yml
182
183
  - spec/config_file/with_nested_envs.yml