aemo 0.3.0.pre.rc1 → 0.3.0

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
  SHA256:
3
- metadata.gz: f959b4ca7bb32fece4066d2cb2bd6efe309cf1dcefd9c602d9589d175b0e082e
4
- data.tar.gz: e3a4a60539a8b97b557b751c1a65df03ddf6f301f12e596a20d7440ab44648d2
3
+ metadata.gz: fa7de5acdc8241646f30953344189284f92dafaecedece6bcd17d506a30c3ef8
4
+ data.tar.gz: d94d22fc41ae2803a1fe1dde01271870e0527cd793668e87042926d1b5137da2
5
5
  SHA512:
6
- metadata.gz: e75333c5f79fda5575ddcf30103d449b518405f500cd72fb929fc69e3f56f03d7eafdc56e8afad90c47ac092db77991b87bcf6f9cf29d08e2f40ffa97dc24f80
7
- data.tar.gz: 203aa713e569e35896b8d4b1ae85df3581ef2f1fbf1c42a75a67557a7264f47a36c51f2ae9b66eff1b5077f24050ac6c7a6cd631e683ce8e4cf4f643d1ace645
6
+ metadata.gz: 39afcd7e6075b1629cfb3e7f5d2a6a5390023d24964f9d4450e47988235a27e93c6d0cf0e0d406673421587abba19d68e03a22844c17367211d6eb6094f7d512
7
+ data.tar.gz: 3cdfce782976e5e7471fecca7d500a508e98c55c7cbd4b504af1a576df7b0bf971003ceb9951993d34d10e11b3e7b0c7cf609a4a8906928d590bff5e10c0013f
@@ -505,6 +505,9 @@ module AEMO
505
505
  # @return [Array<AEMO::NEM12>] An array of NEM12 objects
506
506
  def self.parse_nem12(contents, strict = true)
507
507
  file_contents = contents.tr("\r", "\n").tr("\n\n", "\n").split("\n").delete_if(&:empty?)
508
+ # nothing to further process
509
+ return [] if file_contents.empty?
510
+
508
511
  raise ArgumentError, 'First row should be have a RecordIndicator of 100 and be of type Header Record' unless file_contents.first.parse_csv[0] == '100'
509
512
 
510
513
  nem12s = []
@@ -24,7 +24,7 @@
24
24
  # @author Joel Courtney <euphemize@gmail.com>
25
25
  module AEMO
26
26
  # aemo version
27
- VERSION = '0.3.0-rc1'
27
+ VERSION = '0.3.0'
28
28
 
29
29
  # aemo version split amongst different revisions
30
30
  MAJOR_VERSION, MINOR_VERSION, REVISION = VERSION.split('.').map(&:to_i)
@@ -25,6 +25,9 @@ describe AEMO::NEM12 do
25
25
  end
26
26
 
27
27
  describe '#parse_nem12' do
28
+ it 'should reject an empty NEM12 string' do
29
+ expect(AEMO::NEM12.parse_nem12('')).to eq([])
30
+ end
28
31
  end
29
32
 
30
33
  describe '.parse_nem12_file' do
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.3.0.pre.rc1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Courtney
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-11-04 00:00:00.000000000 Z
13
+ date: 2018-05-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -516,9 +516,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
516
516
  version: 2.3.0
517
517
  required_rubygems_version: !ruby/object:Gem::Requirement
518
518
  requirements:
519
- - - ">"
519
+ - - ">="
520
520
  - !ruby/object:Gem::Version
521
- version: 1.3.1
521
+ version: '0'
522
522
  requirements: []
523
523
  rubyforge_project:
524
524
  rubygems_version: 2.7.6