easy_time 0.2.1 → 0.2.2

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: 81e4762bb54961cecadb64214a5a72264145187d621bca1ed38175c4c73c1efe
4
- data.tar.gz: d78614033f17422a6e8fad9a3127aec448e442f755f26e2587df0e22505d91d4
3
+ metadata.gz: 14627cb45389f5f6d02c4018cd289ec5d395f333b4fc898065c3ac0309f245f4
4
+ data.tar.gz: 0e4cf658977e8c650a0210155e1e471eee52dae57340d12b04f85c23621c2e4e
5
5
  SHA512:
6
- metadata.gz: 9f188b204b034fbdfada4745f300e9852b433e1bcb34470d9b68f5a3cd1a3733ffb7df01286039c366669c8efd3e94db2bb80165b39687e2628109f14b19605e
7
- data.tar.gz: 1c7d9d47438f6867515a23e9c576d8679e16ff04073ac27688655ed6ea7e6dfea959473d783e745f150cb6724ed2a44923f20f14619373c1373cba8e81c3119b
6
+ metadata.gz: 6eb8d35eb1e50d9ead87c14e3cfb929fb5e1d9bd754b262151903e7525479af1cc2018c63cb1305778c69ccf370d6764f43ce7e4ae5e8d5e8399412ef68f50d2
7
+ data.tar.gz: 17425e181160189a63d2b51f101a8723eb4257bb07e6cc1d6112a07c6e512f4dba4c8ad8c66c3773a5a2b9e01156b04f7358c043b55b775b4727028207a636f3
data/.circleci/config.yml CHANGED
@@ -1,11 +1,11 @@
1
1
  version: 2.1
2
2
  orbs:
3
- ruby: circleci/ruby@0.1.2
3
+ ruby: circleci/ruby@2.1.0
4
4
 
5
5
  defaults: &DEFAULTS
6
6
  resource_class: small
7
7
  docker:
8
- - image: circleci/ruby:2.5
8
+ - image: cimg/ruby:2.7.7
9
9
 
10
10
  environment:
11
11
  BUNDLE_JOBS: 3
@@ -17,7 +17,7 @@ defaults: &DEFAULTS
17
17
  jobs:
18
18
  build:
19
19
  docker:
20
- - image: circleci/ruby:2.6.3-stretch-node
20
+ - image: cimg/ruby:2.7.7
21
21
  executor: ruby/default
22
22
  steps:
23
23
  - checkout
@@ -31,7 +31,7 @@ jobs:
31
31
 
32
32
  - run:
33
33
  name: Install bundler
34
- command: gem install bundler
34
+ command: gem install bundler -v 2.4.22
35
35
 
36
36
  - run:
37
37
  name: Check bundle version
@@ -93,7 +93,7 @@ jobs:
93
93
 
94
94
  - run:
95
95
  name: Install bundler
96
- command: gem install bundler
96
+ command: gem install bundler -v 2.4.22
97
97
 
98
98
  - run:
99
99
  name: set the bundle path
@@ -114,9 +114,9 @@ jobs:
114
114
  bundle exec rake clean
115
115
  bundle exec rake build
116
116
 
117
- #- deploy:
118
- # name: Release and push
119
- # command: bundle exec gem push
117
+ - deploy:
118
+ name: Release and push
119
+ command: bundle exec rake release
120
120
 
121
121
  workflows:
122
122
  version: 2
@@ -129,4 +129,3 @@ workflows:
129
129
  filters:
130
130
  branches:
131
131
  only: master
132
-
data/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # Change Log for EasyTime
2
+
3
+ ## [0.2.2] - 2024-01-18
4
+
5
+ ### Added
6
+ This `CHANGELOG.md` file
7
+
8
+ ### Changed
9
+ Added `activesupport` to the development dependencies in the gemspec
10
+
11
+ Updated the `initializer` method to not use the "presence" method.
12
+
13
+ Updated several gems to their latest versions.
data/Gemfile.lock CHANGED
@@ -1,37 +1,46 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- easy_time (0.2.1)
4
+ easy_time (0.2.2)
5
5
  activesupport
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (6.0.2.2)
10
+ activesupport (7.1.3)
11
+ base64
12
+ bigdecimal
11
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
- i18n (>= 0.7, < 2)
13
- minitest (~> 5.1)
14
- tzinfo (~> 1.1)
15
- zeitwerk (~> 2.2)
16
- ast (2.4.0)
14
+ connection_pool (>= 2.2.5)
15
+ drb
16
+ i18n (>= 1.6, < 2)
17
+ minitest (>= 5.1)
18
+ mutex_m
19
+ tzinfo (~> 2.0)
20
+ ast (2.4.2)
21
+ base64 (0.2.0)
22
+ bigdecimal (3.1.6)
17
23
  builder (3.2.4)
18
24
  byebug (11.1.3)
19
- coderay (1.1.2)
20
- concurrent-ruby (1.1.6)
21
- diff-lcs (1.3)
22
- docile (1.3.2)
23
- ffi (1.12.2)
24
- formatador (0.2.5)
25
- fuubar (2.5.0)
25
+ coderay (1.1.3)
26
+ concurrent-ruby (1.2.3)
27
+ connection_pool (2.4.1)
28
+ diff-lcs (1.5.0)
29
+ docile (1.4.0)
30
+ drb (2.2.0)
31
+ ruby2_keywords
32
+ ffi (1.16.3)
33
+ formatador (1.1.0)
34
+ fuubar (2.5.1)
26
35
  rspec-core (~> 3.0)
27
36
  ruby-progressbar (~> 1.4)
28
- guard (2.16.2)
37
+ guard (2.18.1)
29
38
  formatador (>= 0.2.4)
30
39
  listen (>= 2.7, < 4.0)
31
40
  lumberjack (>= 1.0.12, < 2.0)
32
41
  nenv (~> 0.1)
33
42
  notiffany (~> 0.0)
34
- pry (>= 0.9.12)
43
+ pry (>= 0.13.0)
35
44
  shellany (~> 0.0)
36
45
  thor (>= 0.18.1)
37
46
  guard-compat (1.2.1)
@@ -42,80 +51,92 @@ GEM
42
51
  guard-yard (2.2.1)
43
52
  guard (>= 1.1.0)
44
53
  yard (>= 0.7.0)
45
- i18n (1.8.2)
54
+ i18n (1.14.1)
46
55
  concurrent-ruby (~> 1.0)
47
- jaro_winkler (1.5.4)
48
- listen (3.2.1)
56
+ json (2.7.1)
57
+ language_server-protocol (3.17.0.3)
58
+ listen (3.8.0)
49
59
  rb-fsevent (~> 0.10, >= 0.10.3)
50
60
  rb-inotify (~> 0.9, >= 0.9.10)
51
- lumberjack (1.2.4)
61
+ lumberjack (1.2.10)
52
62
  method_source (1.0.0)
53
- minitest (5.14.0)
63
+ minitest (5.21.2)
64
+ mutex_m (0.2.0)
54
65
  nenv (0.3.0)
55
66
  notiffany (0.1.3)
56
67
  nenv (~> 0.1)
57
68
  shellany (~> 0.0)
58
- parallel (1.19.1)
59
- parser (2.7.1.1)
60
- ast (~> 2.4.0)
61
- pry (0.13.1)
69
+ parallel (1.24.0)
70
+ parser (3.3.0.4)
71
+ ast (~> 2.4.1)
72
+ racc
73
+ pry (0.14.2)
62
74
  coderay (~> 1.1)
63
75
  method_source (~> 1.0)
64
- pry-byebug (3.9.0)
76
+ pry-byebug (3.10.1)
65
77
  byebug (~> 11.0)
66
- pry (~> 0.13.0)
67
- rainbow (3.0.0)
68
- rake (13.0.1)
69
- rb-fsevent (0.10.3)
78
+ pry (>= 0.13, < 0.15)
79
+ racc (1.7.3)
80
+ rainbow (3.1.1)
81
+ rake (13.1.0)
82
+ rb-fsevent (0.11.2)
70
83
  rb-inotify (0.10.1)
71
84
  ffi (~> 1.0)
72
- redcarpet (3.5.0)
73
- rexml (3.2.4)
74
- rspec (3.9.0)
75
- rspec-core (~> 3.9.0)
76
- rspec-expectations (~> 3.9.0)
77
- rspec-mocks (~> 3.9.0)
78
- rspec-core (3.9.1)
79
- rspec-support (~> 3.9.1)
80
- rspec-expectations (3.9.1)
85
+ redcarpet (3.6.0)
86
+ regexp_parser (2.9.0)
87
+ rexml (3.2.6)
88
+ rspec (3.12.0)
89
+ rspec-core (~> 3.12.0)
90
+ rspec-expectations (~> 3.12.0)
91
+ rspec-mocks (~> 3.12.0)
92
+ rspec-core (3.12.2)
93
+ rspec-support (~> 3.12.0)
94
+ rspec-expectations (3.12.3)
81
95
  diff-lcs (>= 1.2.0, < 2.0)
82
- rspec-support (~> 3.9.0)
83
- rspec-mocks (3.9.1)
96
+ rspec-support (~> 3.12.0)
97
+ rspec-mocks (3.12.6)
84
98
  diff-lcs (>= 1.2.0, < 2.0)
85
- rspec-support (~> 3.9.0)
86
- rspec-support (3.9.2)
99
+ rspec-support (~> 3.12.0)
100
+ rspec-support (3.12.1)
87
101
  rspec_junit (4.0.4)
88
102
  builder (>= 3.2.2)
89
103
  rspec (>= 3.3.0)
90
- rspec_junit_formatter (0.4.1)
104
+ rspec_junit_formatter (0.6.0)
91
105
  rspec-core (>= 2, < 4, != 2.12.0)
92
- rubocop (0.82.0)
93
- jaro_winkler (~> 1.5.1)
106
+ rubocop (1.60.1)
107
+ json (~> 2.3)
108
+ language_server-protocol (>= 3.17.0)
94
109
  parallel (~> 1.10)
95
- parser (>= 2.7.0.1)
110
+ parser (>= 3.3.0.2)
96
111
  rainbow (>= 2.2.2, < 4.0)
97
- rexml
112
+ regexp_parser (>= 1.8, < 3.0)
113
+ rexml (>= 3.2.5, < 4.0)
114
+ rubocop-ast (>= 1.30.0, < 2.0)
98
115
  ruby-progressbar (~> 1.7)
99
- unicode-display_width (>= 1.4.0, < 2.0)
100
- ruby-progressbar (1.10.1)
116
+ unicode-display_width (>= 2.4.0, < 3.0)
117
+ rubocop-ast (1.30.0)
118
+ parser (>= 3.2.1.0)
119
+ ruby-progressbar (1.13.0)
120
+ ruby2_keywords (0.0.5)
101
121
  shellany (0.0.1)
102
- simplecov (0.18.5)
122
+ simplecov (0.22.0)
103
123
  docile (~> 1.1)
104
124
  simplecov-html (~> 0.11)
105
- simplecov-html (0.12.2)
125
+ simplecov_json_formatter (~> 0.1)
126
+ simplecov-html (0.12.3)
127
+ simplecov_json_formatter (0.1.4)
106
128
  terminal-notifier-guard (1.7.0)
107
- thor (1.0.1)
108
- thread_safe (0.3.6)
109
- tzinfo (1.2.7)
110
- thread_safe (~> 0.1)
111
- unicode-display_width (1.7.0)
112
- yard (0.9.24)
113
- zeitwerk (2.3.0)
129
+ thor (1.3.0)
130
+ tzinfo (2.0.6)
131
+ concurrent-ruby (~> 1.0)
132
+ unicode-display_width (2.5.0)
133
+ yard (0.9.34)
114
134
 
115
135
  PLATFORMS
116
136
  ruby
117
137
 
118
138
  DEPENDENCIES
139
+ activesupport (>= 6.1.4)
119
140
  bundler (~> 2.1.4)
120
141
  easy_time!
121
142
  fuubar (>= 2.5.0)
data/README.md CHANGED
@@ -15,10 +15,10 @@ Well, then, give EasyTime a try!
15
15
 
16
16
  `EasyTime` accepts most of the well-known date and time objects, including
17
17
  `RFC2822`, `HTTPDate`, `XMLSchema`, `ISO8601`, as well as
18
- ActiveSupport::TimeWithZone strings and provides comparisons that have an
18
+ `ActiveSupport::TimeWithZone` strings and provides comparisons that have an
19
19
  adjustable tolerance. With `EasyTime` methods, you can reliably compare two
20
20
  timestamps and determine which one is "newer", "older" or the "same" withing
21
- a configurable tolerance. The default comparison tolerance is 1.minute.
21
+ a configurable tolerance. The default comparison tolerance is `1.minute`.
22
22
 
23
23
  In other words, if you have a time-stamp from an `ActiveRecord` object that is
24
24
  a few seconds different from a related object obtained from a 3rd-party system,
@@ -135,8 +135,8 @@ A `String` value is parsed with the `convert` method.
135
135
 
136
136
  #### Time Strings
137
137
 
138
- Most modern time format strings are recognized: ISO8601, RFD2822, HTTPDate,
139
- XMLSchema, and even some natural date and time formats. Many systems use an
138
+ Most modern time format strings are recognized: `ISO8601`, `RFD2822`, `HTTPDate`,
139
+ `XMLSchema`, and even some natural date and time formats. Many systems use an
140
140
  [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) string, which has date, time,
141
141
  and timezone components, with each variant having some variations.
142
142
 
@@ -204,9 +204,9 @@ applied across all instances of the class.
204
204
 
205
205
  ### EasyTime Instance Methods
206
206
 
207
- Once a `EasyTime` value has been created, it is basically a wrapped `Time` value
208
- where the comparison methods are overridden in order to apply the comparison
209
- tolerance value.
207
+ Once an `EasyTime` value has been created, it is basically a wrapped `Time`
208
+ value where the comparison methods are overridden in order to apply the
209
+ comparison tolerance value.
210
210
 
211
211
  These are the instance methods:
212
212
 
@@ -318,9 +318,9 @@ simple to review the gem API documentation:
318
318
 
319
319
  ## Contributing
320
320
 
321
- If you wish to contribute, please fork the repo, create a new branch for your suggested
322
- improvement, and create a pull request based off of your forked repo branch. Please do
323
- not make changes in the version.
321
+ If you wish to contribute, please fork the repo, create a new branch for your
322
+ suggested improvement, and create a pull request based off of your forked repo
323
+ branch. Please do not make changes in the version.
324
324
 
325
325
  Bug reports and pull requests are welcome on GitHub at https://github.com/aks/easy_time.
326
326
 
data/easy_time.gemspec CHANGED
@@ -29,6 +29,8 @@ Gem::Specification.new do |spec|
29
29
  spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
30
30
 
31
31
  spec.metadata["allowed_push_host"] = "https://rubygems.org"
32
+ # spec.metadata["allowed_push_host"] = "https://rubygems.pkg.github.com/aks"
33
+ spec.metadata["github_repo"] = "ssh://github.com/aks/easy_time"
32
34
 
33
35
  spec.metadata["homepage_uri"] = spec.homepage
34
36
  spec.metadata["source_code_uri"] = "https://github.com/aks/easy_time"
@@ -43,6 +45,7 @@ Gem::Specification.new do |spec|
43
45
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
44
46
  spec.require_paths = ["lib"]
45
47
 
48
+ spec.add_development_dependency "activesupport", ">= 6.1.4"
46
49
  spec.add_development_dependency "bundler", "~> 2.1.4"
47
50
  spec.add_development_dependency "fuubar", ">= 2.5.0"
48
51
  spec.add_development_dependency "guard"
@@ -1,3 +1,3 @@
1
1
  class EasyTime
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
data/lib/easy_time.rb CHANGED
@@ -246,7 +246,7 @@ class EasyTime
246
246
  delegate :to_s, :inspect, to: :time
247
247
 
248
248
  def initialize(*time, tolerance: nil)
249
- @time = time.presence && convert(time.size == 1 ? time.first : time)
249
+ @time = time.size.nonzero? && convert(time.size == 1 ? time.first : time)
250
250
  @comparison_tolerance = tolerance
251
251
  end
252
252
 
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_time
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan Stebbens
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-27 00:00:00.000000000 Z
11
+ date: 2024-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 6.1.4
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 6.1.4
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -263,6 +277,7 @@ files:
263
277
  - ".rubocop.yml"
264
278
  - ".travis.yml"
265
279
  - ".yardopts"
280
+ - CHANGELOG.md
266
281
  - Gemfile
267
282
  - Gemfile.lock
268
283
  - Guardfile
@@ -280,9 +295,10 @@ licenses:
280
295
  - MIT
281
296
  metadata:
282
297
  allowed_push_host: https://rubygems.org
298
+ github_repo: ssh://github.com/aks/easy_time
283
299
  homepage_uri: https://github.com/aks/easy_time
284
300
  source_code_uri: https://github.com/aks/easy_time
285
- post_install_message:
301
+ post_install_message:
286
302
  rdoc_options: []
287
303
  require_paths:
288
304
  - lib
@@ -297,8 +313,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
313
  - !ruby/object:Gem::Version
298
314
  version: '0'
299
315
  requirements: []
300
- rubygems_version: 3.1.2
301
- signing_key:
316
+ rubygems_version: 3.1.6
317
+ signing_key:
302
318
  specification_version: 4
303
319
  summary: Easy auto-conversion of most date and time values with tolerant-comparisons
304
320
  test_files: []
321
+ ...