timeliness 0.4.5 → 0.5.1

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: 84ca036a36065acf094c147e896f73f7ed729c36859688bfb1f1e7a68f3617a9
4
- data.tar.gz: 0a30d2da9fd78e795c9fe915ca40918b77f14b4944cf30a7476e8fbe0f6ea9ed
3
+ metadata.gz: 8a3c28fd75e1bedf4e7679a8fd71b9484a5daadbf7dceea15d7f54fb7f5304c3
4
+ data.tar.gz: 3bc44bf2be43bba84c55ca5eb37f2ba97c8fa4051d10bd30477a307aab1605e9
5
5
  SHA512:
6
- metadata.gz: f8b18ee49649d7a1a58abeb8d981929807b37b750b3bd4b2f305ac9df7dac467cb2505fa8f2a9309a6b61f86728d16d7bd32de8a7d99960360f26599aacdd3fc
7
- data.tar.gz: 3567ce98af3d217e3935560e0e924a6a39c083e32dee114bfc717c0a26933e2e3fb88a912444df8bb21c80f2f4633e9043225ff88759a3e52b963e453cd9a80b
6
+ metadata.gz: 79b6996ca7dce5c043b0dfecf11c2d9cd1016ce5784d134576123f23de9ac8bdc2a4ce0905eda58949d31f03c79e89c37622bdd0e926e70a6e189af265eb5b24
7
+ data.tar.gz: 321feb85cf0177e55ed47e5a35026b85610ba8559ae03daca287f5d6bbcc5f1e4d287ae8212267e22049907adef252415b528def599efbaafecdd34bb7d8ad86
@@ -8,16 +8,39 @@ jobs:
8
8
  runs-on: ubuntu-latest
9
9
 
10
10
  strategy:
11
- fail-fast: false
12
11
  matrix:
13
- ruby: ["2.5", "2.6", "2.7", "3.0", "3.1", ruby-head, jruby-9.2, jruby-9.3, jruby-head]
14
-
12
+ channel: ['stable']
13
+ include:
14
+ - gemfile: activesupport_5_2
15
+ ruby-version: 2.7
16
+ - gemfile: activesupport_6_1
17
+ ruby-version: 3.1
18
+ - gemfile: activesupport_7_0
19
+ ruby-version: 3.0
20
+ - gemfile: activesupport_7_0
21
+ ruby-version: 3.1
22
+ - gemfile: activesupport_7_1
23
+ ruby-version: 3.1
24
+ - gemfile: activesupport_7_1
25
+ ruby-version: 3.2
26
+ - gemfile: activesupport_7_2
27
+ ruby-version: 3.1
28
+ - gemfile: activesupport_7_2
29
+ ruby-version: 3.2
30
+ - gemfile: activesupport_8_0
31
+ ruby-version: 3.2
32
+ - gemfile: activesupport_8_0
33
+ ruby-version: 3.3
34
+ - gemfile: activesupport_8_0
35
+ ruby-version: 3.4
15
36
  steps:
16
- - uses: actions/checkout@v2
17
- - name: Set up Ruby
37
+ - uses: actions/checkout@v4
38
+ - name: Set up Ruby ${{ matrix.ruby-version }}
18
39
  uses: ruby/setup-ruby@v1
19
40
  with:
20
41
  bundler-cache: true # 'bundle install' and cache gems
21
- ruby-version: ${{ matrix.ruby }}
42
+ ruby-version: ${{ matrix.ruby-version }}
22
43
  - name: Run tests
44
+ env:
45
+ RUBYOPT: ${{ matrix.ruby == 'ruby-head' && '--enable=frozen-string-literal' || '' }}
23
46
  run: bundle exec rspec
data/Appraisals ADDED
@@ -0,0 +1,27 @@
1
+ appraise "activesupport_5_2" do
2
+ gem "activesupport", "~> 5.2.0"
3
+ end
4
+
5
+ appraise "activesupport_6_0" do
6
+ gem "activesupport", "~> 6.0.0"
7
+ end
8
+
9
+ appraise "activesupport_6_1" do
10
+ gem "activesupport", "~> 6.1.0"
11
+ end
12
+
13
+ appraise "activesupport_7_0" do
14
+ gem "activesupport", "~> 7.0.0"
15
+ end
16
+
17
+ appraise "activesupport_7_2" do
18
+ gem "activesupport", "~> 7.1.0"
19
+ end
20
+
21
+ appraise "activesupport_7_2" do
22
+ gem "activesupport", "~> 7.2.0"
23
+ end
24
+
25
+ appraise "activesupport_8_0" do
26
+ gem "activesupport", "~> 8.0.0"
27
+ end
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,12 @@
1
+ = 0.5.0 - 2024-12-02
2
+ * Reduce allocations through some internal parsing changes
3
+ * Changed parse method arg handling to simple using keyword args
4
+
5
+ = 0.4.5 - 2023-01-19
6
+ * Support case insensitive months
7
+ * Migrated to Github Actions (@petergoldstein)
8
+ * Various doc, spec, and gemspec fixes and updates (@tagliala)
9
+
1
10
  = 0.4.4 - 2019-08-06
2
11
  * Raise compilation error if token with capturing arg is used more than once in a format
3
12
  * Some small internal refactorings in format compilation
@@ -10,7 +19,7 @@
10
19
  = 0.4.2 - 2019-06-15
11
20
  * Fixed thread safe issue that forced you to use one of the date format methods e.g. `use_euro_formats`
12
21
  to initialize the format sets in each new thread. Now a new thread will default to the global default (main thread).
13
- * Add `Timeliness.ambiguous_date_format` config setting (:us or :euro) to control global default for date format sets.
22
+ * Add `Timeliness.ambiguous_date_format` config setting (:us or :euro) to control global default for date format sets.
14
23
 
15
24
  = 0.4.1 - 2019-06-11
16
25
  * Add format for ISO 8601 with usec and 'Z' UTC zone offset (jartek)
@@ -19,7 +28,7 @@
19
28
 
20
29
  = 0.4.0 - 2019-02-09
21
30
  * Add threadsafety for use_euro_formats & use_us_formats to allow runtime
22
- switching (andruby, timdiggins)
31
+ switching (andruby, timdiggins)
23
32
 
24
33
  = 0.3.10 - 2019-02-06
25
34
  * Fixed file permissions in gem build
data/README.rdoc CHANGED
@@ -1,4 +1,4 @@
1
- = Timeliness {<img src="https://travis-ci.org/adzap/timeliness.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/adzap/timeliness]
1
+ = Timeliness {rdoc-image:https://github.com/adzap/timeliness/actions/workflows/ci.yml/badge.svg?branch=master}[https://github.com/adzap/timeliness/actions/workflows/ci.yml]
2
2
 
3
3
  * Source: https://github.com/adzap/timeliness
4
4
  * Bugs: https://github.com/adzap/timeliness/issues
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "activesupport", "~> 5.2.0"
7
+ gem "debug", platforms: [:mri, :mingw, :x64_mingw]
8
+ gem "memory_profiler"
9
+
10
+ gemspec path: "../"
@@ -0,0 +1,81 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ timeliness (0.5.0)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ activesupport (5.2.8.1)
10
+ concurrent-ruby (~> 1.0, >= 1.0.2)
11
+ i18n (>= 0.7, < 2)
12
+ minitest (~> 5.1)
13
+ tzinfo (~> 1.1)
14
+ appraisal (2.5.0)
15
+ bundler
16
+ rake
17
+ thor (>= 0.14.0)
18
+ base64 (0.2.0)
19
+ bigdecimal (3.1.9)
20
+ concurrent-ruby (1.3.4)
21
+ date (3.4.1)
22
+ debug (1.10.0)
23
+ irb (~> 1.10)
24
+ reline (>= 0.3.8)
25
+ diff-lcs (1.5.1)
26
+ i18n (1.14.6)
27
+ concurrent-ruby (~> 1.0)
28
+ io-console (0.8.0)
29
+ irb (1.14.3)
30
+ rdoc (>= 4.0.0)
31
+ reline (>= 0.4.2)
32
+ memory_profiler (1.1.0)
33
+ minitest (5.25.4)
34
+ mutex_m (0.3.0)
35
+ psych (5.2.2)
36
+ date
37
+ stringio
38
+ rake (13.2.1)
39
+ rdoc (6.10.0)
40
+ psych (>= 4.0.0)
41
+ reline (0.6.0)
42
+ io-console (~> 0.5)
43
+ rspec (3.13.0)
44
+ rspec-core (~> 3.13.0)
45
+ rspec-expectations (~> 3.13.0)
46
+ rspec-mocks (~> 3.13.0)
47
+ rspec-core (3.13.2)
48
+ rspec-support (~> 3.13.0)
49
+ rspec-expectations (3.13.3)
50
+ diff-lcs (>= 1.2.0, < 2.0)
51
+ rspec-support (~> 3.13.0)
52
+ rspec-mocks (3.13.2)
53
+ diff-lcs (>= 1.2.0, < 2.0)
54
+ rspec-support (~> 3.13.0)
55
+ rspec-support (3.13.2)
56
+ stringio (3.1.2)
57
+ thor (1.3.2)
58
+ thread_safe (0.3.6)
59
+ timecop (0.9.10)
60
+ tzinfo (1.2.11)
61
+ thread_safe (~> 0.1)
62
+
63
+ PLATFORMS
64
+ x86_64-darwin-23
65
+
66
+ DEPENDENCIES
67
+ activesupport (~> 5.2.0)
68
+ appraisal
69
+ base64
70
+ bigdecimal
71
+ debug
72
+ i18n
73
+ memory_profiler
74
+ mutex_m
75
+ rspec (~> 3.4)
76
+ timecop
77
+ timeliness!
78
+ tzinfo (>= 0.3.31)
79
+
80
+ BUNDLED WITH
81
+ 2.4.22
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "activesupport", "~> 6.0.0"
7
+ gem "debug", platforms: [:mri, :mingw, :x64_mingw]
8
+ gem "memory_profiler"
9
+
10
+ gemspec path: "../"
@@ -0,0 +1,83 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ timeliness (0.5.0)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ activesupport (6.0.6.1)
10
+ concurrent-ruby (~> 1.0, >= 1.0.2)
11
+ i18n (>= 0.7, < 2)
12
+ minitest (~> 5.1)
13
+ tzinfo (~> 1.1)
14
+ zeitwerk (~> 2.2, >= 2.2.2)
15
+ appraisal (2.5.0)
16
+ bundler
17
+ rake
18
+ thor (>= 0.14.0)
19
+ base64 (0.2.0)
20
+ bigdecimal (3.1.9)
21
+ concurrent-ruby (1.3.4)
22
+ date (3.4.1)
23
+ debug (1.10.0)
24
+ irb (~> 1.10)
25
+ reline (>= 0.3.8)
26
+ diff-lcs (1.5.1)
27
+ i18n (1.14.6)
28
+ concurrent-ruby (~> 1.0)
29
+ io-console (0.8.0)
30
+ irb (1.14.3)
31
+ rdoc (>= 4.0.0)
32
+ reline (>= 0.4.2)
33
+ memory_profiler (1.1.0)
34
+ minitest (5.25.4)
35
+ mutex_m (0.3.0)
36
+ psych (5.2.2)
37
+ date
38
+ stringio
39
+ rake (13.2.1)
40
+ rdoc (6.10.0)
41
+ psych (>= 4.0.0)
42
+ reline (0.6.0)
43
+ io-console (~> 0.5)
44
+ rspec (3.13.0)
45
+ rspec-core (~> 3.13.0)
46
+ rspec-expectations (~> 3.13.0)
47
+ rspec-mocks (~> 3.13.0)
48
+ rspec-core (3.13.2)
49
+ rspec-support (~> 3.13.0)
50
+ rspec-expectations (3.13.3)
51
+ diff-lcs (>= 1.2.0, < 2.0)
52
+ rspec-support (~> 3.13.0)
53
+ rspec-mocks (3.13.2)
54
+ diff-lcs (>= 1.2.0, < 2.0)
55
+ rspec-support (~> 3.13.0)
56
+ rspec-support (3.13.2)
57
+ stringio (3.1.2)
58
+ thor (1.3.2)
59
+ thread_safe (0.3.6)
60
+ timecop (0.9.10)
61
+ tzinfo (1.2.11)
62
+ thread_safe (~> 0.1)
63
+ zeitwerk (2.6.18)
64
+
65
+ PLATFORMS
66
+ x86_64-darwin-23
67
+
68
+ DEPENDENCIES
69
+ activesupport (~> 6.0.0)
70
+ appraisal
71
+ base64
72
+ bigdecimal
73
+ debug
74
+ i18n
75
+ memory_profiler
76
+ mutex_m
77
+ rspec (~> 3.4)
78
+ timecop
79
+ timeliness!
80
+ tzinfo (>= 0.3.31)
81
+
82
+ BUNDLED WITH
83
+ 2.4.22
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "activesupport", "~> 6.1.0"
7
+ gem "debug", platforms: [:mri, :mingw, :x64_mingw]
8
+ gem "memory_profiler"
9
+
10
+ gemspec path: "../"
@@ -0,0 +1,82 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ timeliness (0.5.0)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ activesupport (6.1.7.10)
10
+ concurrent-ruby (~> 1.0, >= 1.0.2)
11
+ i18n (>= 1.6, < 2)
12
+ minitest (>= 5.1)
13
+ tzinfo (~> 2.0)
14
+ zeitwerk (~> 2.3)
15
+ appraisal (2.5.0)
16
+ bundler
17
+ rake
18
+ thor (>= 0.14.0)
19
+ base64 (0.2.0)
20
+ bigdecimal (3.1.9)
21
+ concurrent-ruby (1.3.4)
22
+ date (3.4.1)
23
+ debug (1.10.0)
24
+ irb (~> 1.10)
25
+ reline (>= 0.3.8)
26
+ diff-lcs (1.5.1)
27
+ i18n (1.14.6)
28
+ concurrent-ruby (~> 1.0)
29
+ io-console (0.8.0)
30
+ irb (1.14.3)
31
+ rdoc (>= 4.0.0)
32
+ reline (>= 0.4.2)
33
+ memory_profiler (1.1.0)
34
+ minitest (5.25.4)
35
+ mutex_m (0.3.0)
36
+ psych (5.2.2)
37
+ date
38
+ stringio
39
+ rake (13.2.1)
40
+ rdoc (6.10.0)
41
+ psych (>= 4.0.0)
42
+ reline (0.6.0)
43
+ io-console (~> 0.5)
44
+ rspec (3.13.0)
45
+ rspec-core (~> 3.13.0)
46
+ rspec-expectations (~> 3.13.0)
47
+ rspec-mocks (~> 3.13.0)
48
+ rspec-core (3.13.2)
49
+ rspec-support (~> 3.13.0)
50
+ rspec-expectations (3.13.3)
51
+ diff-lcs (>= 1.2.0, < 2.0)
52
+ rspec-support (~> 3.13.0)
53
+ rspec-mocks (3.13.2)
54
+ diff-lcs (>= 1.2.0, < 2.0)
55
+ rspec-support (~> 3.13.0)
56
+ rspec-support (3.13.2)
57
+ stringio (3.1.2)
58
+ thor (1.3.2)
59
+ timecop (0.9.10)
60
+ tzinfo (2.0.6)
61
+ concurrent-ruby (~> 1.0)
62
+ zeitwerk (2.6.18)
63
+
64
+ PLATFORMS
65
+ x86_64-darwin-23
66
+
67
+ DEPENDENCIES
68
+ activesupport (~> 6.1.0)
69
+ appraisal
70
+ base64
71
+ bigdecimal
72
+ debug
73
+ i18n
74
+ memory_profiler
75
+ mutex_m
76
+ rspec (~> 3.4)
77
+ timecop
78
+ timeliness!
79
+ tzinfo (>= 0.3.31)
80
+
81
+ BUNDLED WITH
82
+ 2.4.22
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "activesupport", "~> 7.0.0"
7
+ gem "debug", platforms: [:mri, :mingw, :x64_mingw]
8
+ gem "memory_profiler"
9
+
10
+ gemspec path: "../"
@@ -0,0 +1,80 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ timeliness (0.5.0)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ activesupport (7.0.8.7)
10
+ concurrent-ruby (~> 1.0, >= 1.0.2)
11
+ i18n (>= 1.6, < 2)
12
+ minitest (>= 5.1)
13
+ tzinfo (~> 2.0)
14
+ appraisal (2.5.0)
15
+ bundler
16
+ rake
17
+ thor (>= 0.14.0)
18
+ base64 (0.2.0)
19
+ bigdecimal (3.1.9)
20
+ concurrent-ruby (1.3.4)
21
+ date (3.4.1)
22
+ debug (1.10.0)
23
+ irb (~> 1.10)
24
+ reline (>= 0.3.8)
25
+ diff-lcs (1.5.1)
26
+ i18n (1.14.6)
27
+ concurrent-ruby (~> 1.0)
28
+ io-console (0.8.0)
29
+ irb (1.14.3)
30
+ rdoc (>= 4.0.0)
31
+ reline (>= 0.4.2)
32
+ memory_profiler (1.1.0)
33
+ minitest (5.25.4)
34
+ mutex_m (0.3.0)
35
+ psych (5.2.2)
36
+ date
37
+ stringio
38
+ rake (13.2.1)
39
+ rdoc (6.10.0)
40
+ psych (>= 4.0.0)
41
+ reline (0.6.0)
42
+ io-console (~> 0.5)
43
+ rspec (3.13.0)
44
+ rspec-core (~> 3.13.0)
45
+ rspec-expectations (~> 3.13.0)
46
+ rspec-mocks (~> 3.13.0)
47
+ rspec-core (3.13.2)
48
+ rspec-support (~> 3.13.0)
49
+ rspec-expectations (3.13.3)
50
+ diff-lcs (>= 1.2.0, < 2.0)
51
+ rspec-support (~> 3.13.0)
52
+ rspec-mocks (3.13.2)
53
+ diff-lcs (>= 1.2.0, < 2.0)
54
+ rspec-support (~> 3.13.0)
55
+ rspec-support (3.13.2)
56
+ stringio (3.1.2)
57
+ thor (1.3.2)
58
+ timecop (0.9.10)
59
+ tzinfo (2.0.6)
60
+ concurrent-ruby (~> 1.0)
61
+
62
+ PLATFORMS
63
+ x86_64-darwin-23
64
+
65
+ DEPENDENCIES
66
+ activesupport (~> 7.0.0)
67
+ appraisal
68
+ base64
69
+ bigdecimal
70
+ debug
71
+ i18n
72
+ memory_profiler
73
+ mutex_m
74
+ rspec (~> 3.4)
75
+ timecop
76
+ timeliness!
77
+ tzinfo (>= 0.3.31)
78
+
79
+ BUNDLED WITH
80
+ 2.4.22
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "activesupport", "~> 7.2.0"
7
+ gem "debug", platforms: [:mri, :mingw, :x64_mingw]
8
+ gem "memory_profiler"
9
+
10
+ gemspec path: "../"
@@ -0,0 +1,92 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ timeliness (0.5.0)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ activesupport (7.2.2.1)
10
+ base64
11
+ benchmark (>= 0.3)
12
+ bigdecimal
13
+ concurrent-ruby (~> 1.0, >= 1.3.1)
14
+ connection_pool (>= 2.2.5)
15
+ drb
16
+ i18n (>= 1.6, < 2)
17
+ logger (>= 1.4.2)
18
+ minitest (>= 5.1)
19
+ securerandom (>= 0.3)
20
+ tzinfo (~> 2.0, >= 2.0.5)
21
+ appraisal (2.5.0)
22
+ bundler
23
+ rake
24
+ thor (>= 0.14.0)
25
+ base64 (0.2.0)
26
+ benchmark (0.4.0)
27
+ bigdecimal (3.1.9)
28
+ concurrent-ruby (1.3.4)
29
+ connection_pool (2.4.1)
30
+ date (3.4.1)
31
+ debug (1.10.0)
32
+ irb (~> 1.10)
33
+ reline (>= 0.3.8)
34
+ diff-lcs (1.5.1)
35
+ drb (2.2.1)
36
+ i18n (1.14.6)
37
+ concurrent-ruby (~> 1.0)
38
+ io-console (0.8.0)
39
+ irb (1.14.3)
40
+ rdoc (>= 4.0.0)
41
+ reline (>= 0.4.2)
42
+ logger (1.6.4)
43
+ memory_profiler (1.1.0)
44
+ minitest (5.25.4)
45
+ mutex_m (0.3.0)
46
+ psych (5.2.2)
47
+ date
48
+ stringio
49
+ rake (13.2.1)
50
+ rdoc (6.10.0)
51
+ psych (>= 4.0.0)
52
+ reline (0.6.0)
53
+ io-console (~> 0.5)
54
+ rspec (3.13.0)
55
+ rspec-core (~> 3.13.0)
56
+ rspec-expectations (~> 3.13.0)
57
+ rspec-mocks (~> 3.13.0)
58
+ rspec-core (3.13.2)
59
+ rspec-support (~> 3.13.0)
60
+ rspec-expectations (3.13.3)
61
+ diff-lcs (>= 1.2.0, < 2.0)
62
+ rspec-support (~> 3.13.0)
63
+ rspec-mocks (3.13.2)
64
+ diff-lcs (>= 1.2.0, < 2.0)
65
+ rspec-support (~> 3.13.0)
66
+ rspec-support (3.13.2)
67
+ securerandom (0.4.1)
68
+ stringio (3.1.2)
69
+ thor (1.3.2)
70
+ timecop (0.9.10)
71
+ tzinfo (2.0.6)
72
+ concurrent-ruby (~> 1.0)
73
+
74
+ PLATFORMS
75
+ x86_64-darwin-23
76
+
77
+ DEPENDENCIES
78
+ activesupport (~> 7.2.0)
79
+ appraisal
80
+ base64
81
+ bigdecimal
82
+ debug
83
+ i18n
84
+ memory_profiler
85
+ mutex_m
86
+ rspec (~> 3.4)
87
+ timecop
88
+ timeliness!
89
+ tzinfo (>= 0.3.31)
90
+
91
+ BUNDLED WITH
92
+ 2.4.22
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "activesupport", "~> 8.0.0"
7
+ gem "debug", platforms: [:mri, :mingw, :x64_mingw]
8
+ gem "memory_profiler"
9
+
10
+ gemspec path: "../"
@@ -0,0 +1,95 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ timeliness (0.5.0)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ activesupport (8.0.1)
10
+ base64
11
+ benchmark (>= 0.3)
12
+ bigdecimal
13
+ concurrent-ruby (~> 1.0, >= 1.3.1)
14
+ connection_pool (>= 2.2.5)
15
+ drb
16
+ i18n (>= 1.6, < 2)
17
+ logger (>= 1.4.2)
18
+ minitest (>= 5.1)
19
+ securerandom (>= 0.3)
20
+ tzinfo (~> 2.0, >= 2.0.5)
21
+ uri (>= 0.13.1)
22
+ appraisal (2.5.0)
23
+ bundler
24
+ rake
25
+ thor (>= 0.14.0)
26
+ base64 (0.2.0)
27
+ benchmark (0.4.0)
28
+ bigdecimal (3.1.9)
29
+ concurrent-ruby (1.3.4)
30
+ connection_pool (2.4.1)
31
+ date (3.4.1)
32
+ debug (1.10.0)
33
+ irb (~> 1.10)
34
+ reline (>= 0.3.8)
35
+ diff-lcs (1.5.1)
36
+ drb (2.2.1)
37
+ i18n (1.14.6)
38
+ concurrent-ruby (~> 1.0)
39
+ io-console (0.8.0)
40
+ irb (1.14.3)
41
+ rdoc (>= 4.0.0)
42
+ reline (>= 0.4.2)
43
+ logger (1.6.4)
44
+ memory_profiler (1.1.0)
45
+ minitest (5.25.4)
46
+ mutex_m (0.3.0)
47
+ psych (5.2.2)
48
+ date
49
+ stringio
50
+ rake (13.2.1)
51
+ rdoc (6.10.0)
52
+ psych (>= 4.0.0)
53
+ reline (0.6.0)
54
+ io-console (~> 0.5)
55
+ rspec (3.13.0)
56
+ rspec-core (~> 3.13.0)
57
+ rspec-expectations (~> 3.13.0)
58
+ rspec-mocks (~> 3.13.0)
59
+ rspec-core (3.13.2)
60
+ rspec-support (~> 3.13.0)
61
+ rspec-expectations (3.13.3)
62
+ diff-lcs (>= 1.2.0, < 2.0)
63
+ rspec-support (~> 3.13.0)
64
+ rspec-mocks (3.13.2)
65
+ diff-lcs (>= 1.2.0, < 2.0)
66
+ rspec-support (~> 3.13.0)
67
+ rspec-support (3.13.2)
68
+ securerandom (0.4.1)
69
+ stringio (3.1.2)
70
+ thor (1.3.2)
71
+ timecop (0.9.10)
72
+ tzinfo (2.0.6)
73
+ concurrent-ruby (~> 1.0)
74
+ uri (1.0.2)
75
+
76
+ PLATFORMS
77
+ ruby
78
+ x86_64-darwin-23
79
+
80
+ DEPENDENCIES
81
+ activesupport (~> 8.0.0)
82
+ appraisal
83
+ base64
84
+ bigdecimal
85
+ debug
86
+ i18n
87
+ memory_profiler
88
+ mutex_m
89
+ rspec (~> 3.4)
90
+ timecop
91
+ timeliness!
92
+ tzinfo (>= 0.3.31)
93
+
94
+ BUNDLED WITH
95
+ 2.6.2
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Timeliness
2
4
  module Definitions
3
5
 
@@ -72,15 +74,18 @@ module Timeliness
72
74
  'dd-mm-yyyy hh:nn:ss',
73
75
  'dd-mm-yyyy h:nn_ampm',
74
76
  'dd-mm-yyyy h:nn',
77
+ 'dd.mm.yyyy hh:nn:ss',
78
+ 'dd.mm.yyyy h:nn',
75
79
  'ddd, dd mmm yyyy hh:nn:ss tz', # RFC 822
76
80
  'ddd, dd mmm yyyy hh:nn:ss zo', # RFC 822
77
81
  'ddd mmm d hh:nn:ss zo yyyy', # Ruby time string
82
+ 'yyyy-mm-ddThh:nn', # ISO 8601 without seconds
78
83
  'yyyy-mm-ddThh:nn:ss', # ISO 8601
79
84
  'yyyy-mm-ddThh:nn:sszo', # ISO 8601 with zone offset
80
85
  'yyyy-mm-ddThh:nn:sszt', # ISO 8601 with 'Zulu time' (i.e. Z) UTC zone designator
81
86
  'yyyy-mm-ddThh:nn:ss.u', # ISO 8601 with usec
82
87
  'yyyy-mm-ddThh:nn:ss.uzo', # ISO 8601 with usec and offset
83
- 'yyyy-mm-ddThh:nn:ss.uzt', # ISO 8601 with usec and 'Zulu time' (i.e. Z) UTC zone designator
88
+ 'yyyy-mm-ddThh:nn:ss.uzt', # ISO 8601 with usec and 'Zulu time' (i.e. Z) UTC zone designator
84
89
  'yyyy-mm-dd hh:nn:ss zo', # Ruby time string in later versions
85
90
  'yyyy-mm-dd hh:nn:ss tz', # Ruby time string for UTC in later versions
86
91
  ]
@@ -46,7 +46,7 @@ module Timeliness
46
46
 
47
47
  define_process_method(token_order.compact)
48
48
  @regexp_string = format
49
- @regexp = Regexp.new("^(#{format})$")
49
+ @regexp = Regexp.new("^(?>#{format})$")
50
50
  self
51
51
  rescue => ex
52
52
  raise CompilationFailed, "The format '#{format_string}' failed to compile using regexp string #{format}. Error message: #{ex.inspect}"
@@ -63,6 +63,7 @@ module Timeliness
63
63
  position, code = Definitions.format_components[component]
64
64
  values[position] = code || "#{component}.to_i" if position
65
65
  end
66
+ components << '*_' # absorb any excess arguments not used by format
66
67
  instance_eval <<-DEF
67
68
  def process(#{components.join(',')})
68
69
  [#{values.map { |i| i || 'nil' }.join(',')}]
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Timeliness
2
4
  class FormatSet
3
5
  attr_reader :formats, :regexp
@@ -15,13 +17,13 @@ module Timeliness
15
17
  # Compiles the formats into one big regexp. Stores the index of where
16
18
  # each format's capture values begin in the matchdata.
17
19
  def compile!
18
- regexp_string = ''
20
+ regexp_string = +''
19
21
  @formats.inject(0) { |index, format_string|
20
22
  format = Format.new(format_string).compile!
21
23
  @formats_hash[format_string] = format
22
24
  @match_indexes[index] = format
23
- regexp_string = "#{regexp_string}(#{format.regexp_string})|"
24
- index + format.token_count + 1 # add one for wrapper capture
25
+ regexp_string.concat("(?>#{format.regexp_string})|")
26
+ index + format.token_count
25
27
  }
26
28
  @regexp = %r[\A(?:#{regexp_string.chop})\z]
27
29
  self
@@ -31,10 +33,10 @@ module Timeliness
31
33
  format = single_format(format_string) if format_string
32
34
  match_regexp = format && format.regexp || @regexp
33
35
 
34
- if match_data = match_regexp.match(string)
35
- index = match_data.captures.index(string)
36
- start = index + 1
37
- values = match_data.captures[start..(start+7)].compact
36
+ match_regexp.match(string) do |match_data|
37
+ captures = match_data.captures # For a multi-format regexp there are lots of nils
38
+ index = captures.find_index { |e| !e.nil? } # Find the start of captures for matched format
39
+ values = captures.values_at(index..(index+7))
38
40
  format ||= @match_indexes[index]
39
41
  format.process(*values)
40
42
  end
@@ -4,11 +4,14 @@ module Timeliness
4
4
 
5
5
  class << self
6
6
 
7
- def parse(value, *args)
7
+ def parse(value, type=nil, **options)
8
8
  return value if acts_like_temporal?(value)
9
9
  return nil unless parseable?(value)
10
10
 
11
- type, options = type_and_options_from_args(args)
11
+ if type && !type.is_a?(Symbol)
12
+ options[:now] = type if type
13
+ type = nil
14
+ end
12
15
 
13
16
  time_array = _parse(value, type, options)
14
17
  return nil if time_array.nil?
@@ -40,7 +43,7 @@ module Timeliness
40
43
  Definitions.send("#{type}_format_set").match(string, options[:format])
41
44
  else
42
45
  values = nil
43
- Definitions.format_sets(type, string).find { |set| values = set.match(string, options[:format]) }
46
+ Definitions.format_sets(type, string).any? { |set| values = set.match(string, options[:format]) }
44
47
  values
45
48
  end
46
49
  rescue
@@ -95,8 +98,10 @@ module Timeliness
95
98
 
96
99
  def current_time_in_zone(zone)
97
100
  case zone
98
- when :utc, :local
99
- Time.now.send("get#{zone}")
101
+ when :utc
102
+ Time.now.getutc
103
+ when :local
104
+ Time.now.getlocal
100
105
  when :current
101
106
  Time.current
102
107
  else
@@ -107,8 +112,10 @@ module Timeliness
107
112
  def shift_time_to_zone(time, zone=nil)
108
113
  zone ||= Timeliness.configuration.default_timezone
109
114
  case zone
110
- when :utc, :local
111
- time.send("get#{zone}")
115
+ when :utc
116
+ time.getutc
117
+ when :local
118
+ time.getlocal
112
119
  when :current
113
120
  time.in_time_zone
114
121
  else
@@ -1,3 +1,3 @@
1
1
  module Timeliness
2
- VERSION = '0.4.5'
2
+ VERSION = '0.5.1'.freeze
3
3
  end
@@ -61,6 +61,9 @@ describe Timeliness::FormatSet do
61
61
  'ddd mmm d hh:nn:ss tz yyyy' => {pass: ['Sat Jul 19 12:00:00 EST 2008'], fail: []},
62
62
  'yyyy-mm-ddThh:nn:sszo' => {pass: ['2008-07-19T12:00:00+10:00'], fail: ['2008-07-19T12:00:00Z+10:00']},
63
63
  'yyyy-mm-ddThh:nn:ss.uzt' => {pass: ['2019-06-07T03:35:55.100000Z'], fail: []},
64
+ 'dd.mm.yyyy hh:nn' => {pass: ['07.06.2019 03:35'], fail: []},
65
+ 'yyyy-mm-dd hh:nn' => {pass: ['2019-06-07 03:35'], fail: []},
66
+ 'yyyy-mm-ddThh:nn' => {pass: ['2019-06-07T03:35'], fail: []},
64
67
  }
65
68
  format_tests.each do |format, values|
66
69
  it "should correctly match datetimes in format '#{format}'" do
@@ -1,4 +1,6 @@
1
+ require 'active_support'
1
2
  require 'active_support/time'
3
+ require 'active_support/core_ext/object'
2
4
  require 'timecop'
3
5
  require 'timeliness'
4
6
  require 'timeliness/core_ext'
@@ -12,20 +14,20 @@ module TimelinessHelpers
12
14
  Timeliness::Definitions
13
15
  end
14
16
 
15
- def parse(*args)
16
- Timeliness::Parser.parse(*args)
17
+ def parse(value, type=nil, **args)
18
+ Timeliness::Parser.parse(value, type, **args)
17
19
  end
18
20
 
19
21
  def current_date(options={})
20
22
  Timeliness::Parser.send(:current_date, options)
21
23
  end
22
24
 
23
- def should_parse(*args)
24
- expect(Timeliness::Parser.parse(*args)).not_to be_nil
25
+ def should_parse(value, type=nil, **args)
26
+ expect(Timeliness::Parser.parse(value, type, **args)).not_to be_nil
25
27
  end
26
28
 
27
- def should_not_parse(*args)
28
- expect(Timeliness::Parser.parse(*args)).to be_nil
29
+ def should_not_parse(value, type=nil, **args)
30
+ expect(Timeliness::Parser.parse(value, type, **args)).to be_nil
29
31
  end
30
32
  end
31
33
 
@@ -38,4 +40,4 @@ RSpec.configure do |c|
38
40
  c.after do
39
41
  Timeliness.configuration = Timeliness::Configuration.new
40
42
  end
41
- end
43
+ end
data/timeliness.gemspec CHANGED
@@ -3,6 +3,9 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
  require "timeliness/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
+
7
+ github_url = 'https://github.com/adzap/timeliness'
8
+
6
9
  s.name = "timeliness"
7
10
  s.version = Timeliness::VERSION
8
11
  s.platform = Gem::Platform::RUBY
@@ -13,10 +16,21 @@ Gem::Specification.new do |s|
13
16
  s.description = %q{Fast date/time parser with customisable formats, timezone and I18n support.}
14
17
  s.license = "MIT"
15
18
 
19
+ s.metadata = {
20
+ "rubygems_mfa_required" => "true",
21
+ "bug_tracker_uri" => "#{github_url}/issues",
22
+ "changelog_uri" => "#{github_url}/blob/master/CHANGELOG.rdoc",
23
+ "source_code_uri" => "#{github_url}",
24
+ "wiki_uri" => "#{github_url}/wiki",
25
+ }
26
+
16
27
  s.add_development_dependency 'activesupport', '>= 3.2'
17
28
  s.add_development_dependency 'tzinfo', '>= 0.3.31'
18
29
  s.add_development_dependency 'rspec', '~> 3.4'
19
30
  s.add_development_dependency 'timecop'
31
+ s.add_development_dependency 'base64'
32
+ s.add_development_dependency 'bigdecimal'
33
+ s.add_development_dependency 'mutex_m'
20
34
  s.add_development_dependency 'i18n'
21
35
 
22
36
  s.files = `git ls-files`.split("\n")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timeliness
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Meehan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-18 00:00:00.000000000 Z
11
+ date: 2025-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -66,6 +66,48 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: base64
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: bigdecimal
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: mutex_m
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
69
111
  - !ruby/object:Gem::Dependency
70
112
  name: i18n
71
113
  requirement: !ruby/object:Gem::Requirement
@@ -89,12 +131,24 @@ extra_rdoc_files:
89
131
  - CHANGELOG.rdoc
90
132
  files:
91
133
  - ".github/workflows/ci.yml"
92
- - ".travis.yml"
134
+ - Appraisals
93
135
  - CHANGELOG.rdoc
94
136
  - LICENSE
95
137
  - README.rdoc
96
138
  - Rakefile
97
139
  - benchmark.rb
140
+ - gemfiles/activesupport_5_2.gemfile
141
+ - gemfiles/activesupport_5_2.gemfile.lock
142
+ - gemfiles/activesupport_6_0.gemfile
143
+ - gemfiles/activesupport_6_0.gemfile.lock
144
+ - gemfiles/activesupport_6_1.gemfile
145
+ - gemfiles/activesupport_6_1.gemfile.lock
146
+ - gemfiles/activesupport_7_0.gemfile
147
+ - gemfiles/activesupport_7_0.gemfile.lock
148
+ - gemfiles/activesupport_7_2.gemfile
149
+ - gemfiles/activesupport_7_2.gemfile.lock
150
+ - gemfiles/activesupport_8_0.gemfile
151
+ - gemfiles/activesupport_8_0.gemfile.lock
98
152
  - lib/timeliness.rb
99
153
  - lib/timeliness/configuration.rb
100
154
  - lib/timeliness/core_ext.rb
@@ -116,7 +170,12 @@ files:
116
170
  homepage: http://github.com/adzap/timeliness
117
171
  licenses:
118
172
  - MIT
119
- metadata: {}
173
+ metadata:
174
+ rubygems_mfa_required: 'true'
175
+ bug_tracker_uri: https://github.com/adzap/timeliness/issues
176
+ changelog_uri: https://github.com/adzap/timeliness/blob/master/CHANGELOG.rdoc
177
+ source_code_uri: https://github.com/adzap/timeliness
178
+ wiki_uri: https://github.com/adzap/timeliness/wiki
120
179
  post_install_message:
121
180
  rdoc_options: []
122
181
  require_paths:
@@ -132,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
191
  - !ruby/object:Gem::Version
133
192
  version: '0'
134
193
  requirements: []
135
- rubygems_version: 3.1.6
194
+ rubygems_version: 3.4.19
136
195
  signing_key:
137
196
  specification_version: 4
138
197
  summary: Date/time parsing for the control freak.
data/.travis.yml DELETED
@@ -1,25 +0,0 @@
1
- dist: focal
2
- os: linux
3
- language: ruby
4
- before_install: gem install bundler
5
- cache: bundler
6
-
7
- rvm:
8
- - "2.5.8"
9
- - "2.6.6"
10
- - "2.7.2"
11
- - "3.0.0"
12
- - ruby-head
13
-
14
- jobs:
15
- allow_failures:
16
- - rvm: ruby-head
17
-
18
- script: 'bundle exec rspec'
19
-
20
- notifications:
21
- email:
22
- recipients:
23
- - adam.meehan@gmail.com
24
- on_failure: change
25
- on_success: never