Skip to content

Commit

Permalink
move version off into a separate file for minimal inclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
ddollar committed Jan 10, 2011
1 parent 353508e commit 2e650f5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
2 changes: 0 additions & 2 deletions config.ru
Expand Up @@ -2,8 +2,6 @@ require 'rubygems'
require 'bundler/setup'
require 'extlib'

$:.unshift File.dirname(__FILE__) + '/lib'

require 'taps/config'
Taps::Config.taps_database_url = ENV['DATABASE_URL']
Taps::Config.login = ENV['TAPS_LOGIN']
Expand Down
15 changes: 1 addition & 14 deletions lib/taps/config.rb
@@ -1,24 +1,11 @@
require 'sequel'
require 'sqlite3'
require 'yaml'
require 'taps/version'

Sequel.datetime_class = DateTime

module Taps
def self.version_yml
@@version_yml ||= YAML.load(File.read(File.dirname(__FILE__) + '/../../VERSION.yml'))
end

def self.version
version = "#{version_yml[:major]}.#{version_yml[:minor]}.#{version_yml[:patch]}"
version += ".#{version_yml[:build]}" if version_yml[:build]
version
end

def self.compatible_version
"#{version_yml[:major]}.#{version_yml[:minor]}"
end

def self.exiting=(val)
@@exiting = val
end
Expand Down
16 changes: 16 additions & 0 deletions lib/taps/version.rb
@@ -0,0 +1,16 @@
module Taps
def self.version_yml
@@version_yml ||= YAML.load(File.read(File.dirname(__FILE__) + '/../../VERSION.yml'))
end

def self.version
version = "#{version_yml[:major]}.#{version_yml[:minor]}.#{version_yml[:patch]}"
version += ".#{version_yml[:build]}" if version_yml[:build]
version
end

def self.compatible_version
"#{version_yml[:major]}.#{version_yml[:minor]}"
end
end

2 changes: 1 addition & 1 deletion taps.gemspec
@@ -1,5 +1,5 @@
$:.unshift File.expand_path("../lib", __FILE__)
require "taps/cli"
require "taps/version"

Gem::Specification.new do |gem|
gem.name = "taps"
Expand Down

0 comments on commit 2e650f5

Please sign in to comment.