Skip to content
Browse files

defaults is the king

  • Loading branch information...
1 parent 691f8bb commit beef0ac51343ba1121f56cf07f65f60b31cf69a0 @godfat committed
Showing with 30 additions and 26 deletions.
  1. +1 −0 README
  2. +5 −23 Rakefile
  3. +3 −3 ripl-rc.gemspec
  4. +21 −0 task/gemgem.rb
View
1 README
View
28 Rakefile
@@ -6,32 +6,14 @@ Gemgem.dir = dir
desc 'Generate gemspec'
task 'gem:spec' do
- Gemgem.spec = Gem::Specification.new do |s|
+ Gemgem.spec = Gemgem.create do |s|
require 'ripl/rc/version'
-
- s.name = 'ripl-rc'
- s.version = Ripl::Rc::VERSION
-
- s.add_dependency('ripl')
- %w[bacon rr].each{ |g|
- s.add_development_dependency(g)
- }
-
- s.authors = ['Lin Jen-Shin (godfat)']
- s.email = ['godfat (XD) godfat.org']
- s.homepage = "http://github.com/godfat/#{s.name}"
- s.summary = File.read("#{Gemgem.dir}/README.md").
- match(/## DESCRIPTION:\n\n(.+)?\n\n## SYNOPSIS:/m)[1]
- s.description = s.summary
+ s.name = 'ripl-rc'
+ s.version = Ripl::Rc::VERSION
s.executables = [s.name]
- s.date = Time.now.strftime('%Y-%m-%d')
- s.rubygems_version = Gem::VERSION
- s.files = Gemgem.gem_files
- s.test_files = Gemgem.gem_files.grep(/test_.+?\.rb$/)
- s.extra_rdoc_files = %w[CHANGES LICENSE TODO]
- s.rdoc_options = %w[--main README.md]
- s.require_paths = %w[lib]
+ %w[ripl] .each{ |g| s.add_runtime_dependency(g) }
+ %w[bacon rr].each{ |g| s.add_development_dependency(g) }
end
Gemgem.write
View
6 ripl-rc.gemspec
@@ -6,14 +6,14 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Lin Jen-Shin (godfat)"]
- s.date = %q{2011-02-26}
+ s.date = %q{2011-02-27}
s.default_executable = %q{ripl-rc}
s.description = %q{ripl plugins collection, take you want, leave you don't.}
s.email = ["godfat (XD) godfat.org"]
s.executables = ["ripl-rc"]
s.extra_rdoc_files = ["CHANGES", "LICENSE", "TODO"]
- s.files = [".gitignore", "CHANGES", "Gemfile", "LICENSE", "README.md", "Rakefile", "TODO", "bin/ripl-rc", "lib/ripl/rc.rb", "lib/ripl/rc/anchor.rb", "lib/ripl/rc/color.rb", "lib/ripl/rc/ctrld_newline.rb", "lib/ripl/rc/eat_whites.rb", "lib/ripl/rc/mkdir_history.rb", "lib/ripl/rc/multiline.rb", "lib/ripl/rc/noirbrc.rb", "lib/ripl/rc/squeeze_history.rb", "lib/ripl/rc/strip_backtrace.rb", "lib/ripl/rc/version.rb", "ripl-rc.gemspec", "screenshot.png", "task/gemgem.rb", "test/test_squeeze_history.rb"]
- s.homepage = %q{http://github.com/godfat/ripl-rc}
+ s.files = [".gitignore", "CHANGES", "Gemfile", "LICENSE", "README", "README.md", "Rakefile", "TODO", "bin/ripl-rc", "lib/ripl/rc.rb", "lib/ripl/rc/anchor.rb", "lib/ripl/rc/color.rb", "lib/ripl/rc/ctrld_newline.rb", "lib/ripl/rc/eat_whites.rb", "lib/ripl/rc/mkdir_history.rb", "lib/ripl/rc/multiline.rb", "lib/ripl/rc/noirbrc.rb", "lib/ripl/rc/squeeze_history.rb", "lib/ripl/rc/strip_backtrace.rb", "lib/ripl/rc/version.rb", "ripl-rc.gemspec", "screenshot.png", "task/gemgem.rb", "test/test_squeeze_history.rb"]
+ s.homepage = %q{http://github.com/godfat/}
s.rdoc_options = ["--main", "README.md"]
s.require_paths = ["lib"]
s.rubygems_version = %q{1.5.2}
View
21 task/gemgem.rb
@@ -7,6 +7,27 @@ class << self
end
module_function
+ def create
+ yield(spec = Gem::Specification.new{ |s|
+ s.authors = ['Lin Jen-Shin (godfat)']
+ s.email = ['godfat (XD) godfat.org']
+ s.homepage = "http://github.com/godfat/#{s.name}"
+
+ s.summary = File.read("#{Gemgem.dir}/README").
+ match(/DESCRIPTION:\n\n(.+?)\n\n/m)[1]
+ s.description = s.summary
+
+ s.extra_rdoc_files = %w[CHANGES LICENSE TODO]
+ s.rdoc_options = %w[--main README.md]
+ s.rubygems_version = Gem::VERSION
+ s.date = Time.now.strftime('%Y-%m-%d')
+ s.files = gem_files
+ s.test_files = gem_files.grep(%r{^test/(.+?/)*test_.+?\.rb$})
+ s.require_paths = %w[lib]
+ })
+ spec
+ end
+
def gem_tag
"#{spec.name}-#{spec.version}"
end

0 comments on commit beef0ac

Please sign in to comment.
Something went wrong with that request. Please try again.