green-button-data 0.7.5 → 1.0.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 +5 -5
- data/.circleci/config.yml +93 -0
- data/Gemfile.lock +28 -28
- data/README.md +17 -2
- data/green-button-data.gemspec +2 -2
- data/lib/green-button-data/core_extensions/fixnum.rb +6 -2
- data/lib/green-button-data/parser/cost_additional_detail_last_period.rb +15 -6
- data/lib/green-button-data/parser/main_address.rb +1 -1
- data/lib/green-button-data/utilities.rb +2 -2
- data/lib/green-button-data/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 20b38303872ce2f93255dcc55e52e683c7ec264904e17fc578794ff241738017
|
|
4
|
+
data.tar.gz: 64ac1db54bcf51f90958468fe0ae22e8d470b2943bf31253e7f725720e7af444
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b77bdf9f4c7fc5bc5ea259427d714ad98bf430aa8f0653980df9cbb3c9ba76dca1328b29d44d6c10c32227103928098c9b6a76810b9605c1a9e171ba57ac6440
|
|
7
|
+
data.tar.gz: 7401878c7c2a2fbbd04adaef7ebef22bd0d0ee15049703b1d84d94a5b0b6398b3602779943da2403133c76d78704a41a90993d5ec990a15116e3e29edf8ca0ea
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
|
|
3
|
+
test-steps: &test-steps
|
|
4
|
+
working_directory: ~/green-button-data
|
|
5
|
+
steps:
|
|
6
|
+
- checkout
|
|
7
|
+
- restore_cache:
|
|
8
|
+
keys:
|
|
9
|
+
- v1-gem-cache-{{ arch }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
|
|
10
|
+
- v1-gem-cache-{{ arch }}-{{ .Branch }}
|
|
11
|
+
- v1-gem-cache-{{ arch }}
|
|
12
|
+
- run:
|
|
13
|
+
name: Install dependencies
|
|
14
|
+
command: bundle install && bundle clean
|
|
15
|
+
- save_cache:
|
|
16
|
+
paths:
|
|
17
|
+
- ~/.bundle
|
|
18
|
+
key: v1-gem-cache-{{ arch }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
|
|
19
|
+
- run:
|
|
20
|
+
name: Run tests
|
|
21
|
+
command: rspec
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
test-ruby-2.4:
|
|
25
|
+
docker:
|
|
26
|
+
- image: circleci/ruby:2.4
|
|
27
|
+
<<: *test-steps
|
|
28
|
+
|
|
29
|
+
test-ruby-2.5:
|
|
30
|
+
docker:
|
|
31
|
+
- image: circleci/ruby:2.5
|
|
32
|
+
<<: *test-steps
|
|
33
|
+
|
|
34
|
+
test-ruby-2.6:
|
|
35
|
+
docker:
|
|
36
|
+
- image: circleci/ruby:2.6
|
|
37
|
+
<<: *test-steps
|
|
38
|
+
|
|
39
|
+
build:
|
|
40
|
+
docker:
|
|
41
|
+
- image: circleci/ruby:2.4
|
|
42
|
+
working_directory: ~/green-button-data
|
|
43
|
+
steps:
|
|
44
|
+
- checkout
|
|
45
|
+
- run:
|
|
46
|
+
name: Build gem
|
|
47
|
+
command: gem build green-button-data.gemspec
|
|
48
|
+
- persist_to_workspace:
|
|
49
|
+
root: .
|
|
50
|
+
paths:
|
|
51
|
+
- green-button-data-*.gem
|
|
52
|
+
|
|
53
|
+
publish:
|
|
54
|
+
docker:
|
|
55
|
+
- image: circleci/ruby:2.4
|
|
56
|
+
working_directory: ~/green-button-data
|
|
57
|
+
steps:
|
|
58
|
+
- attach_workspace:
|
|
59
|
+
at: .
|
|
60
|
+
- run:
|
|
61
|
+
name: Login to RubyGems.org
|
|
62
|
+
command: |
|
|
63
|
+
mkdir ~/.gem; \
|
|
64
|
+
curl -u ${RUBYGEMS_USER}:${RUBYGEMS_PASS} https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; \
|
|
65
|
+
chmod 0600 ~/.gem/credentials
|
|
66
|
+
- run:
|
|
67
|
+
name: Publish to RubyGems.org
|
|
68
|
+
command: gem push green-button-data-${CIRCLE_TAG:1}.gem
|
|
69
|
+
|
|
70
|
+
workflows:
|
|
71
|
+
version: 2
|
|
72
|
+
tests:
|
|
73
|
+
jobs:
|
|
74
|
+
- test-ruby-2.4
|
|
75
|
+
- test-ruby-2.5
|
|
76
|
+
- test-ruby-2.6
|
|
77
|
+
release:
|
|
78
|
+
jobs:
|
|
79
|
+
- build:
|
|
80
|
+
filters:
|
|
81
|
+
branches:
|
|
82
|
+
ignore: /.*/
|
|
83
|
+
tags:
|
|
84
|
+
only: /v\d+(\.\d+){0,2}/
|
|
85
|
+
- publish:
|
|
86
|
+
context: ruby gem
|
|
87
|
+
requires:
|
|
88
|
+
- build
|
|
89
|
+
filters:
|
|
90
|
+
branches:
|
|
91
|
+
ignore: /.*/
|
|
92
|
+
tags:
|
|
93
|
+
only: /v\d+(\.\d+){0,2}/
|
data/Gemfile.lock
CHANGED
|
@@ -9,9 +9,9 @@ PATH
|
|
|
9
9
|
GEM
|
|
10
10
|
remote: https://rubygems.org/
|
|
11
11
|
specs:
|
|
12
|
-
addressable (2.
|
|
12
|
+
addressable (2.6.0)
|
|
13
13
|
public_suffix (>= 2.0.2, < 4.0)
|
|
14
|
-
codecov (0.1.
|
|
14
|
+
codecov (0.1.14)
|
|
15
15
|
json
|
|
16
16
|
simplecov
|
|
17
17
|
url
|
|
@@ -19,12 +19,12 @@ GEM
|
|
|
19
19
|
crack (0.4.3)
|
|
20
20
|
safe_yaml (~> 1.0.0)
|
|
21
21
|
diff-lcs (1.3)
|
|
22
|
-
docile (1.3.
|
|
23
|
-
faraday (0.15.
|
|
22
|
+
docile (1.3.1)
|
|
23
|
+
faraday (0.15.4)
|
|
24
24
|
multipart-post (>= 1.2, < 3)
|
|
25
|
-
ffi (1.
|
|
25
|
+
ffi (1.10.0)
|
|
26
26
|
formatador (0.2.5)
|
|
27
|
-
guard (2.
|
|
27
|
+
guard (2.15.0)
|
|
28
28
|
formatador (>= 0.2.4)
|
|
29
29
|
listen (>= 2.7, < 4.0)
|
|
30
30
|
lumberjack (>= 1.0.12, < 2.0)
|
|
@@ -38,42 +38,42 @@ GEM
|
|
|
38
38
|
guard (~> 2.1)
|
|
39
39
|
guard-compat (~> 1.1)
|
|
40
40
|
rspec (>= 2.99.0, < 4.0)
|
|
41
|
-
hashdiff (0.3.
|
|
41
|
+
hashdiff (0.3.8)
|
|
42
42
|
json (2.1.0)
|
|
43
43
|
listen (3.1.5)
|
|
44
44
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
|
45
45
|
rb-inotify (~> 0.9, >= 0.9.7)
|
|
46
46
|
ruby_dep (~> 1.2)
|
|
47
47
|
lumberjack (1.0.13)
|
|
48
|
-
method_source (0.9.
|
|
49
|
-
mini_portile2 (2.
|
|
48
|
+
method_source (0.9.2)
|
|
49
|
+
mini_portile2 (2.4.0)
|
|
50
50
|
multipart-post (2.0.0)
|
|
51
51
|
nenv (0.3.0)
|
|
52
|
-
nokogiri (1.
|
|
53
|
-
mini_portile2 (~> 2.
|
|
52
|
+
nokogiri (1.10.1)
|
|
53
|
+
mini_portile2 (~> 2.4.0)
|
|
54
54
|
notiffany (0.1.1)
|
|
55
55
|
nenv (~> 0.1)
|
|
56
56
|
shellany (~> 0.0)
|
|
57
|
-
pry (0.
|
|
57
|
+
pry (0.12.2)
|
|
58
58
|
coderay (~> 1.1.0)
|
|
59
59
|
method_source (~> 0.9.0)
|
|
60
|
-
public_suffix (3.0.
|
|
60
|
+
public_suffix (3.0.3)
|
|
61
61
|
rb-fsevent (0.10.3)
|
|
62
|
-
rb-inotify (0.
|
|
63
|
-
ffi (
|
|
64
|
-
rspec (3.
|
|
65
|
-
rspec-core (~> 3.
|
|
66
|
-
rspec-expectations (~> 3.
|
|
67
|
-
rspec-mocks (~> 3.
|
|
68
|
-
rspec-core (3.
|
|
69
|
-
rspec-support (~> 3.
|
|
70
|
-
rspec-expectations (3.
|
|
62
|
+
rb-inotify (0.10.0)
|
|
63
|
+
ffi (~> 1.0)
|
|
64
|
+
rspec (3.8.0)
|
|
65
|
+
rspec-core (~> 3.8.0)
|
|
66
|
+
rspec-expectations (~> 3.8.0)
|
|
67
|
+
rspec-mocks (~> 3.8.0)
|
|
68
|
+
rspec-core (3.8.0)
|
|
69
|
+
rspec-support (~> 3.8.0)
|
|
70
|
+
rspec-expectations (3.8.2)
|
|
71
71
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
72
|
-
rspec-support (~> 3.
|
|
73
|
-
rspec-mocks (3.
|
|
72
|
+
rspec-support (~> 3.8.0)
|
|
73
|
+
rspec-mocks (3.8.0)
|
|
74
74
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
75
|
-
rspec-support (~> 3.
|
|
76
|
-
rspec-support (3.
|
|
75
|
+
rspec-support (~> 3.8.0)
|
|
76
|
+
rspec-support (3.8.0)
|
|
77
77
|
ruby_dep (1.5.0)
|
|
78
78
|
safe_yaml (1.0.4)
|
|
79
79
|
sax-machine (1.3.2)
|
|
@@ -83,7 +83,7 @@ GEM
|
|
|
83
83
|
json (>= 1.8, < 3)
|
|
84
84
|
simplecov-html (~> 0.10.0)
|
|
85
85
|
simplecov-html (0.10.2)
|
|
86
|
-
thor (0.20.
|
|
86
|
+
thor (0.20.3)
|
|
87
87
|
url (0.3.2)
|
|
88
88
|
webmock (1.24.6)
|
|
89
89
|
addressable (>= 2.3.6)
|
|
@@ -102,4 +102,4 @@ DEPENDENCIES
|
|
|
102
102
|
webmock (~> 1.21)
|
|
103
103
|
|
|
104
104
|
BUNDLED WITH
|
|
105
|
-
1.16.
|
|
105
|
+
1.16.2
|
data/README.md
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://rubygems.org/gems/green-button-data)
|
|
4
4
|
[](https://circleci.com/gh/VerdigrisTech/green-button-data)
|
|
5
|
-
[](https://gemnasium.com/VerdigrisTech/green-button-data)
|
|
6
5
|
[](https://codeclimate.com/github/VerdigrisTech/green-button-data)
|
|
7
6
|
[](https://codecov.io/github/VerdigrisTech/green-button-data)
|
|
8
7
|
|
|
@@ -334,4 +333,20 @@ Verdigris Technologies Inc. assumes NO RESPONSIBILITY OR LIABILITY
|
|
|
334
333
|
UNDER ANY CIRCUMSTANCES for usage of this software. See the [LICENSE.txt](https://raw.githubusercontent.com/VerdigrisTech/green-button-data/master/LICENSE.txt)
|
|
335
334
|
file for detailed legal information.
|
|
336
335
|
|
|
337
|
-
|
|
336
|
+
## 📣 We’re Hiring!
|
|
337
|
+
|
|
338
|
+
Do you have passion for solving challenging engineering problems? You may just be the right fit at Verdigris! We are hiring software engineers for our [Mountain View, California, USA](verdigris-location) office.
|
|
339
|
+
|
|
340
|
+
### Open Positions
|
|
341
|
+
|
|
342
|
+
* [Product Manager](https://jobs.lever.co/verdigris/bd472be8-df8e-48e9-952a-ad803c44c02f?source=GitHub) — [Apply](https://jobs.lever.co/verdigris/bd472be8-df8e-48e9-952a-ad803c44c02f/apply?source=GitHub)
|
|
343
|
+
* [Technical Lead - Software Engineer](https://jobs.lever.co/verdigris/c65cd690-a7bd-4ab6-ab16-16a34888181b?source=GitHub) — [Apply](https://jobs.lever.co/verdigris/c65cd690-a7bd-4ab6-ab16-16a34888181b/apply?source=GitHub)
|
|
344
|
+
|
|
345
|
+
For more information, check out our [Careers](verdigris-careers) page.
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
<sub>Copyright © 2015-2019, [Verdigris Technologies Inc](https://verdigris.co). All rights reserved.</sub>
|
|
350
|
+
|
|
351
|
+
[verdigris-location]: https://www.google.com/maps/place/Verdigris+Technologies/@37.4105674,-122.0605774,17z
|
|
352
|
+
[verdigris-careers]: https://verdigris.co/careers
|
data/green-button-data.gemspec
CHANGED
|
@@ -4,7 +4,7 @@ Gem::Specification.new do |s|
|
|
|
4
4
|
s.name = 'green-button-data'
|
|
5
5
|
s.version = GreenButtonData::VERSION
|
|
6
6
|
|
|
7
|
-
s.authors = ['Andrew Jo', 'Orlando Lee']
|
|
7
|
+
s.authors = ['Andrew Jo', 'Orlando Lee', 'Edward Breen']
|
|
8
8
|
s.email = 'engineering@verdigris.co'
|
|
9
9
|
s.homepage = 'http://verdigris.co'
|
|
10
10
|
s.licenses = ['BSD-2-Clause']
|
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|
|
22
22
|
s.require_paths = ['lib']
|
|
23
23
|
|
|
24
24
|
s.platform = Gem::Platform::RUBY
|
|
25
|
-
s.required_ruby_version = '>= 2.
|
|
25
|
+
s.required_ruby_version = '>= 2.4.0'
|
|
26
26
|
|
|
27
27
|
s.add_dependency 'nokogiri', '~> 1.8'
|
|
28
28
|
s.add_dependency 'sax-machine', '~> 1.3'
|
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
module GreenButtonData
|
|
2
2
|
module Parser
|
|
3
3
|
class CostAdditionalDetailLastPeriod < SummaryMeasurement
|
|
4
|
-
element :note
|
|
5
|
-
element :itemKind, class: Integer, as: :item_kind
|
|
6
4
|
element :amount, class: Integer, as: :amount
|
|
5
|
+
element :itemKind, class: Integer, as: :item_kind
|
|
6
|
+
element :itemPeriod, class: Interval, as: :item_period
|
|
7
|
+
element :note
|
|
8
|
+
element :unitCost, class: Integer, as: :unit_cost
|
|
7
9
|
|
|
8
10
|
# ESPI Namespacing
|
|
9
|
-
element :'espi:
|
|
11
|
+
element :'espi:amount', class: Integer, as: :amount
|
|
10
12
|
element :'espi:itemKind', class: Integer, as: :item_kind
|
|
13
|
+
element :'espi:itemPeriod', class: Interval, as: :item_period
|
|
14
|
+
element :'espi:note', as: :note
|
|
15
|
+
element :'espi:unitCost', class: Integer, as: :unit_cost
|
|
11
16
|
|
|
12
17
|
# Special case for PG&E generic namespacing
|
|
13
|
-
element :'ns0:
|
|
18
|
+
element :'ns0:amount', class: Integer, as: :amount
|
|
14
19
|
element :'ns0:itemKind', class: Integer, as: :item_kind
|
|
20
|
+
element :'ns0:itemPeriod', class: Interval, as: :item_period
|
|
21
|
+
element :'ns0:note', as: :note
|
|
22
|
+
element :'ns0:unitCost', class: Integer, as: :unit_cost
|
|
15
23
|
|
|
16
|
-
|
|
17
|
-
|
|
24
|
+
def cost
|
|
25
|
+
@amount / 100_000.0 if @amount.class == Fixnum
|
|
26
|
+
end
|
|
18
27
|
end
|
|
19
28
|
end
|
|
20
29
|
end
|
|
@@ -25,9 +25,9 @@ module GreenButtonData
|
|
|
25
25
|
#
|
|
26
26
|
# * +epoch+ - Amount of seconds/milliseconds/microseconds since 1970-01-01
|
|
27
27
|
def normalize_epoch(epoch)
|
|
28
|
-
if epoch.
|
|
28
|
+
if epoch.num_digits >= 15
|
|
29
29
|
epoch / 100000
|
|
30
|
-
elsif epoch.
|
|
30
|
+
elsif epoch.num_digits >= 13
|
|
31
31
|
epoch / 1000
|
|
32
32
|
else
|
|
33
33
|
epoch
|
metadata
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: green-button-data
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Jo
|
|
8
8
|
- Orlando Lee
|
|
9
|
+
- Edward Breen
|
|
9
10
|
autorequire:
|
|
10
11
|
bindir: bin
|
|
11
12
|
cert_chain: []
|
|
12
|
-
date:
|
|
13
|
+
date: 2019-02-01 00:00:00.000000000 Z
|
|
13
14
|
dependencies:
|
|
14
15
|
- !ruby/object:Gem::Dependency
|
|
15
16
|
name: nokogiri
|
|
@@ -103,6 +104,7 @@ executables: []
|
|
|
103
104
|
extensions: []
|
|
104
105
|
extra_rdoc_files: []
|
|
105
106
|
files:
|
|
107
|
+
- ".circleci/config.yml"
|
|
106
108
|
- ".codeclimate.yml"
|
|
107
109
|
- ".github/pull_request_template.md"
|
|
108
110
|
- ".gitignore"
|
|
@@ -194,15 +196,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
194
196
|
requirements:
|
|
195
197
|
- - ">="
|
|
196
198
|
- !ruby/object:Gem::Version
|
|
197
|
-
version: 2.
|
|
199
|
+
version: 2.4.0
|
|
198
200
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
201
|
requirements:
|
|
200
202
|
- - ">="
|
|
201
203
|
- !ruby/object:Gem::Version
|
|
202
204
|
version: '0'
|
|
203
205
|
requirements: []
|
|
204
|
-
|
|
205
|
-
rubygems_version: 2.6.14
|
|
206
|
+
rubygems_version: 3.0.1
|
|
206
207
|
signing_key:
|
|
207
208
|
specification_version: 4
|
|
208
209
|
summary: Client and parser for Green Button API
|