ce-greenbutton 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ce-greenbutton/version.rb +1 -1
- data/lib/ce-greenbutton.rb +3 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e02ea138af90eae3c4f7c0dd7fe0598013f3c0e4
|
4
|
+
data.tar.gz: 7b80b4a3e2775c28bc940b585c6bd1ba93641717
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50755016e85cfc5656fc26e2fc058e33f71d91d578b3a495171214a4df0ec0f387da5f6674c442ed41c328484579e27c6d85d068a491aad502d991deaf499d10
|
7
|
+
data.tar.gz: ea548d78a9a0cb1ae4081c13506dc95937d1d360fdc9aaa1f0de6d091ce304bcd91fbaf9c374242defc854f8606206e113dd07550925f4795f3ab3e0737459d0
|
data/lib/ce-greenbutton.rb
CHANGED
@@ -102,7 +102,7 @@ module GreenButton
|
|
102
102
|
params.length > 0
|
103
103
|
data = open(resource_url,
|
104
104
|
'Authorization' => "Bearer #{access_token}")
|
105
|
-
parse_data(
|
105
|
+
parse_data(data) #Return
|
106
106
|
end
|
107
107
|
|
108
108
|
# Public: Downloads and parses the GreenButton data, hosted in a FTP server.
|
@@ -132,13 +132,12 @@ module GreenButton
|
|
132
132
|
|
133
133
|
# Parses the given greenbutton data to the corresponding ruby objects.
|
134
134
|
#
|
135
|
-
# user_id - identifies the owner of the data.
|
136
135
|
# data - The source GreenButton xml data, can be string, or any stream returning
|
137
136
|
# from a call to open(uri)
|
138
137
|
#
|
139
138
|
# Returns the parsed array of gb_data_description
|
140
139
|
private
|
141
|
-
def self.parse_data(
|
140
|
+
def self.parse_data(data)
|
142
141
|
# get ApplicationInformation
|
143
142
|
app_info = GreenButton::Parser::GbApplicationInformation.
|
144
143
|
parse(open(@application_information_url,
|
@@ -157,7 +156,7 @@ module GreenButton
|
|
157
156
|
gb_data_description = @interpreters[usage_point.kind]
|
158
157
|
.get_gb_data_description(entry, feed)
|
159
158
|
gb_data_description.custodian = app_info.data_custodian_id
|
160
|
-
gb_data_description.user_id =
|
159
|
+
gb_data_description.user_id = /.*\/(\d+)\/UsagePoint\/\d+/.match(entry.self)[1]
|
161
160
|
gb << gb_data_description
|
162
161
|
end
|
163
162
|
|
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ce-greenbutton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ahmed.seddiq
|
8
|
-
-
|
8
|
+
- brandon.jahner
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|