hermeneutics 1.14 → 1.15

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: 34855e35779618671f657756ec5e16cb4f57da8925d822a605aa5a727aa3362c
4
- data.tar.gz: 6ebed997b49c501692cd829c2fd010fd06bd4ef34e1f76ca88a6970ca0ffab67
3
+ metadata.gz: aabd1ffa167d6b9e0add90086e915603207b905d49f2d86052956296976ce52c
4
+ data.tar.gz: 3b457fc4face001a9fddba09eac732aab2374851d59b8f1b72577761ba36f4cb
5
5
  SHA512:
6
- metadata.gz: 04a4d6586ee2dd68e571b6e5a4e9da0bc329fd715dd619a1c72392e0e68992dd6e84bd70f8542645545c8e9d25f81e46c2814cbc794ff0d4e3cd3a11f3794161
7
- data.tar.gz: d44b4fdf6b8285938b3bf4bf66ec5f7627fdd274d0be9ca764ffc918dcfe2ddd431ca9ffdefa988ee6ac5f4e5cffafb5f4b4d227442e9b3dab0f8968835421cc
6
+ metadata.gz: 19b8ab9cd48b49b96ec3a646178f31474de04cd1f92205477b2a67126191d7d88ae74c30fabbc87fbb0c8622f122911d3a46051ecf2bac567769c648a1f6e9e4
7
+ data.tar.gz: 59f9a3642bb013efb659bf32de2dac725193d6861ec7e9cd404a7cb87dc32357ceb4f623901b71757956b554ac689d86d0d0c2d7ca38d05c61fd72a18f5df3a8
@@ -17,45 +17,52 @@ end
17
17
 
18
18
  module Hermeneutics
19
19
 
20
- class PlainText < String
20
+ class PlainText
21
21
  class <<self
22
22
  def parse str
23
23
  t = HeaderExt.decode str
24
24
  new t
25
25
  end
26
26
  end
27
- def initialize text
28
- super
29
- gsub! /\s+/, " "
30
- strip!
27
+ attr_reader :value
28
+ def initialize value
29
+ self.value = value
31
30
  end
32
- def quote
33
- to_s
31
+ def value= value
32
+ @value = value
33
+ @value.gsub! /\s+/, " "
34
+ @value.strip!
35
+ @value.freeze
34
36
  end
37
+ def to_s ; @value ; end
38
+ alias quote to_s
35
39
  def encode
36
- (HeaderExt.encode self).split
40
+ HeaderExt.encode @value
37
41
  end
38
42
  end
39
43
 
40
- class Timestamp < Time
41
- class <<self
42
- def new time = nil
43
- case time
44
- when nil then now
45
- when Time then mktime *time.to_a
46
- else parse time.to_s
47
- end
44
+ class Timestamp
45
+ attr_reader :value
46
+ def initialize value = nil
47
+ self.value = value
48
+ end
49
+ def value= value
50
+ @value = case value
51
+ when nil then Time.now
52
+ when Time then value
53
+ else Time.parse value.to_s
48
54
  end
49
55
  end
56
+ def to_s ; @value.to_s ; end
50
57
  def quote
51
58
  to_s
52
59
  end
53
60
  def encode
54
- rfc822
61
+ @value.rfc822
55
62
  end
56
63
  end
57
64
 
58
- class Id < String
65
+ class Id
59
66
  @host = nil
60
67
  class <<self
61
68
  attr_writer :host
@@ -69,10 +76,15 @@ module Hermeneutics
69
76
  $1
70
77
  end
71
78
  end
72
- attr_reader :id
73
- def initialize id = nil
74
- super id || generate
79
+ attr_reader :value
80
+ def initialize value = nil
81
+ self.value = value
82
+ end
83
+ def value= value
84
+ @value = value ? value.new_string : generate
85
+ @value.freeze
75
86
  end
87
+ def to_s ; @value ; end
76
88
  alias quote to_s
77
89
  def encode
78
90
  "<#{self}>"
@@ -89,7 +101,7 @@ module Hermeneutics
89
101
  end
90
102
  end
91
103
 
92
- class IdList < Array
104
+ class IdList
93
105
  class <<self
94
106
  def parse str
95
107
  i = new
@@ -101,17 +113,23 @@ module Hermeneutics
101
113
  i
102
114
  end
103
115
  end
104
- def initialize
105
- super
116
+ attr_reader :value
117
+ def initialize *ids
118
+ ids.flatten!
119
+ self.value = ids
106
120
  end
107
- def add id
108
- id = Id.new id.to_s unless Id === id
109
- puts id
121
+ def value= ids
122
+ @list = []
123
+ ids.each { |id|
124
+ id = Id.new id unless Id === id
125
+ @list.push id
126
+ }
127
+ @list.freeze
110
128
  end
111
- def quote
129
+ def to_s
112
130
  map { |i| i.quote }.join " "
113
131
  end
114
- alias to_s quote
132
+ alias quote to_s
115
133
  def encode
116
134
  map { |i| i.encode }.join " "
117
135
  end
@@ -124,11 +142,12 @@ module Hermeneutics
124
142
  new i
125
143
  end
126
144
  end
145
+ attr_reader :value
127
146
  def initialize num
128
- @i = num.to_i
147
+ @value = num.to_i
129
148
  end
130
- def method_missing sym, *args, **kwargs, &block
131
- @i.send sym, *args, **kwargs, &block
149
+ def value= value
150
+ @value = value
132
151
  end
133
152
  alias quote to_s
134
153
  alias encode to_s
@@ -13,7 +13,7 @@
13
13
  module Hermeneutics
14
14
 
15
15
  NAME = "hermeneutics"
16
- VERSION = "1.14".freeze
16
+ VERSION = "1.15".freeze
17
17
  SUMMARY = "CGI and mail handling"
18
18
 
19
19
  DESCRIPTION = <<~EOT
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hermeneutics
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.14'
4
+ version: '1.15'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bertram Scharpf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-14 00:00:00.000000000 Z
11
+ date: 2023-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: supplement
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
97
  version: '0'
98
98
  requirements:
99
99
  - Ruby, at least 3.0
100
- rubygems_version: 3.0.8
100
+ rubygems_version: 3.4.13
101
101
  signing_key:
102
102
  specification_version: 4
103
103
  summary: CGI and mail handling