seedling 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +2 -2
- data/bin/seedling +9 -2
- data/lib/seedling/bin.rb +1 -1
- data/lib/seedling/project_creator.rb +1 -1
- data/lib/seedling/version.rb +1 -1
- data/lib/templates/core/.gems +5 -0
- data/lib/templates/core/.rvmrc.seed +2 -0
- data/lib/templates/core/Rakefile.seed +27 -19
- data/lib/templates/core/lib/library.rb.seed +45 -4
- data/lib/templates/core/options.rb.seed +15 -0
- data/lib/templates/core/tasks/authors.rake +2 -0
- data/lib/templates/core/tasks/bacon.rake +2 -1
- data/lib/templates/core/tasks/gem.rake +2 -2
- data/lib/templates/core/tasks/gem_setup.rake +112 -0
- data/lib/templates/core/tasks/metric_changes.rake +24 -0
- data/lib/templates/core/tasks/release.rake +5 -5
- data/lib/templates/core/tasks/setup.rake +12 -0
- data/lib/templates/core/tasks/todo.rake +27 -0
- data/lib/templates/ramaze/tasks/traits.rake +21 -0
- data/spec/bin.rb +7 -0
- data/tasks/gem.rake +2 -2
- metadata +14 -7
- data/lib/templates/core/tasks/gem_installer.rake +0 -76
- data/lib/templates/core/tasks/setup.rake.seed +0 -15
data/Rakefile
CHANGED
@@ -6,10 +6,10 @@ begin; require 'rubygems'; rescue LoadError; end
|
|
6
6
|
|
7
7
|
require 'rake'
|
8
8
|
require 'rake/clean'
|
9
|
-
require '
|
9
|
+
require 'rubygems/package_task'
|
10
10
|
require 'time'
|
11
11
|
require 'date'
|
12
|
-
require "lib/seedling"
|
12
|
+
require "./lib/seedling"
|
13
13
|
|
14
14
|
PROJECT_SPECS = FileList[
|
15
15
|
'spec/**/*.rb'
|
data/bin/seedling
CHANGED
@@ -1,15 +1,22 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "pathname"
|
4
|
+
|
2
5
|
begin
|
3
|
-
|
4
|
-
|
6
|
+
file = Pathname(__FILE__)
|
7
|
+
file = file.readlink if file.symlink?
|
8
|
+
local_seedling = file.join('../../lib/seedling.rb').expand_path
|
9
|
+
|
5
10
|
if local_seedling.file?
|
6
11
|
require local_seedling
|
7
12
|
else
|
8
13
|
require "seedling"
|
9
14
|
end
|
15
|
+
|
10
16
|
require "seedling/bin"
|
11
17
|
rescue LoadError
|
12
18
|
require "rubygems"
|
13
19
|
require "seedling/bin"
|
14
20
|
end
|
21
|
+
|
15
22
|
Seedling::Bin::Cmd.run(ARGV)
|
data/lib/seedling/bin.rb
CHANGED
@@ -157,7 +157,7 @@ module Seedling
|
|
157
157
|
raise "plant_defaults requires a :lib_name in the calling argument" unless o[:lib_name]
|
158
158
|
o[:lib_name_u] = o[:lib_name].underscore
|
159
159
|
[:author_name, :author_email].each do |opt|
|
160
|
-
o[opt]
|
160
|
+
o[opt] ||= self.send(opt)
|
161
161
|
end
|
162
162
|
o[:summary] ||= "The #{o[:lib_name].classify.titleize} library, by #{o[:author_name]}"
|
163
163
|
o[:description] ||= o[:summary]
|
data/lib/seedling/version.rb
CHANGED
@@ -2,13 +2,13 @@ begin; require 'rubygems'; rescue LoadError; end
|
|
2
2
|
|
3
3
|
require 'rake'
|
4
4
|
require 'rake/clean'
|
5
|
-
require '
|
5
|
+
require 'rubygems/package_task'
|
6
6
|
require 'time'
|
7
7
|
require 'date'
|
8
|
-
|
8
|
+
require_relative "./lib/<%= @options[:lib_name_u] %>"
|
9
9
|
|
10
10
|
PROJECT_SPECS = FileList[
|
11
|
-
'spec
|
11
|
+
'spec/*/**/*.rb'
|
12
12
|
]
|
13
13
|
|
14
14
|
PROJECT_MODULE = '<%= @options[:lib_name] %>'
|
@@ -40,30 +40,38 @@ PROJECT_COPYRIGHT = PROJECT_COPYRIGHT_SUMMARY + [
|
|
40
40
|
"# THE SOFTWARE."
|
41
41
|
]
|
42
42
|
|
43
|
+
<%= @options[:lib_name] %>_VERSION =
|
44
|
+
if version = ENV['PROJECT_VERSION'] || ENV['VERSION']
|
45
|
+
version
|
46
|
+
else
|
47
|
+
<%= @options[:lib_name] %>::VERSION rescue Date.today.strftime("%Y.%m.%d")
|
48
|
+
end
|
43
49
|
|
44
50
|
# To release the monthly version do:
|
45
|
-
# $
|
46
|
-
IGNORE_FILES = [/\.
|
51
|
+
# $ <%= @options[:lib_name] %>_VERSION=2009.03 rake release
|
52
|
+
IGNORE_FILES = [/\.git(?:ignore)?/]
|
53
|
+
|
54
|
+
PROJECT_FILES = `find . -type f`.split("\n").sort.reject { |f| IGNORE_FILES.detect { |exp| f.match(exp) } }
|
47
55
|
|
48
56
|
GEMSPEC = Gem::Specification.new{|s|
|
49
|
-
s.name =
|
50
|
-
s.author =
|
51
|
-
s.summary =
|
52
|
-
s.description =
|
53
|
-
s.email =
|
54
|
-
s.homepage =
|
57
|
+
s.name = <%= @options[:lib_name_u].to_s.dump %>
|
58
|
+
s.author = <%= @options[:author_name].to_s.dump %>
|
59
|
+
s.summary = <%= @options[:summary].to_s.dump %>
|
60
|
+
s.description = <%= (@options[:description] || @options[:summary]).to_s.dump %>
|
61
|
+
s.email = <%= @options[:author_email].to_s.dump %>
|
62
|
+
s.homepage = <%= @options[:project_url].to_s.dump %>
|
55
63
|
s.platform = Gem::Platform::RUBY
|
56
|
-
s.version =
|
57
|
-
s.files =
|
64
|
+
s.version = <%= @options[:lib_name] %>_VERSION
|
65
|
+
s.files = PROJECT_FILES
|
58
66
|
s.has_rdoc = true
|
59
|
-
s.require_path =
|
60
|
-
s.bindir
|
61
|
-
s.executables
|
67
|
+
s.require_path = "lib"
|
68
|
+
s.bindir = "bin"
|
69
|
+
s.executables = [<%= @options[:lib_name_u].to_s.dump %>]
|
62
70
|
<% if @options[:rubyforge_project] %>
|
63
|
-
s.rubyforge_project =
|
71
|
+
s.rubyforge_project = <%= @options[:rubyforge_project].to_s.dump %>
|
64
72
|
<% end %>
|
65
73
|
|
66
|
-
s.post_install_message = <<MESSAGE
|
74
|
+
s.post_install_message = <<MESSAGE
|
67
75
|
============================================================
|
68
76
|
|
69
77
|
Thank you for installing <%= @options[:lib_name] %>!
|
@@ -72,7 +80,7 @@ Thank you for installing <%= @options[:lib_name] %>!
|
|
72
80
|
MESSAGE
|
73
81
|
}
|
74
82
|
|
75
|
-
Dir
|
83
|
+
Dir.glob('tasks/*.rake'){|f| import(f) }
|
76
84
|
|
77
85
|
task :default => [:bacon]
|
78
86
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require "pathname"
|
2
|
-
|
2
|
+
require "logger"
|
3
3
|
|
4
4
|
# Allows for pathnames to be easily added to
|
5
5
|
class Pathname
|
@@ -9,8 +9,49 @@ class Pathname
|
|
9
9
|
end
|
10
10
|
|
11
11
|
# <%= @options[:summary] %>
|
12
|
+
# This sets all the globals and creates our main namespace
|
12
13
|
module <%= @options[:lib_name] %>
|
13
|
-
|
14
|
-
ROOT =
|
15
|
-
|
14
|
+
LIBROOT = Pathname(__FILE__).dirname.expand_path
|
15
|
+
ROOT = LIBROOT/".."
|
16
|
+
MIGRATION_ROOT = ROOT/:migrations
|
17
|
+
MODEL_ROOT = ROOT/:model
|
18
|
+
SPEC_HELPER_PATH = ROOT/:spec
|
19
|
+
autoload :VERSION, (LIBROOT/"<%= @options[:lib_name_u] %>/version").to_s
|
20
|
+
# Helper method to load models
|
21
|
+
# @model String The model you wish to load
|
22
|
+
def self.M(model)
|
23
|
+
require <%= @options[:lib_name] %>::MODEL_ROOT.join(model).to_s
|
24
|
+
end
|
25
|
+
|
26
|
+
# Helper method to load files from ROOT
|
27
|
+
# @file String The file you wish to load
|
28
|
+
def self.R(file)
|
29
|
+
require <%= @options[:lib_name] %>::ROOT.join(file).to_s
|
30
|
+
end
|
31
|
+
|
32
|
+
# Helper method to load files from lib/yrb
|
33
|
+
# @file String The file you wish to load
|
34
|
+
def self.L(file)
|
35
|
+
require (<%= @options[:lib_name] %>::LIBROOT/:<%= @options[:lib_name_u] %>).join(file).to_s
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.Run(*args)
|
39
|
+
require "open3"
|
40
|
+
Open3.popen3(*args) do |sin, sout, serr|
|
41
|
+
o = Thread.new do
|
42
|
+
sout.each_line { |l| puts l.chomp }
|
43
|
+
end
|
44
|
+
e = Thread.new do
|
45
|
+
serr.each_line { |l| $stderr.puts l.chomp }
|
46
|
+
end
|
47
|
+
sin.close
|
48
|
+
o.join
|
49
|
+
e.join
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
16
53
|
end
|
54
|
+
<%= @options[:lib_name] %>::R "options"
|
55
|
+
<%= @options[:lib_name] %>::Log = Logger.new(<%= @options[:lib_name] %>.options.logfile, 10, 10240000) unless <%= @options[:lib_name] %>.const_defined?("Log")
|
56
|
+
<%= @options[:lib_name] %>::Log.level = <%= @options[:lib_name] %>.options.log_level
|
57
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "innate"
|
2
|
+
|
3
|
+
module <%= @options[:lib_name] %>
|
4
|
+
include Innate::Optioned
|
5
|
+
|
6
|
+
options.dsl do
|
7
|
+
o "Database", :db, ENV["<%=options[:lib_name] %>_DB"] || "postgres://postgres@localhost/<%= @options[:lib_name_u] %>"
|
8
|
+
|
9
|
+
o "Logfile", :logfile, ENV["<%=options[:lib_name] %>_LOG"] || $stdout
|
10
|
+
|
11
|
+
o "Log Level", :log_level, ENV["<%=options[:lib_name] %>_LogLevel"] || Logger::INFO
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
@@ -17,6 +17,8 @@ task :authors do
|
|
17
17
|
name, email = "Kevin Berry", "kb@rubyists.com"
|
18
18
|
when /^(?:(?:jayson|thedonvaughn|jvaughn)$|Jayson Vaughn)/
|
19
19
|
name, email = "Jayson Vaughn", "jv@rubyists.com"
|
20
|
+
when /^(?:rubyists@rubyists.com)/
|
21
|
+
name, email = "The Rubyists, LLC", "rubyists@rubyists.com"
|
20
22
|
end
|
21
23
|
|
22
24
|
authors[[name, email]] += count.to_i
|
@@ -3,6 +3,7 @@ task :bacon => :install_dependencies do
|
|
3
3
|
require 'open3'
|
4
4
|
require 'scanf'
|
5
5
|
require 'matrix'
|
6
|
+
require 'fileutils'
|
6
7
|
|
7
8
|
specs = PROJECT_SPECS
|
8
9
|
|
@@ -23,7 +24,7 @@ task :bacon => :install_dependencies do
|
|
23
24
|
specs.each_with_index do |spec, idx|
|
24
25
|
print(left_format % [idx + 1, specs_size, spec])
|
25
26
|
|
26
|
-
Open3.popen3(RUBY, spec) do |sin, sout, serr|
|
27
|
+
Open3.popen3(FileUtils::RUBY, spec) do |sin, sout, serr|
|
27
28
|
out = sout.read.strip
|
28
29
|
err = serr.read.strip
|
29
30
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'rubygems/package_task'
|
2
2
|
|
3
3
|
desc "make a gemspec"
|
4
4
|
task :gemspec => [:manifest, :changelog, :authors] do
|
@@ -17,7 +17,7 @@ task :uninstall => [:clean] do
|
|
17
17
|
sh %{gem uninstall -x #{GEMSPEC.name}}
|
18
18
|
end
|
19
19
|
|
20
|
-
|
20
|
+
Gem::PackageTask.new(GEMSPEC) do |p|
|
21
21
|
p.need_tar = true
|
22
22
|
p.need_zip = true
|
23
23
|
end
|
@@ -0,0 +1,112 @@
|
|
1
|
+
task :gem_setup do
|
2
|
+
class GemSetup
|
3
|
+
def initialize(options = {}, &block)
|
4
|
+
@gems = []
|
5
|
+
@options = options.dup
|
6
|
+
@verbose = @options.delete(:verbose)
|
7
|
+
|
8
|
+
run(&block)
|
9
|
+
end
|
10
|
+
|
11
|
+
def run(&block)
|
12
|
+
return unless block_given?
|
13
|
+
instance_eval(&block)
|
14
|
+
setup
|
15
|
+
end
|
16
|
+
|
17
|
+
def gem(name, version = nil, options = {})
|
18
|
+
if version.respond_to?(:merge!)
|
19
|
+
options = version
|
20
|
+
else
|
21
|
+
options[:version] = version
|
22
|
+
end
|
23
|
+
|
24
|
+
@gems << [name, options]
|
25
|
+
end
|
26
|
+
|
27
|
+
# all gems defined, let's try to load/install them
|
28
|
+
def setup
|
29
|
+
require 'rubygems'
|
30
|
+
require 'rubygems/dependency_installer'
|
31
|
+
|
32
|
+
@gems.each do |name, options|
|
33
|
+
setup_gem(name, options)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def setup_gemspec(gemspec)
|
38
|
+
gemspec.dependencies.each do |dependency|
|
39
|
+
dependency.version_requirements.as_list.each do |version|
|
40
|
+
gem(dependency.name, version)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
setup
|
45
|
+
end
|
46
|
+
|
47
|
+
# First try to activate.
|
48
|
+
# If activation fails, try to install and activate again.
|
49
|
+
# If the second activation also fails, try to require as it may just as
|
50
|
+
# well be in $LOAD_PATH.
|
51
|
+
def setup_gem(name, options)
|
52
|
+
version = [options[:version]].compact
|
53
|
+
lib_name = options[:lib] || name
|
54
|
+
|
55
|
+
log "activating #{name}"
|
56
|
+
|
57
|
+
Gem.activate(name, *version)
|
58
|
+
rescue Gem::LoadError
|
59
|
+
log "activating #{name} failed, try to install"
|
60
|
+
|
61
|
+
install_gem(name, version, options)
|
62
|
+
end
|
63
|
+
|
64
|
+
# tell rubygems to install a gem
|
65
|
+
def install_gem(name, version, options)
|
66
|
+
installer = Gem::DependencyInstaller.new(options)
|
67
|
+
|
68
|
+
temp_argv(options[:extconf]) do
|
69
|
+
log "installing #{name}"
|
70
|
+
installer.install(name, *version)
|
71
|
+
end
|
72
|
+
|
73
|
+
Gem.activate(name, *version)
|
74
|
+
|
75
|
+
log "install and final activation successful"
|
76
|
+
rescue Gem::GemNotFoundException => ex
|
77
|
+
log "installation failed: #{ex}, use normal require"
|
78
|
+
|
79
|
+
require(options[:lib] || name)
|
80
|
+
|
81
|
+
log "require successful, cannot verify version though"
|
82
|
+
end
|
83
|
+
|
84
|
+
# prepare ARGV for rubygems installer
|
85
|
+
def temp_argv(extconf)
|
86
|
+
if extconf ||= @options[:extconf]
|
87
|
+
old_argv = ARGV.clone
|
88
|
+
ARGV.replace(extconf.split(' '))
|
89
|
+
end
|
90
|
+
|
91
|
+
yield
|
92
|
+
|
93
|
+
ensure
|
94
|
+
ARGV.replace(old_argv) if extconf
|
95
|
+
end
|
96
|
+
|
97
|
+
private
|
98
|
+
|
99
|
+
def log(msg)
|
100
|
+
return unless @verbose
|
101
|
+
|
102
|
+
if defined?(Log)
|
103
|
+
Log.info(msg)
|
104
|
+
else
|
105
|
+
puts(msg)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
def rubyforge; 'http://gems.rubyforge.org/' end
|
110
|
+
def github; 'http://gems.github.com/' end
|
111
|
+
end
|
112
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
namespace :metric do
|
2
|
+
desc 'committed changes per file according to git'
|
3
|
+
task 'changes' do
|
4
|
+
$stdout.sync = true
|
5
|
+
out = lambda{|changes, rb| puts("%4d %s" % [changes, rb]) }
|
6
|
+
changes = {}
|
7
|
+
|
8
|
+
print 'counting changes '
|
9
|
+
|
10
|
+
Dir['lib/**/*.rb'].each do |rb|
|
11
|
+
changes = `git-log --pretty=oneline '#{rb}'`.count("\n")
|
12
|
+
print '.'
|
13
|
+
# out[changes, rb]
|
14
|
+
changes[rb] = changes
|
15
|
+
end
|
16
|
+
puts ' done.'
|
17
|
+
|
18
|
+
sorted = changes.sort_by{|r,c| c }.reverse
|
19
|
+
puts "Top 20:"
|
20
|
+
sorted.first(20).each{|(r,c)| out[c,r] }
|
21
|
+
puts "Bottom 20:"
|
22
|
+
sorted.last(20).each{|(r,c)| out[c,r] }
|
23
|
+
end
|
24
|
+
end
|
@@ -23,28 +23,28 @@ INSTRUCTIONS
|
|
23
23
|
# TODO: Not tested
|
24
24
|
desc 'Display instructions to release on rubyforge'
|
25
25
|
task :rubyforge => [:reversion, :gemspec, :package] do
|
26
|
-
name, version = GEMSPEC.name, GEMSPEC.version
|
26
|
+
name, version = GEMSPEC.name, GEMSPEC.version.to_s
|
27
27
|
|
28
28
|
puts <<INSTRUCTIONS
|
29
29
|
To publish to rubyforge do following:
|
30
30
|
|
31
31
|
rubyforge login
|
32
|
-
rubyforge add_release #{name} #{name}
|
32
|
+
rubyforge add_release #{name} #{name} #{version.dump} pkg/#{name}-#{version}.gem
|
33
33
|
|
34
34
|
After you have done these steps, see:
|
35
35
|
|
36
|
-
rake release:rubyforge_archives
|
36
|
+
VERSION=#{version.dump} rake release:rubyforge_archives
|
37
37
|
|
38
38
|
INSTRUCTIONS
|
39
39
|
end
|
40
40
|
|
41
41
|
desc 'Display instructions to add archives after release:rubyforge'
|
42
42
|
task :rubyforge_archives do
|
43
|
-
name, version = GEMSPEC.name, GEMSPEC.version
|
43
|
+
name, version = GEMSPEC.name, GEMSPEC.version.to_s
|
44
44
|
puts "Adding archives for distro packagers is:", ""
|
45
45
|
|
46
46
|
Dir["pkg/#{name}-#{version}.{tgz,zip}"].each do |file|
|
47
|
-
puts "rubyforge add_file
|
47
|
+
puts "rubyforge add_file %s %s %p %p" % [name, name, version, file]
|
48
48
|
end
|
49
49
|
|
50
50
|
puts
|
@@ -0,0 +1,12 @@
|
|
1
|
+
desc 'install all possible dependencies'
|
2
|
+
task :setup => [:gem_setup] do
|
3
|
+
GemSetup.new :verbose => false do
|
4
|
+
DEPENDENCIES.each do |name, options|
|
5
|
+
gem(name, options)
|
6
|
+
end
|
7
|
+
|
8
|
+
DEVELOPMENT_DEPENDENCIES.each do |name, options|
|
9
|
+
gem(name, options)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
desc "show a todolist from all the TODO tags in the source"
|
2
|
+
task :todo do
|
3
|
+
Dir.glob('{lib,spec}/**/*.rb') do |file|
|
4
|
+
lastline = todo = comment = long_comment = false
|
5
|
+
|
6
|
+
File.readlines(file).each_with_index do |line, lineno|
|
7
|
+
lineno += 1
|
8
|
+
comment = line =~ /^\s*?#.*?$/
|
9
|
+
long_comment = line =~ /^=begin/
|
10
|
+
long_comment = line =~ /^=end/
|
11
|
+
todo = true if line =~ /TODO|FIXME|THINK/ and (long_comment or comment)
|
12
|
+
todo = false if line.gsub('#', '').strip.empty?
|
13
|
+
todo = false unless comment or long_comment
|
14
|
+
if todo
|
15
|
+
unless lastline and lastline + 1 == lineno
|
16
|
+
puts
|
17
|
+
puts "vim #{file} +#{lineno}"
|
18
|
+
end
|
19
|
+
|
20
|
+
l = line.strip.gsub(/^#\s*/, '')
|
21
|
+
print ' ' unless l =~ /^-/
|
22
|
+
puts l
|
23
|
+
lastline = lineno
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
desc 'listing of available traits per class/module'
|
2
|
+
task 'traits' do
|
3
|
+
nodes = Hash.new{|h,k| h[k] = []}
|
4
|
+
Dir['lib/**/*.rb'].each do |file|
|
5
|
+
content = File.read(file)
|
6
|
+
traits = content.grep(/^\s*trait\s*:/)
|
7
|
+
traits.each do |trait|
|
8
|
+
space = content[0..content.index(trait)].scan(/^\s*(?:class|module)\s+(.*)$/)
|
9
|
+
space = space.flatten.join('::')
|
10
|
+
nodes[space] << trait.strip
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
nodes.each do |space, traits|
|
15
|
+
puts space
|
16
|
+
traits.each do |trait|
|
17
|
+
print ' ', trait, "\n"
|
18
|
+
end
|
19
|
+
puts
|
20
|
+
end
|
21
|
+
end
|
data/spec/bin.rb
CHANGED
@@ -58,4 +58,11 @@ describe "Seedling Planted Tree" do
|
|
58
58
|
$?.should.equal 0
|
59
59
|
output.should.match /1 specifications \(1 requirements\), 0 failures, 0 errors/m
|
60
60
|
end
|
61
|
+
|
62
|
+
it "Should set email properly" do
|
63
|
+
Seedling::Bin::Cmd.run(["plant", "the_tree", "-q", "--email", "foo@bar.com"])
|
64
|
+
rakelines = (@tmpdir/:the_tree/"Rakefile").readlines
|
65
|
+
rakelines.detect { |l| l.match(/\s+s.email\s+=\s+"(.*)"/) }.should.not.be.nil
|
66
|
+
$~[1].should.equal "foo@bar.com"
|
67
|
+
end
|
61
68
|
end
|
data/tasks/gem.rake
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# Distributed under the terms of the MIT license.
|
3
3
|
# See the LICENSE file that accompanied this software for the full MIT License text
|
4
4
|
#
|
5
|
-
require '
|
5
|
+
require 'rubygems/package_task'
|
6
6
|
|
7
7
|
desc "make a gemspec"
|
8
8
|
task :gemspec => [:manifest, :changelog, :authors] do
|
@@ -21,7 +21,7 @@ task :uninstall => [:clean] do
|
|
21
21
|
sh %{gem uninstall -x #{GEMSPEC.name}}
|
22
22
|
end
|
23
23
|
|
24
|
-
|
24
|
+
Gem::PackageTask.new(GEMSPEC) do |p|
|
25
25
|
p.need_tar = true
|
26
26
|
p.need_zip = true
|
27
27
|
end
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seedling
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.6
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Kevin Berry
|
@@ -9,7 +10,7 @@ autorequire:
|
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
12
|
|
12
|
-
date:
|
13
|
+
date: 2014-02-27 00:00:00 -06:00
|
13
14
|
default_executable:
|
14
15
|
dependencies: []
|
15
16
|
|
@@ -35,24 +36,30 @@ files:
|
|
35
36
|
- lib/seedling/extensions/inflector.rb
|
36
37
|
- lib/seedling/project_creator.rb
|
37
38
|
- lib/seedling/version.rb
|
39
|
+
- lib/templates/core/.gems
|
40
|
+
- lib/templates/core/.rvmrc.seed
|
38
41
|
- lib/templates/core/README.seed
|
39
42
|
- lib/templates/core/Rakefile.seed
|
40
43
|
- lib/templates/core/lib/library.rb.seed
|
41
44
|
- lib/templates/core/lib/library/version.rb.seed
|
45
|
+
- lib/templates/core/options.rb.seed
|
42
46
|
- lib/templates/core/spec/helper.rb.seed
|
43
47
|
- lib/templates/core/tasks/authors.rake
|
44
48
|
- lib/templates/core/tasks/bacon.rake
|
45
49
|
- lib/templates/core/tasks/changelog.rake
|
46
50
|
- lib/templates/core/tasks/copyright.rake
|
47
51
|
- lib/templates/core/tasks/gem.rake
|
48
|
-
- lib/templates/core/tasks/
|
52
|
+
- lib/templates/core/tasks/gem_setup.rake
|
49
53
|
- lib/templates/core/tasks/install_dependencies.rake
|
50
54
|
- lib/templates/core/tasks/manifest.rake
|
55
|
+
- lib/templates/core/tasks/metric_changes.rake
|
51
56
|
- lib/templates/core/tasks/rcov.rake
|
52
57
|
- lib/templates/core/tasks/release.rake
|
53
58
|
- lib/templates/core/tasks/reversion.rake
|
54
|
-
- lib/templates/core/tasks/setup.rake
|
59
|
+
- lib/templates/core/tasks/setup.rake
|
60
|
+
- lib/templates/core/tasks/todo.rake
|
55
61
|
- lib/templates/core/tasks/yard.rake
|
62
|
+
- lib/templates/ramaze/tasks/traits.rake
|
56
63
|
- lib/templates/sequel-postgres/spec/db_helper.rb.seed
|
57
64
|
- lib/templates/sequel-postgres/tasks/schema.rake.seed
|
58
65
|
- lib/templates/sequel/tasks/migrate.rake.seed
|
@@ -90,21 +97,21 @@ rdoc_options: []
|
|
90
97
|
require_paths:
|
91
98
|
- lib
|
92
99
|
required_ruby_version: !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
93
101
|
requirements:
|
94
102
|
- - ">="
|
95
103
|
- !ruby/object:Gem::Version
|
96
104
|
version: "0"
|
97
|
-
version:
|
98
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
99
107
|
requirements:
|
100
108
|
- - ">="
|
101
109
|
- !ruby/object:Gem::Version
|
102
110
|
version: "0"
|
103
|
-
version:
|
104
111
|
requirements: []
|
105
112
|
|
106
113
|
rubyforge_project: seedling
|
107
|
-
rubygems_version: 1.
|
114
|
+
rubygems_version: 1.6.2
|
108
115
|
signing_key:
|
109
116
|
specification_version: 3
|
110
117
|
summary: A lightweight tool to create new ruby library trees, with helpers to make gemming and maintaining a breeze.
|
@@ -1,76 +0,0 @@
|
|
1
|
-
task :gem_installer do
|
2
|
-
class GemInstaller
|
3
|
-
def initialize(options = {}, &block)
|
4
|
-
@gems = []
|
5
|
-
@options = options
|
6
|
-
|
7
|
-
run(&block)
|
8
|
-
end
|
9
|
-
|
10
|
-
def run(&block)
|
11
|
-
instance_eval(&block) if block_given?
|
12
|
-
end
|
13
|
-
|
14
|
-
def gem(name, version = nil, options = {})
|
15
|
-
if version.respond_to?(:merge!)
|
16
|
-
options = version
|
17
|
-
else
|
18
|
-
options[:version] = version
|
19
|
-
end
|
20
|
-
|
21
|
-
@gems << [name, options]
|
22
|
-
end
|
23
|
-
|
24
|
-
def setup_gemspec(gemspec)
|
25
|
-
gemspec.dependencies.each do |dependency|
|
26
|
-
dependency.version_requirements.as_list.each do |version|
|
27
|
-
gem(dependency.name, version)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
setup
|
32
|
-
end
|
33
|
-
|
34
|
-
def setup
|
35
|
-
require 'rubygems'
|
36
|
-
require 'rubygems/dependency_installer'
|
37
|
-
|
38
|
-
@gems.each do |name, options|
|
39
|
-
setup_gem(name, options)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def setup_gem(name, options, try_install = true)
|
44
|
-
print "activating #{name} ... "
|
45
|
-
Gem.activate(name, *[options[:version]].compact)
|
46
|
-
require(options[:lib] || name)
|
47
|
-
puts "success."
|
48
|
-
rescue LoadError => error
|
49
|
-
puts error
|
50
|
-
install_gem(name, options) if try_install
|
51
|
-
setup_gem(name, options, try_install = false)
|
52
|
-
end
|
53
|
-
|
54
|
-
def install_gem(name, options)
|
55
|
-
installer = Gem::DependencyInstaller.new(options)
|
56
|
-
|
57
|
-
temp_argv(options[:extconf]) do
|
58
|
-
print "Installing #{name} ... "
|
59
|
-
installer.install(name, options[:version])
|
60
|
-
puts "done."
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
def temp_argv(extconf)
|
65
|
-
if extconf ||= @options[:extconf]
|
66
|
-
old_argv = ARGV.clone
|
67
|
-
ARGV.replace(extconf.split(' '))
|
68
|
-
end
|
69
|
-
|
70
|
-
yield
|
71
|
-
|
72
|
-
ensure
|
73
|
-
ARGV.replace(old_argv) if extconf
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|