summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Rakefile2
-rw-r--r--highline.gemspec15
-rwxr-xr-xlib/highline.rb4
-rw-r--r--lib/highline/version.rb4
4 files changed, 12 insertions, 13 deletions
diff --git a/Rakefile b/Rakefile
index 92cd981..e7ee26e 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,6 +1,7 @@
require "rdoc/task"
require "rake/testtask"
require "rubygems/package_task"
+require "bundler/gem_tasks"
require "rubygems"
@@ -31,7 +32,6 @@ task :upload_docs => [:rdoc] do
"bbazzarrakk@rubyforge.org:/var/www/gforge-projects/highline/"
end
-load(File.join(File.dirname(__FILE__), "highline.gemspec"))
Gem::PackageTask.new(SPEC) do |package|
# do nothing: I just need a gem but this block is required
end
diff --git a/highline.gemspec b/highline.gemspec
index d330b51..b71e9b2 100644
--- a/highline.gemspec
+++ b/highline.gemspec
@@ -1,12 +1,9 @@
-DIR = File.dirname(__FILE__)
-LIB = File.join(DIR, *%w[lib highline.rb])
-GEM_VERSION = open(LIB) { |lib|
- lib.each { |line|
- if v = line[/^\s*VERSION\s*=\s*(['"])(\d+\.\d+\.\d+)\1/, 2]
- break v
- end
- }
-}
+# coding: utf-8
+lib = File.expand_path('../lib', __FILE__)
+$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
+require 'highline/version'
+
+GEM_VERSION = HighLine::VERSION
SPEC = Gem::Specification.new do |spec|
spec.name = "highline"
diff --git a/lib/highline.rb b/lib/highline.rb
index 161635c..eedd1a8 100755
--- a/lib/highline.rb
+++ b/lib/highline.rb
@@ -16,6 +16,7 @@ require "highline/question"
require "highline/menu"
require "highline/color_scheme"
require "highline/style"
+require "highline/version"
#
# A HighLine object is a "high-level line oriented" shell over an input and an
@@ -27,9 +28,6 @@ require "highline/style"
# checking, convert types, etc.
#
class HighLine
- # The version of the installed library.
- VERSION = "1.6.21".freeze
-
# An internal HighLine error. User code does not need to trap this.
class QuestionError < StandardError
# do nothing, just creating a unique error type
diff --git a/lib/highline/version.rb b/lib/highline/version.rb
new file mode 100644
index 0000000..64f31e2
--- /dev/null
+++ b/lib/highline/version.rb
@@ -0,0 +1,4 @@
+class HighLine
+ # The version of the installed library.
+ VERSION = "1.6.21".freeze
+end