polyrex 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/polyrex.rb +3 -1
  2. metadata +1 -1
data/lib/polyrex.rb CHANGED
@@ -14,6 +14,7 @@ class Polyrex
14
14
  include REXML
15
15
 
16
16
  def initialize(location)
17
+ @id = '0'
17
18
  open(location)
18
19
  end
19
20
 
@@ -198,7 +199,8 @@ class Polyrex
198
199
  @recordx.shift
199
200
  end
200
201
 
201
- @id = XPath.match(@doc.root, '//@id').map{|x| x.value.to_i}.max.to_s.succ
202
+ ids = XPath.match(@doc.root, '//@id')
203
+ @id = ids.map{|x| x.value.to_i}.max.to_s.succ unless ids.empty?
202
204
 
203
205
  #puts 'schema : ' + schema
204
206
  load_handlers(schema)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyrex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors: []
7
7