diff --git a/lib/prototype_project/version.rb b/lib/prototype_project/version.rb index 4149bf2..37c3757 100644 --- a/lib/prototype_project/version.rb +++ b/lib/prototype_project/version.rb @@ -1,27 +1,9 @@ module PrototypeProject module Version - class << self - def string - @string ||= File.read(File.dirname(__FILE__) + "/../../VERSION").chomp - end + MAJOR = 0 + MINOR = 0 + TINY = 0 - def major - version_parts[0] - end - - def minor - version_parts[1] - end - - def tiny - version_parts[2] - end - - private - - def version_parts - string.split(".").map { |part| part.to_i } - end - end + STRING = "#{MAJOR}.#{MINOR}.#{TINY}" end end diff --git a/spec/prototype_project/version_spec.rb b/spec/prototype_project/version_spec.rb index 327903b..cfb5796 100644 --- a/spec/prototype_project/version_spec.rb +++ b/spec/prototype_project/version_spec.rb @@ -3,19 +3,19 @@ describe PrototypeProject do describe "VERSION" do it "should be at 0.0.0" do - PrototypeProject::Version.string.should == "0.0.0" + PrototypeProject::Version::STRING.should == "0.0.0" end it "should have major as 0" do - PrototypeProject::Version.major.should == 0 + PrototypeProject::Version::MAJOR.should == 0 end it "should have minor as 0" do - PrototypeProject::Version.minor.should == 0 + PrototypeProject::Version::MINOR.should == 0 end it "should have tiny as 0" do - PrototypeProject::Version.tiny.should == 0 + PrototypeProject::Version::TINY.should == 0 end end end