green-button-data 0.3.1 → 0.3.2
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 +8 -8
- data/lib/green-button-data/fetchable.rb +21 -1
- data/lib/green-button-data/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDZiY2U4YTc5MWZjMGQ0YmEzNTEzMTk5MmQwZDA5YzlmZWI3Mjk4MA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
M2VmZWZkOGI2MzU5NTgxZTMwYjVkNzZiYzM4ZjEyYjE0YjY3NzliYQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjZlN2JlYTI1YTk2NzliNmY1Mzg2ZGRiZDM1ZjFhN2VlMzdhODA0ODJhMmJm
|
10
|
+
MzY4MGY1MjdlMzRjYzIxMWNjNDliY2EyOWFkODY0MDU3MTA1MThhYzAzOTNi
|
11
|
+
ZTY3ZDg2ZGJlYmUxNWY1OWM3OTEwY2NmOTc0ZTg4NGZiMTE3OTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjgzZjk3MGQzNWNlZWZkMGViZDBhMmFhNDQzZGVkN2E2MWVhYzU4M2U3NzNi
|
14
|
+
MzE3Njc1NGRlOTFiMzE4YWNjOTU3YzAyMjdkMjAzMzU1Yzg3M2JkYjRjYTc1
|
15
|
+
NmYwYmI2NWNiZjdmOTUxNmFhNjg0ZTc3NDRkNWZkMWRlYTY1MmE=
|
@@ -160,7 +160,27 @@ module GreenButtonData
|
|
160
160
|
entry_content = nil
|
161
161
|
|
162
162
|
feed.entries.each do |entry|
|
163
|
-
|
163
|
+
# Matches resource name in URL (e.g. ApplicationInformation)
|
164
|
+
resource = '([a-zA-Z]+)'
|
165
|
+
|
166
|
+
# Matches Base 64 encoded resource ID used by PG&E for MeterReading
|
167
|
+
# resource identifier
|
168
|
+
base64_id = '\w+=*'
|
169
|
+
|
170
|
+
# Matches numeric ID with thousands separator in commas used for
|
171
|
+
# UsageSummary IDs for PG&E endpoints but also matches traditional
|
172
|
+
# digits without comma separator
|
173
|
+
num_id = '(\d+,*\d*)+'
|
174
|
+
|
175
|
+
# Matches GUID as the resource ID used mainly by PG&E for
|
176
|
+
# ApplicationInformation resource identifier
|
177
|
+
guid = '[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}' +
|
178
|
+
'-[0-9A-Fa-f]{12}'
|
179
|
+
|
180
|
+
# Identifier can be any of the above patterns
|
181
|
+
identifier = "(#{base64_id}|#{num_id}|#{guid})"
|
182
|
+
|
183
|
+
match_data = /\/(#{resource}|#{resource}\/#{identifier})\/*\z/.
|
164
184
|
match(entry.self)
|
165
185
|
|
166
186
|
unless match_data.nil?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: green-button-data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Jo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|