sinatra-contrib 3.2.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03c164118c404e74ff0c1be0a36177ab2ab8b0409444fa71bc9a4297b4f08a6a
4
- data.tar.gz: f55df9470405a33061f506b6dbc24641a85d0067d684d939bb69311e1d762c81
3
+ metadata.gz: 3847278bcdd943f86243445ea0959559d9c0f148b2320e07f4474400af3d69c9
4
+ data.tar.gz: 6430fb1432cfa954fcffbadf3edcae9b8c622c69cc118c3cd21e9489f489a3af
5
5
  SHA512:
6
- metadata.gz: 4efe2c51cd24dfcacc0150f2d298edb7358de015fdb6ab37ca023d36df23fd6c08b1823f8d0c7b657306cc2f8a9a72ec440b9a69e87def6d7fc5ad32fa70def3
7
- data.tar.gz: b04167f8e4d6532cc6bb118b3e18301cf008c0face2d833cfb596bd83c6080ea586867788f1d6ec2318e75d266cd11a7c892fc8a95f42b8483ba3ef29b1aa424
6
+ metadata.gz: 01dc3a37a746bdd1229776b7da8de2920e5ced4ddd3d571aaece41b45828975f42916ab165225a221c9265f24a07975aa9290ae08685d7149d0716314d9b28db
7
+ data.tar.gz: b5dd64828094ab97e66af29e9be9aab13f9d42cd598f796d6917502e2ce0aaa00ccf7970c9f09ccb5fa20d10fbc5da136cb1a88e4268e0530cf2cb7811216ce7
data/README.md CHANGED
@@ -69,7 +69,7 @@ consider using an alternative like [rerun](https://github.com/alexch/rerun) or
69
69
  * [`sinatra/test_helpers`][sinatra-test-helpers]: Helper methods to ease testing your Sinatra
70
70
  application. Partly extracted from Sinatra. Testing framework agnostic
71
71
 
72
- * `sinatra/quiet_logger`: Extension to exclude specific pathes from access log.
72
+ * `sinatra/quiet_logger`: Extension to exclude specific paths from access log.
73
73
  It works by patching Rack::CommonLogger
74
74
 
75
75
  ## Installation
data/ideas.md CHANGED
@@ -10,7 +10,7 @@
10
10
  end
11
11
 
12
12
  * `sinatra-smart-cache`: update cache header only if arguments are more
13
- restrictive than curent value, set caching headers that way for most helper
13
+ restrictive than current value, set caching headers that way for most helper
14
14
  methods (i.e. `send_file`)
15
15
 
16
16
  * Some verbose logging extension: Log what filters, routes, error handlers,
@@ -92,7 +92,7 @@ module Sinatra
92
92
  with_haml_buffer(buffer) { capture_haml(*args, &block) }
93
93
  else
94
94
  buf_was = @_out_buf
95
- @_out_buf = ''
95
+ @_out_buf = +''
96
96
  begin
97
97
  raw = block[*args]
98
98
  captured = block.binding.eval('@_out_buf')
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sinatra
4
4
  module Contrib
5
- VERSION = '3.2.0'
5
+ VERSION = '4.1.0'
6
6
  end
7
7
  end
@@ -60,7 +60,7 @@ module Sinatra
60
60
  attr_reader :options
61
61
 
62
62
  def initialize(app)
63
- @response_string = nil
63
+ @response_array = nil
64
64
  @response_hash = {}
65
65
  @response = app.response
66
66
  @request = app.request
@@ -309,12 +309,12 @@ module Sinatra
309
309
  end
310
310
 
311
311
  def parse_response
312
- string = @response['Set-Cookie']
313
- return if @response_string == string
312
+ cookies_from_response = Array(@response['Set-Cookie'])
313
+ return if @response_array == cookies_from_response
314
314
 
315
315
  hash = {}
316
316
 
317
- string.each_line do |line|
317
+ cookies_from_response.each do |line|
318
318
  key, value = line.split(';', 2).first.to_s.split('=', 2)
319
319
  next if key.nil?
320
320
 
@@ -328,7 +328,7 @@ module Sinatra
328
328
  end
329
329
 
330
330
  @response_hash.replace hash
331
- @response_string = string
331
+ @response_array = cookies_from_response
332
332
  end
333
333
 
334
334
  def request_cookies
@@ -13,7 +13,7 @@ module Sinatra
13
13
  # require 'sinatra/haml_helpers'
14
14
  #
15
15
  # class Application < Sinatra::Base
16
- # register Sinatra::HamlHelpers
16
+ # helpers Sinatra::HamlHelpers
17
17
  #
18
18
  # # now you can use the helpers in your views
19
19
  # get '/' do
@@ -88,11 +88,13 @@ module Sinatra
88
88
  http_pattern = ['<%s>', *options].join ';'
89
89
  link = (response['Link'] ||= '')
90
90
 
91
+ link = response['Link'] = +link
92
+
91
93
  urls.map do |url|
92
- link << ",\n" unless link.empty?
94
+ link << "," unless link.empty?
93
95
  link << (http_pattern % url)
94
96
  html_pattern % url
95
- end.join "\n"
97
+ end.join
96
98
  end
97
99
 
98
100
  ##
@@ -117,10 +119,10 @@ module Sinatra
117
119
  yield if block_given?
118
120
  return '' unless response.include? 'Link'
119
121
 
120
- response['Link'].split(",\n").map do |line|
122
+ response['Link'].split(",").map do |line|
121
123
  url, *opts = line.split(';').map(&:strip)
122
124
  "<link href=\"#{url[1..-2]}\" #{opts.join ' '} />"
123
- end.join "\n"
125
+ end.join
124
126
  end
125
127
 
126
128
  def self.registered(_base)
@@ -395,12 +395,12 @@ module Sinatra
395
395
  # attr_reader :register_path warn on -w (private attribute)
396
396
  def register_path; @register_path ||= nil; end
397
397
 
398
- # Indicates an extesion is being registered.
398
+ # Indicates an extension is being registered.
399
399
  def start_registering_extension
400
400
  @register_path = caller_files[2]
401
401
  end
402
402
 
403
- # Indicates the extesion has already been registered.
403
+ # Indicates the extension has already been registered.
404
404
  def stop_registering_extension
405
405
  @register_path = nil
406
406
  end
@@ -92,7 +92,7 @@ module Sinatra
92
92
  end
93
93
 
94
94
  def log
95
- @log ||= ''
95
+ @log ||= +''
96
96
  loop { @log << pipe.read_nonblock(1) }
97
97
  rescue Exception
98
98
  @log
@@ -21,7 +21,7 @@ module Sinatra
21
21
  # end
22
22
  # end
23
23
  #
24
- # You can use it in classic application just by requring the extension:
24
+ # You can use it in classic application just by requiring the extension:
25
25
  #
26
26
  # require 'sinatra'
27
27
  # require 'sinatra/webdav'
@@ -35,7 +35,7 @@ RubyGems 2.0 or newer is required to protect against public gem pushes. You can
35
35
  'rubygems_mfa_required' => 'true'
36
36
  }
37
37
 
38
- s.required_ruby_version = '>= 2.6.0'
38
+ s.required_ruby_version = '>= 2.7.8'
39
39
 
40
40
  s.add_dependency 'multi_json', '>= 0.0.2'
41
41
  s.add_dependency 'mustermann', '~> 3.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-contrib
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://github.com/sinatra/sinatra/graphs/contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-29 00:00:00.000000000 Z
11
+ date: 2024-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 3.2.0
47
+ version: 4.1.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 3.2.0
54
+ version: 4.1.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: sinatra
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 3.2.0
61
+ version: 4.1.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 3.2.0
68
+ version: 4.1.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: tilt
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -131,14 +131,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
131
131
  requirements:
132
132
  - - ">="
133
133
  - !ruby/object:Gem::Version
134
- version: 2.6.0
134
+ version: 2.7.8
135
135
  required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - ">="
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
140
  requirements: []
141
- rubygems_version: 3.5.3
141
+ rubygems_version: 3.5.22
142
142
  signing_key:
143
143
  specification_version: 4
144
144
  summary: Collection of useful Sinatra extensions.