hermeneutics 1.24 → 1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df19436c205dec9d79e7ea6329b0039f73c0df18785684b3497a5beacba86de0
4
- data.tar.gz: 71249e9f95d7d3b7a5cc4c69de6dcdf8d50312db07d6b4e06e75df798e24a7f6
3
+ metadata.gz: 3f4027dd9c76ea6a00f300cdf887318983f22f4e55a20534cef11dfd2772388a
4
+ data.tar.gz: 11b4764b8877e335fdf6c4375139044c52accc06189cfb3bd147d48cab18f56e
5
5
  SHA512:
6
- metadata.gz: 53de39c130f7134771b2ae8a03047ddd58ddf8daed8bf1b62e32f3627fe0125324e89a33aec4072cd38e4c5194261322e32d6069533fed8845c352982ca714fc
7
- data.tar.gz: f3b02d37c1397fa5ddc2bf76247d85b1eef0d99a74d0c3afda583e97d1938ab1a7542c3ea557eec95c0deef199ddd1dfa5e73f3618598af009b8848f7def97d9
6
+ metadata.gz: 05bd6e482d1c1c25a60176123d0fdc182b373bd9e95cf9ba9706854abf1ffe7354cddf8eb61baefce51adfa3a67e772467461f31fe6031092813aee33a4e79bb
7
+ data.tar.gz: fa952d5679728fb02430311f5de0132efda7f860b1b315599a520281aa262fe728664d5acfecd36c3cf6a03075d82907f41efba77efb5e0a2e5e3a0afc25b9e6
@@ -91,8 +91,9 @@ module Hermeneutics
91
91
  end
92
92
  end
93
93
 
94
- CGIENV = %w(content document gateway http query
95
- remote request script server unique)
94
+ CGIENV = %w(
95
+ content document gateway http query remote request script server unique
96
+ )
96
97
 
97
98
  private
98
99
 
@@ -197,6 +197,79 @@ module Hermeneutics
197
197
  end
198
198
 
199
199
 
200
+ class Namespace < CommandNamed
201
+
202
+ NAME = :NAMESPACE
203
+
204
+ def initialize
205
+ super
206
+ end
207
+
208
+ def params ; [] ; end
209
+
210
+ end
211
+
212
+
213
+ class List < CommandNamed
214
+
215
+ NAME = :LIST
216
+
217
+ def initialize ref, mailbox
218
+ super *[]
219
+ @ref, @mailbox = ref, mailbox
220
+ end
221
+
222
+ def params ; [ @ref, @mailbox] ; end
223
+
224
+ end
225
+
226
+ class Lsub < List
227
+
228
+ NAME = :LSUB
229
+
230
+ end
231
+
232
+ class Subscribe < CommandNamed
233
+
234
+ NAME = :SUBSCRIBE
235
+
236
+ def initialize mailbox
237
+ super *[]
238
+ @mailbox = mailbox
239
+ end
240
+
241
+ def params ; [ @mailbox] ; end
242
+
243
+ end
244
+
245
+ class Unsubscribe < CommandNamed
246
+
247
+ NAME = :UNSUBSCRIBE
248
+
249
+ def initialize mailbox
250
+ super *[]
251
+ @mailbox = mailbox
252
+ end
253
+
254
+ def params ; [ @mailbox] ; end
255
+
256
+ end
257
+
258
+
259
+ class Status < CommandNamed
260
+
261
+ NAME = :STATUS
262
+
263
+ def initialize mailbox, *items
264
+ super *[]
265
+ @mailbox, @items = mailbox, items
266
+ end
267
+
268
+ def params ; [ @mailbox, @items] ; end
269
+
270
+ end
271
+
272
+
200
273
  class Fetch < CommandNamed
201
274
 
202
275
  NAME = :FETCH
@@ -243,38 +316,6 @@ module Hermeneutics
243
316
 
244
317
  end
245
318
 
246
- class Status < CommandNamed
247
-
248
- NAME = :STATUS
249
-
250
- def initialize mailbox, *items
251
- super *[]
252
- @mailbox, @items = mailbox, items
253
- end
254
-
255
- def params ; [ @mailbox, @items] ; end
256
-
257
- end
258
-
259
- class List < CommandNamed
260
-
261
- NAME = :LIST
262
-
263
- def initialize ref, mailbox
264
- super *[]
265
- @ref, @mailbox = ref, mailbox
266
- end
267
-
268
- def params ; [ @ref, @mailbox] ; end
269
-
270
- end
271
-
272
- class DataLsub < List
273
-
274
- NAME = :LSUB
275
-
276
- end
277
-
278
319
  end
279
320
 
280
321
  end
@@ -41,6 +41,8 @@ module Hermeneutics
41
41
  #
42
42
  class Html
43
43
 
44
+ module Display ; end
45
+
44
46
  class <<self
45
47
  attr_accessor :main
46
48
  def inherited cls
@@ -135,7 +137,7 @@ module Hermeneutics
135
137
  # 2 = newline after both
136
138
  # 3 = and advance indent
137
139
  # 4 = Block without any indent
138
- def tag tag, type, attrs = nil
140
+ def tag tag, type, **attrs
139
141
  tag = tag.to_s
140
142
  nls = type & 0xf
141
143
  if (type & 0x10).nonzero? then
@@ -157,7 +159,9 @@ module Hermeneutics
157
159
  indent_if nls>2 do
158
160
  if block_given? then
159
161
  r = yield
160
- plain r if String === r
162
+ case r
163
+ when String, Display then plain r
164
+ end
161
165
  end
162
166
  end
163
167
  end
@@ -171,7 +175,7 @@ module Hermeneutics
171
175
  nil
172
176
  end
173
177
  # Processing Instruction
174
- def pi_tag tag, attrs = nil
178
+ def pi_tag tag, **attrs
175
179
  tag = tag.to_s
176
180
  brace true do
177
181
  begin
@@ -272,7 +276,6 @@ module Hermeneutics
272
276
  @ind.pop
273
277
  end
274
278
  def mkattrs attrs
275
- attrs or return
276
279
  attrs.each { |k,v|
277
280
  if Symbol === k then k = k.to_s ; k.gsub! /_/, "-" end
278
281
  v = case v
@@ -325,14 +328,14 @@ module Hermeneutics
325
328
 
326
329
  private
327
330
 
328
- def method_missing name, *args, &block
331
+ def method_missing name, *args, **kwargs, &block
329
332
  t = tag? name
330
333
  t or super
331
334
  if String === args.last then
332
335
  b = args.pop
333
- @generator.tag name, t, *args do b end
336
+ @generator.tag name, t, *args, **kwargs do b end
334
337
  else
335
- @generator.tag name, t, *args, &block
338
+ @generator.tag name, t, *args, **kwargs, &block
336
339
  end
337
340
  end
338
341
 
@@ -369,8 +372,7 @@ module Hermeneutics
369
372
  end
370
373
 
371
374
  def javascript str = nil, &block
372
- mime = { type: "text/javascript" }
373
- script mime, str, &block
375
+ script str, type: "text/javascript", &block
374
376
  end
375
377
 
376
378
  def html **attrs
@@ -13,7 +13,7 @@
13
13
  module Hermeneutics
14
14
 
15
15
  NAME = "hermeneutics"
16
- VERSION = "1.24".freeze
16
+ VERSION = "1.26".freeze
17
17
  SUMMARY = "CGI and mail handling"
18
18
 
19
19
  DESCRIPTION = <<~EOT
@@ -21,7 +21,7 @@ module Hermeneutics
21
21
  and CSS. Further, it is a CGI library.
22
22
  EOT
23
23
 
24
- COPYRIGHT = "(C) 2013-2024 Bertram Scharpf"
24
+ COPYRIGHT = "(C) 2013-2026 Bertram Scharpf"
25
25
  LICENSE = "BSD-2-Clause"
26
26
  AUTHORS = [ "Bertram Scharpf"]
27
27
  MAIL = "<software@bertram-scharpf.de>"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hermeneutics
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.24'
4
+ version: '1.26'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bertram Scharpf
@@ -88,7 +88,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - ">="
90
90
  - !ruby/object:Gem::Version
91
- version: '0'
91
+ version: '3.0'
92
92
  required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="