cpiu 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/gem-push.yml +43 -0
- data/.github/workflows/ruby.yml +54 -0
- data/CHANGELOG.md +19 -0
- data/README.md +15 -3
- data/cpiu.gemspec +5 -4
- data/lib/cpiu/version.rb +1 -1
- metadata +27 -12
- data/.travis.yml +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 10ed76839dd29d78e9f22e7def78b29e3c408c197898f8df034e67494623ad0a
|
4
|
+
data.tar.gz: 656bb9d2034ee200482ca11fdf8f3614fc02ae4a618adf052000281672ce4210
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29c67cb7606492757507a15aa7eb6972bbf9882cc20f68c991b22fd16492130d6ae1a683e311894f4e041bac9cfdb8e791c9c492307e57c667c26fb85924c88c
|
7
|
+
data.tar.gz: 7db34775289b579cf0dbda79daa59dd8a9691f3c5f69bba24e741e05d9b84311d5286f5c061c457165d9b9c04bf1ca661a35df3e5aebc97be1c599f32d216010
|
@@ -0,0 +1,43 @@
|
|
1
|
+
name: Ruby Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags: [ "v*" ]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
build:
|
9
|
+
name: Build + Publish
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
permissions:
|
12
|
+
contents: read
|
13
|
+
packages: write
|
14
|
+
|
15
|
+
steps:
|
16
|
+
- uses: actions/checkout@v3
|
17
|
+
- name: Set up Ruby 3.0
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: 3.0
|
21
|
+
|
22
|
+
- name: Publish to GPR
|
23
|
+
run: |
|
24
|
+
mkdir -p $HOME/.gem
|
25
|
+
touch $HOME/.gem/credentials
|
26
|
+
chmod 0600 $HOME/.gem/credentials
|
27
|
+
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
28
|
+
gem build *.gemspec
|
29
|
+
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
|
30
|
+
env:
|
31
|
+
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
|
32
|
+
OWNER: ${{ github.repository_owner }}
|
33
|
+
|
34
|
+
- name: Publish to RubyGems
|
35
|
+
run: |
|
36
|
+
mkdir -p $HOME/.gem
|
37
|
+
touch $HOME/.gem/credentials
|
38
|
+
chmod 0600 $HOME/.gem/credentials
|
39
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
40
|
+
gem build *.gemspec
|
41
|
+
gem push *.gem
|
42
|
+
env:
|
43
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ "master" ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ "master" ]
|
15
|
+
|
16
|
+
permissions:
|
17
|
+
contents: read
|
18
|
+
|
19
|
+
jobs:
|
20
|
+
test:
|
21
|
+
|
22
|
+
runs-on: ubuntu-latest
|
23
|
+
strategy:
|
24
|
+
matrix:
|
25
|
+
ruby-version: ['3.0', '3.1', '3.2']
|
26
|
+
|
27
|
+
steps:
|
28
|
+
- uses: actions/checkout@v3
|
29
|
+
- name: Set up Ruby
|
30
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
31
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
32
|
+
# uses: ruby/setup-ruby@v1
|
33
|
+
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
|
34
|
+
with:
|
35
|
+
ruby-version: ${{ matrix.ruby-version }}
|
36
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
37
|
+
- name: Run tests
|
38
|
+
run: bundle exec rake
|
39
|
+
- name: Coveralls
|
40
|
+
uses: coverallsapp/github-action@v2
|
41
|
+
with:
|
42
|
+
flag-name: run-${{ join(matrix.*, '-') }}
|
43
|
+
parallel: true
|
44
|
+
|
45
|
+
finish:
|
46
|
+
needs: test
|
47
|
+
if: ${{ always() }}
|
48
|
+
runs-on: ubuntu-latest
|
49
|
+
steps:
|
50
|
+
- name: Coveralls Finished
|
51
|
+
uses: coverallsapp/github-action@v2
|
52
|
+
with:
|
53
|
+
parallel-finished: true
|
54
|
+
carryforward: "run-3.0,run-3.1,run-3.2"
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# CPIU
|
2
|
+
|
3
|
+
## 0.2.1
|
4
|
+
|
5
|
+
* Add information on `.env` file to documentation
|
6
|
+
|
7
|
+
## 0.2.0
|
8
|
+
|
9
|
+
* Added two new methods to CPIU::Data:
|
10
|
+
* cpiu_year(year): get the annual average CPI of a given year
|
11
|
+
* cpiu_month(year, month): get the CPI of a given month and year
|
12
|
+
|
13
|
+
## 0.1.1
|
14
|
+
|
15
|
+
* Fixed gem homepage link in gemspec
|
16
|
+
|
17
|
+
## 0.1.0
|
18
|
+
|
19
|
+
* Initial release
|
data/README.md
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# CPIU
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/clpo13/cpiu-ruby.svg?branch=master)](https://travis-ci.org/clpo13/cpiu-ruby)
|
4
3
|
[![Coverage Status](https://coveralls.io/repos/github/clpo13/cpiu-ruby/badge.svg?branch=master)](https://coveralls.io/github/clpo13/cpiu-ruby?branch=master)
|
5
4
|
[![Gem Version](https://badge.fury.io/rb/cpiu.svg)](https://badge.fury.io/rb/cpiu)
|
6
5
|
|
@@ -13,7 +12,7 @@ Neither I nor BLS.gov can vouch for the data or analyses derived from these data
|
|
13
12
|
Add this line to your application's Gemfile:
|
14
13
|
|
15
14
|
```ruby
|
16
|
-
gem 'cpiu', '~> 0.
|
15
|
+
gem 'cpiu', '~> 0.2'
|
17
16
|
```
|
18
17
|
|
19
18
|
And then execute:
|
@@ -36,6 +35,8 @@ Add the following to your program:
|
|
36
35
|
require 'cpiu'
|
37
36
|
```
|
38
37
|
|
38
|
+
In order to get the most out of the BLS API, you will need a registration key, which can be obtained [here](https://data.bls.gov/registrationEngine/). Create a file named `.env` in the root of your project folder with the contents `BLS_API_KEY=<your key here>`. The API can still be queried without a key, but there are [restrictions](https://www.bls.gov/developers/api_faqs.htm#register1) on what data will be returned.
|
39
|
+
|
39
40
|
The following methods will retrieve JSON objects containing CPI-U data:
|
40
41
|
|
41
42
|
* `CPIU::Data.single_year(year)` - data for a single year
|
@@ -56,6 +57,11 @@ The data is returned in an array of hashes:
|
|
56
57
|
]
|
57
58
|
```
|
58
59
|
|
60
|
+
If you just want CPI-U values:
|
61
|
+
|
62
|
+
* `CPIU::Data.cpiu_year(year)` - the annual average CPI value for a year
|
63
|
+
* `CPIU::Data.cpiu_month(year, month)` - the CPI value for a particular month
|
64
|
+
|
59
65
|
A raw API call method is available too:
|
60
66
|
|
61
67
|
* `CPIU::API.request_data(startyear, endyear, ann_avg, calcs)`
|
@@ -111,4 +117,10 @@ Bug reports and pull requests are welcome on GitHub at <https://github.com/clpo1
|
|
111
117
|
|
112
118
|
## License
|
113
119
|
|
114
|
-
|
120
|
+
Copyright © 2017 Cody Logan
|
121
|
+
|
122
|
+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
123
|
+
|
124
|
+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
125
|
+
|
126
|
+
A copy of the GNU General Public License can be found in [LICENSE.txt](LICENSE.txt) and at <http://www.gnu.org/licenses/>.
|
data/cpiu.gemspec
CHANGED
@@ -38,12 +38,13 @@ Gem::Specification.new do |spec|
|
|
38
38
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
39
39
|
spec.require_paths = ['lib']
|
40
40
|
|
41
|
-
spec.add_development_dependency 'bundler', '~>
|
42
|
-
spec.add_development_dependency 'rake', '~>
|
41
|
+
spec.add_development_dependency 'bundler', '~> 2.2'
|
42
|
+
spec.add_development_dependency 'rake', '~> 12.3'
|
43
43
|
spec.add_development_dependency 'rspec', '~> 3.2'
|
44
44
|
spec.add_development_dependency 'webmock', '~> 3.0'
|
45
|
-
spec.add_development_dependency 'vcr', '~>
|
46
|
-
spec.add_development_dependency '
|
45
|
+
spec.add_development_dependency 'vcr', '~> 6.2'
|
46
|
+
spec.add_development_dependency 'simplecov', '~> 0.22'
|
47
|
+
spec.add_development_dependency 'simplecov-lcov', '~> 0.8'
|
47
48
|
|
48
49
|
spec.add_dependency 'rest-client', '~> 2.0'
|
49
50
|
spec.add_dependency 'json', '~> 2.1'
|
data/lib/cpiu/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cpiu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cody Logan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.2'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '12.3'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '12.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,16 +72,30 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '6.2'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '6.2'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: simplecov
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.22'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.22'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
98
|
+
name: simplecov-lcov
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
101
|
- - "~>"
|
@@ -143,10 +157,12 @@ executables: []
|
|
143
157
|
extensions: []
|
144
158
|
extra_rdoc_files: []
|
145
159
|
files:
|
160
|
+
- ".github/workflows/gem-push.yml"
|
161
|
+
- ".github/workflows/ruby.yml"
|
146
162
|
- ".gitignore"
|
147
163
|
- ".rspec"
|
148
164
|
- ".rubocop.yml"
|
149
|
-
-
|
165
|
+
- CHANGELOG.md
|
150
166
|
- Gemfile
|
151
167
|
- LICENSE.txt
|
152
168
|
- README.md
|
@@ -179,8 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
179
195
|
- !ruby/object:Gem::Version
|
180
196
|
version: '0'
|
181
197
|
requirements: []
|
182
|
-
|
183
|
-
rubygems_version: 2.6.11
|
198
|
+
rubygems_version: 3.4.10
|
184
199
|
signing_key:
|
185
200
|
specification_version: 4
|
186
201
|
summary: A Ruby interface for getting CPI-U data from BLS.gov
|
data/.travis.yml
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
language: ruby
|
3
|
-
rvm:
|
4
|
-
- 2.4
|
5
|
-
- 2.3
|
6
|
-
- 2.2
|
7
|
-
before_install: gem install bundler -v 1.15.3
|
8
|
-
cache: bundler
|
9
|
-
deploy:
|
10
|
-
provider: rubygems
|
11
|
-
api_key:
|
12
|
-
secure: mwHBcES+QeqKqbz3o9Xoz5J87C1S9BoqhLU6E5+wjskzfuUUPb5nFiZXN7Fe1zssx2jzEF1K0rGD5eYpJaq/qnoRXMSTFWNrOhk+CAy5g6yzizqRO8Gx7T7H2jMtxkEP0I+x/bFFXlHIhh2t7+cBm2WBSDWtAVnHKXlNAq+lDBhuQX9r9XKW50dfjPVaio4dvUAtehea3AhAFH+S/s1Vkz5bJYPYxZA/ddpwt1KfGvYnvhyuWPHPyuMCmQnyeOifaQZhQy5GCqSnlCs5nOlmn+Y7JTDGv4UNsSPt7Fkhlp7leqCto06oh82hHfUtJP8pzW42prU0rCfN4Un1zAnNMf5KNFp4o3SmAkHjAOQ1LrHafiTXNKUpLm6aLlKRr6O6S2ly3EKPDVlCcMU34n7X7vTH2YdK8AsWZUa/LB3gNLTM6HwNrzjJe77t4TU3NgVbVjqb9nuiFrVkBxuDDRVKc6zR2j04jwQswljxoyr5zXAvq4V/YRvpB4RlZAmhS+CtirRFYtIK/n85wtv7uRHQODcF67E2V/YsTQ1X8Tr1Z39waVbMRSIsqazas5XODNYzYW3gtHO45C12V3F8Zj5e6p23lqFSjqXxMy+/fIjvVA3Uyjl4UvHcNmPaMZSdRrr5T0WZk0x+BR8Z0v/aSb+xKCA1g4C7wSUqXJuLYOyifC8=
|
13
|
-
gem: cpiu
|
14
|
-
on:
|
15
|
-
tags: true
|
16
|
-
repo: clpo13/cpiu-ruby
|