green-button-data 0.7.3 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +93 -0
- data/.github/pull_request_template.md +17 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/CONTRIBUTING.md +27 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +54 -50
- data/LICENSE.txt +1 -1
- 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/content.rb +4 -0
- data/lib/green-button-data/parser/cost_additional_detail_last_period.rb +15 -6
- data/lib/green-button-data/parser/customer_agreement.rb +3 -0
- data/lib/green-button-data/parser/entry.rb +8 -0
- data/lib/green-button-data/parser/feed.rb +9 -0
- data/lib/green-button-data/parser/main_address.rb +2 -2
- data/lib/green-button-data/parser/service_location.rb +1 -1
- data/lib/green-button-data/parser/street_detail.rb +1 -1
- data/lib/green-button-data/parser/town_detail.rb +1 -1
- data/lib/green-button-data/utilities.rb +2 -2
- data/lib/green-button-data/version.rb +1 -1
- metadata +9 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dae9932c54c73c781f41c0ec66506aab91a2bba47b2678ccf79da0abe2db880b
|
4
|
+
data.tar.gz: 0057ee004bb027a412500746c11e1657fc2250e222a5580ad0ffa4918ac43f77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f86bf2c8c9681e08b177616b8ae3acd943d4abbd3743e79305f8948c54964c29cecb097ab077587bf4f10b7e6b2393f3c76b3a6f730a86e2dcf76f5686116e6
|
7
|
+
data.tar.gz: c2067cc14d5f95ef00adceb3ce90f5be83677e9e4b6c76dc43ef6240208f5053b2dfce7d5be3066d8c7ef6c55c589d2c2615f08269595185378160cf6c19ea2b
|
@@ -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
|
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}/
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Fixes # .
|
2
|
+
|
3
|
+
## Changes
|
4
|
+
|
5
|
+
-
|
6
|
+
-
|
7
|
+
-
|
8
|
+
|
9
|
+
## Pull request requirements checklist
|
10
|
+
|
11
|
+
Please ensure all of the requirements below are met. PRs that do not meet these
|
12
|
+
requirements will not be approved.
|
13
|
+
|
14
|
+
- [ ] Is there a description of the changes in this pull request?
|
15
|
+
- [ ] Are tests written for the changes?
|
16
|
+
- [ ] Are breaking changes documented?
|
17
|
+
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# Code of Conduct
|
2
|
+
|
3
|
+
## 1. Purpose
|
4
|
+
|
5
|
+
A primary goal of Green Button Data is to be inclusive to the largest number of contributors, with the most varied and diverse backgrounds possible. As such, we are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion (or lack thereof).
|
6
|
+
|
7
|
+
This code of conduct outlines our expectations for all those who participate in our community, as well as the consequences for unacceptable behavior.
|
8
|
+
|
9
|
+
We invite all those who participate in Green Button Data to help us create safe and positive experiences for everyone.
|
10
|
+
|
11
|
+
## 2. Open Source Citizenship
|
12
|
+
|
13
|
+
A supplemental goal of this Code of Conduct is to increase open source citizenship by encouraging participants to recognize and strengthen the relationships between our actions and their effects on our community.
|
14
|
+
|
15
|
+
Communities mirror the societies in which they exist and positive action is essential to counteract the many forms of inequality and abuses of power that exist in society.
|
16
|
+
|
17
|
+
If you see someone who is making an extra effort to ensure our community is welcoming, friendly, and encourages all participants to contribute to the fullest extent, we want to know.
|
18
|
+
|
19
|
+
## 3. Expected Behavior
|
20
|
+
|
21
|
+
The following behaviors are expected and requested of all community members:
|
22
|
+
|
23
|
+
* Participate in an authentic and active way. In doing so, you contribute to the health and longevity of this community.
|
24
|
+
* Exercise consideration and respect in your speech and actions.
|
25
|
+
* Attempt collaboration before conflict.
|
26
|
+
* Refrain from demeaning, discriminatory, or harassing behavior and speech.
|
27
|
+
* Be mindful of your surroundings and of your fellow participants. Alert community leaders if you notice a dangerous situation, someone in distress, or violations of this Code of Conduct, even if they seem inconsequential.
|
28
|
+
* Remember that community event venues may be shared with members of the public; please be respectful to all patrons of these locations.
|
29
|
+
|
30
|
+
## 4. Unacceptable Behavior
|
31
|
+
|
32
|
+
The following behaviors are considered harassment and are unacceptable within our community:
|
33
|
+
|
34
|
+
* Violence, threats of violence or violent language directed against another person.
|
35
|
+
* Sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory jokes and language.
|
36
|
+
* Posting or displaying sexually explicit or violent material.
|
37
|
+
* Posting or threatening to post other people’s personally identifying information ("doxing").
|
38
|
+
* Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability.
|
39
|
+
* Inappropriate photography or recording.
|
40
|
+
* Inappropriate physical contact. You should have someone’s consent before touching them.
|
41
|
+
* Unwelcome sexual attention. This includes, sexualized comments or jokes; inappropriate touching, groping, and unwelcomed sexual advances.
|
42
|
+
* Deliberate intimidation, stalking or following (online or in person).
|
43
|
+
* Advocating for, or encouraging, any of the above behavior.
|
44
|
+
* Sustained disruption of community events, including talks and presentations.
|
45
|
+
|
46
|
+
## 5. Consequences of Unacceptable Behavior
|
47
|
+
|
48
|
+
Unacceptable behavior from any community member, including sponsors and those with decision-making authority, will not be tolerated.
|
49
|
+
|
50
|
+
Anyone asked to stop unacceptable behavior is expected to comply immediately.
|
51
|
+
|
52
|
+
If a community member engages in unacceptable behavior, the community organizers may take any action they deem appropriate, up to and including a temporary ban or permanent expulsion from the community without warning (and without refund in the case of a paid event).
|
53
|
+
|
54
|
+
## 6. Reporting Guidelines
|
55
|
+
|
56
|
+
If you are subject to or witness unacceptable behavior, or have any other concerns, please notify a community organizer as soon as possible. opensource@verdigris.co.
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
Additionally, community organizers are available to help community members engage with local law enforcement or to otherwise help those experiencing unacceptable behavior feel safe. In the context of in-person events, organizers will also provide escorts as desired by the person experiencing distress.
|
61
|
+
|
62
|
+
## 7. Addressing Grievances
|
63
|
+
|
64
|
+
If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify Verdigris Technologies, Inc. with a concise description of your grievance. Your grievance will be handled in accordance with our existing governing policies.
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
## 8. Scope
|
69
|
+
|
70
|
+
We expect all community participants (contributors, paid or otherwise; sponsors; and other guests) to abide by this Code of Conduct in all community venues–online and in-person–as well as in all one-on-one communications pertaining to community business.
|
71
|
+
|
72
|
+
This code of conduct and its related procedures also applies to unacceptable behavior occurring outside the scope of community activities when such behavior has the potential to adversely affect the safety and well-being of community members.
|
73
|
+
|
74
|
+
## 9. Contact info
|
75
|
+
|
76
|
+
opensource@verdigris.co
|
77
|
+
|
78
|
+
## 10. License and attribution
|
79
|
+
|
80
|
+
This Code of Conduct is distributed under a [Creative Commons Attribution-ShareAlike license](http://creativecommons.org/licenses/by-sa/3.0/).
|
81
|
+
|
82
|
+
Portions of text derived from the [Django Code of Conduct](https://www.djangoproject.com/conduct/) and the [Geek Feminism Anti-Harassment Policy](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy).
|
83
|
+
|
84
|
+
Retrieved on November 22, 2016 from [http://citizencodeofconduct.org/](http://citizencodeofconduct.org/)
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
Pull request guidelines
|
2
|
+
-----------------------
|
3
|
+
|
4
|
+
- Changes should have corresponding unit and/or integration tests.
|
5
|
+
- Affected public classes and functions should have accurate documentation.
|
6
|
+
- Source code formatting should be hygienic:
|
7
|
+
- Use 2-space indentation.
|
8
|
+
- Do not use hard tabs.
|
9
|
+
- No trailing or inconsistent whitespace.
|
10
|
+
- No exceptionally long lines.
|
11
|
+
- Variable names should be clear but concise.
|
12
|
+
- Commit history should be relatively hygienic:
|
13
|
+
- Roughly one commit per logical change.
|
14
|
+
- Log messages are clear and understandable.
|
15
|
+
- Few (or no) "merge" commits.
|
16
|
+
- Hint: `git rebase -i` is great for cleaning up a branch.
|
17
|
+
|
18
|
+
|
19
|
+
Pull requests for branches that are still in development should be prefixed with WIP:
|
20
|
+
so that they don't get accidently merged. Remove WIP: once the pull request is
|
21
|
+
considered finalized and ready to be reviewed and merged.
|
22
|
+
|
23
|
+
License
|
24
|
+
-------
|
25
|
+
|
26
|
+
By contributing code to Green Button Data, you are agreeing to release it under the
|
27
|
+
[Simplified BSD License](https://raw.githubusercontent.com/VerdigrisTech/green-button-data/master/LICENSE.txt).
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
green-button-data (0.
|
4
|
+
green-button-data (1.0.0)
|
5
5
|
faraday (~> 0.11)
|
6
6
|
nokogiri (~> 1.8)
|
7
7
|
sax-machine (~> 1.3)
|
@@ -9,82 +9,86 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
addressable (2.
|
13
|
-
|
12
|
+
addressable (2.6.0)
|
13
|
+
public_suffix (>= 2.0.2, < 4.0)
|
14
|
+
codecov (0.1.14)
|
14
15
|
json
|
15
16
|
simplecov
|
16
17
|
url
|
17
|
-
coderay (1.1.
|
18
|
-
crack (0.4.
|
18
|
+
coderay (1.1.2)
|
19
|
+
crack (0.4.3)
|
19
20
|
safe_yaml (~> 1.0.0)
|
20
|
-
diff-lcs (1.
|
21
|
-
docile (1.1
|
22
|
-
faraday (0.
|
21
|
+
diff-lcs (1.3)
|
22
|
+
docile (1.3.1)
|
23
|
+
faraday (0.17.0)
|
23
24
|
multipart-post (>= 1.2, < 3)
|
24
|
-
ffi (1.
|
25
|
+
ffi (1.10.0)
|
25
26
|
formatador (0.2.5)
|
26
|
-
guard (2.
|
27
|
+
guard (2.15.0)
|
27
28
|
formatador (>= 0.2.4)
|
28
|
-
listen (>= 2.7,
|
29
|
-
lumberjack (
|
29
|
+
listen (>= 2.7, < 4.0)
|
30
|
+
lumberjack (>= 1.0.12, < 2.0)
|
30
31
|
nenv (~> 0.1)
|
31
32
|
notiffany (~> 0.0)
|
32
33
|
pry (>= 0.9.12)
|
33
34
|
shellany (~> 0.0)
|
34
35
|
thor (>= 0.18.1)
|
35
36
|
guard-compat (1.2.1)
|
36
|
-
guard-rspec (4.
|
37
|
+
guard-rspec (4.7.3)
|
37
38
|
guard (~> 2.1)
|
38
39
|
guard-compat (~> 1.1)
|
39
40
|
rspec (>= 2.99.0, < 4.0)
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
rb-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
41
|
+
hashdiff (0.3.8)
|
42
|
+
json (2.3.1)
|
43
|
+
listen (3.1.5)
|
44
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
45
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
46
|
+
ruby_dep (~> 1.2)
|
47
|
+
lumberjack (1.0.13)
|
48
|
+
method_source (0.9.2)
|
49
|
+
mini_portile2 (2.4.0)
|
50
|
+
multipart-post (2.1.1)
|
51
|
+
nenv (0.3.0)
|
52
|
+
nokogiri (1.10.8)
|
53
|
+
mini_portile2 (~> 2.4.0)
|
54
|
+
notiffany (0.1.1)
|
52
55
|
nenv (~> 0.1)
|
53
56
|
shellany (~> 0.0)
|
54
|
-
pry (0.
|
57
|
+
pry (0.12.2)
|
55
58
|
coderay (~> 1.1.0)
|
56
|
-
method_source (~> 0.
|
57
|
-
|
58
|
-
rb-fsevent (0.
|
59
|
-
rb-inotify (0.
|
60
|
-
ffi (
|
61
|
-
rspec (3.
|
62
|
-
rspec-core (~> 3.
|
63
|
-
rspec-expectations (~> 3.
|
64
|
-
rspec-mocks (~> 3.
|
65
|
-
rspec-core (3.
|
66
|
-
rspec-support (~> 3.
|
67
|
-
rspec-expectations (3.
|
59
|
+
method_source (~> 0.9.0)
|
60
|
+
public_suffix (3.0.3)
|
61
|
+
rb-fsevent (0.10.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)
|
68
71
|
diff-lcs (>= 1.2.0, < 2.0)
|
69
|
-
rspec-support (~> 3.
|
70
|
-
rspec-mocks (3.
|
72
|
+
rspec-support (~> 3.8.0)
|
73
|
+
rspec-mocks (3.8.0)
|
71
74
|
diff-lcs (>= 1.2.0, < 2.0)
|
72
|
-
rspec-support (~> 3.
|
73
|
-
rspec-support (3.
|
75
|
+
rspec-support (~> 3.8.0)
|
76
|
+
rspec-support (3.8.0)
|
77
|
+
ruby_dep (1.5.0)
|
74
78
|
safe_yaml (1.0.4)
|
75
79
|
sax-machine (1.3.2)
|
76
80
|
shellany (0.0.1)
|
77
|
-
simplecov (0.
|
78
|
-
docile (~> 1.1
|
79
|
-
json (
|
81
|
+
simplecov (0.16.1)
|
82
|
+
docile (~> 1.1)
|
83
|
+
json (>= 1.8, < 3)
|
80
84
|
simplecov-html (~> 0.10.0)
|
81
|
-
simplecov-html (0.10.
|
82
|
-
|
83
|
-
thor (0.19.1)
|
85
|
+
simplecov-html (0.10.2)
|
86
|
+
thor (0.20.3)
|
84
87
|
url (0.3.2)
|
85
|
-
webmock (1.
|
88
|
+
webmock (1.24.6)
|
86
89
|
addressable (>= 2.3.6)
|
87
90
|
crack (>= 0.3.2)
|
91
|
+
hashdiff
|
88
92
|
|
89
93
|
PLATFORMS
|
90
94
|
ruby
|
@@ -98,4 +102,4 @@ DEPENDENCIES
|
|
98
102
|
webmock (~> 1.21)
|
99
103
|
|
100
104
|
BUNDLED WITH
|
101
|
-
1.
|
105
|
+
1.16.6
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](https://img.shields.io/gem/v/green-button-data.svg)](https://rubygems.org/gems/green-button-data)
|
4
4
|
[![CI Results](https://img.shields.io/circleci/project/VerdigrisTech/green-button-data.svg)](https://circleci.com/gh/VerdigrisTech/green-button-data)
|
5
|
-
[![Dependencies](https://img.shields.io/gemnasium/VerdigrisTech/green-button-data.svg)](https://gemnasium.com/VerdigrisTech/green-button-data)
|
6
5
|
[![Code Climate](https://img.shields.io/codeclimate/maintainability/VerdigrisTech/green-button-data.svg)](https://codeclimate.com/github/VerdigrisTech/green-button-data)
|
7
6
|
[![Code Coverage](https://img.shields.io/codecov/c/github/VerdigrisTech/green-button-data.svg)](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-2020, [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'
|
@@ -56,6 +56,10 @@ module GreenButtonData
|
|
56
56
|
as: :service_location
|
57
57
|
element :'ns0:CustomerAgreement', class: CustomerAgreement,
|
58
58
|
as: :customer_agreement
|
59
|
+
|
60
|
+
# Special case for SCE namespacing
|
61
|
+
element :'cust:CustomerAgreement', class: CustomerAgreement,
|
62
|
+
as: :customer_agreement
|
59
63
|
end
|
60
64
|
end
|
61
65
|
end
|
@@ -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
|
@@ -42,6 +42,14 @@ module GreenButtonData
|
|
42
42
|
element :'ns1:content', class: Content, as: :content
|
43
43
|
element :'ns1:published', as: :published
|
44
44
|
element :'ns1:updated', as: :updated
|
45
|
+
|
46
|
+
element :'ns2:id', as: :entry_id
|
47
|
+
element :'ns2:link', as: :up, value: :href, with: { rel: 'up' }
|
48
|
+
element :'ns2:link', as: :self, value: :href, with: { rel: 'self' }
|
49
|
+
elements :'ns2:link', as: :related, value: :href, with: { rel: 'related' }
|
50
|
+
element :'ns2:content', class: Content, as: :content
|
51
|
+
element :'ns2:published', as: :published
|
52
|
+
element :'ns2:updated', as: :updated
|
45
53
|
end
|
46
54
|
end
|
47
55
|
end
|
@@ -42,6 +42,15 @@ module GreenButtonData
|
|
42
42
|
element :'ns1:links', as: :links, value: :href
|
43
43
|
elements :'ns1:entry', class: Entry, as: :entries
|
44
44
|
element :'ns1:updated', as: :updated
|
45
|
+
|
46
|
+
element :'ns2:id', as: :feed_id
|
47
|
+
element :'ns2:title', as: :title
|
48
|
+
element :'ns2:subtitle', as: :description
|
49
|
+
element :'ns2:link', as: :url, value: :href, with: { type: 'text/html' }
|
50
|
+
element :'ns2:link', as: :feed_url, value: :href, with: { rel: 'self' }
|
51
|
+
element :'ns2:links', as: :links, value: :href
|
52
|
+
elements :'ns2:entry', class: Entry, as: :entries
|
53
|
+
element :'ns2:updated', as: :updated
|
45
54
|
end
|
46
55
|
end
|
47
56
|
end
|
@@ -27,8 +27,8 @@ module GreenButtonData
|
|
27
27
|
address_general + ',' + town_detail_info
|
28
28
|
end
|
29
29
|
|
30
|
-
element :
|
31
|
-
element :
|
30
|
+
element :townDetail, class: TownDetail, as: :town_detail
|
31
|
+
element :streetDetail, class: StreetDetail, as: :street_detail
|
32
32
|
|
33
33
|
|
34
34
|
# ESPI Namespacing
|
@@ -3,7 +3,7 @@ module GreenButtonData
|
|
3
3
|
class ServiceLocation
|
4
4
|
include SAXMachine
|
5
5
|
|
6
|
-
element :
|
6
|
+
element :mainAddress, class: MainAddress, as: :main_address
|
7
7
|
|
8
8
|
# ESPI Namespacing
|
9
9
|
element :'espi:mainAddress', class: MainAddress, as: :main_address
|
@@ -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.3
|
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: 2020-08-10 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: nokogiri
|
@@ -103,9 +104,13 @@ executables: []
|
|
103
104
|
extensions: []
|
104
105
|
extra_rdoc_files: []
|
105
106
|
files:
|
107
|
+
- ".circleci/config.yml"
|
106
108
|
- ".codeclimate.yml"
|
109
|
+
- ".github/pull_request_template.md"
|
107
110
|
- ".gitignore"
|
108
111
|
- ".rspec"
|
112
|
+
- CODE_OF_CONDUCT.md
|
113
|
+
- CONTRIBUTING.md
|
109
114
|
- Gemfile
|
110
115
|
- Gemfile.lock
|
111
116
|
- Guardfile
|
@@ -191,15 +196,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
191
196
|
requirements:
|
192
197
|
- - ">="
|
193
198
|
- !ruby/object:Gem::Version
|
194
|
-
version: 2.
|
199
|
+
version: 2.4.0
|
195
200
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
201
|
requirements:
|
197
202
|
- - ">="
|
198
203
|
- !ruby/object:Gem::Version
|
199
204
|
version: '0'
|
200
205
|
requirements: []
|
201
|
-
|
202
|
-
rubygems_version: 2.6.11
|
206
|
+
rubygems_version: 3.0.3
|
203
207
|
signing_key:
|
204
208
|
specification_version: 4
|
205
209
|
summary: Client and parser for Green Button API
|