cpiu 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/.rspec +2 -0
- data/.rubocop.yml +2 -0
- data/.travis.yml +8 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +674 -0
- data/README.md +113 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/fixtures/vcr_cassettes/single_year.yml +47 -0
- data/fixtures/vcr_cassettes/year_range.yml +47 -0
- data/lib/cpiu.rb +24 -0
- data/lib/cpiu/api.rb +57 -0
- data/lib/cpiu/data.rb +40 -0
- data/lib/cpiu/version.rb +22 -0
- data/ruby_cpiu.gemspec +51 -0
- metadata +187 -0
data/README.md
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
# CPIU
|
2
|
+
|
3
|
+
[](https://travis-ci.org/clpo13/cpiu-ruby)
|
4
|
+
[](https://coveralls.io/github/clpo13/cpiu-ruby?branch=master)
|
5
|
+
|
6
|
+
CPIU is a Ruby interface for [CPI-U](https://www.bls.gov/cpi/) data provided by the U.S. Bureau of Labor Statistics. CPI-U data are commonly used for calculating inflation. More info on the BLS Public Data API is available [here](https://www.bls.gov/developers/home.htm).
|
7
|
+
|
8
|
+
Neither I nor BLS.gov can vouch for the data or analyses derived from these data after the data have been retrieved from BLS.gov.
|
9
|
+
|
10
|
+
## Installation
|
11
|
+
|
12
|
+
Add this line to your application's Gemfile:
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
gem 'cpiu', '~> 0.1'
|
16
|
+
```
|
17
|
+
|
18
|
+
And then execute:
|
19
|
+
|
20
|
+
```bash
|
21
|
+
bundle
|
22
|
+
```
|
23
|
+
|
24
|
+
Or install it yourself as:
|
25
|
+
|
26
|
+
```bash
|
27
|
+
gem install cpiu
|
28
|
+
```
|
29
|
+
|
30
|
+
## Usage
|
31
|
+
|
32
|
+
Add the following to your program:
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
require 'cpiu'
|
36
|
+
```
|
37
|
+
|
38
|
+
The following methods will retrieve JSON objects containing CPI-U data:
|
39
|
+
|
40
|
+
* `CPIU::Data.single_year(year)` - data for a single year
|
41
|
+
* `CPIU::Data.year_range(startyear, endyear)` - data for a year range no greater than 20 years
|
42
|
+
|
43
|
+
The data is returned in an array of hashes:
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
[
|
47
|
+
{
|
48
|
+
"year" => "1913",
|
49
|
+
"period" => "M12",
|
50
|
+
"periodName" => "December",
|
51
|
+
"value" => "10.0",
|
52
|
+
"footnotes" => [{}]
|
53
|
+
},
|
54
|
+
...
|
55
|
+
]
|
56
|
+
```
|
57
|
+
|
58
|
+
A raw API call method is available too:
|
59
|
+
|
60
|
+
* `CPIU::API.request_data(startyear, endyear, ann_avg, calcs)`
|
61
|
+
|
62
|
+
If set to `true`, `ann_avg` will return the average CPI value for each year, and `calcs` will return net and percent changes in CPI. This method returns all response data in the form of a hash:
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
{
|
66
|
+
"status" => "REQUEST_SUCCEEDED",
|
67
|
+
"responseTime" => 34,
|
68
|
+
"message" => [],
|
69
|
+
"Results" => {
|
70
|
+
"series" => [
|
71
|
+
{
|
72
|
+
"seriesID" => "CUUR0000SA0",
|
73
|
+
"data" => [
|
74
|
+
{
|
75
|
+
"year" => "1913",
|
76
|
+
"period" => "M13",
|
77
|
+
"periodName" => "Annual",
|
78
|
+
"value" => "9.9",
|
79
|
+
"footnotes" => [{}],
|
80
|
+
"calculations" => {
|
81
|
+
"net_changes" => {},
|
82
|
+
"pct_changes" => {
|
83
|
+
"1" => "-1.0",
|
84
|
+
"3" => "-1.0",
|
85
|
+
"6" => "0.0"
|
86
|
+
}
|
87
|
+
}
|
88
|
+
},
|
89
|
+
...
|
90
|
+
]
|
91
|
+
}
|
92
|
+
]
|
93
|
+
}
|
94
|
+
}
|
95
|
+
```
|
96
|
+
|
97
|
+
## Development
|
98
|
+
|
99
|
+
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.
|
100
|
+
|
101
|
+
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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
102
|
+
|
103
|
+
### TODO
|
104
|
+
|
105
|
+
* [ ] Handle API errors
|
106
|
+
|
107
|
+
## Contributing
|
108
|
+
|
109
|
+
Bug reports and pull requests are welcome on GitHub at <https://github.com/clpo13/ruby_cpiu>.
|
110
|
+
|
111
|
+
## License
|
112
|
+
|
113
|
+
This code is licensed under [GPLv3](LICENSE.txt).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'cpiu'
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require 'irb'
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.bls.gov/publicAPI/v2/timeseries/data/
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"seriesid":["CUUR0000SA0"],"startyear":1913,"endyear":1913,"annualaverage":false,"calculations":false,"registrationkey":"<SECURE>"}'
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- rest-client/2.0.2 (mingw32 x86_64) ruby/2.4.1p111
|
16
|
+
Content-Type:
|
17
|
+
- application/json
|
18
|
+
Content-Length:
|
19
|
+
- '156'
|
20
|
+
Host:
|
21
|
+
- api.bls.gov
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 200
|
25
|
+
message: OK
|
26
|
+
headers:
|
27
|
+
Date:
|
28
|
+
- Tue, 01 Aug 2017 23:28:15 GMT
|
29
|
+
Strict-Transport-Security:
|
30
|
+
- max-age=31536000; includeSubdomains;
|
31
|
+
Set-Cookie:
|
32
|
+
- JSESSIONID=09DB0ABAB033B05BC1CECBB682675792; Version=1; Path="/publicAPI/";
|
33
|
+
Secure; HttpOnly
|
34
|
+
Content-Type:
|
35
|
+
- application/json
|
36
|
+
Content-Length:
|
37
|
+
- '1137'
|
38
|
+
body:
|
39
|
+
encoding: UTF-8
|
40
|
+
string: |-
|
41
|
+
{"status":"REQUEST_SUCCEEDED","responseTime":38,"message":[],"Results":{
|
42
|
+
"series":
|
43
|
+
[{"seriesID":"CUUR0000SA0","data":[{"year":"1913","period":"M12","periodName":"December","value":"10.0","footnotes":[{}]},{"year":"1913","period":"M11","periodName":"November","value":"10.1","footnotes":[{}]},{"year":"1913","period":"M10","periodName":"October","value":"10.0","footnotes":[{}]},{"year":"1913","period":"M09","periodName":"September","value":"10.0","footnotes":[{}]},{"year":"1913","period":"M08","periodName":"August","value":"9.9","footnotes":[{}]},{"year":"1913","period":"M07","periodName":"July","value":"9.9","footnotes":[{}]},{"year":"1913","period":"M06","periodName":"June","value":"9.8","footnotes":[{}]},{"year":"1913","period":"M05","periodName":"May","value":"9.7","footnotes":[{}]},{"year":"1913","period":"M04","periodName":"April","value":"9.8","footnotes":[{}]},{"year":"1913","period":"M03","periodName":"March","value":"9.8","footnotes":[{}]},{"year":"1913","period":"M02","periodName":"February","value":"9.8","footnotes":[{}]},{"year":"1913","period":"M01","periodName":"January","value":"9.8","footnotes":[{}]}]}]
|
44
|
+
}}
|
45
|
+
http_version:
|
46
|
+
recorded_at: Tue, 01 Aug 2017 23:28:14 GMT
|
47
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,47 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.bls.gov/publicAPI/v2/timeseries/data/
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"seriesid":["CUUR0000SA0"],"startyear":1913,"endyear":1914,"annualaverage":false,"calculations":false,"registrationkey":"<SECURE>"}'
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- rest-client/2.0.2 (mingw32 x86_64) ruby/2.4.1p111
|
16
|
+
Content-Type:
|
17
|
+
- application/json
|
18
|
+
Content-Length:
|
19
|
+
- '156'
|
20
|
+
Host:
|
21
|
+
- api.bls.gov
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 200
|
25
|
+
message: OK
|
26
|
+
headers:
|
27
|
+
Date:
|
28
|
+
- Tue, 01 Aug 2017 23:28:36 GMT
|
29
|
+
Strict-Transport-Security:
|
30
|
+
- max-age=31536000; includeSubdomains;
|
31
|
+
Set-Cookie:
|
32
|
+
- JSESSIONID=F7FDB348E776CCB74BBDC3102716FACA; Version=1; Path="/publicAPI/";
|
33
|
+
Secure; HttpOnly
|
34
|
+
Content-Type:
|
35
|
+
- application/json
|
36
|
+
Content-Length:
|
37
|
+
- '2154'
|
38
|
+
body:
|
39
|
+
encoding: UTF-8
|
40
|
+
string: |-
|
41
|
+
{"status":"REQUEST_SUCCEEDED","responseTime":45,"message":[],"Results":{
|
42
|
+
"series":
|
43
|
+
[{"seriesID":"CUUR0000SA0","data":[{"year":"1914","period":"M12","periodName":"December","value":"10.1","footnotes":[{}]},{"year":"1914","period":"M11","periodName":"November","value":"10.2","footnotes":[{}]},{"year":"1914","period":"M10","periodName":"October","value":"10.1","footnotes":[{}]},{"year":"1914","period":"M09","periodName":"September","value":"10.2","footnotes":[{}]},{"year":"1914","period":"M08","periodName":"August","value":"10.2","footnotes":[{}]},{"year":"1914","period":"M07","periodName":"July","value":"10.0","footnotes":[{}]},{"year":"1914","period":"M06","periodName":"June","value":"9.9","footnotes":[{}]},{"year":"1914","period":"M05","periodName":"May","value":"9.9","footnotes":[{}]},{"year":"1914","period":"M04","periodName":"April","value":"9.8","footnotes":[{}]},{"year":"1914","period":"M03","periodName":"March","value":"9.9","footnotes":[{}]},{"year":"1914","period":"M02","periodName":"February","value":"9.9","footnotes":[{}]},{"year":"1914","period":"M01","periodName":"January","value":"10.0","footnotes":[{}]},{"year":"1913","period":"M12","periodName":"December","value":"10.0","footnotes":[{}]},{"year":"1913","period":"M11","periodName":"November","value":"10.1","footnotes":[{}]},{"year":"1913","period":"M10","periodName":"October","value":"10.0","footnotes":[{}]},{"year":"1913","period":"M09","periodName":"September","value":"10.0","footnotes":[{}]},{"year":"1913","period":"M08","periodName":"August","value":"9.9","footnotes":[{}]},{"year":"1913","period":"M07","periodName":"July","value":"9.9","footnotes":[{}]},{"year":"1913","period":"M06","periodName":"June","value":"9.8","footnotes":[{}]},{"year":"1913","period":"M05","periodName":"May","value":"9.7","footnotes":[{}]},{"year":"1913","period":"M04","periodName":"April","value":"9.8","footnotes":[{}]},{"year":"1913","period":"M03","periodName":"March","value":"9.8","footnotes":[{}]},{"year":"1913","period":"M02","periodName":"February","value":"9.8","footnotes":[{}]},{"year":"1913","period":"M01","periodName":"January","value":"9.8","footnotes":[{}]}]}]
|
44
|
+
}}
|
45
|
+
http_version:
|
46
|
+
recorded_at: Tue, 01 Aug 2017 23:28:36 GMT
|
47
|
+
recorded_with: VCR 3.0.3
|
data/lib/cpiu.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# CPIU - a Ruby interface for fetching CPI-U data from BLS.gov
|
2
|
+
# Copyright (C) 2017 Cody Logan
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
#
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
require 'cpiu/api'
|
18
|
+
require 'cpiu/data'
|
19
|
+
require 'cpiu/version'
|
20
|
+
|
21
|
+
# main cpiu module
|
22
|
+
module CPIU
|
23
|
+
# Your code goes here...
|
24
|
+
end
|
data/lib/cpiu/api.rb
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# CPIU - a Ruby interface for fetching CPI-U data from BLS.gov
|
4
|
+
# Copyright (C) 2017 Cody Logan
|
5
|
+
#
|
6
|
+
# This program is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# This program is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
|
19
|
+
require 'rest-client'
|
20
|
+
require 'json'
|
21
|
+
require 'dotenv/load'
|
22
|
+
|
23
|
+
module CPIU
|
24
|
+
# Interacts with the BLS.gov public API
|
25
|
+
class API
|
26
|
+
# URL to send POST requests to
|
27
|
+
URL = 'https://api.bls.gov/publicAPI/v2/timeseries/data/'.freeze
|
28
|
+
# The time series to query
|
29
|
+
SERIESID = 'CUUR0000SA0'.freeze
|
30
|
+
|
31
|
+
# Requests CPI-U data from the BLS server given two years between 1913 and
|
32
|
+
# the present. The API will only return a maximum range of 20 years from
|
33
|
+
# the start year.
|
34
|
+
#
|
35
|
+
# @param startyear [Integer] the first year to get data for
|
36
|
+
# @param endyear [Integer] the last year to get data for
|
37
|
+
# @param ann_avg [Boolean] set to true to include the average of monthly CPI
|
38
|
+
# values for a year
|
39
|
+
# @param calcs [Boolean] set to true to include net and percent CPI change
|
40
|
+
# calculations
|
41
|
+
# @return [Hash{String => String, Integer, Array}] the response data
|
42
|
+
# retrieved from the server
|
43
|
+
def self.request_data(startyear, endyear, ann_avg = false, calcs = false)
|
44
|
+
response = RestClient.post(URL,
|
45
|
+
{
|
46
|
+
'seriesid' => [SERIESID],
|
47
|
+
'startyear' => startyear,
|
48
|
+
'endyear' => endyear,
|
49
|
+
'annualaverage' => ann_avg,
|
50
|
+
'calculations' => calcs,
|
51
|
+
'registrationkey' => ENV['BLS_API_KEY']
|
52
|
+
}.to_json,
|
53
|
+
content_type: 'application/json')
|
54
|
+
JSON(response)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
data/lib/cpiu/data.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# CPIU - a Ruby interface for fetching CPI-U data from BLS.gov
|
2
|
+
# Copyright (C) 2017 Cody Logan
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
#
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
require 'cpiu/api'
|
18
|
+
|
19
|
+
module CPIU
|
20
|
+
# Return CPI data to the user while stripping the rest
|
21
|
+
# of the response data returned by the server
|
22
|
+
class Data
|
23
|
+
# Get CPI data for a single year
|
24
|
+
# @param year [Integer]
|
25
|
+
# @return [Array<Hash>] an array of hashes containing monthly CPI values
|
26
|
+
def self.single_year(year)
|
27
|
+
response = CPIU::API.request_data(year, year)
|
28
|
+
response['Results']['series'][0]['data']
|
29
|
+
end
|
30
|
+
|
31
|
+
# Get CPI data for a year range (up to 20 years)
|
32
|
+
# @param startyear [Integer] the first year to get data for
|
33
|
+
# @param endyear [Integer] the last year to get data for
|
34
|
+
# @return [Array<Hash>] an array of hashes containing monthly CPI values
|
35
|
+
def self.year_range(startyear, endyear)
|
36
|
+
response = CPIU::API.request_data(startyear, endyear)
|
37
|
+
response['Results']['series'][0]['data']
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/cpiu/version.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# CPIU - a Ruby interface for fetching CPI-U data from BLS.gov
|
4
|
+
# Copyright (C) 2017 Cody Logan
|
5
|
+
#
|
6
|
+
# This program is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# This program is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
|
19
|
+
module CPIU
|
20
|
+
# Current CPIU gem version
|
21
|
+
VERSION = '0.1.0'.freeze
|
22
|
+
end
|
data/ruby_cpiu.gemspec
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
# CPIU - a Ruby interface for fetching CPI-U data from BLS.gov
|
4
|
+
# Copyright (C) 2017 Cody Logan
|
5
|
+
#
|
6
|
+
# This program is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# This program is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
|
19
|
+
lib = File.expand_path('../lib', __FILE__)
|
20
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
21
|
+
require 'cpiu/version'
|
22
|
+
|
23
|
+
Gem::Specification.new do |spec|
|
24
|
+
spec.name = 'cpiu'
|
25
|
+
spec.version = CPIU::VERSION
|
26
|
+
spec.authors = ['Cody Logan']
|
27
|
+
spec.email = ['cody@madrants.net']
|
28
|
+
|
29
|
+
spec.summary = 'A Ruby interface for getting CPI-U data from BLS.gov'
|
30
|
+
spec.homepage = 'https://github.com/clpo13/ruby_cpiu'
|
31
|
+
|
32
|
+
spec.license = 'GPL-3.0'
|
33
|
+
|
34
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
35
|
+
f.match(%r{^(test|spec|features)/})
|
36
|
+
end
|
37
|
+
spec.bindir = 'exe'
|
38
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
39
|
+
spec.require_paths = ['lib']
|
40
|
+
|
41
|
+
spec.add_development_dependency 'bundler', '~> 1.15'
|
42
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
43
|
+
spec.add_development_dependency 'rspec', '~> 3.2'
|
44
|
+
spec.add_development_dependency 'webmock', '~> 3.0'
|
45
|
+
spec.add_development_dependency 'vcr', '~> 3.0'
|
46
|
+
spec.add_development_dependency 'coveralls', '~> 0.8'
|
47
|
+
|
48
|
+
spec.add_dependency 'rest-client', '~> 2.0'
|
49
|
+
spec.add_dependency 'json', '~> 2.1'
|
50
|
+
spec.add_dependency 'dotenv', '~> 2.2'
|
51
|
+
end
|
metadata
ADDED
@@ -0,0 +1,187 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cpiu
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Cody Logan
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-08-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.15'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.15'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.2'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: webmock
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: vcr
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: coveralls
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.8'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.8'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rest-client
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '2.0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '2.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: json
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '2.1'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '2.1'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: dotenv
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '2.2'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '2.2'
|
139
|
+
description:
|
140
|
+
email:
|
141
|
+
- cody@madrants.net
|
142
|
+
executables: []
|
143
|
+
extensions: []
|
144
|
+
extra_rdoc_files: []
|
145
|
+
files:
|
146
|
+
- ".gitignore"
|
147
|
+
- ".rspec"
|
148
|
+
- ".rubocop.yml"
|
149
|
+
- ".travis.yml"
|
150
|
+
- Gemfile
|
151
|
+
- LICENSE.txt
|
152
|
+
- README.md
|
153
|
+
- Rakefile
|
154
|
+
- bin/console
|
155
|
+
- bin/setup
|
156
|
+
- fixtures/vcr_cassettes/single_year.yml
|
157
|
+
- fixtures/vcr_cassettes/year_range.yml
|
158
|
+
- lib/cpiu.rb
|
159
|
+
- lib/cpiu/api.rb
|
160
|
+
- lib/cpiu/data.rb
|
161
|
+
- lib/cpiu/version.rb
|
162
|
+
- ruby_cpiu.gemspec
|
163
|
+
homepage: https://github.com/clpo13/ruby_cpiu
|
164
|
+
licenses:
|
165
|
+
- GPL-3.0
|
166
|
+
metadata: {}
|
167
|
+
post_install_message:
|
168
|
+
rdoc_options: []
|
169
|
+
require_paths:
|
170
|
+
- lib
|
171
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
172
|
+
requirements:
|
173
|
+
- - ">="
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
version: '0'
|
176
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
requirements: []
|
182
|
+
rubyforge_project:
|
183
|
+
rubygems_version: 2.6.11
|
184
|
+
signing_key:
|
185
|
+
specification_version: 4
|
186
|
+
summary: A Ruby interface for getting CPI-U data from BLS.gov
|
187
|
+
test_files: []
|