SgfParser 0.9.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +1 -0
- data/Gemfile.lock +2 -0
- data/README.rdoc +44 -38
- data/SgfParser.gemspec +17 -15
- data/VERSION +1 -1
- data/lib/sgf.rb +8 -0
- data/lib/sgf/{sgf_indent.rb → indenter.rb} +108 -108
- data/lib/sgf/{parser/node.rb → node.rb} +61 -57
- data/lib/sgf/{parser/tree_parse.rb → parser.rb} +120 -111
- data/lib/sgf/{parser/properties.rb → properties.rb} +97 -97
- data/lib/sgf/{parser/tree.rb → tree.rb} +91 -107
- data/sample_usage/parsing_files.rb +18 -18
- data/{sample_sgf → spec/data}/ff4_ex.sgf +0 -0
- data/{sample_sgf → spec/data}/ff4_ex_saved.sgf +0 -0
- data/{sample_sgf → spec/data}/redrose-tartrate.sgf +1068 -1068
- data/{sample_sgf → spec/data}/simple.sgf +11 -11
- data/spec/data/simple_saved.sgf +7 -0
- data/spec/node_spec.rb +63 -33
- data/spec/parser_spec.rb +20 -0
- data/spec/spec_helper.rb +6 -6
- data/spec/tree_spec.rb +29 -41
- metadata +69 -87
- data/lib/sgf/sgfindent.rb +0 -118
- data/lib/sgf_parser.rb +0 -8
- data/sample_sgf/simple_saved.sgf +0 -7
- data/spec/tree_parser_spec.rb +0 -24
data/lib/sgf_parser.rb
DELETED
data/sample_sgf/simple_saved.sgf
DELETED
data/spec/tree_parser_spec.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
-
|
3
|
-
describe "SgfParser::Tree.parse" do
|
4
|
-
|
5
|
-
before :each do
|
6
|
-
@tree = SgfParser::Tree.new :filename => 'sample_sgf/ff4_ex.sgf'
|
7
|
-
end
|
8
|
-
|
9
|
-
it "should have FF in the first node" do
|
10
|
-
@tree.root.children[0].properties.keys.should include("FF")
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should give an error if FF is missing from the first node" do
|
14
|
-
pending "To be coded later"
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should parse properly the AW property" do
|
18
|
-
input = StringIO.new "dd][de][ef]"
|
19
|
-
tree = SgfParser::Tree.new
|
20
|
-
tree.instance_variable_set "@stream", input
|
21
|
-
tree.get_property.should == "[dd][de][ef]"
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|