edtf 3.2.0 → 4.0.0

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.
data/lib/edtf/parser.y CHANGED
@@ -21,9 +21,9 @@ rule
21
21
  ;
22
22
 
23
23
  date :
24
- year { result = Date.new(val[0]).year_precision! }
25
- | year_month { result = Date.new(*val.flatten).month_precision! }
26
- | year_month_day { result = Date.new(*val.flatten).day_precision! }
24
+ year { result = Date.gregorian(val[0]).year_precision! }
25
+ | year_month { result = Date.gregorian(*val.flatten).month_precision! }
26
+ | year_month_day { result = Date.gregorian(*val.flatten).day_precision! }
27
27
  ;
28
28
 
29
29
 
@@ -97,7 +97,7 @@ rule
97
97
 
98
98
  unspecified : unspecified_year
99
99
  {
100
- result = Date.new(val[0][0]).year_precision!
100
+ result = Date.gregorian(val[0][0]).year_precision!
101
101
  result.unspecified.year[2,2] = val[0][1]
102
102
  }
103
103
  | unspecified_month
@@ -123,36 +123,68 @@ rule
123
123
  }
124
124
 
125
125
  unspecified_month : year '-' U U {
126
- result = Date.new(val[0]).unspecified!(:month)
126
+ result = Date.gregorian(val[0]).unspecified!(:month)
127
127
  result.precision = :month
128
128
  }
129
129
 
130
130
  unspecified_day : year_month '-' U U {
131
- result = Date.new(*val[0]).unspecified!(:day)
131
+ result = Date.gregorian(*val[0]).unspecified!(:day)
132
132
  }
133
133
 
134
134
  unspecified_day_and_month : year '-' U U '-' U U {
135
- result = Date.new(val[0]).unspecified!([:day,:month])
135
+ result = Date.gregorian(val[0]).unspecified!([:day,:month])
136
136
  }
137
137
 
138
- level_1_interval : level_1_start '/' level_1_end {
138
+ level_1_interval : level_1_interval_closed | level_1_interval_open | level_1_interval_unknown
139
+
140
+ level_1_interval_closed : level_1_start '/' level_1_end {
139
141
  result = Interval.new(val[0], val[2])
140
142
  }
141
143
 
142
- level_1_start : date | partial_uncertain_or_approximate | unspecified | partial_unspecified | UNKNOWN
144
+ level_1_interval_open : level_1_interval_open_start | level_1_interval_open_end
145
+
146
+ level_1_interval_open_start : open_start_or_end '/' level_1_end {
147
+ result = Interval.new(:open, val[2])
148
+ }
149
+
150
+ level_1_interval_open_end : level_1_start '/' open_start_or_end {
151
+ result = Interval.new(val[0], :open)
152
+ }
153
+
154
+ open_start_or_end : OPEN | DOTS
155
+
156
+ level_1_interval_unknown : level_1_interval_empty_start | level_1_interval_empty_end | level_1_interval_unknown_start | level_1_interval_unknown_end
157
+
158
+ level_1_interval_empty_start : '/' level_1_end {
159
+ result = Interval.new(:unknown, val[1])
160
+ }
161
+
162
+ level_1_interval_empty_end : level_1_start '/' {
163
+ result = Interval.new(val[0], :unknown)
164
+ }
165
+
166
+ level_1_interval_unknown_start : UNKNOWN '/' level_1_end {
167
+ result = Interval.new(:unknown, val[2])
168
+ }
169
+
170
+ level_1_interval_unknown_end : level_1_start '/' UNKNOWN {
171
+ result = Interval.new(val[0], :unknown)
172
+ }
173
+
174
+ level_1_start : date | partial_uncertain_or_approximate | unspecified | partial_unspecified
143
175
 
144
- level_1_end : level_1_start | OPEN
176
+ level_1_end : level_1_start
145
177
 
146
178
 
147
179
  long_year_simple :
148
180
  LONGYEAR long_year
149
181
  {
150
- result = Date.new(val[1])
182
+ result = Date.gregorian(val[1])
151
183
  result.precision = :year
152
184
  }
153
185
  | LONGYEAR '-' long_year
154
186
  {
155
- result = Date.new(-1 * val[2])
187
+ result = Date.gregorian(-1 * val[2])
156
188
  result.precision = :year
157
189
  }
158
190
  ;
@@ -197,15 +229,15 @@ rule
197
229
  long_year_scientific :
198
230
  long_year_simple E integer
199
231
  {
200
- result = Date.new(val[0].year * 10 ** val[2]).year_precision!
232
+ result = Date.gregorian(val[0].year * 10 ** val[2]).year_precision!
201
233
  }
202
234
  | LONGYEAR int1_4 E integer
203
235
  {
204
- result = Date.new(val[1] * 10 ** val[3]).year_precision!
236
+ result = Date.gregorian(val[1] * 10 ** val[3]).year_precision!
205
237
  }
206
238
  | LONGYEAR '-' int1_4 E integer
207
239
  {
208
- result = Date.new(-1 * val[2] * 10 ** val[4]).year_precision!
240
+ result = Date.gregorian(-1 * val[2] * 10 ** val[4]).year_precision!
209
241
  }
210
242
  ;
211
243
 
@@ -255,49 +287,49 @@ rule
255
287
 
256
288
  earlier : DOTS date { result = val[1] }
257
289
 
258
- later : year_month_day DOTS { result = Date.new(*val[0]).day_precision! }
259
- | year_month DOTS { result = Date.new(*val[0]).month_precision! }
260
- | year DOTS { result = Date.new(val[0]).year_precision! }
290
+ later : year_month_day DOTS { result = Date.gregorian(*val[0]).day_precision! }
291
+ | year_month DOTS { result = Date.gregorian(*val[0]).month_precision! }
292
+ | year DOTS { result = Date.gregorian(val[0]).year_precision! }
261
293
  ;
262
294
 
263
- consecutives : year_month_day DOTS year_month_day { result = (Date.new(val[0]).day_precision! .. Date.new(val[2]).day_precision!) }
264
- | year_month DOTS year_month { result = (Date.new(val[0]).month_precision! .. Date.new(val[2]).month_precision!) }
265
- | year DOTS year { result = (Date.new(val[0]).year_precision! .. Date.new(val[2]).year_precision!) }
295
+ consecutives : year_month_day DOTS year_month_day { result = (Date.gregorian(*val[0]).day_precision! .. Date.gregorian(*val[2]).day_precision!) }
296
+ | year_month DOTS year_month { result = (Date.gregorian(*val[0]).month_precision! .. Date.gregorian(*val[2]).month_precision!) }
297
+ | year DOTS year { result = (Date.gregorian(val[0]).year_precision! .. Date.gregorian(val[2]).year_precision!) }
266
298
  ;
267
299
 
268
300
  partial_unspecified :
269
301
  unspecified_year '-' month '-' day
270
302
  {
271
- result = Date.new(val[0][0], val[2], val[4])
303
+ result = Date.gregorian(val[0][0], val[2], val[4])
272
304
  result.unspecified.year[2,2] = val[0][1]
273
305
  }
274
306
  | unspecified_year '-' month
275
307
  {
276
- result = Date.new(val[0][0], val[2], 1)
308
+ result = Date.gregorian(val[0][0], val[2], 1)
277
309
  result.month_precision!
278
310
  result.unspecified.year[2,2] = val[0][1]
279
311
  }
280
312
  | unspecified_year '-' U U '-' day
281
313
  {
282
- result = Date.new(val[0][0], 1, val[5])
314
+ result = Date.gregorian(val[0][0], 1, val[5])
283
315
  result.unspecified.year[2,2] = val[0][1]
284
316
  result.unspecified!(:month)
285
317
  }
286
318
  | unspecified_year '-' U U '-' U U
287
319
  {
288
- result = Date.new(val[0][0], 1, 1)
320
+ result = Date.gregorian(val[0][0], 1, 1)
289
321
  result.unspecified.year[2,2] = val[0][1]
290
322
  result.unspecified!([:month, :day])
291
323
  }
292
324
  | unspecified_year '-' month '-' U U
293
325
  {
294
- result = Date.new(val[0][0], val[2], 1)
326
+ result = Date.gregorian(val[0][0], val[2], 1)
295
327
  result.unspecified.year[2,2] = val[0][1]
296
328
  result.unspecified!(:day)
297
329
  }
298
330
  | year '-' U U '-' day
299
331
  {
300
- result = Date.new(val[0], 1, val[5])
332
+ result = Date.gregorian(val[0], 1, val[5])
301
333
  result.unspecified!(:month)
302
334
  }
303
335
  ;
@@ -310,17 +342,17 @@ rule
310
342
  | pua_year_month { result = val[0][0].month_precision! }
311
343
  | pua_year_month_day { result = val[0].day_precision! }
312
344
 
313
- pua_year : year UA { result = uoa(Date.new(val[0]), val[1], :year) }
345
+ pua_year : year UA { result = uoa(Date.gregorian(val[0]), val[1], :year) }
314
346
 
315
347
  pua_year_month :
316
348
  pua_year '-' month ua {
317
349
  result = [uoa(val[0].change(:month => val[2]), val[3], [:month, :year])]
318
350
  }
319
351
  | year '-' month UA {
320
- result = [uoa(Date.new(val[0], val[2]), val[3], [:year, :month])]
352
+ result = [uoa(Date.gregorian(val[0], val[2]), val[3], [:year, :month])]
321
353
  }
322
354
  | year '-(' month ')' UA {
323
- result = [uoa(Date.new(val[0], val[2]), val[4], [:month]), true]
355
+ result = [uoa(Date.gregorian(val[0], val[2]), val[4], [:month]), true]
324
356
  }
325
357
  | pua_year '-(' month ')' UA {
326
358
  result = [uoa(val[0].change(:month => val[2]), val[4], [:month]), true]
@@ -335,19 +367,19 @@ rule
335
367
  result = uoa(val[0][0].change(:day => val[2]), val[4], [:day])
336
368
  }
337
369
  | year '-(' month ')' UA day ua {
338
- result = uoa(uoa(Date.new(val[0], val[2], val[5]), val[4], :month), val[6], :day)
370
+ result = uoa(uoa(Date.gregorian(val[0], val[2], val[5]), val[4], :month), val[6], :day)
339
371
  }
340
372
  | year_month '-' day UA {
341
- result = uoa(Date.new(val[0][0], val[0][1], val[2]), val[3])
373
+ result = uoa(Date.gregorian(val[0][0], val[0][1], val[2]), val[3])
342
374
  }
343
375
  | year_month '-(' day ')' UA {
344
- result = uoa(Date.new(val[0][0], val[0][1], val[2]), val[4], [:day])
376
+ result = uoa(Date.gregorian(val[0][0], val[0][1], val[2]), val[4], [:day])
345
377
  }
346
378
  | year '-(' month '-' day ')' UA {
347
- result = uoa(Date.new(val[0], val[2], val[4]), val[6], [:month, :day])
379
+ result = uoa(Date.gregorian(val[0], val[2], val[4]), val[6], [:month, :day])
348
380
  }
349
381
  | year '-(' month '-(' day ')' UA ')' UA {
350
- result = Date.new(val[0], val[2], val[4])
382
+ result = Date.gregorian(val[0], val[2], val[4])
351
383
  result = uoa(result, val[6], [:day])
352
384
  result = uoa(result, val[8], [:month, :day])
353
385
  }
data/lib/edtf/season.rb CHANGED
@@ -130,7 +130,13 @@ module EDTF
130
130
  def qualified?; !!@qualifier; end
131
131
 
132
132
  def edtf
133
- '%04d-%2d%s' % [year, CODES[season], qualified? ? "^#{qualifier}" : '']
133
+ '%04d-%2d%s%s%s' % [
134
+ year,
135
+ CODES[season],
136
+ uncertain? ? '?' : '',
137
+ approximate? ? '~' : '',
138
+ qualified? ? "^#{qualifier}" : ''
139
+ ]
134
140
  end
135
141
 
136
142
  alias to_s edtf
@@ -140,7 +146,9 @@ module EDTF
140
146
  case other
141
147
  when Date
142
148
  cover?(other) ? 0 : to_date <=> other
143
- when Interval, Epoch
149
+ when Interval
150
+ (c = other <=> self) && -c
151
+ when Epoch
144
152
  [min, max] <=> [other.min, other.max]
145
153
  when Season
146
154
  [year, month, qualifier] <=> [other.year, other.month, other.qualifier]
data/lib/edtf/set.rb CHANGED
@@ -7,7 +7,6 @@ module EDTF
7
7
  include Comparable
8
8
 
9
9
  def_delegators :@dates, :size, :length, :empty?
10
- def_delegators :to_a, :include?
11
10
 
12
11
  attr_accessor :choice, :later, :earlier
13
12
 
@@ -29,6 +28,21 @@ module EDTF
29
28
  end
30
29
  end
31
30
 
31
+ def include?(v)
32
+ return false unless v.is_a?(Date)
33
+ return false if empty?
34
+
35
+ dates_array = to_a
36
+ if earlier?
37
+ (min = dates_array.first) >= v && min.precision == v.precision
38
+ elsif later?
39
+ (max = dates_array.last) <= v && max.precision == v.precision
40
+ else
41
+ dates_array.member?(v)
42
+ end
43
+ end
44
+ alias member? include?
45
+
32
46
  def <<(date)
33
47
  dates << date
34
48
  self
@@ -12,7 +12,6 @@ module EDTF
12
12
  end
13
13
 
14
14
  def hash_base=(base)
15
- @hash_map = false
16
15
  @hash_base = base
17
16
  end
18
17
 
@@ -37,13 +36,7 @@ module EDTF
37
36
  end
38
37
 
39
38
  def hash
40
- values.zip(hash_map).reduce(0) { |s, (v, h)| s + (v ? h : 0) }
41
- end
42
-
43
- private
44
-
45
- def hash_map
46
- @hash_map ||= (0...length).map { |i| hash_base << i }
39
+ (year ? hash_base : 0) + (month ? hash_base << 1 : 0) + (day ? hash_base << 2 : 0)
47
40
  end
48
41
 
49
42
  end
@@ -79,6 +72,12 @@ module EDTF
79
72
  alias specific! specified!
80
73
  alias unspecific! unspecified!
81
74
 
75
+ def hash
76
+ y, m, d = year, month, day
77
+ (y[0] ? 1 : 0) | (y[1] ? 2 : 0) | (y[2] ? 4 : 0) | (y[3] ? 8 : 0) |
78
+ (m[0] ? 16 : 0) | (m[1] ? 32 : 0) | (d[0] ? 64 : 0) | (d[1] ? 128 : 0)
79
+ end
80
+
82
81
  private :year=, :month=, :day=
83
82
 
84
83
  def to_s
data/lib/edtf/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module EDTF
2
- VERSION = '3.2.0'.freeze
2
+ VERSION = '4.0.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edtf
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvester Keil
8
8
  - Ilja Srna
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2024-11-26 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activesupport
@@ -31,37 +30,29 @@ dependencies:
31
30
  - - "<"
32
31
  - !ruby/object:Gem::Version
33
32
  version: '9.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: racc
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.7'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.7'
34
47
  description: A Ruby implementation of the Extended Date/Time Format (EDTF).
35
- email:
36
48
  executables: []
37
49
  extensions: []
38
50
  extra_rdoc_files:
39
- - README.md
40
51
  - LICENSE
52
+ - README.md
41
53
  files:
42
- - ".autotest"
43
- - ".github/workflows/ci.yml"
44
- - ".gitignore"
45
- - ".rspec"
46
- - ".simplecov"
47
- - Gemfile
48
54
  - LICENSE
49
55
  - README.md
50
- - Rakefile
51
- - cucumber.yml
52
- - edtf.gemspec
53
- - features/parser/date_times.feature
54
- - features/parser/dates.feature
55
- - features/parser/intervals.feature
56
- - features/parser/precision.feature
57
- - features/parser/uncertain_or_approximate.feature
58
- - features/parser/unspecified.feature
59
- - features/print/level_0_edtf.feature
60
- - features/print/level_1_edtf.feature
61
- - features/print/level_2_edtf.feature
62
- - features/print/uncertain_or_approximate.feature
63
- - features/step_definitions/edtf_steps.rb
64
- - features/support/env.rb
65
56
  - lib/edtf.rb
66
57
  - lib/edtf/compatibility.rb
67
58
  - lib/edtf/date.rb
@@ -76,62 +67,35 @@ files:
76
67
  - lib/edtf/uncertainty.rb
77
68
  - lib/edtf/unknown.rb
78
69
  - lib/edtf/version.rb
79
- - spec/edtf/date_spec.rb
80
- - spec/edtf/epoch_spec.rb
81
- - spec/edtf/interval_spec.rb
82
- - spec/edtf/parser_spec.rb
83
- - spec/edtf/season_spec.rb
84
- - spec/edtf/set_spec.rb
85
- - spec/edtf/uncertainty_spec.rb
86
- - spec/spec_helper.rb
87
- homepage: http://github.com/inukshuk/edtf-ruby
70
+ homepage: https://github.com/inukshuk/edtf-ruby
88
71
  licenses:
89
72
  - BSD-2-Clause-Views
90
- metadata: {}
91
- post_install_message:
73
+ metadata:
74
+ source_code_uri: https://github.com/inukshuk/edtf-ruby
75
+ bug_tracker_uri: https://github.com/inukshuk/edtf-ruby/issues
76
+ rubygems_mfa_required: 'true'
92
77
  rdoc_options:
93
78
  - "--line-numbers"
94
- - "--inline-source"
95
79
  - "--title"
96
- - '"EDTF-Ruby"'
80
+ - EDTF-Ruby
97
81
  - "--main"
98
82
  - README.md
99
- - "--webcvs=http://github.com/inukshuk/edtf-ruby/tree/master/"
83
+ - "--exclude"
84
+ - lib/edtf/parser.rb
100
85
  require_paths:
101
86
  - lib
102
87
  required_ruby_version: !ruby/object:Gem::Requirement
103
88
  requirements:
104
89
  - - ">="
105
90
  - !ruby/object:Gem::Version
106
- version: '0'
91
+ version: '3.3'
107
92
  required_rubygems_version: !ruby/object:Gem::Requirement
108
93
  requirements:
109
94
  - - ">="
110
95
  - !ruby/object:Gem::Version
111
96
  version: '0'
112
97
  requirements: []
113
- rubygems_version: 3.5.6
114
- signing_key:
98
+ rubygems_version: 4.0.22
115
99
  specification_version: 4
116
100
  summary: Extended Date/Time Format for Ruby.
117
- test_files:
118
- - features/parser/date_times.feature
119
- - features/parser/dates.feature
120
- - features/parser/intervals.feature
121
- - features/parser/precision.feature
122
- - features/parser/uncertain_or_approximate.feature
123
- - features/parser/unspecified.feature
124
- - features/print/level_0_edtf.feature
125
- - features/print/level_1_edtf.feature
126
- - features/print/level_2_edtf.feature
127
- - features/print/uncertain_or_approximate.feature
128
- - features/step_definitions/edtf_steps.rb
129
- - features/support/env.rb
130
- - spec/edtf/date_spec.rb
131
- - spec/edtf/epoch_spec.rb
132
- - spec/edtf/interval_spec.rb
133
- - spec/edtf/parser_spec.rb
134
- - spec/edtf/season_spec.rb
135
- - spec/edtf/set_spec.rb
136
- - spec/edtf/uncertainty_spec.rb
137
- - spec/spec_helper.rb
101
+ test_files: []
data/.autotest DELETED
@@ -1,8 +0,0 @@
1
- require 'autotest/bundler'
2
-
3
- Autotest.add_hook :initialize do |at|
4
- at.add_mapping(/.+\.y$/) do |f,_|
5
- system 'rake clean racc_debug'
6
- end
7
- end
8
-
@@ -1,41 +0,0 @@
1
- name: ci
2
-
3
- on:
4
- push:
5
- branches: [ main ]
6
- pull_request:
7
- branches: [ main ]
8
-
9
- jobs:
10
- build:
11
- environment: CI
12
- runs-on: ubuntu-latest
13
-
14
- strategy:
15
- matrix:
16
- ruby-version:
17
- - '2.7'
18
- - '3.0'
19
- - '3.1'
20
- - '3.2'
21
- - 'jruby'
22
-
23
- steps:
24
- - name: Git checkout
25
- uses: actions/checkout@v2
26
-
27
- - name: Setup Ruby
28
- uses: ruby/setup-ruby@v1
29
- with:
30
- ruby-version: ${{ matrix.ruby-version }}
31
- bundler-cache: true
32
-
33
- - name: Run tests
34
- run: bundle exec rake
35
-
36
- - name: Upload coverage results
37
- if: matrix.ruby-version == '3.1'
38
- continue-on-error: true
39
- uses: coverallsapp/github-action@master
40
- with:
41
- github-token: ${{ github.token }}
data/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- Gemfile.lock
2
- lib/edtf/parser.output
3
- *.rbc
4
- .rbx
5
- .ruby-version
6
- *.swp
7
- .bundle
8
- coverage
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --color
2
- --require ./spec/spec_helper.rb
3
- --format progress
data/.simplecov DELETED
@@ -1,19 +0,0 @@
1
- require 'simplecov-lcov'
2
-
3
- SimpleCov::Formatter::LcovFormatter.config do |c|
4
- c.output_directory = 'coverage'
5
- c.lcov_file_name = 'lcov.info'
6
- c.report_with_single_file = true
7
- end
8
-
9
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
10
- SimpleCov::Formatter::HTMLFormatter,
11
- SimpleCov::Formatter::LcovFormatter
12
- ])
13
-
14
- SimpleCov.start do
15
- add_filter 'spec/'
16
- add_filter 'features/'
17
-
18
- enable_coverage :branch
19
- end
data/Gemfile DELETED
@@ -1,22 +0,0 @@
1
- source 'https://rubygems.org'
2
- gemspec
3
-
4
- group :debug do
5
- gem 'debug', platform: 'mri'
6
- end
7
-
8
- group :development do
9
- gem 'rake'
10
- gem 'racc'
11
- gem 'cucumber'
12
- gem 'rspec'
13
- gem 'simplecov', platform: 'mri'
14
- gem 'simplecov-lcov', platform: 'mri'
15
- end
16
-
17
- group :extra do
18
- gem 'ZenTest'
19
- end
20
-
21
- # active_support requires this
22
- gem 'i18n'
data/Rakefile DELETED
@@ -1,68 +0,0 @@
1
-
2
- require 'bundler'
3
- begin
4
- Bundler.setup
5
- rescue Bundler::BundlerError => e
6
- $stderr.puts e.message
7
- $stderr.puts "Run `bundle install` to install missing gems"
8
- exit e.status_code
9
- end
10
-
11
- $:.unshift(File.join(File.dirname(__FILE__), './lib'))
12
- require 'edtf/version'
13
-
14
- require 'rake/clean'
15
-
16
- task :default => [:spec, :cucumber]
17
-
18
- desc 'Run an IRB session with CiteProc loaded'
19
- task :console, [:script] do |t,args|
20
- ARGV.clear
21
-
22
- require 'irb'
23
- require 'edtf'
24
-
25
- IRB.conf[:SCRIPT] = args.script
26
- IRB.start
27
- end
28
-
29
- desc 'Generates the parser'
30
- task :racc do
31
- system 'bundle exec racc -o lib/edtf/parser.rb lib/edtf/parser.y'
32
- end
33
-
34
- desc 'Generates the parser with debug information'
35
- task :racc_debug do
36
- system 'bundle exec racc -v -t -o lib/edtf/parser.rb lib/edtf/parser.y'
37
- end
38
-
39
- require 'rspec/core'
40
- require 'rspec/core/rake_task'
41
- RSpec::Core::RakeTask.new(:spec) do |spec|
42
- spec.pattern = FileList['spec/**/*_spec.rb']
43
- end
44
-
45
- require 'cucumber/rake/task'
46
- Cucumber::Rake::Task.new(:cucumber)
47
-
48
- desc 'Builds the gem file'
49
- task :build => [:check_warnings] do
50
- system 'gem build edtf.gemspec'
51
- end
52
-
53
- task :check_warnings do
54
- $VERBOSE = true
55
- require 'edtf'
56
- puts EDTF::VERSION
57
- end
58
-
59
- task :release => [ :build] do
60
- system "git tag #{EDTF::VERSION}"
61
- system "git push --tags"
62
- system "gem push edtf-#{EDTF::VERSION}.gem"
63
- end
64
-
65
- CLEAN.include('lib/edtf/parser.rb')
66
- CLEAN.include('lib/edtf/parser.output')
67
- CLEAN.include('*.gem')
68
- CLEAN.include('**/*.rbc')
data/cucumber.yml DELETED
@@ -1 +0,0 @@
1
- default: --format progress --require features --color --publish-quiet
data/edtf.gemspec DELETED
@@ -1,29 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- lib = File.expand_path('../lib/', __FILE__)
3
- $:.unshift lib unless $:.include?(lib)
4
-
5
- require 'edtf/version'
6
-
7
- Gem::Specification.new do |s|
8
- s.name = 'edtf'
9
- s.version = EDTF::VERSION.dup
10
- s.platform = Gem::Platform::RUBY
11
- s.authors = ['Sylvester Keil', 'Ilja Srna']
12
- s.homepage = 'http://github.com/inukshuk/edtf-ruby'
13
- s.summary = 'Extended Date/Time Format for Ruby.'
14
- s.description = 'A Ruby implementation of the Extended Date/Time Format (EDTF).'
15
- s.license = 'BSD-2-Clause-Views'
16
-
17
- s.add_runtime_dependency('activesupport', '>= 3.0', '< 9.0')
18
-
19
- s.files = `git ls-files`.split("\n") << 'lib/edtf/parser.rb'
20
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
- s.executables = []
22
- s.require_path = 'lib'
23
-
24
- s.rdoc_options = %w{--line-numbers --inline-source --title "EDTF-Ruby" --main README.md --webcvs=http://github.com/inukshuk/edtf-ruby/tree/master/}
25
- s.extra_rdoc_files = %w{README.md LICENSE}
26
-
27
- end
28
-
29
- # vim: syntax=ruby