Skip to content
Browse files

Add Sequel.version for getting the internal version of Sequel

  • Loading branch information...
1 parent 0a294e6 commit f3fa745e731541c26cc064ce14f007782476e72a @jeremyevans jeremyevans committed Jan 12, 2009
Showing with 29 additions and 2 deletions.
  1. +4 −0 CHANGELOG
  2. +6 −1 Rakefile
  3. +1 −1 lib/sequel_core.rb
  4. +11 −0 lib/sequel_core/version.rb
  5. +7 −0 spec/sequel_core/version_spec.rb
View
4 CHANGELOG
@@ -1,3 +1,7 @@
+=== HEAD
+
+* Add Sequel.version for getting the internal version of Sequel (pusewicz, jeremyevans)
+
=== 2.9.0 (2009-01-12)
* Add -L option to sequel command line tool to load all .rb files in the given directory (pkondzior, jeremyevans)
View
7 Rakefile
@@ -8,11 +8,12 @@ rescue LoadError
require "rake/rdoctask"
end
require "fileutils"
+require "lib/sequel_core/version"
include FileUtils
NAME = 'sequel'
-VERS = '2.9.0'
+VERS = Sequel.version
CLEAN.include ["**/.*.sw?", "pkg", ".config", "rdoc", "coverage", "www/public/*.html"]
RDOC_OPTS = ["--quiet", "--line-numbers", "--inline-source", '--title', \
'Sequel: The Database Toolkit for Ruby', '--main', 'README']
@@ -165,3 +166,7 @@ task :stats do
CodeStatistics.new(*STATS_DIRECTORIES).to_s
end
+desc "Print Sequel version"
+task :version do
+ puts VERS
+end
View
2 lib/sequel_core.rb
@@ -2,7 +2,7 @@
require f
end
%w"core_ext sql core_sql connection_pool exceptions pretty_table
- dataset migration schema database object_graph".each do |f|
+ dataset migration schema database object_graph version".each do |f|
require "sequel_core/#{f}"
end
View
11 lib/sequel_core/version.rb
@@ -0,0 +1,11 @@
+module Sequel
+ MAJOR = 2
+ MINOR = 9
+ TINY = 0
+
+ VERSION = [MAJOR, MINOR, TINY].join('.')
+
+ def self.version
+ VERSION
+ end
+end
View
7 spec/sequel_core/version_spec.rb
@@ -0,0 +1,7 @@
+require File.join(File.dirname(__FILE__), 'spec_helper')
+
+context "Sequel.version" do
+ specify "should be in the form X.Y.Z with all being numbers" do
+ Sequel.version.should =~ /\A\d+\.\d+\.\d+\z/
+ end
+end

0 comments on commit f3fa745

Please sign in to comment.
Something went wrong with that request. Please try again.