aemo 0.1.16 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 832594e01ce71664640977db21679e44f79457e8
4
- data.tar.gz: 1154b8205f53dfb56f73f59c7ccd9a632f55d345
3
+ metadata.gz: e9f534b1b97bec9bc352216cfc352bcbbc9a4883
4
+ data.tar.gz: 7f94739af0677d741fbc40a556db9a3c64912ca1
5
5
  SHA512:
6
- metadata.gz: f399467b78bc4b78816a3b8248683c789460c1113fc81bf9cfaf07ea092b8e6819cbef86143fa96602f8039af6bb9ff1b4424527bd8083a6debeca1a95b70d11
7
- data.tar.gz: 4d31d8e8f21284131a7f2ce75899e84462316fa57e8fdbe37a57f78be812e5d2dc9aa972af3022572d75da528e9d91ccf211ebf81fc2f9377e2653f9cb9ee5f2
6
+ metadata.gz: 33b75e75812ff15f24222447689792ff07c04ee5f71ec950f753284dc9bf2e8874996a3672a571dfe1990679192efce12f6bb76f76e0f2d0a5d1d5b51535ab74
7
+ data.tar.gz: 1b877767ec31988797dc055d537f12f52a3b97fbcecc05bbaec47e43810426bd4cf8014860477ca156913de2ba77d75ea6e2cab7b4c4f583741026ff1f45373a
data/Rakefile ADDED
@@ -0,0 +1,5 @@
1
+ require 'bundler/gem_tasks'
2
+
3
+ task :console do
4
+ exec "irb -r aemo -I ./lib"
5
+ end
data/lib/aemo/msats.rb CHANGED
@@ -62,7 +62,7 @@ module AEMO
62
62
  inittransId: options[:init_trans_id],
63
63
  }
64
64
 
65
- response = self.get( "/C4/#{@@participant_id}", basic_auth: @@auth, headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml'}, query: query )
65
+ response = self.get( "/C4/#{@@participant_id}", basic_auth: @@auth, headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml'}, query: query, verify: (options[:verify_ssl] != false) )
66
66
  if response.response.code != '200'
67
67
  response
68
68
  else
@@ -78,7 +78,7 @@ module AEMO
78
78
  query = {
79
79
  transactionId: Digest::SHA1.hexdigest(Time.now.to_s)[0..35],
80
80
  }
81
- response = self.get( "/MSATSLimits/#{@@participant_id}", basic_auth: @@auth, headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml'}, query: query )
81
+ response = self.get( "/MSATSLimits/#{@@participant_id}", basic_auth: @@auth, headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml'}, query: query, verify: (options[:verify_ssl] != false) )
82
82
  if response.response.code != '200'
83
83
  response
84
84
  else
@@ -102,7 +102,7 @@ module AEMO
102
102
  deliveryPointIdentifier: delivery_point_identifier.to_i
103
103
  }
104
104
 
105
- response = self.get( "/NMIDiscovery/#{@@participant_id}", basic_auth: @@auth, headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml'}, query: query )
105
+ response = self.get( "/NMIDiscovery/#{@@participant_id}", basic_auth: @@auth, headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml'}, query: query, verify: (options[:verify_ssl] != false) )
106
106
  if response.response.code != '200'
107
107
  response
108
108
  else
@@ -124,7 +124,7 @@ module AEMO
124
124
  meterSerialNumber: meter_serial_number.to_i
125
125
  }
126
126
 
127
- response = self.get( "/NMIDiscovery/#{@@participant_id}", basic_auth: @@auth, headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml'}, query: query )
127
+ response = self.get( "/NMIDiscovery/#{@@participant_id}", basic_auth: @@auth, headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml'}, query: query, verify: (options[:verify_ssl] != false) )
128
128
  if response.response.code != '200'
129
129
  response
130
130
  else
@@ -176,7 +176,7 @@ module AEMO
176
176
  stateOrTerritory: options[:state_or_territory]
177
177
  }
178
178
 
179
- response = self.get( "/NMIDiscovery/#{@@participant_id}", basic_auth: @@auth, headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml'}, query: query )
179
+ response = self.get( "/NMIDiscovery/#{@@participant_id}", basic_auth: @@auth, headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml'}, query: query, verify: (options[:verify_ssl] != false) )
180
180
  if response.response.code != '200'
181
181
  response
182
182
  else
@@ -204,7 +204,7 @@ module AEMO
204
204
  reason: options[:reason]
205
205
  }
206
206
 
207
- response = self.get( "/NMIDetail/#{@@participant_id}", basic_auth: @@auth, headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml'}, query: query )
207
+ response = self.get( "/NMIDetail/#{@@participant_id}", basic_auth: @@auth, headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml'}, query: query, verify: (options[:verify_ssl] != false) )
208
208
  if response.response.code != '200'
209
209
  response
210
210
  else
@@ -220,7 +220,7 @@ module AEMO
220
220
  query = {
221
221
  transactionId: Digest::SHA1.hexdigest(Time.now.to_s)[0..35],
222
222
  }
223
- response = self.get( "/ParticipantSystemStatus/#{@@participant_id}", basic_auth: @@auth, headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml'}, query: query )
223
+ response = self.get( "/ParticipantSystemStatus/#{@@participant_id}", basic_auth: @@auth, headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml'}, query: query, verify: (options[:verify_ssl] != false) )
224
224
  if response.response.code != '200'
225
225
  response
226
226
  else
data/lib/aemo/nmi.rb CHANGED
@@ -482,18 +482,18 @@ module AEMO
482
482
  # Provided MSATS is configured, gets the MSATS data for the NMI
483
483
  #
484
484
  # @return [Hash] MSATS NMI Detail data
485
- def raw_msats_nmi_detail
485
+ def raw_msats_nmi_detail(options={})
486
486
  raise ArgumentError, 'MSATS has no authentication credentials' unless AEMO::MSATS.can_authenticate?
487
487
 
488
- AEMO::MSATS.nmi_detail(@nmi)
488
+ AEMO::MSATS.nmi_detail(@nmi,options)
489
489
  end
490
490
 
491
491
  # Provided MSATS is configured, uses the raw MSATS data to augment NMI information
492
492
  #
493
493
  # @return [self] returns self
494
- def update_from_msats!
494
+ def update_from_msats!(options={})
495
495
  # Update local cache
496
- @msats_detail = raw_msats_nmi_detail
496
+ @msats_detail = raw_msats_nmi_detail(options)
497
497
  # Set the details if there are any
498
498
  unless @msats_detail['MasterData'].nil?
499
499
  @tni = @msats_detail['MasterData']['TransmissionNodeIdentifier']
data/lib/aemo/version.rb CHANGED
@@ -22,7 +22,7 @@
22
22
  # @author Joel Courtney <euphemize@gmail.com>
23
23
  module AEMO
24
24
  # aemo version
25
- VERSION = '0.1.16'
25
+ VERSION = '0.1.17'
26
26
 
27
27
  # aemo version split amongst different revisions
28
28
  MAJOR_VERSION, MINOR_VERSION, REVISION = VERSION.split('.').map(&:to_i)
@@ -3,14 +3,14 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
3
3
  describe AEMO::Market do
4
4
  describe '.regions' do
5
5
  it "returns the SupportedFormats constant" do
6
- AEMO::Market.regions.should == AEMO::Region::REGIONS
6
+ expect(AEMO::Market.regions).to eq(AEMO::Region::REGIONS)
7
7
  end
8
8
 
9
9
  it "returns the SupportedFormats constant for subclasses" do
10
10
  class MyParser < HTTParty::Parser
11
11
  SupportedFormats = {"application/atom+xml" => :atom}
12
12
  end
13
- MyParser.formats.should == {"application/atom+xml" => :atom}
13
+ expect(MyParser.formats).to eq({"application/atom+xml" => :atom})
14
14
  end
15
15
  end
16
- end
16
+ end
@@ -3,7 +3,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
3
3
  describe AEMO::Region do
4
4
  describe '.REGIONS' do
5
5
  it "should be a hash" do
6
- AEMO::Market.regions.should be_instance_of(Hash)
6
+ expect(AEMO::Market.regions).to be_instance_of(Hash)
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aemo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Courtney
@@ -112,6 +112,7 @@ files:
112
112
  - Gemfile
113
113
  - Gemfile.lock
114
114
  - README.md
115
+ - Rakefile
115
116
  - aemo.gemspec
116
117
  - lib/aemo.rb
117
118
  - lib/aemo/dispatchable.rb