eol_rb 0.5.0 → 0.6.0

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: deb5ee5f5e55c55d103549f179b6078084153e50e5587321da7bb5dfbf83f4de
4
- data.tar.gz: 0ab6131015550d5dda5e89b2f47daa01ccf65936f23515e6615eb01448024037
3
+ metadata.gz: 7d69c96762db4b69e4ae3b06009a2727dda41b3f2a8db4c60caa368e24ae93fd
4
+ data.tar.gz: 868897d47432ecfc2393df155ce3e302dfb4438a0c5a58dea01f65c209b08c72
5
5
  SHA512:
6
- metadata.gz: fd25b0ea142602354fedc7a3cb39b389757870cdee1ad1c5e6996afb29f49b5344722fad7620592f11d352036488b083c7498ae0c739a8d82374ec68bb1b8cce
7
- data.tar.gz: 7b70b8189c4b66ead731fba5f815844cc79d37d3ac5993f81f314e0eea7ba4ca5ca884a489932abc2a05d5bb6c550a365b3b82ade92f982fd504f4453aa20925
6
+ metadata.gz: 55c7de394f55a141f69ad781cbebfd696743e7e9ef9fe9c83bf3de403525bb285c8d7ae4fc6fddf96d880114f6db88f52d112fd5672950c008e587e4120ffcd5
7
+ data.tar.gz: 7da113e2ba7c209ba6b340f8826dc9bdcaf71c67520b851484ba9950f323cae644ba87ab9d041d19fc81bb9a52547a7ebbb9ebd2a50624a09cd7843e9f20251d
data/README.md CHANGED
@@ -47,17 +47,20 @@ EOL.info('ruby', cycle: '3.1')
47
47
  # @lts=false,
48
48
  # @release_date=#<Date: 2021-12-25 ((2459574j,0s,0n),+0s,2299161j)>,
49
49
  # @version=Gem::Version.new("3.1")>
50
+
51
+ EOL.info('ruby', cycle: '2.6').supported?
52
+ # => false
50
53
  ```
51
54
 
52
55
  ## Development
53
56
 
54
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
57
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
55
58
 
56
59
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
57
60
 
58
61
  ## Contributing
59
62
 
60
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/eol_rb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/eol_rb/blob/master/CODE_OF_CONDUCT.md).
63
+ Bug reports and pull requests are welcome on GitHub at [Coolomina/eol_rb](https://github.com/Coolomina/eol-rb/issues). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/Coolomina/eol_rb/blob/main/CODE_OF_CONDUCT.md).
61
64
 
62
65
  ## License
63
66
 
@@ -65,4 +68,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
65
68
 
66
69
  ## Code of Conduct
67
70
 
68
- Everyone interacting in the EolRb project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/eol_rb/blob/master/CODE_OF_CONDUCT.md).
71
+ Everyone interacting in the EolRb project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/Coolomina/eol_rb/blob/main/CODE_OF_CONDUCT.md).
@@ -8,7 +8,7 @@ module EOL
8
8
 
9
9
  def initialize(specs)
10
10
  @version = Gem::Version.new(specs.fetch("cycle"))
11
- @eol = Date.parse(specs.fetch("eol"))
11
+ @eol = parse_eol(specs.fetch("eol"))
12
12
  @latest = Gem::Version.new(specs.fetch("latest"))
13
13
  @latest_release_date = Date.parse(specs.fetch("latestReleaseDate"))
14
14
  @release_date = Date.parse(specs.fetch("releaseDate"))
@@ -16,8 +16,20 @@ module EOL
16
16
  end
17
17
 
18
18
  def supported?
19
+ return !eol if [true, false].include? eol
20
+
19
21
  @eol > Time.now.to_date
20
22
  end
23
+
24
+ private
25
+
26
+ def parse_eol(eol)
27
+ return false if eol.nil?
28
+ return eol if [true, false].include? eol
29
+ return Date.parse(eol) if eol.is_a? String
30
+
31
+ nil
32
+ end
21
33
  end
22
34
  end
23
35
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EOL
4
- VERSION = "0.5.0"
4
+ VERSION = "0.6.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eol_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alejandro Colomina
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-17 00:00:00.000000000 Z
11
+ date: 2023-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -66,6 +66,34 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.39'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop-rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.6.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.6.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop-rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '2.22'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '2.22'
69
97
  description: Ruby client for endoflife.date API
70
98
  email:
71
99
  - ale@coolomina.dev