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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 845e58a8ed72a51387f8b0496f84608f08052cfb
4
- data.tar.gz: 99cbfa423332376f5766ead78fe693f8a90b372b
2
+ SHA256:
3
+ metadata.gz: 20b38303872ce2f93255dcc55e52e683c7ec264904e17fc578794ff241738017
4
+ data.tar.gz: 64ac1db54bcf51f90958468fe0ae22e8d470b2943bf31253e7f725720e7af444
5
5
  SHA512:
6
- metadata.gz: 8628bfe4f648aea5ab87a4bf304a0d0bddab56a4d409d36269e6967561e1172642b24880197c2609bf9708669a6ac042c6f1714a2e9aa06a1a682bd514df25d7
7
- data.tar.gz: a2be1ecf3bf39fddff02790749593c72263466affa62e604c3c95f852652c52f2b1887649a68990bcb7fadf90349786cf13da38610fd40002fbcb7a595e6a936
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}/
@@ -9,9 +9,9 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- addressable (2.5.2)
12
+ addressable (2.6.0)
13
13
  public_suffix (>= 2.0.2, < 4.0)
14
- codecov (0.1.10)
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.0)
23
- faraday (0.15.0)
22
+ docile (1.3.1)
23
+ faraday (0.15.4)
24
24
  multipart-post (>= 1.2, < 3)
25
- ffi (1.9.23)
25
+ ffi (1.10.0)
26
26
  formatador (0.2.5)
27
- guard (2.14.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.7)
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.0)
49
- mini_portile2 (2.3.0)
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.8.2)
53
- mini_portile2 (~> 2.3.0)
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.11.3)
57
+ pry (0.12.2)
58
58
  coderay (~> 1.1.0)
59
59
  method_source (~> 0.9.0)
60
- public_suffix (3.0.2)
60
+ public_suffix (3.0.3)
61
61
  rb-fsevent (0.10.3)
62
- rb-inotify (0.9.10)
63
- ffi (>= 0.5.0, < 2)
64
- rspec (3.7.0)
65
- rspec-core (~> 3.7.0)
66
- rspec-expectations (~> 3.7.0)
67
- rspec-mocks (~> 3.7.0)
68
- rspec-core (3.7.1)
69
- rspec-support (~> 3.7.0)
70
- rspec-expectations (3.7.0)
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.7.0)
73
- rspec-mocks (3.7.0)
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.7.0)
76
- rspec-support (3.7.1)
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.0)
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.1
105
+ 1.16.2
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
- Copyright © 2015-2018, [Verdigris Technologies Inc](https://verdigris.co). All rights reserved.
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
@@ -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.1.0'
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,6 +1,10 @@
1
1
  Fixnum.class_eval do
2
- unless 0.respond_to? :digits
3
- def digits(base = 10)
2
+ if 0.respond_to? :digits
3
+ def num_digits(base = 10)
4
+ self.digits.count
5
+ end
6
+ else
7
+ def num_digits(base = 10)
4
8
  num = self.abs
5
9
  if num == 0
6
10
  1
@@ -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:note', as: :note
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:note', as: :note
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
- # Special case for SCE generic namespacing
17
- element :'ns0:amount', class: Integer, as: :amount
24
+ def cost
25
+ @amount / 100_000.0 if @amount.class == Fixnum
26
+ end
18
27
  end
19
28
  end
20
29
  end
@@ -28,7 +28,7 @@ module GreenButtonData
28
28
  end
29
29
 
30
30
  element :townDetail, class: TownDetail, as: :town_detail
31
- element :streetDetail, class: StreetDetail, as: :town_detail
31
+ element :streetDetail, class: StreetDetail, as: :street_detail
32
32
 
33
33
 
34
34
  # ESPI Namespacing
@@ -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.digits >= 15
28
+ if epoch.num_digits >= 15
29
29
  epoch / 100000
30
- elsif epoch.digits >= 13
30
+ elsif epoch.num_digits >= 13
31
31
  epoch / 1000
32
32
  else
33
33
  epoch
@@ -1,3 +1,3 @@
1
1
  module GreenButtonData
2
- VERSION = '0.7.5'
2
+ VERSION = '1.0.0'
3
3
  end
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.7.5
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: 2018-04-29 00:00:00.000000000 Z
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.1.0
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
- rubyforge_project:
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