diff options
author | Philip Arndt <parndt@gmail.com> | 2011-04-25 13:43:14 +1200 |
---|---|---|
committer | Philip Arndt <parndt@gmail.com> | 2011-04-25 13:43:14 +1200 |
commit | 1f72e3d90a1e8678de4a4b658b6675d2597d857c (patch) | |
tree | 8eeca6b19459d6adbedb40503ff2fed8c5468d91 /lib | |
parent | 5e69fdac1778ffb9f6a188e9b5cc2e56bd2febf8 (diff) | |
download | refinerycms-blog-1f72e3d90a1e8678de4a4b658b6675d2597d857c.tar.gz refinerycms-blog-1f72e3d90a1e8678de4a4b658b6675d2597d857c.tar.bz2 refinerycms-blog-1f72e3d90a1e8678de4a4b658b6675d2597d857c.zip |
Made version code more accessible and fixed up lib/gemspec.rb
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gemspec.rb | 8 | ||||
-rw-r--r-- | lib/refinery/blog/version.rb | 17 | ||||
-rw-r--r-- | lib/refinerycms-blog.rb | 13 |
3 files changed, 30 insertions, 8 deletions
diff --git a/lib/gemspec.rb b/lib/gemspec.rb index d112795..dfd4213 100644 --- a/lib/gemspec.rb +++ b/lib/gemspec.rb @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -require File.expand_path('../refinerycms-blog.rb', __FILE__) -version = ::Refinery::Blog.version +require File.expand_path('../refinery/blog/version', __FILE__) +version = ::Refinery::Blog::Version.to_s raise "Could not get version so gemspec can not be built" if version.nil? files = Dir.glob("**/*").flatten.reject do |file| file =~ /\.gem(spec)?$/ @@ -18,10 +18,14 @@ Gem::Specification.new do |s| s.authors = ['Resolve Digital', 'Neoteric Design'] s.require_paths = %w(lib) + # Runtime dependencies s.add_dependency 'refinerycms-core', '>= 0.9.9.1' s.add_dependency 'filters_spam', '~> 0.2' s.add_dependency 'acts-as-taggable-on' + # Development dependencies + s.add_development_dependency 'factory_girl' + s.files = %w( #{files.join("\n ")} ) diff --git a/lib/refinery/blog/version.rb b/lib/refinery/blog/version.rb new file mode 100644 index 0000000..6365f94 --- /dev/null +++ b/lib/refinery/blog/version.rb @@ -0,0 +1,17 @@ +module Refinery + module Blog + class Version + @major = 1 + @minor = 4 + @tiny = 0 + + class << self + attr_reader :major, :minor, :tiny + + def to_s + [@major, @minor, @tiny].compact.join('.') + end + end + end + end +end
\ No newline at end of file diff --git a/lib/refinerycms-blog.rb b/lib/refinerycms-blog.rb index 60c9bfa..312ee9b 100644 --- a/lib/refinerycms-blog.rb +++ b/lib/refinerycms-blog.rb @@ -3,6 +3,13 @@ require 'filters_spam' module Refinery module Blog + autoload :Version, File.expand_path('../refinery/blog/version', __FILE__) + class << self + def version + ::Refinery::Blog::Version.to_s + end + end + class Engine < Rails::Engine initializer 'blog serves assets' do |app| app.middleware.insert_after ::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public" @@ -35,11 +42,5 @@ module Refinery end end end if defined?(Rails::Engine) - - class << self - def version - %q{1.4} - end - end end end |