rogdl 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/array.rb CHANGED
@@ -1,7 +1,4 @@
1
- require 'lib/rogdl'
2
-
3
1
  class Array
4
-
5
2
 
6
3
  def to_n
7
4
  first = nil
data/lib/fixnum.rb CHANGED
@@ -1,7 +1,4 @@
1
- require 'lib/rogdl'
2
-
3
1
  class Fixnum
4
-
5
2
 
6
3
  def to_n
7
4
  return Rogdl::Node.new(self.to_s)
data/lib/hash.rb CHANGED
@@ -1,7 +1,4 @@
1
- require 'lib/rogdl'
2
-
3
1
  class Hash
4
-
5
2
 
6
3
  def to_n
7
4
  return self.to_a.to_n
data/lib/nil.rb CHANGED
@@ -3,6 +3,7 @@ class NilClass
3
3
  def gvalue
4
4
  nil
5
5
  end
6
+ alias gval gvalue
6
7
 
7
8
  def to_b
8
9
  false
data/lib/parser.rb CHANGED
@@ -1,4 +1,3 @@
1
- require 'lib/node'
2
1
  module Rogdl
3
2
 
4
3
 
@@ -384,7 +383,7 @@ module Rogdl
384
383
  nodes << temp
385
384
 
386
385
  line.each_with_index do |name, j|
387
- temp[j] = Node.new(name) unless name.nil?
386
+ temp[j] = name.to_n unless name.nil?
388
387
  end
389
388
  end
390
389
  end
data/lib/rogdl.rb CHANGED
@@ -1,14 +1,14 @@
1
- require 'lib/node'
2
- require 'lib/parser'
3
- require 'lib/schema'
4
- require 'lib/writer'
5
- require 'lib/nil'
6
- require 'lib/string'
7
- require 'lib/array'
8
- require 'lib/hash'
9
- require 'lib/fixnum'
10
- require 'lib/symbol'
1
+ require 'node'
2
+ require 'parser'
3
+ require 'schema'
4
+ require 'writer'
5
+
6
+ require 'nil'
7
+ require 'string'
8
+ require 'array'
9
+ require 'hash'
10
+ require 'fixnum'
11
+ require 'symbol'
11
12
 
12
13
  module Rogdl
13
- VERSION = '0.1.0'
14
14
  end
data/lib/string.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'lib/rogdl'
2
-
3
1
  class String
4
2
 
5
3
  def camel_case
data/lib/symbol.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'lib/rogdl'
2
-
3
1
  class Symbol
4
2
 
5
3
  def to_n
data/lib/writer.rb CHANGED
@@ -1,4 +1,3 @@
1
- require 'lib/node'
2
1
  require 'erb'
3
2
  require 'find'
4
3
 
data/test/test_array.rb CHANGED
@@ -1,8 +1,9 @@
1
1
  require 'test/unit'
2
- require 'lib/rogdl'
2
+ require 'lib/array'
3
+ require 'lib/string'
4
+ require 'lib/node'
3
5
 
4
6
  class TestArray < Test::Unit::TestCase
5
- include Rogdl
6
7
 
7
8
  def test_empty
8
9
  assert_equal nil, [].to_n
data/test/test_fixnum.rb CHANGED
@@ -1,13 +1,11 @@
1
1
  require 'test/unit'
2
- require 'lib/rogdl'
2
+ require 'lib/fixnum'
3
+ require 'lib/node'
3
4
 
4
5
  class TestFixnum < Test::Unit::TestCase
5
- include Rogdl
6
6
 
7
7
  def test_one
8
8
  assert_equal '1', 1.to_n.gname
9
9
  end
10
10
 
11
-
12
-
13
11
  end
data/test/test_hash.rb CHANGED
@@ -1,8 +1,10 @@
1
1
  require 'test/unit'
2
- require 'lib/rogdl'
2
+ require 'lib/hash'
3
+ require 'lib/node'
4
+ require 'lib/array'
5
+ require 'lib/string'
3
6
 
4
7
  class TestHash < Test::Unit::TestCase
5
- include Rogdl
6
8
 
7
9
  def test_empty
8
10
  assert_equal nil, {}.to_n
data/test/test_nil.rb CHANGED
@@ -1,13 +1,16 @@
1
1
  require 'test/unit'
2
- require 'lib/rogdl'
2
+ require 'lib/nil'
3
3
 
4
4
  class TestNil < Test::Unit::TestCase
5
- include Rogdl
6
5
 
7
6
  def test_gvalue
8
7
  assert_equal nil, nil.gvalue
9
8
  end
10
9
 
10
+ def test_gval
11
+ assert_equal nil, nil.gval
12
+ end
13
+
11
14
  def test_to_b
12
15
  assert_equal false, nil.to_b
13
16
  end
data/test/test_node.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'test/unit'
2
- require 'lib/rogdl'
2
+ require 'lib/node'
3
+ require 'lib/string'
3
4
 
4
5
  class TestNode < Test::Unit::TestCase
5
6
  include Rogdl
@@ -234,44 +235,6 @@ class TestNode < Test::Unit::TestCase
234
235
 
235
236
  end
236
237
 
237
- def test_add_others
238
- a = Node.new('a')
239
-
240
- a.add(['b'])
241
- a.add(3)
242
- a.add({'d'=>'e'})
243
- a.add('f')
244
- a.add(:g)
245
-
246
- assert_equal 'b', a.b.gname
247
- assert_equal 'b', a[0].gname
248
- assert_equal 'a', a[0].gparent.gname
249
-
250
- assert_equal '3', a['3'].gname
251
- assert_equal '3', a[1].gname
252
- assert_equal 'a', a[1].gparent.gname
253
-
254
- assert_equal 'd', a.d.gname
255
- assert_equal 'd', a[2].gname
256
- assert_equal 'a', a[2].gparent.gname
257
-
258
- assert_equal 'f', a.f.gname
259
- assert_equal 'f', a[3].gname
260
- assert_equal 'a', a[3].gparent.gname
261
-
262
- assert_equal ':g', a[':g'].gname
263
- assert_equal ':g', a[4].gname
264
- assert_equal 'a', a[4].gparent.gname
265
-
266
- end
267
-
268
-
269
-
270
-
271
-
272
-
273
-
274
-
275
238
 
276
239
 
277
240
 
data/test/test_parser.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  require 'test/unit'
2
- require 'lib/rogdl'
2
+ require 'lib/node'
3
+ require 'lib/parser'
4
+ require 'lib/string'
3
5
 
4
6
  class TestParser < Test::Unit::TestCase
5
7
  include Rogdl
data/test/test_schema.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require 'test/unit'
2
- require 'lib/rogdl'
3
-
2
+ require 'lib/schema'
3
+ require 'lib/node'
4
+ require 'lib/parser'
5
+ require 'lib/string'
4
6
 
5
7
  class TestSchema < Test::Unit::TestCase
6
8
  include Rogdl
data/test/test_string.rb CHANGED
@@ -1,5 +1,6 @@
1
- require 'lib/rogdl'
2
1
  require 'test/unit'
2
+ require 'lib/string'
3
+ require 'lib/node'
3
4
 
4
5
  class TestString < Test::Unit::TestCase
5
6
  include Rogdl
data/test/test_symbol.rb CHANGED
@@ -1,13 +1,12 @@
1
1
  require 'test/unit'
2
- require 'lib/rogdl'
2
+ require 'lib/symbol'
3
+ require 'lib/string'
4
+ require 'lib/node'
3
5
 
4
6
  class TestSymbol < Test::Unit::TestCase
5
- include Rogdl
6
7
 
7
- def test_a
8
+ def test_to_n
8
9
  assert_equal ':a', :a.to_n.gname
9
- end
10
-
11
-
10
+ end
12
11
 
13
12
  end
data/test/test_writer.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require 'test/unit'
2
- require 'lib/node'
3
2
  require 'lib/writer'
4
- require 'lib/parser'
3
+ require 'lib/node'
5
4
 
6
5
  class TestWriter < Test::Unit::TestCase
7
6
  include Rogdl
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: rogdl
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.1
6
+ version: 0.1.3
7
7
  date: 2007-08-21 00:00:00 -05:00
8
8
  summary: Rogdl is a package for parsing OGDL files.
9
9
  require_paths:
@@ -46,7 +46,6 @@ files:
46
46
  - test/test_nil.rb
47
47
  - test/test_node.rb
48
48
  - test/test_parser.rb
49
- - test/test_rogdl.rb
50
49
  - test/test_schema.rb
51
50
  - test/test_string.rb
52
51
  - test/test_symbol.rb
@@ -63,13 +62,5 @@ extensions: []
63
62
 
64
63
  requirements: []
65
64
 
66
- dependencies:
67
- - !ruby/object:Gem::Dependency
68
- name: erb
69
- version_requirement:
70
- version_requirements: !ruby/object:Gem::Version::Requirement
71
- requirements:
72
- - - ">"
73
- - !ruby/object:Gem::Version
74
- version: 0.0.0
75
- version:
65
+ dependencies: []
66
+
data/test/test_rogdl.rb DELETED
@@ -1,11 +0,0 @@
1
- require 'test/unit'
2
- require 'lib/rogdl'
3
-
4
- class TestRogdl < Test::Unit::TestCase
5
- include Rogdl
6
-
7
- def test_empty
8
- # this is included for Gem publication
9
- end
10
-
11
- end