Skip to content

Commit

Permalink
change how we generate gemspec for gem
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt committed May 17, 2010
1 parent 487d056 commit 0536798
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 30 deletions.
40 changes: 40 additions & 0 deletions lib/gemspec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env ruby
version = File.read(File.expand_path('../../VERSION', __FILE__)).strip
raise "Could not get version so gemspec can not be built" if version.nil?
files = %w( .gems .gitignore .yardopts Gemfile Rakefile readme.md license.md VERSION todo.md )
%w(app bin config db lib public script test themes vendor).each do |dir|
files += Dir.glob("#{dir}/**/*")
end

save = ARGV.delete('-s')

gemspec = <<EOF
Gem::Specification.new do |s|
s.name = %q{refinerycms}
s.version = %q{#{version}}
s.description = %q{A beautiful open source Ruby on Rails content manager for small business. Easy to extend, easy to use, lightweight and all wrapped up in a super slick UI.}
s.date = %q{#{Time.now.strftime('%Y-%m-%d')}}
s.summary = %q{A beautiful open source Ruby on Rails content manager for small business.}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.authors = %w(Resolve\ Digital David\ Jones Philip\ Arndt)
s.require_paths = %w(lib)
s.executables = %w(refinery refinery-override refinery-update-core)
s.files = [
'#{files.join("',\n\t\t'")}'
]
s.test_files = [
'#{Dir.glob("test/**/*.rb").join("',\n\t\t'")}'
]
end
EOF

if save
if File.exist?(file = "refinerycms.gemspec")
File.delete(file)
end
File.open(file, 'w') { |f| f.puts gemspec }
else
puts gemspec
end
30 changes: 0 additions & 30 deletions lib/refinery/tasks/refinery.rake
Original file line number Diff line number Diff line change
Expand Up @@ -50,34 +50,4 @@ namespace :test do
end
Rake::Task['test:refinery:benchmark'].comment = 'Benchmark the performance tests in Refinery'
end
end

# You don't need to worry about this unless you're releasing Refinery gems.
begin
require 'jeweler'
Jeweler::Tasks.new do |s|
s.name = %q{refinerycms}
s.description = %q{A beautiful open source Ruby on Rails content manager for small business. Easy to extend, easy to use, lightweight and all wrapped up in a super slick UI.}
s.summary = %q{A beautiful open source Ruby on Rails content manager for small business.}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.authors = ["Resolve Digital", "David Jones", "Philip Arndt"]
s.extra_rdoc_files = %w(readme.md contributors.md license.md VERSION)
s.rdoc_options << "--inline-source"
s.has_rdoc = true
end

namespace :version do
namespace :bump do
desc "Bump the application's version by a build version."
task :build => [:version_required, :version] do
version = Jeweler::VersionHelper.new(Rails.root.to_s)
version.update_to(version.major, version.minor, version.patch, ((version.build || 0).to_i + 1))
version.write
$stdout.puts "Updated version: #{version.to_s}"
end
end
end
rescue LoadError
#puts "Jeweler not available. Install it with: sudo gem install jeweler"
end

0 comments on commit 0536798

Please sign in to comment.