Skip to content

Commit 2684c78

Browse files
committed
First gem release: v0.8.0
1 parent 0144012 commit 2684c78

29 files changed

+1898
-1851
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ rdoc
1919
pkg
2020

2121
## PROJECT::SPECIFIC
22+
23+
24+
## Rubymine
25+
.idea/*

LICENSE

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
Copyright (c) 2009 Aldric Giacomoni
2-
3-
Permission is hereby granted, free of charge, to any person obtaining
4-
a copy of this software and associated documentation files (the
5-
"Software"), to deal in the Software without restriction, including
6-
without limitation the rights to use, copy, modify, merge, publish,
7-
distribute, sublicense, and/or sell copies of the Software, and to
8-
permit persons to whom the Software is furnished to do so, subject to
9-
the following conditions:
10-
11-
The above copyright notice and this permission notice shall be
12-
included in all copies or substantial portions of the Software.
13-
14-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1+
Copyright (c) 2009 Aldric Giacomoni
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.rdoc

+28-28
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
SGF: all formats (but untested with FF < 4)
2-
Ruby: >1.8.7 (may work with 1.8.6)
3-
4-
Example:
5-
require 'sgfparser'
6-
tree = SGF::Tree.new :filename => File
7-
tree = SGF::Tree.new :sgf_string => String
8-
9-
All trees begin with an empty node ( @root) which allows a simple support of multiple gametrees.
10-
Most games will just care about, say,
11-
tree.root.children[0] which is the first node of the first gametree.
12-
13-
For any node, one can summon the properties as such:
14-
node.properties # => returns a hash of the properties.
15-
A single property can be called, like the comments, for instance, like so:
16-
node.C # => returns the comments for this node.
17-
18-
The library currently uses method_missing to painlessly return the data. I must admit that this is both clever coding and laziness on my part.
19-
20-
The 'SGF Indenter', the purpose of which is to make the actual SGF file more
21-
human readable, is working.
22-
23-
___
24-
25-
TODO
26-
? Create a "Game" class, and if a whole set of () exists, then I have a game?
27-
That way maybe I can easily go to multiple games stored in a single SGF file?
28-
Mostly syntactic sugar, but may be worth implementing.
1+
SGF: all formats (but untested with FF < 4)
2+
Ruby: >1.8.7 (may work with 1.8.6)
3+
4+
Example:
5+
require 'sgf_parser'
6+
tree = SgfParser::Tree.new :filename => File
7+
tree = SgfParser::Tree.new :sgf_string => String
8+
9+
All trees begin with an empty node ( @root) which allows a simple support of multiple gametrees.
10+
Most games will just care about, say,
11+
tree.root.children[0] which is the first node of the first gametree.
12+
13+
For any node, one can summon the properties as such:
14+
node.properties # => returns a hash of the properties.
15+
A single property can be called, like the comments, for instance, like so:
16+
node.C # => returns the comments for this node.
17+
18+
The library currently uses method_missing to painlessly return the data. I must admit that this is both clever coding and laziness on my part.
19+
20+
The 'SGF Indenter', the purpose of which is to make the actual SGF file more
21+
human readable, is working.
22+
23+
___
24+
25+
TODO
26+
? Create a "Game" class, and if a whole set of () exists, then I have a game?
27+
That way maybe I can easily go to multiple games stored in a single SGF file?
28+
Mostly syntactic sugar, but may be worth implementing.

Rakefile

+59-57
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,59 @@
1-
require 'rubygems'
2-
require 'rake'
3-
4-
begin
5-
require 'jeweler'
6-
Jeweler::Tasks.new do |gem|
7-
gem.name = "SGFParser"
8-
gem.summary = %Q{A library for working with SGF files.}
9-
gem.description = %Q{SGFParser is a library that parses and saves SGF (Smart Game Format) files.}
10-
gem.email = "[email protected]"
11-
gem.homepage = "http://github.com/Trevoke/SGFParser"
12-
gem.authors = ["Aldric Giacomoni"]
13-
gem.add_development_dependency "rspec", ">= 1.2.9"
14-
gem.add_development_dependency "cucumber", ">= 0.4"
15-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
16-
end
17-
Jeweler::GemcutterTasks.new
18-
rescue LoadError
19-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
20-
end
21-
22-
require 'spec/rake/spectask'
23-
Spec::Rake::SpecTask.new(:spec) do |spec|
24-
spec.libs << 'lib' << 'spec'
25-
spec.spec_files = FileList['spec/**/*_spec.rb']
26-
end
27-
28-
Spec::Rake::SpecTask.new(:rcov) do |spec|
29-
spec.libs << 'lib' << 'spec'
30-
spec.pattern = 'spec/**/*_spec.rb'
31-
spec.rcov = true
32-
end
33-
34-
task :spec => :check_dependencies
35-
36-
begin
37-
require 'cucumber/rake/task'
38-
Cucumber::Rake::Task.new(:features)
39-
40-
task :features => :check_dependencies
41-
rescue LoadError
42-
task :features do
43-
abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
44-
end
45-
end
46-
47-
task :default => [:spec, :features]
48-
49-
require 'rake/rdoctask'
50-
Rake::RDocTask.new do |rdoc|
51-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
52-
53-
rdoc.rdoc_dir = 'rdoc'
54-
rdoc.title = "SGFParser #{version}"
55-
rdoc.rdoc_files.include('README*')
56-
rdoc.rdoc_files.include('lib/**/*.rb')
57-
end
1+
require 'rubygems'
2+
require 'rake'
3+
4+
begin
5+
require 'jeweler'
6+
Jeweler::Tasks.new do |gem|
7+
gem.name = "SgfParser"
8+
gem.summary = %Q{A library for working with SGF files.}
9+
gem.description = %Q{SGFParser is a library that parses and saves SGF (Smart Game Format) files.}
10+
gem.email = "[email protected]"
11+
gem.homepage = "http://github.com/Trevoke/SGFParser"
12+
gem.authors = ["Aldric Giacomoni"]
13+
gem.add_development_dependency "rspec", ">= 1.2.9"
14+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
15+
end
16+
Jeweler::GemcutterTasks.new
17+
rescue LoadError
18+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
19+
end
20+
21+
require 'spec/rake/spectask'
22+
Spec::Rake::SpecTask.new(:spec) do |spec|
23+
spec.libs << 'lib' << 'spec'
24+
spec.spec_files = FileList['spec/**/*_spec.rb']
25+
end
26+
27+
Spec::Rake::SpecTask.new(:rcov) do |spec|
28+
spec.libs << 'lib' << 'spec'
29+
spec.pattern = 'spec/**/*_spec.rb'
30+
spec.rcov = true
31+
end
32+
33+
task :spec => :check_dependencies
34+
35+
# In case I ever want to go back to cucumber.
36+
#begin
37+
# require 'cucumber/rake/task'
38+
# Cucumber::Rake::Task.new(:features)
39+
#
40+
# task :features => :check_dependencies
41+
#rescue LoadError
42+
# task :features do
43+
# abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
44+
# end
45+
#end
46+
47+
#task :default => [:spec, :features]
48+
49+
task :default => [:spec]
50+
51+
require 'rake/rdoctask'
52+
Rake::RDocTask.new do |rdoc|
53+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
54+
55+
rdoc.rdoc_dir = 'rdoc'
56+
rdoc.title = "SgfParser #{version}"
57+
rdoc.rdoc_files.include('README*')
58+
rdoc.rdoc_files.include('lib/**/*.rb')
59+
end

SgfParser.gemspec

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Generated by jeweler
2+
# DO NOT EDIT THIS FILE DIRECTLY
3+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4+
# -*- encoding: utf-8 -*-
5+
6+
Gem::Specification.new do |s|
7+
s.name = %q{SgfParser}
8+
s.version = "0.8.0"
9+
10+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11+
s.authors = ["Aldric Giacomoni"]
12+
s.date = %q{2010-01-05}
13+
s.description = %q{SGFParser is a library that parses and saves SGF (Smart Game Format) files.}
14+
s.email = %q{[email protected]}
15+
s.extra_rdoc_files = [
16+
"LICENSE",
17+
"README.rdoc"
18+
]
19+
s.files = [
20+
".document",
21+
".gitignore",
22+
"LICENSE",
23+
"README.rdoc",
24+
"Rakefile",
25+
"SgfParser.gemspec",
26+
"VERSION",
27+
"lib/sgf/parser/node.rb",
28+
"lib/sgf/parser/properties.rb",
29+
"lib/sgf/parser/tree.rb",
30+
"lib/sgf/parser/tree_parse.rb",
31+
"lib/sgf/sgfindent.rb",
32+
"lib/sgf_parser.rb",
33+
"sample_sgf/ff4_ex.sgf",
34+
"sample_sgf/ff4_ex_saved.sgf",
35+
"sample_sgf/redrose-tartrate.sgf",
36+
"sample_usage/parsing_files.rb",
37+
"spec/node_spec.rb",
38+
"spec/spec.opts",
39+
"spec/spec_helper.rb",
40+
"spec/tree_spec.rb"
41+
]
42+
s.homepage = %q{http://github.com/Trevoke/SGFParser}
43+
s.rdoc_options = ["--charset=UTF-8"]
44+
s.require_paths = ["lib"]
45+
s.rubygems_version = %q{1.3.5}
46+
s.summary = %q{A library for working with SGF files.}
47+
s.test_files = [
48+
"spec/node_spec.rb",
49+
"spec/spec_helper.rb",
50+
"spec/tree_spec.rb"
51+
]
52+
53+
if s.respond_to? :specification_version then
54+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
55+
s.specification_version = 3
56+
57+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
58+
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
59+
else
60+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
61+
end
62+
else
63+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
64+
end
65+
end
66+

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.0
1+
0.8.0

features/basic.feature

-13
This file was deleted.

features/parse.feature

-12
This file was deleted.

features/samples/ff4_ex_saved.sgf

-64
This file was deleted.

features/save.feature

-8
This file was deleted.

0 commit comments

Comments
 (0)