ce-greenbutton 0.1.6 → 0.1.7
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 +8 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fb5f5fcf5c5594ec51732aac929f8f206815504
|
4
|
+
data.tar.gz: d59fb734b908d229f0fa0c8bb1bad625cf85393d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 445f7ba66616d6a1d666150be6d4cb28883b6f25d059d4fa833f022ac664488f346c098a08b7ccdebaa29953c77fe6eba25fb8debb0b8c12aea912398046c8b6
|
7
|
+
data.tar.gz: f08de159c9b9cb83f1e5612c36bb490e527f080885ade4b7ad9296e0c6c1e2109812ce058095b3f9ee3e861de4bf727d0fbde8d0749149dfaa6d1a69258582a4
|
data/lib/ce-greenbutton.rb
CHANGED
@@ -120,19 +120,22 @@ module GreenButton
|
|
120
120
|
# Returns an array of gb_data_description
|
121
121
|
# Raises ArgumentError if any passed argument is invalid.
|
122
122
|
# Propagates errors from OpenURI for any connection/authentication
|
123
|
-
|
124
|
-
def self.download_data_ftp(filename)
|
123
|
+
def self.download_data_ftp(application_id, time=Time.now, utility_name)
|
125
124
|
check_arguments_ftp(application_id, time, utility_name)
|
126
125
|
|
127
126
|
# construct the ftp url
|
128
|
-
|
129
|
-
|
127
|
+
ftp_url = "ftp://#{@ftp_user}:#{@ftp_password}@#{@ftp_host}/#{@ftp_path}/" +
|
128
|
+
"D_#{utility_name}_#{application_id}_CONSUMPTION_#{time.strftime('%Y%m%d%H%M%S')}.XML"
|
130
129
|
|
130
|
+
parse_data(open(ftp_url))
|
131
|
+
end
|
132
|
+
|
133
|
+
def self.download_data_ftp_by_filename(filename)
|
131
134
|
ftp_url = "ftp://#{@ftp_user}:#{@ftp_password}@#{@ftp_host}/#{@ftp_path}/" +
|
132
135
|
"#{filename}"
|
133
136
|
|
134
137
|
parse_data(open(ftp_url))
|
135
|
-
end
|
138
|
+
end
|
136
139
|
|
137
140
|
# Parses the given greenbutton data to the corresponding ruby objects.
|
138
141
|
#
|