historical_dating 1.8.0 → 1.9.1
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 +4 -4
- data/Gemfile +2 -0
- data/Gemfile.lock +23 -18
- data/historical_dating.gemspec +4 -2
- data/lib/historical_dating/parser.rb +10 -1
- data/lib/historical_dating/transform.rb +21 -0
- data/lib/historical_dating/version.rb +1 -1
- metadata +16 -15
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e8d41ccea6467e9b0af4679dfde3cf7591993c7269c31f24cd20076cd2b77049
|
|
4
|
+
data.tar.gz: 548be0649b5f157434f29d8e2c106c2abf66ee88d49425e8c464361701f71c89
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3da263bae047e57e00b8003d767680ff08cca84ae8ffcbac5ff5e7c1c9ca1251d6f672e9821e0a702ffd6748247811d8006265e3cf3ebe3f203f95a7e775ed81
|
|
7
|
+
data.tar.gz: 22d8f2b7d3cda26c24feaee8beab051136fa2864b2abf7ac00c5720d6af4aabc3e71cc2a2f3cd9f4748b327fd5cc76a2d05ec0b61b1e7d2a03646b13c1ba33ea
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
historical_dating (1.
|
|
5
|
-
activesupport (
|
|
4
|
+
historical_dating (1.9.1)
|
|
5
|
+
activesupport (~> 6.1.4.1)
|
|
6
6
|
parslet (~> 2.0.0)
|
|
7
7
|
|
|
8
8
|
GEM
|
|
9
9
|
remote: https://rubygems.org/
|
|
10
10
|
specs:
|
|
11
|
-
activesupport (6.
|
|
11
|
+
activesupport (6.1.4.7)
|
|
12
12
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
13
|
-
i18n (>=
|
|
14
|
-
minitest (
|
|
15
|
-
tzinfo (~>
|
|
16
|
-
zeitwerk (~> 2.
|
|
13
|
+
i18n (>= 1.6, < 2)
|
|
14
|
+
minitest (>= 5.1)
|
|
15
|
+
tzinfo (~> 2.0)
|
|
16
|
+
zeitwerk (~> 2.3)
|
|
17
17
|
coderay (1.1.3)
|
|
18
|
-
concurrent-ruby (1.
|
|
18
|
+
concurrent-ruby (1.3.7)
|
|
19
19
|
diff-lcs (1.4.4)
|
|
20
|
-
i18n (1.
|
|
20
|
+
i18n (1.15.2)
|
|
21
21
|
concurrent-ruby (~> 1.0)
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
io-console (0.8.2)
|
|
23
|
+
method_source (1.1.0)
|
|
24
|
+
minitest (5.27.0)
|
|
24
25
|
parslet (2.0.0)
|
|
25
|
-
pry (0.
|
|
26
|
+
pry (0.16.0)
|
|
26
27
|
coderay (~> 1.1)
|
|
27
28
|
method_source (~> 1.0)
|
|
29
|
+
reline (>= 0.6.0)
|
|
28
30
|
rake (12.3.3)
|
|
31
|
+
reline (0.6.3)
|
|
32
|
+
io-console (~> 0.5)
|
|
29
33
|
rspec (3.9.0)
|
|
30
34
|
rspec-core (~> 3.9.0)
|
|
31
35
|
rspec-expectations (~> 3.9.0)
|
|
@@ -39,10 +43,10 @@ GEM
|
|
|
39
43
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
40
44
|
rspec-support (~> 3.9.0)
|
|
41
45
|
rspec-support (3.9.3)
|
|
42
|
-
|
|
43
|
-
tzinfo (
|
|
44
|
-
|
|
45
|
-
zeitwerk (2.
|
|
46
|
+
timecop (0.9.11)
|
|
47
|
+
tzinfo (2.0.6)
|
|
48
|
+
concurrent-ruby (~> 1.0)
|
|
49
|
+
zeitwerk (2.8.2)
|
|
46
50
|
|
|
47
51
|
PLATFORMS
|
|
48
52
|
ruby
|
|
@@ -50,9 +54,10 @@ PLATFORMS
|
|
|
50
54
|
DEPENDENCIES
|
|
51
55
|
historical_dating!
|
|
52
56
|
minitest (~> 5.0)
|
|
53
|
-
pry
|
|
57
|
+
pry (~> 0.16.0)
|
|
54
58
|
rake (~> 12.0)
|
|
55
59
|
rspec (~> 3.9.0)
|
|
60
|
+
timecop (~> 0.9.11)
|
|
56
61
|
|
|
57
62
|
BUNDLED WITH
|
|
58
|
-
2.2.
|
|
63
|
+
2.2.30
|
data/historical_dating.gemspec
CHANGED
|
@@ -11,6 +11,8 @@ Gem::Specification.new do |spec|
|
|
|
11
11
|
spec.homepage = "https://github.com/wendig-ou/historical_dating"
|
|
12
12
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
|
13
13
|
|
|
14
|
+
spec.licenses = ['AGPL-3.0-or-later']
|
|
15
|
+
|
|
14
16
|
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
|
15
17
|
|
|
16
18
|
spec.metadata["homepage_uri"] = spec.homepage
|
|
@@ -27,8 +29,8 @@ Gem::Specification.new do |spec|
|
|
|
27
29
|
spec.require_paths = ["lib"]
|
|
28
30
|
|
|
29
31
|
spec.add_runtime_dependency 'parslet', '~> 2.0.0'
|
|
30
|
-
spec.add_runtime_dependency 'activesupport', '
|
|
32
|
+
spec.add_runtime_dependency 'activesupport', '~> 6.1.4.1'
|
|
31
33
|
|
|
32
34
|
spec.add_development_dependency 'rspec', '~> 3.9.0'
|
|
33
|
-
spec.add_development_dependency 'pry'
|
|
35
|
+
spec.add_development_dependency 'pry', '~> 0.16.0'
|
|
34
36
|
end
|
|
@@ -81,6 +81,14 @@ class HistoricalDating::Parser < Parslet::Parser
|
|
|
81
81
|
str('4. Viertel')
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
# Special cases / conflicts with existing rules
|
|
85
|
+
|
|
86
|
+
rule(:uncertain_from_range){
|
|
87
|
+
natural_number.as(:from_year) >> str('/') >> whole_number >>
|
|
88
|
+
space.maybe >> to_characters >> space.maybe >>
|
|
89
|
+
natural_number.as(:to_year)
|
|
90
|
+
}
|
|
91
|
+
|
|
84
92
|
# Dating
|
|
85
93
|
|
|
86
94
|
rule(:day){ match['1-2'] >> match['0-9'] | str('3') >> match['0-1'] | match['1-9'] | str('0') >> match['1-9'] }
|
|
@@ -143,7 +151,8 @@ class HistoricalDating::Parser < Parslet::Parser
|
|
|
143
151
|
century_part.as(:century_part) |
|
|
144
152
|
century.as(:century) |
|
|
145
153
|
date.as(:date) |
|
|
146
|
-
year.as(:year)
|
|
154
|
+
year.as(:year) |
|
|
155
|
+
uncertain_from_range.as(:special)
|
|
147
156
|
}
|
|
148
157
|
|
|
149
158
|
root(:dating)
|
|
@@ -65,6 +65,20 @@ class HistoricalDating::Transform < Parslet::Transform
|
|
|
65
65
|
end
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
+
# rule(from_year: simple(:from_year), to_year: simple(:to_year), acbc: simple(:acbc)) do
|
|
69
|
+
# if acbc.nil? || acbc.match(/(nach|n.) (Chr.|Christus)/)
|
|
70
|
+
# {
|
|
71
|
+
# :from => Date.new(from_year.to_i, 1, 1),
|
|
72
|
+
# :to => Date.new(to_year.to_i, 12, 31)
|
|
73
|
+
# }
|
|
74
|
+
# else
|
|
75
|
+
# {
|
|
76
|
+
# :from => Date.new(to_year.to_i * -1, 1, 1),
|
|
77
|
+
# :to => Date.new(from_year.to_i * -1, 12, 31)
|
|
78
|
+
# }
|
|
79
|
+
# end
|
|
80
|
+
# end
|
|
81
|
+
|
|
68
82
|
rule(:day => simple(:day), :month => simple(:month), :yearnum => simple(:yearnum)) do
|
|
69
83
|
if !Date.leap?(yearnum.to_i) && month.to_i == 2 && day.to_i == 29
|
|
70
84
|
raise HistoricalDating::Error.new('not_leap_year', year: yearnum.to_i)
|
|
@@ -143,6 +157,13 @@ class HistoricalDating::Transform < Parslet::Transform
|
|
|
143
157
|
end
|
|
144
158
|
end
|
|
145
159
|
|
|
160
|
+
rule(special: subtree(:a)) do
|
|
161
|
+
result = {
|
|
162
|
+
from: Date.new(a[:from_year].to_i, 1, 1),
|
|
163
|
+
to: Date.new(a[:to_year].to_i, 12, 31)
|
|
164
|
+
}
|
|
165
|
+
end
|
|
166
|
+
|
|
146
167
|
def self.ac?(acbc)
|
|
147
168
|
acbc.nil? || acbc.match(/(nach|n.) (Chr.|Christus)/) || acbc.match(/AC|Ac|Anno Domini|A. D.|AD/)
|
|
148
169
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: historical_dating
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.9.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Moritz Schepp
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-06-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: parslet
|
|
@@ -28,16 +28,16 @@ dependencies:
|
|
|
28
28
|
name: activesupport
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- - "
|
|
31
|
+
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
33
|
+
version: 6.1.4.1
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- - "
|
|
38
|
+
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version:
|
|
40
|
+
version: 6.1.4.1
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: rspec
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -56,16 +56,16 @@ dependencies:
|
|
|
56
56
|
name: pry
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
|
-
- - "
|
|
59
|
+
- - "~>"
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version:
|
|
61
|
+
version: 0.16.0
|
|
62
62
|
type: :development
|
|
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:
|
|
68
|
+
version: 0.16.0
|
|
69
69
|
description: Parse human historical datings and convert them to Julian day ranges
|
|
70
70
|
email:
|
|
71
71
|
- moritz.schepp@gmail.com
|
|
@@ -94,13 +94,14 @@ files:
|
|
|
94
94
|
- lib/historical_dating/transform.rb
|
|
95
95
|
- lib/historical_dating/version.rb
|
|
96
96
|
homepage: https://github.com/wendig-ou/historical_dating
|
|
97
|
-
licenses:
|
|
97
|
+
licenses:
|
|
98
|
+
- AGPL-3.0-or-later
|
|
98
99
|
metadata:
|
|
99
100
|
allowed_push_host: https://rubygems.org
|
|
100
101
|
homepage_uri: https://github.com/wendig-ou/historical_dating
|
|
101
102
|
source_code_uri: https://github.com/wendig-ou/historical_dating
|
|
102
103
|
changelog_uri: https://github.com/wendig-ou/historical_dating/blob/master/CHANGELOG.md
|
|
103
|
-
post_install_message:
|
|
104
|
+
post_install_message:
|
|
104
105
|
rdoc_options: []
|
|
105
106
|
require_paths:
|
|
106
107
|
- lib
|
|
@@ -115,8 +116,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
115
116
|
- !ruby/object:Gem::Version
|
|
116
117
|
version: '0'
|
|
117
118
|
requirements: []
|
|
118
|
-
rubygems_version: 3.
|
|
119
|
-
signing_key:
|
|
119
|
+
rubygems_version: 3.5.22
|
|
120
|
+
signing_key:
|
|
120
121
|
specification_version: 4
|
|
121
122
|
summary: Parse human historical datings
|
|
122
123
|
test_files: []
|