summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2011-12-15 17:02:17 +0900
committerRandy Morgan <[email protected]>2011-12-15 17:02:17 +0900
commit460e264aa954a141c622fcec2d4533a5b0f68ef3 (patch)
treebcea53dd526965109a42bd3500e79a9804f44041
parent8123745202afee56a46e82423e76ea44b50f53ae (diff)
downloadcaxlsx-460e264aa954a141c622fcec2d4533a5b0f68ef3.tar.gz
caxlsx-460e264aa954a141c622fcec2d4533a5b0f68ef3.zip
Added a check for the gemspec/rakefile included VERSION constant so bundler does not puke warnings.
-rw-r--r--axlsx.gemspec9
-rw-r--r--lib/axlsx/version.rb5
2 files changed, 5 insertions, 9 deletions
diff --git a/axlsx.gemspec b/axlsx.gemspec
index 622b6a0f..f8b0d464 100644
--- a/axlsx.gemspec
+++ b/axlsx.gemspec
@@ -1,13 +1,6 @@
# This will recursively require rake when using rake 0.9.2.2 and bundler
#require 'rake'
-
-begin
- require File.expand_path(File.dirname(__FILE__) + '/lib/axlsx/version.rb') unless Axlsx::VERSION
-rescue NameError=>e
- # As far as I can tell, when a consuming application points to github, bundler runs the Gemfile, which in turn
- # kicks this and then includes axlsx. As we are defining Axlsx::VERSION here, we see a
- # warning: already initialized constant VERSION
-end
+require File.expand_path(File.dirname(__FILE__) + '/lib/axlsx/version.rb')
Gem::Specification.new do |s|
s.name = 'axlsx'
diff --git a/lib/axlsx/version.rb b/lib/axlsx/version.rb
index 72bb6e99..7d217c22 100644
--- a/lib/axlsx/version.rb
+++ b/lib/axlsx/version.rb
@@ -1,4 +1,7 @@
module Axlsx
# version
- VERSION="1.0.14"
+ # When using bunle exec rake and referencing the gem on github or locally
+ # it will use the gemspec, which preloads this constant for the gem's version.
+ # We check to make sure that it has not already been loaded
+ VERSION="1.0.14" unless Axlsx.const_defined? :VERSION
end