sinatra 1.3.5 → 1.3.6

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.

data/CHANGES CHANGED
@@ -1,3 +1,13 @@
1
+ = 1.3.6 (backport release) / 2013-03-15
2
+
3
+ Backported from 1.4.0:
4
+
5
+ * Take views option into account for template caching. (Konstantin Haase)
6
+
7
+ * Improve documentation (Konstantin Haase)
8
+
9
+ * No longer override `define_singleton_method`. (Konstantin Haase)
10
+
1
11
  = 1.3.5 / 2013-02-25
2
12
 
3
13
  * Fix for RubyGems 2.0 (Uchio KONDO)
@@ -213,6 +223,20 @@
213
223
  * Fix handling of broken query params when displaying exceptions. (Luke
214
224
  Jahnke)
215
225
 
226
+ = 1.2.9 (backports release) / 2013-03-15
227
+
228
+ IMPORTANT: THIS IS THE LAST 1.2.x RELEASE, PLEASE UPGRADE.
229
+
230
+ * Display EOL warning when loading Sinatra. (Konstantin Haase)
231
+
232
+ * Improve documentation. (Anurag Priyam, Konstantin Haase)
233
+
234
+ * Do not modify the load path. (Konstantin Haase)
235
+
236
+ * Display deprecation warning if RUBY_IGNORE_CALLERS is used. (Konstantin Haase)
237
+
238
+ * Add backports library so we can still run on Ruby 1.8.6. (Konstantin Haase)
239
+
216
240
  = 1.2.8 (backports release) / 2011-12-30
217
241
 
218
242
  Backported from 1.3.2:
data/Gemfile CHANGED
@@ -7,7 +7,7 @@
7
7
  # If you have issues with a gem: `bundle install --without-coffee-script`.
8
8
 
9
9
  RUBY_ENGINE = 'ruby' unless defined? RUBY_ENGINE
10
- source :rubygems unless ENV['QUICK']
10
+ source 'https://rubygems.org/' unless ENV['QUICK']
11
11
  gemspec
12
12
 
13
13
  gem 'rake'
@@ -36,7 +36,7 @@ gem 'liquid' unless RUBY_ENGINE == 'rbx' and RUBY_VERSION > '1.9'
36
36
  gem 'slim', '~> 1.0'
37
37
  gem 'temple', '!= 0.3.3'
38
38
  gem 'coffee-script', '>= 2.0'
39
- gem 'rdoc', '~> 3.12'
39
+ gem 'rdoc', RUBY_VERSION < '1.9' ? '~> 3.12' : '>= 4.0'
40
40
  gem 'kramdown'
41
41
  gem 'maruku'
42
42
  gem 'creole'
@@ -54,8 +54,6 @@ end
54
54
 
55
55
  if RUBY_ENGINE == "ruby" and RUBY_VERSION > '1.9'
56
56
  gem 'less', '~> 2.0'
57
- else
58
- gem 'less', '~> 1.0'
59
57
  end
60
58
 
61
59
  if RUBY_ENGINE != 'jruby' or not ENV['TRAVIS']
data/Rakefile CHANGED
@@ -99,8 +99,8 @@ desc "list of contributors"
99
99
  task :thanks, [:release,:backports] do |t, a|
100
100
  a.with_defaults :release => "#{prev_version}..HEAD",
101
101
  :backports => "#{prev_feature}.0..#{prev_feature}.x"
102
- included = `git log --format=format:"%aN\t%s" #{a.release}`.lines.to_a
103
- excluded = `git log --format=format:"%aN\t%s" #{a.backports}`.lines.to_a
102
+ included = `git log --format=format:"%aN\t%s" #{a.release}`.lines.map { |l| l.force_encoding('binary') }
103
+ excluded = `git log --format=format:"%aN\t%s" #{a.backports}`.lines.map { |l| l.force_encoding('binary') }
104
104
  commits = (included - excluded).group_by { |c| c[/^[^\t]+/] }
105
105
  authors = commits.keys.sort_by { |n| - commits[n].size } - team
106
106
  puts authors[0..-2].join(', ') << " and " << authors.last,
@@ -25,11 +25,11 @@ __END__
25
25
 
26
26
  @@ layout
27
27
  <html>
28
- <head>
29
- <title>Super Simple Chat with Sinatra</title>
28
+ <head>
29
+ <title>Super Simple Chat with Sinatra</title>
30
30
  <meta charset="utf-8" />
31
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
32
- </head>
31
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
32
+ </head>
33
33
  <body><%= yield %></body>
34
34
  </html>
35
35
 
@@ -42,6 +42,9 @@ __END__
42
42
 
43
43
  @@ chat
44
44
  <pre id='chat'></pre>
45
+ <form>
46
+ <input id='msg' placeholder='type message here...' />
47
+ </form>
45
48
 
46
49
  <script>
47
50
  // reading
@@ -49,13 +52,10 @@ __END__
49
52
  es.onmessage = function(e) { $('#chat').append(e.data + "\n") };
50
53
 
51
54
  // writing
52
- $("form").live("submit", function(e) {
55
+ $("form").on('submit',function(e) {
53
56
  $.post('/', {msg: "<%= user %>: " + $('#msg').val()});
54
57
  $('#msg').val(''); $('#msg').focus();
55
58
  e.preventDefault();
56
59
  });
57
60
  </script>
58
61
 
59
- <form>
60
- <input id='msg' placeholder='type message here...' />
61
- </form>
@@ -96,7 +96,7 @@ module Sinatra
96
96
  headers["Content-Length"] = body.inject(0) { |l, p| l + Rack::Utils.bytesize(p) }.to_s
97
97
  end
98
98
 
99
- [status.to_i, header, result]
99
+ [status.to_i, headers, result]
100
100
  end
101
101
 
102
102
  private
@@ -130,7 +130,7 @@ module Sinatra
130
130
 
131
131
  private
132
132
 
133
- def setup_close(env, status, header, body)
133
+ def setup_close(env, status, headers, body)
134
134
  return unless body.respond_to? :close and env.include? 'async.close'
135
135
  env['async.close'].callback { body.close }
136
136
  env['async.close'].errback { body.close }
@@ -1076,9 +1076,9 @@ module Sinatra
1076
1076
  end
1077
1077
  end
1078
1078
 
1079
- define_singleton_method("#{option}=", setter) if setter
1080
- define_singleton_method(option, getter) if getter
1081
- define_singleton_method("#{option}?", "!!#{option}") unless method_defined? "#{option}?"
1079
+ define_singleton("#{option}=", setter) if setter
1080
+ define_singleton(option, getter) if getter
1081
+ define_singleton("#{option}?", "!!#{option}") unless method_defined? "#{option}?"
1082
1082
  self
1083
1083
  end
1084
1084
 
@@ -1200,7 +1200,7 @@ module Sinatra
1200
1200
 
1201
1201
  private
1202
1202
  # Dynamically defines a method on settings.
1203
- def define_singleton_method(name, content = Proc.new)
1203
+ def define_singleton(name, content = Proc.new)
1204
1204
  # replace with call to singleton_class once we're 1.9 only
1205
1205
  (class << self; self; end).class_eval do
1206
1206
  undef_method(name) if method_defined? name
@@ -1,3 +1,3 @@
1
1
  module Sinatra
2
- VERSION = '1.3.5'
2
+ VERSION = '1.3.6'
3
3
  end
@@ -82,7 +82,9 @@ private
82
82
  end
83
83
 
84
84
  def self.test_name(name)
85
- "test_#{sanitize_name(name).gsub(/\s+/,'_')}".to_sym
85
+ name = "test_#{sanitize_name(name).gsub(/\s+/,'_')}_0"
86
+ name = name.succ while method_defined? name
87
+ name.to_sym
86
88
  end
87
89
 
88
90
  def self.sanitize_name(name)
@@ -434,7 +434,10 @@ class HelpersTest < Test::Unit::TestCase
434
434
  end
435
435
  end
436
436
 
437
- get '/'
437
+ # Silence warnings since Rack::Session::Cookie complains about the non-present session secret
438
+ silence_warnings do
439
+ get '/'
440
+ end
438
441
  assert_body 'ok'
439
442
  end
440
443
 
@@ -16,13 +16,13 @@ class RdocTest < Test::Unit::TestCase
16
16
  it 'renders inline rdoc strings' do
17
17
  rdoc_app { rdoc '= Hiya' }
18
18
  assert ok?
19
- assert_body /<h1[^>]*>Hiya<\/h1>/
19
+ assert_body /<h1[^>]*>Hiya(<span><a href=\"#label-Hiya\">&para;<\/a> <a href=\"#documentation\">&uarr;<\/a><\/span>)?<\/h1>/
20
20
  end
21
21
 
22
22
  it 'renders .rdoc files in views path' do
23
23
  rdoc_app { rdoc :hello }
24
24
  assert ok?
25
- assert_body /<h1[^>]*>Hello From RDoc<\/h1>/
25
+ assert_body /<h1[^>]*>Hello From RDoc(<span><a href=\"#label-Hello\+From\+RDoc\">&para;<\/a> <a href=\"#documentation\">&uarr;<\/a><\/span>)?<\/h1>/
26
26
  end
27
27
 
28
28
  it "raises error if template not found" do
@@ -8,8 +8,7 @@ class ResponseTest < Test::Unit::TestCase
8
8
  end
9
9
 
10
10
  def assert_same_body(a, b)
11
- enum = Enumerable.const_get(:Enumerator)
12
- assert_equal enum.new(a).to_a, enum.new(b).to_a
11
+ assert_equal a.to_enum(:each).to_a, b.to_enum(:each).to_a
13
12
  end
14
13
 
15
14
  it "initializes with 200, text/html, and empty body" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.5
4
+ version: 1.3.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-02-25 00:00:00.000000000 Z
15
+ date: 2013-03-15 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rack
@@ -219,7 +219,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
219
219
  version: '0'
220
220
  segments:
221
221
  - 0
222
- hash: 2069879997840551551
222
+ hash: -3428773898316879023
223
223
  required_rubygems_version: !ruby/object:Gem::Requirement
224
224
  none: false
225
225
  requirements:
@@ -228,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
228
  version: '0'
229
229
  segments:
230
230
  - 0
231
- hash: 2069879997840551551
231
+ hash: -3428773898316879023
232
232
  requirements: []
233
233
  rubyforge_project:
234
234
  rubygems_version: 1.8.23