forked from refinery/refinerycms
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change how we generate gemspec for gem
- Loading branch information
Showing
2 changed files
with
40 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters