polyrex-createobject 0.2.0 → 0.2.1

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-createobject.rb +4 -4
  2. metadata +2 -2
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/ruby
2
2
 
3
- # file: polyrex-createobject.rb
3
+ # file: polyrex-createobject2.rb
4
4
 
5
5
  require 'polyrex-schema'
6
6
  require 'backtrack-xpath'
7
7
  require 'rexml/document'
8
8
 
9
- class PolyrexCreateObject
9
+ class PolyrexCreateObject2
10
10
  include REXML
11
11
 
12
12
  attr_accessor :id
@@ -61,7 +61,7 @@ end
61
61
  if @id.to_s[/[0-9]/] then
62
62
  @id = (@id.to_i + 1).to_s
63
63
  else
64
- @id = XPath.first(@parent_node.root, 'count(//@id)').to_i + 1
64
+ @id = XPath.first(@parent_node.root, 'count(//@id)').to_i + 2
65
65
  end
66
66
 
67
67
  a = child_schema[/[^\[]+(?=\])/].split(',')
@@ -70,7 +70,7 @@ end
70
70
  field.text = params[field_name.to_sym]
71
71
  end
72
72
 
73
- parent_node.add record
73
+ parent_node.add record.root
74
74
  record
75
75
  end
76
76
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyrex-createobject
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors: []
7
7
 
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-06-02 00:00:00 +01:00
12
+ date: 2010-06-09 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency