ce-greenbutton 0.1.6 → 0.1.7

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
2
  SHA1:
3
- metadata.gz: 81a9718c675714b41bd7a17acdbceea06b936282
4
- data.tar.gz: ca22f65eff6437cd41679f1c209bf73351c9757a
3
+ metadata.gz: 2fb5f5fcf5c5594ec51732aac929f8f206815504
4
+ data.tar.gz: d59fb734b908d229f0fa0c8bb1bad625cf85393d
5
5
  SHA512:
6
- metadata.gz: 821ecd0daf89446136f7f2955bfb4a1d0d3d63573c462b0e85222dd8043164688bb723f009db9021e06b773254803c26262f8a8250d48029dd870e4acc546f8d
7
- data.tar.gz: f4d44f1a7cf9a531ce1d198564ca55ba16a8ce12b60e0648076b15f794ea0ed0698a3243712c5717aa374f125cb30612499337d7c6049e2c6b3a9ace406f1d1f
6
+ metadata.gz: 445f7ba66616d6a1d666150be6d4cb28883b6f25d059d4fa833f022ac664488f346c098a08b7ccdebaa29953c77fe6eba25fb8debb0b8c12aea912398046c8b6
7
+ data.tar.gz: f08de159c9b9cb83f1e5612c36bb490e527f080885ade4b7ad9296e0c6c1e2109812ce058095b3f9ee3e861de4bf727d0fbde8d0749149dfaa6d1a69258582a4
@@ -1,3 +1,3 @@
1
1
  module GreenButton
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
@@ -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
- # def self.download_data_ftp(application_id, time=Time.now, utility_name)
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
- # ftp_url = "ftp://#{@ftp_user}:#{@ftp_password}@#{@ftp_host}/#{@ftp_path}/" +
129
- # "D_#{utility_name}_#{application_id}_CONSUMPTION_#{time.strftime('%Y%m%d%H%M%S')}.XML"
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
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ce-greenbutton
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - ahmed.seddiq