sinatra-contrib 3.1.0 → 3.2.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: f0bffd33869745287a4ebe72f36cb2f7f5261f4875d6527ea5ae0c6bf4c0b7ab
4
- data.tar.gz: 14bde99fedc38325348371a7b8cb414177598d0f7f8040267cfd6e97c2cb72df
3
+ metadata.gz: 03c164118c404e74ff0c1be0a36177ab2ab8b0409444fa71bc9a4297b4f08a6a
4
+ data.tar.gz: f55df9470405a33061f506b6dbc24641a85d0067d684d939bb69311e1d762c81
5
5
  SHA512:
6
- metadata.gz: a7223b638c4ba32d08624d6e81262e783790d05cf54f6cfdd13f1dbe7b830cfc2759aa90a76ce8da7939166eb987ae2313160a74384d86401dfcab8946824647
7
- data.tar.gz: 075d7c1e54fd52e20ca534ff6e5daadddea714dadbf7fc6fa0ec194414af7e6093c01f0af012f834c33da0fa2d3c41a1f7a4c4029bf4e9a29909e8bc643e13d3
6
+ metadata.gz: 4efe2c51cd24dfcacc0150f2d298edb7358de015fdb6ab37ca023d36df23fd6c08b1823f8d0c7b657306cc2f8a9a72ec440b9a69e87def6d7fc5ad32fa70def3
7
+ data.tar.gz: b04167f8e4d6532cc6bb118b3e18301cf008c0face2d833cfb596bd83c6080ea586867788f1d6ec2318e75d266cd11a7c892fc8a95f42b8483ba3ef29b1aa424
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sinatra
4
4
  module Contrib
5
- VERSION = '3.1.0'
5
+ VERSION = '3.2.0'
6
6
  end
7
7
  end
@@ -28,6 +28,8 @@ module Sinatra
28
28
  # Other extensions you don't want to be loaded unless needed.
29
29
  module Custom
30
30
  register :Reloader, 'sinatra/reloader'
31
+
32
+ helpers :HamlHelpers, 'sinatra/haml_helpers'
31
33
  end
32
34
 
33
35
  ##
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'sinatra/base'
4
+ require 'sinatra/capture'
5
+
6
+ module Sinatra
7
+ # = Sinatra::HamlHelpers
8
+ #
9
+ # This extension provides some of the helper methods that existed in Haml 5
10
+ # but were removed in Haml 6. To use this in your app, just +register+ it:
11
+ #
12
+ # require 'sinatra/base'
13
+ # require 'sinatra/haml_helpers'
14
+ #
15
+ # class Application < Sinatra::Base
16
+ # register Sinatra::HamlHelpers
17
+ #
18
+ # # now you can use the helpers in your views
19
+ # get '/' do
20
+ # haml_code = <<~HAML
21
+ # %p
22
+ # != surround "(", ")" do
23
+ # %a{ href: "https://example.org/" } example.org
24
+ # HAML
25
+ # haml haml_code
26
+ # end
27
+ # end
28
+ #
29
+ module HamlHelpers
30
+ include Sinatra::Capture
31
+
32
+ def surround(front, back = front, &block)
33
+ "#{front}#{_capture_haml(&block).chomp}#{back}\n"
34
+ end
35
+
36
+ def precede(str, &block)
37
+ "#{str}#{_capture_haml(&block).chomp}\n"
38
+ end
39
+
40
+ def succeed(str, &block)
41
+ "#{_capture_haml(&block).chomp}#{str}\n"
42
+ end
43
+
44
+ def _capture_haml(*args, &block)
45
+ capture(*args, &block)
46
+ end
47
+ end
48
+
49
+ helpers HamlHelpers
50
+ end
@@ -117,7 +117,7 @@ module Sinatra
117
117
 
118
118
  if Time.now - @started > timeout
119
119
  warn command, log
120
- raise 'timeout'
120
+ raise "timeout starting server with command '#{command}'"
121
121
  else
122
122
  sleep 0.1
123
123
  end
@@ -37,23 +37,9 @@ RubyGems 2.0 or newer is required to protect against public gem pushes. You can
37
37
 
38
38
  s.required_ruby_version = '>= 2.6.0'
39
39
 
40
- s.add_dependency 'multi_json'
40
+ s.add_dependency 'multi_json', '>= 0.0.2'
41
41
  s.add_dependency 'mustermann', '~> 3.0'
42
42
  s.add_dependency 'rack-protection', version
43
43
  s.add_dependency 'sinatra', version
44
44
  s.add_dependency 'tilt', '~> 2.0'
45
-
46
- s.add_development_dependency 'asciidoctor'
47
- s.add_development_dependency 'builder'
48
- s.add_development_dependency 'erubi'
49
- s.add_development_dependency 'haml'
50
- s.add_development_dependency 'liquid'
51
- s.add_development_dependency 'markaby'
52
- s.add_development_dependency 'nokogiri'
53
- s.add_development_dependency 'rack-test', '~> 2'
54
- s.add_development_dependency 'rake', '>= 12.3.3'
55
- s.add_development_dependency 'redcarpet'
56
- s.add_development_dependency 'rspec', '~> 3'
57
- s.add_development_dependency 'sass-embedded', '~> 1.54'
58
- s.add_development_dependency 'slim'
59
45
  end
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.1.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://github.com/sinatra/sinatra/graphs/contributors
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-07 00:00:00.000000000 Z
11
+ date: 2023-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 0.0.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 0.0.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mustermann
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 3.1.0
47
+ version: 3.2.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.1.0
54
+ version: 3.2.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.1.0
61
+ version: 3.2.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.1.0
68
+ version: 3.2.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: tilt
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -80,188 +80,6 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '2.0'
83
- - !ruby/object:Gem::Dependency
84
- name: asciidoctor
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: builder
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: erubi
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: haml
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: liquid
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
- - !ruby/object:Gem::Dependency
154
- name: markaby
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: '0'
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: '0'
167
- - !ruby/object:Gem::Dependency
168
- name: nokogiri
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - ">="
172
- - !ruby/object:Gem::Version
173
- version: '0'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - ">="
179
- - !ruby/object:Gem::Version
180
- version: '0'
181
- - !ruby/object:Gem::Dependency
182
- name: rack-test
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - "~>"
186
- - !ruby/object:Gem::Version
187
- version: '2'
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - "~>"
193
- - !ruby/object:Gem::Version
194
- version: '2'
195
- - !ruby/object:Gem::Dependency
196
- name: rake
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - ">="
200
- - !ruby/object:Gem::Version
201
- version: 12.3.3
202
- type: :development
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - ">="
207
- - !ruby/object:Gem::Version
208
- version: 12.3.3
209
- - !ruby/object:Gem::Dependency
210
- name: redcarpet
211
- requirement: !ruby/object:Gem::Requirement
212
- requirements:
213
- - - ">="
214
- - !ruby/object:Gem::Version
215
- version: '0'
216
- type: :development
217
- prerelease: false
218
- version_requirements: !ruby/object:Gem::Requirement
219
- requirements:
220
- - - ">="
221
- - !ruby/object:Gem::Version
222
- version: '0'
223
- - !ruby/object:Gem::Dependency
224
- name: rspec
225
- requirement: !ruby/object:Gem::Requirement
226
- requirements:
227
- - - "~>"
228
- - !ruby/object:Gem::Version
229
- version: '3'
230
- type: :development
231
- prerelease: false
232
- version_requirements: !ruby/object:Gem::Requirement
233
- requirements:
234
- - - "~>"
235
- - !ruby/object:Gem::Version
236
- version: '3'
237
- - !ruby/object:Gem::Dependency
238
- name: sass-embedded
239
- requirement: !ruby/object:Gem::Requirement
240
- requirements:
241
- - - "~>"
242
- - !ruby/object:Gem::Version
243
- version: '1.54'
244
- type: :development
245
- prerelease: false
246
- version_requirements: !ruby/object:Gem::Requirement
247
- requirements:
248
- - - "~>"
249
- - !ruby/object:Gem::Version
250
- version: '1.54'
251
- - !ruby/object:Gem::Dependency
252
- name: slim
253
- requirement: !ruby/object:Gem::Requirement
254
- requirements:
255
- - - ">="
256
- - !ruby/object:Gem::Version
257
- version: '0'
258
- type: :development
259
- prerelease: false
260
- version_requirements: !ruby/object:Gem::Requirement
261
- requirements:
262
- - - ">="
263
- - !ruby/object:Gem::Version
264
- version: '0'
265
83
  description: Collection of useful Sinatra extensions
266
84
  email: sinatrarb@googlegroups.com
267
85
  executables: []
@@ -283,6 +101,7 @@ files:
283
101
  - lib/sinatra/custom_logger.rb
284
102
  - lib/sinatra/engine_tracking.rb
285
103
  - lib/sinatra/extension.rb
104
+ - lib/sinatra/haml_helpers.rb
286
105
  - lib/sinatra/json.rb
287
106
  - lib/sinatra/link_header.rb
288
107
  - lib/sinatra/multi_route.rb
@@ -304,7 +123,7 @@ metadata:
304
123
  homepage_uri: http://sinatrarb.com/contrib/
305
124
  documentation_uri: https://www.rubydoc.info/gems/sinatra-contrib
306
125
  rubygems_mfa_required: 'true'
307
- post_install_message:
126
+ post_install_message:
308
127
  rdoc_options: []
309
128
  require_paths:
310
129
  - lib
@@ -319,8 +138,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
319
138
  - !ruby/object:Gem::Version
320
139
  version: '0'
321
140
  requirements: []
322
- rubygems_version: 3.4.18
323
- signing_key:
141
+ rubygems_version: 3.5.3
142
+ signing_key:
324
143
  specification_version: 4
325
144
  summary: Collection of useful Sinatra extensions.
326
145
  test_files: []