solar_terms_24 1.0.0 → 1.0.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: 0f15bcb96c0c6c3df06a9dd6ee78674ec3989e6145b80395f85c5eb5d8066d79
4
- data.tar.gz: 9d1c839c510ca6a35fb0c76965e08b7e3b27921cf7c0a95ab9d2d7712081026d
3
+ metadata.gz: 53d4cbf868874c299990294354e75867efcfa3acbd0cc4fe94145613ad805bae
4
+ data.tar.gz: 6fe4eb41ba5ad2e4640e9ce02d7f7d030412f54962a07792aa90ab79a18e2b1b
5
5
  SHA512:
6
- metadata.gz: 207af75cae0041c4f8924122e5e3dad13bc5ce2d8f9114059a5b716451f0e23a49919a3b1dfd55d69b2d7ff61a49e8e068dcf4c7ac9f1132cb407c0e82c786f0
7
- data.tar.gz: d0f40428a096d8a58afdc0a2b256ecb73ed5ba3e1e09ff4e9002b9a03fc56c63edd30a7a51e6096e3613b3c2bd48c4cd812028bf8e9400990842d369a41e4b2c
6
+ metadata.gz: fce29ee1482edfedaf9ff737e0b3f9694d4abf46bde7490f12113f8380a68677f3f3371d71ff26ed9270081932e35d2033f4b936a685d770d294f090bb31a517
7
+ data.tar.gz: b53680779e6b8401fc8dfd2867ac3488f16c8823f09483b609ca6f0fa94da30babdf922e50ba1eace768f18671437cac73a027437e0c05af64c73c466cf87534
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- solar_terms_24 (1.0.0)
4
+ solar_terms_24 (1.0.1)
5
5
  faraday (~> 2.0)
6
6
  i18n (~> 1.0)
7
7
  thor (~> 1.0)
@@ -78,4 +78,4 @@ DEPENDENCIES
78
78
  solar_terms_24!
79
79
 
80
80
  BUNDLED WITH
81
- 2.3.7
81
+ 2.4.1
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Gem Version](https://badge.fury.io/rb/solar_terms_24.svg)](https://badge.fury.io/rb/solar_terms_24)
2
+ [![Ruby](https://github.com/kevinluo201/solar_terms_24/actions/workflows/main.yml/badge.svg)](https://github.com/kevinluo201/solar_terms_24/actions/workflows/main.yml)
1
3
  # SolarTerms24
2
4
 
3
5
  ## Introduction
@@ -96,7 +98,7 @@ $ solar_terms_24 list 2022 --timezone=Asia/Taipei --lang=zh-TW
96
98
  # 冬至: 2022-12-22 05:48
97
99
  ```
98
100
  ### In code
99
-
101
+ You can use `SolarTerms24::SolarTerms` to grab solar terms information of a year.
100
102
  ```ruby
101
103
  year = 2022
102
104
  solar_terms = SolarTerms24::SolarTerms.new(year)
@@ -109,7 +111,9 @@ solar_term.date.strftime('%Y-%m-%d')
109
111
  solar_term.datetime.strftime('%Y-%m-%d %H:%M:%S')
110
112
  # => 2022-12-21 21:48:14
111
113
  # => solar_term.datetime is a DateTime object
112
-
114
+ ```
115
+ To specify different timezones and languages, for example, `Asia/Taipei` and `zh-TW`
116
+ ```ruby
113
117
  solar_terms = SolarTerms24::SolarTerms.new(year, timezone: 'Asia/Taipei', lang: 'zh-TW')
114
118
  solar_term = solar_terms.winter_solstice
115
119
  solar_term.name
@@ -134,7 +138,7 @@ These are the supported languages:
134
138
 
135
139
  ### Timezone
136
140
 
137
- It uses the gem [tzinfo], so all timezones in [IANA Time Zone Database](http://www.iana.org/time-zones) are supported. For example,
141
+ It uses the gem [tzinfo](https://github.com/tzinfo/tzinfo), so all timezones in [IANA Time Zone Database](http://www.iana.org/time-zones) are supported. For example,
138
142
  * UTC (default)
139
143
  * Asia/Ho_Chi_Minh
140
144
  * Asia/Seoul
@@ -9,7 +9,7 @@ module SolarTerms24
9
9
  option :lang, type: :string, default: 'en', desc: 'Language: en, zh-TW, or ja'
10
10
  option :timezone, type: :string, default: 'UTC', desc: 'Timezone: UTC, Asia/Taipei, Asia/Tokyo, etc.'
11
11
  def list(year)
12
- solar_terms = SolarTerms.new(year, timezone: options[:timezone], lang: options[:lang])
12
+ solar_terms = SolarTerms.new(year.to_i, timezone: options[:timezone], lang: options[:lang])
13
13
  solar_terms.solar_terms.each_value do |solar_term|
14
14
  puts "#{solar_term.name}: #{solar_term.datetime.strftime("%Y-%m-%d %H:%M")}"
15
15
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolarTerms24
4
- VERSION = '1.0.0'
4
+ VERSION = '1.0.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solar_terms_24
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kevinluo201
@@ -375,8 +375,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
375
375
  - !ruby/object:Gem::Version
376
376
  version: '0'
377
377
  requirements: []
378
- rubygems_version: 3.3.7
378
+ rubygems_version: 3.4.1
379
379
  signing_key:
380
380
  specification_version: 4
381
- summary: "`solar_terms_24` calculates and collects 24 solar terms each year."
381
+ summary: "`solar_terms_24` calculates and collects 24 solar terms each year by using
382
+ NASA JPL Horizons System API."
382
383
  test_files: []