Skip to content

Commit

Permalink
Use a single place to define the Gem Version
Browse files Browse the repository at this point in the history
  • Loading branch information
maurogeorge committed Mar 18, 2015
1 parent 4332366 commit 95c6bfd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion awesome_print.gemspec
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
require "rake"

require 'awesome_print/version'

This comment has been minimized.

Copy link
@alexch

alexch Mar 19, 2015

Collaborator

This line is causing CI to fail:

There was a LoadError while loading awesome_print.gemspec: 
cannot load such file -- awesome_print/version from
  /home/travis/build/michaeldv/awesome_print/awesome_print.gemspec:3:in `<main>'
Does it try to require a relative path? That's been removed in Ruby 1.9.

I approve of the idea, though; what's the right way to require_relative in a multi-version-compatible gem these days?

This comment has been minimized.

Copy link
@maurogeorge

maurogeorge Mar 19, 2015

Author Collaborator

Sorry for that, I will update soon.
I think we can do something like:

$:.push File.expand_path('../lib', __FILE__)
require 'awesome_print/version'

I get this from here. This gemspec was generated using the rails engine template.


Gem::Specification.new do |s|
s.name = "awesome_print"
s.version = "1.6.2"
s.version = AwesomePrint.version
# s.platform = Gem::Platform::RUBY
s.authors = "Michael Dvorkin"
s.date = Time.now.strftime("%Y-%m-%d")
Expand Down
2 changes: 1 addition & 1 deletion lib/awesome_print/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module AwesomePrint
def self.version
'1.6.2'
'2.0.0.beta'
end
end

0 comments on commit 95c6bfd

Please sign in to comment.