hermeneutics 1.14 → 1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hermeneutics/types.rb +51 -32
- data/lib/hermeneutics/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aabd1ffa167d6b9e0add90086e915603207b905d49f2d86052956296976ce52c
|
4
|
+
data.tar.gz: 3b457fc4face001a9fddba09eac732aab2374851d59b8f1b72577761ba36f4cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19b8ab9cd48b49b96ec3a646178f31474de04cd1f92205477b2a67126191d7d88ae74c30fabbc87fbb0c8622f122911d3a46051ecf2bac567769c648a1f6e9e4
|
7
|
+
data.tar.gz: 59f9a3642bb013efb659bf32de2dac725193d6861ec7e9cd404a7cb87dc32357ceb4f623901b71757956b554ac689d86d0d0c2d7ca38d05c61fd72a18f5df3a8
|
data/lib/hermeneutics/types.rb
CHANGED
@@ -17,45 +17,52 @@ end
|
|
17
17
|
|
18
18
|
module Hermeneutics
|
19
19
|
|
20
|
-
class PlainText
|
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
|
-
|
28
|
-
|
29
|
-
|
30
|
-
strip!
|
27
|
+
attr_reader :value
|
28
|
+
def initialize value
|
29
|
+
self.value = value
|
31
30
|
end
|
32
|
-
def
|
33
|
-
|
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
|
-
|
40
|
+
HeaderExt.encode @value
|
37
41
|
end
|
38
42
|
end
|
39
43
|
|
40
|
-
class Timestamp
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
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
|
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 :
|
73
|
-
def initialize
|
74
|
-
|
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
|
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
|
-
|
105
|
-
|
116
|
+
attr_reader :value
|
117
|
+
def initialize *ids
|
118
|
+
ids.flatten!
|
119
|
+
self.value = ids
|
106
120
|
end
|
107
|
-
def
|
108
|
-
|
109
|
-
|
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
|
129
|
+
def to_s
|
112
130
|
map { |i| i.quote }.join " "
|
113
131
|
end
|
114
|
-
alias to_s
|
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
|
-
@
|
147
|
+
@value = num.to_i
|
129
148
|
end
|
130
|
-
def
|
131
|
-
@
|
149
|
+
def value= value
|
150
|
+
@value = value
|
132
151
|
end
|
133
152
|
alias quote to_s
|
134
153
|
alias encode to_s
|
data/lib/hermeneutics/version.rb
CHANGED
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.
|
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-
|
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.
|
100
|
+
rubygems_version: 3.4.13
|
101
101
|
signing_key:
|
102
102
|
specification_version: 4
|
103
103
|
summary: CGI and mail handling
|