sinatra 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sinatra might be problematic. Click here for more details.

Files changed (5) hide show
  1. data/CHANGES +4 -0
  2. data/Rakefile +51 -9
  3. data/lib/sinatra/base.rb +2 -2
  4. data/sinatra.gemspec +2 -2
  5. metadata +3 -77
data/CHANGES CHANGED
@@ -1,3 +1,7 @@
1
+ = 1.1.4 / 2011-04-13
2
+
3
+ * Compatible with Tilt 1.3. (Konstantin Haase)
4
+
1
5
  = 1.1.3 / 2011-02-20
2
6
 
3
7
  * Fixed issues with `user_agent` condition if the user agent header is missing.
data/Rakefile CHANGED
@@ -9,11 +9,23 @@ task :spec => :test
9
9
  CLEAN.include "**/*.rbc"
10
10
 
11
11
  def source_version
12
- line = File.read('lib/sinatra/base.rb')[/^\s*VERSION = .*/]
13
- line.match(/.*VERSION = '(.*)'/)[1]
12
+ @source_version ||= begin
13
+ line = File.read('lib/sinatra/base.rb')[/^\s*VERSION = .*/]
14
+ line.match(/.*VERSION = '(.*)'/)[1]
15
+ end
16
+ end
17
+
18
+ def prev_feature
19
+ source_version.gsub(/^(\d\.)(\d+)\..*$/) { $1 + ($2.to_i - 1).to_s }
20
+ end
21
+
22
+ def prev_version
23
+ return prev_feature + '.0' if source_version.end_with? '.0'
24
+ source_version.gsub(/\d+$/) { |s| s.to_i - 1 }
14
25
  end
15
26
 
16
27
  # SPECS ===============================================================
28
+
17
29
  task :test do
18
30
  ENV['LANG'] = 'C'
19
31
  ENV.delete 'LC_CTYPE'
@@ -24,19 +36,18 @@ Rake::TestTask.new(:test) do |t|
24
36
  t.ruby_opts = ['-rubygems'] if defined? Gem
25
37
  t.ruby_opts << '-I.'
26
38
  end
39
+
27
40
  # Rcov ================================================================
41
+
28
42
  namespace :test do
29
43
  desc 'Mesures test coverage'
30
44
  task :coverage do
31
45
  rm_f "coverage"
32
- rcov = "rcov --text-summary -Ilib"
33
- system("#{rcov} --no-html --no-color test/*_test.rb")
46
+ sh "rcov -Ilib test/*_test.rb"
34
47
  end
35
48
  end
36
49
 
37
50
  # Website =============================================================
38
- # Building docs requires HAML and the hanna gem:
39
- # gem install mislav-hanna --source=http://gems.github.com
40
51
 
41
52
  desc 'Generate RDoc under doc/api'
42
53
  task 'doc' => ['doc:api']
@@ -44,6 +55,7 @@ task('doc:api') { sh "yardoc -o doc/api" }
44
55
  CLEAN.include 'doc/api'
45
56
 
46
57
  # README ===============================================================
58
+
47
59
  task :add_template, [:name] do |t, args|
48
60
  Dir.glob('README.*') do |file|
49
61
  code = File.read(file)
@@ -56,13 +68,43 @@ task :add_template, [:name] do |t, args|
56
68
  else
57
69
  puts "Adding section to #{file}"
58
70
  template = template.gsub(/Liquid/, args.name.capitalize).gsub(/liquid/, args.name.downcase)
59
- code.gsub! /^(\s*===.*CoffeeScript)/, template << "\n\\1"
71
+ code.gsub! /^(\s*===.*CoffeeScript)/, "\n" << template << "\n\\1"
60
72
  File.open(file, "w") { |f| f << code }
61
73
  end
62
74
  end
63
75
  end
64
76
  end
65
77
 
78
+ # Thanks in announcement ===============================================
79
+
80
+ team = ["Ryan Tomayko", "Blake Mizerany", "Simon Rozet", "Konstantin Haase"]
81
+ desc "list of contributors"
82
+ task :thanks, [:release,:backports] do |t, a|
83
+ a.with_defaults :release => "#{prev_version}..HEAD",
84
+ :backports => "#{prev_feature}.0..#{prev_feature}.x"
85
+ included = `git log --format=format:"%aN\t%s" #{a.release}`.lines.to_a
86
+ excluded = `git log --format=format:"%aN\t%s" #{a.backports}`.lines.to_a
87
+ commits = (included - excluded).group_by { |c| c[/^[^\t]+/] }
88
+ authors = commits.keys.sort_by { |n| - commits[n].size } - team
89
+ puts authors[0..-2].join(', ') << " and " << authors.last,
90
+ "(based on commits included in #{a.release}, but not in #{a.backports})"
91
+ end
92
+
93
+ task :authors, [:format, :sep] do |t, a|
94
+ a.with_defaults :format => "%s (%d)", :sep => ', '
95
+ authors = Hash.new { |h,k| h[k] = 0 }
96
+ blake = "Blake Mizerany"
97
+ mapping = {
98
+ "blake.mizerany@gmail.com" => blake, "bmizerany" => blake,
99
+ "a_user@mac.com" => blake, "ichverstehe" => "Harry Vangberg",
100
+ "Wu Jiang (nouse)" => "Wu Jiang" }
101
+ `git shortlog -s`.lines.map do |line|
102
+ num, name = line.split("\t", 2).map(&:strip)
103
+ authors[mapping[name] || name] += num.to_i
104
+ end
105
+ puts authors.sort_by { |n,c| -c }.map { |e| a.format % e }.join(a.sep)
106
+ end
107
+
66
108
  # PACKAGING ============================================================
67
109
 
68
110
  if defined?(Gem)
@@ -127,8 +169,8 @@ if defined?(Gem)
127
169
  sh <<-SH
128
170
  gem install #{package('.gem')} --local &&
129
171
  gem push #{package('.gem')} &&
130
- git add sinatra.gemspec &&
131
- git commit --allow-empty -m '#{source_version} release' &&
172
+ git commit --allow-empty -a -m '#{source_version} release' &&
173
+ git tag -s v#{source_version} -m '#{source_version} release' &&
132
174
  git tag -s #{source_version} -m '#{source_version} release' &&
133
175
  git push && (git push sinatra || true) &&
134
176
  git push --tags && (git push sinatra --tags || true)
@@ -7,7 +7,7 @@ require 'sinatra/showexceptions'
7
7
  require 'tilt'
8
8
 
9
9
  module Sinatra
10
- VERSION = '1.1.3'
10
+ VERSION = '1.1.4'
11
11
 
12
12
  # The request object. See Rack::Request for more info:
13
13
  # http://rack.rubyforge.org/doc/classes/Rack/Request.html
@@ -506,7 +506,7 @@ module Sinatra
506
506
  else
507
507
  found = false
508
508
  Tilt.mappings.each do |ext, klass|
509
- next unless klass == template
509
+ next unless Array(klass).include? template
510
510
  path = ::File.join(views, "#{data}.#{ext}")
511
511
  break if found = File.exists?(path)
512
512
  end
@@ -3,8 +3,8 @@ Gem::Specification.new do |s|
3
3
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
4
4
 
5
5
  s.name = 'sinatra'
6
- s.version = '1.1.3'
7
- s.date = '2011-02-20'
6
+ s.version = '1.1.4'
7
+ s.date = '2011-04-13'
8
8
 
9
9
  s.description = "Classy web-development dressed in a DSL"
10
10
  s.summary = "Classy web-development dressed in a DSL"
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
5
4
  prerelease:
6
- segments:
7
- - 1
8
- - 1
9
- - 3
10
- version: 1.1.3
5
+ version: 1.1.4
11
6
  platform: ruby
12
7
  authors:
13
8
  - Blake Mizerany
@@ -18,7 +13,7 @@ autorequire:
18
13
  bindir: bin
19
14
  cert_chain: []
20
15
 
21
- date: 2011-02-20 00:00:00 +01:00
16
+ date: 2011-04-13 00:00:00 +02:00
22
17
  default_executable:
23
18
  dependencies:
24
19
  - !ruby/object:Gem::Dependency
@@ -29,10 +24,6 @@ dependencies:
29
24
  requirements:
30
25
  - - ~>
31
26
  - !ruby/object:Gem::Version
32
- hash: 13
33
- segments:
34
- - 1
35
- - 1
36
27
  version: "1.1"
37
28
  type: :runtime
38
29
  version_requirements: *id001
@@ -44,18 +35,9 @@ dependencies:
44
35
  requirements:
45
36
  - - ">="
46
37
  - !ruby/object:Gem::Version
47
- hash: 27
48
- segments:
49
- - 1
50
- - 2
51
- - 2
52
38
  version: 1.2.2
53
39
  - - <
54
40
  - !ruby/object:Gem::Version
55
- hash: 3
56
- segments:
57
- - 2
58
- - 0
59
41
  version: "2.0"
60
42
  type: :runtime
61
43
  version_requirements: *id002
@@ -67,9 +49,6 @@ dependencies:
67
49
  requirements:
68
50
  - - ">="
69
51
  - !ruby/object:Gem::Version
70
- hash: 3
71
- segments:
72
- - 0
73
52
  version: "0"
74
53
  type: :development
75
54
  version_requirements: *id003
@@ -81,10 +60,6 @@ dependencies:
81
60
  requirements:
82
61
  - - ~>
83
62
  - !ruby/object:Gem::Version
84
- hash: 7
85
- segments:
86
- - 0
87
- - 6
88
63
  version: "0.6"
89
64
  type: :development
90
65
  version_requirements: *id004
@@ -96,11 +71,6 @@ dependencies:
96
71
  requirements:
97
72
  - - ">="
98
73
  - !ruby/object:Gem::Version
99
- hash: 7
100
- segments:
101
- - 0
102
- - 5
103
- - 6
104
74
  version: 0.5.6
105
75
  type: :development
106
76
  version_requirements: *id005
@@ -112,10 +82,6 @@ dependencies:
112
82
  requirements:
113
83
  - - ">="
114
84
  - !ruby/object:Gem::Version
115
- hash: 7
116
- segments:
117
- - 3
118
- - 0
119
85
  version: "3.0"
120
86
  type: :development
121
87
  version_requirements: *id006
@@ -127,9 +93,6 @@ dependencies:
127
93
  requirements:
128
94
  - - ">="
129
95
  - !ruby/object:Gem::Version
130
- hash: 3
131
- segments:
132
- - 0
133
96
  version: "0"
134
97
  type: :development
135
98
  version_requirements: *id007
@@ -141,9 +104,6 @@ dependencies:
141
104
  requirements:
142
105
  - - ">="
143
106
  - !ruby/object:Gem::Version
144
- hash: 3
145
- segments:
146
- - 0
147
107
  version: "0"
148
108
  type: :development
149
109
  version_requirements: *id008
@@ -155,9 +115,6 @@ dependencies:
155
115
  requirements:
156
116
  - - ">="
157
117
  - !ruby/object:Gem::Version
158
- hash: 3
159
- segments:
160
- - 0
161
118
  version: "0"
162
119
  type: :development
163
120
  version_requirements: *id009
@@ -169,9 +126,6 @@ dependencies:
169
126
  requirements:
170
127
  - - ">="
171
128
  - !ruby/object:Gem::Version
172
- hash: 3
173
- segments:
174
- - 0
175
129
  version: "0"
176
130
  type: :development
177
131
  version_requirements: *id010
@@ -183,9 +137,6 @@ dependencies:
183
137
  requirements:
184
138
  - - ">="
185
139
  - !ruby/object:Gem::Version
186
- hash: 3
187
- segments:
188
- - 0
189
140
  version: "0"
190
141
  type: :development
191
142
  version_requirements: *id011
@@ -197,9 +148,6 @@ dependencies:
197
148
  requirements:
198
149
  - - ">="
199
150
  - !ruby/object:Gem::Version
200
- hash: 3
201
- segments:
202
- - 0
203
151
  version: "0"
204
152
  type: :development
205
153
  version_requirements: *id012
@@ -211,9 +159,6 @@ dependencies:
211
159
  requirements:
212
160
  - - ">="
213
161
  - !ruby/object:Gem::Version
214
- hash: 3
215
- segments:
216
- - 0
217
162
  version: "0"
218
163
  type: :development
219
164
  version_requirements: *id013
@@ -225,9 +170,6 @@ dependencies:
225
170
  requirements:
226
171
  - - ">="
227
172
  - !ruby/object:Gem::Version
228
- hash: 3
229
- segments:
230
- - 0
231
173
  version: "0"
232
174
  type: :development
233
175
  version_requirements: *id014
@@ -239,10 +181,6 @@ dependencies:
239
181
  requirements:
240
182
  - - ">="
241
183
  - !ruby/object:Gem::Version
242
- hash: 3
243
- segments:
244
- - 2
245
- - 0
246
184
  version: "2.0"
247
185
  type: :development
248
186
  version_requirements: *id015
@@ -254,9 +192,6 @@ dependencies:
254
192
  requirements:
255
193
  - - ">="
256
194
  - !ruby/object:Gem::Version
257
- hash: 3
258
- segments:
259
- - 0
260
195
  version: "0"
261
196
  type: :development
262
197
  version_requirements: *id016
@@ -268,9 +203,6 @@ dependencies:
268
203
  requirements:
269
204
  - - ">="
270
205
  - !ruby/object:Gem::Version
271
- hash: 3
272
- segments:
273
- - 0
274
206
  version: "0"
275
207
  type: :development
276
208
  version_requirements: *id017
@@ -403,23 +335,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
403
335
  requirements:
404
336
  - - ">="
405
337
  - !ruby/object:Gem::Version
406
- hash: 3
407
- segments:
408
- - 0
409
338
  version: "0"
410
339
  required_rubygems_version: !ruby/object:Gem::Requirement
411
340
  none: false
412
341
  requirements:
413
342
  - - ">="
414
343
  - !ruby/object:Gem::Version
415
- hash: 3
416
- segments:
417
- - 0
418
344
  version: "0"
419
345
  requirements: []
420
346
 
421
347
  rubyforge_project: sinatra
422
- rubygems_version: 1.5.2
348
+ rubygems_version: 1.6.2
423
349
  signing_key:
424
350
  specification_version: 2
425
351
  summary: Classy web-development dressed in a DSL