lib/sgf.rb in SgfParser-2.0.0 vs lib/sgf.rb in SgfParser-3.0.0
- old
+ new
@@ -1,10 +1,19 @@
-$: << File.dirname(__FILE__)
+module SGF
+ class FileDoesNotExistError < StandardError ; end
+ def self.parse(filename)
+ SGF::Parser.new.parse File.read(filename)
+ rescue Errno::ENOENT
+ raise FileDoesNotExistError
+ end
-require 'sgf/error'
-require 'sgf/version'
-require 'sgf/properties'
-require 'sgf/node'
-require 'sgf/tree'
-require 'sgf/parser'
-require 'sgf/game'
-require 'sgf/writer'
\ No newline at end of file
+end
+
+require_relative 'sgf/error'
+require_relative 'sgf/version'
+require_relative 'sgf/properties'
+require_relative 'sgf/variation'
+require_relative 'sgf/node'
+require_relative 'sgf/collection'
+require_relative 'sgf/parser'
+require_relative 'sgf/gametree'
+require_relative 'sgf/writer'