Skip to content

Commit

Permalink
Add Sequel.version for getting the internal version of Sequel
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyevans committed Jan 12, 2009
1 parent 0a294e6 commit f3fa745
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
7 changes: 6 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down Expand Up @@ -165,3 +166,7 @@ task :stats do
CodeStatistics.new(*STATS_DIRECTORIES).to_s
end

desc "Print Sequel version"
task :version do
puts VERS
end
2 changes: 1 addition & 1 deletion lib/sequel_core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 11 additions & 0 deletions lib/sequel_core/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Sequel
MAJOR = 2
MINOR = 9
TINY = 0

VERSION = [MAJOR, MINOR, TINY].join('.')

def self.version
VERSION
end
end
7 changes: 7 additions & 0 deletions spec/sequel_core/version_spec.rb
Original file line number Diff line number Diff line change
@@ -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.