jackdempsey-beet 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/beet.gemspec +6 -2
- data/bin/beet +3 -5
- data/lib/beet/executor.rb +34 -5
- data/lib/beet/gem_location_map.rb +64 -0
- data/lib/beet.rb +1 -0
- metadata +14 -4
data/Rakefile
CHANGED
@@ -9,6 +9,7 @@ begin
|
|
9
9
|
gem.email = "jack.dempsey@gmail.com"
|
10
10
|
gem.homepage = "http://github.com/jackdempsey/beet"
|
11
11
|
gem.authors = ["Jack Dempsey"]
|
12
|
+
gem.add_dependency "thor"
|
12
13
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
13
14
|
end
|
14
15
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/beet.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{beet}
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.5"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Jack Dempsey"]
|
9
|
-
s.date = %q{2009-05-
|
9
|
+
s.date = %q{2009-05-23}
|
10
10
|
s.default_executable = %q{beet}
|
11
11
|
s.email = %q{jack.dempsey@gmail.com}
|
12
12
|
s.executables = ["beet"]
|
@@ -27,6 +27,7 @@ Gem::Specification.new do |s|
|
|
27
27
|
"lib/beet/execution.rb",
|
28
28
|
"lib/beet/executor.rb",
|
29
29
|
"lib/beet/file_system.rb",
|
30
|
+
"lib/beet/gem_location_map.rb",
|
30
31
|
"lib/beet/interaction.rb",
|
31
32
|
"lib/beet/logger.rb",
|
32
33
|
"lib/beet/rails.rb",
|
@@ -56,8 +57,11 @@ Gem::Specification.new do |s|
|
|
56
57
|
s.specification_version = 3
|
57
58
|
|
58
59
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
60
|
+
s.add_runtime_dependency(%q<thor>, [">= 0"])
|
59
61
|
else
|
62
|
+
s.add_dependency(%q<thor>, [">= 0"])
|
60
63
|
end
|
61
64
|
else
|
65
|
+
s.add_dependency(%q<thor>, [">= 0"])
|
62
66
|
end
|
63
67
|
end
|
data/bin/beet
CHANGED
@@ -14,16 +14,14 @@ class BeetRunner < Thor
|
|
14
14
|
map "-v" => :version
|
15
15
|
|
16
16
|
desc 'generate [app_name]', "the main app generate method"
|
17
|
-
method_options :templates => :optional
|
17
|
+
method_options :templates => :optional, :gems => :optional
|
18
18
|
def generate(app_name, type=:rails)
|
19
19
|
case type
|
20
20
|
when :rails
|
21
21
|
puts "Generating rails project #{app_name}..."
|
22
22
|
system("rails #{app_name}")
|
23
|
-
|
24
|
-
|
25
|
-
executor.run_templates
|
26
|
-
end
|
23
|
+
executor = Beet::Executor.new(app_name, options)
|
24
|
+
executor.start
|
27
25
|
else
|
28
26
|
puts "type not recognized!"
|
29
27
|
end
|
data/lib/beet/executor.rb
CHANGED
@@ -12,20 +12,37 @@ module Beet
|
|
12
12
|
include Beet::SCM
|
13
13
|
|
14
14
|
attr_reader :root, :logger
|
15
|
-
attr_accessor :templates, :project_name
|
15
|
+
attr_accessor :templates, :project_name, :gems
|
16
16
|
|
17
|
-
def initialize(
|
17
|
+
def initialize(project_name, options) # :nodoc:
|
18
18
|
@root = File.expand_path(File.join(Dir.pwd, project_name))
|
19
19
|
@project_name = project_name
|
20
20
|
@logger = Beet::Logger.new
|
21
|
+
@gems = []
|
22
|
+
if options[:gems]
|
23
|
+
options[:gems].split(/[\s,]+/).each do |gem|
|
24
|
+
if location = gem_location(gem)
|
25
|
+
@gems << {:name => gem, :source => location}
|
26
|
+
else
|
27
|
+
puts "gem: #{gem} not found. Did you spell it correctly? If so, submit a patch with its location!"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
21
31
|
@templates = []
|
22
|
-
templates
|
23
|
-
|
24
|
-
|
32
|
+
if options[:templates]
|
33
|
+
options[:templates].split(/[\s,]+/).each do |template|
|
34
|
+
if file = template_location(template)
|
35
|
+
@templates << file
|
36
|
+
end
|
25
37
|
end
|
26
38
|
end
|
27
39
|
end
|
28
40
|
|
41
|
+
def start
|
42
|
+
run_templates
|
43
|
+
add_gems
|
44
|
+
end
|
45
|
+
|
29
46
|
def run_templates
|
30
47
|
@templates.each do |template|
|
31
48
|
begin
|
@@ -37,12 +54,24 @@ module Beet
|
|
37
54
|
end
|
38
55
|
end
|
39
56
|
|
57
|
+
def add_gems
|
58
|
+
if @gems
|
59
|
+
@gems.each do |gem_data|
|
60
|
+
gem(gem_data[:name], :source => gem_data[:source])
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
40
65
|
def log(*args)
|
41
66
|
logger.log(*args)
|
42
67
|
end
|
43
68
|
|
44
69
|
private
|
45
70
|
|
71
|
+
def gem_location(gem_name)
|
72
|
+
GEM_LOCATIONS[gem_name]
|
73
|
+
end
|
74
|
+
|
46
75
|
def template_location(template)
|
47
76
|
return template if File.exists?(template) or template.include?('http://')
|
48
77
|
locations = []
|
@@ -0,0 +1,64 @@
|
|
1
|
+
GEM_LOCATIONS = {
|
2
|
+
'restful-authentcation' => 'git://github.com/technoweenie/restful-authentication.git',
|
3
|
+
'authlogic' => 'git://github.com/binarylogic/authlogic.git',
|
4
|
+
'clearance' => 'git://github.com/thoughtbot/clearance.git',
|
5
|
+
'will_paginate' => 'git://github.com/mislav/will_paginate.git',
|
6
|
+
'paperclip' => 'git://github.com/thoughtbot/paperclip.git',
|
7
|
+
'attachment_fu' => 'git://github.com/technoweenie/attachment_fu.git',
|
8
|
+
'rspec' => 'git://github.com/dchelimsky/rspec.git',
|
9
|
+
'rspec-rails' => 'git://github.com/dchelimsky/rspec-rails.git',
|
10
|
+
'cucumber' => 'git://github.com/aslakhellesoy/cucumber.git',
|
11
|
+
'shoulda' => 'git://github.com/thoughtbot/shoulda.git',
|
12
|
+
'matchy' => 'git://github.com/jeremymcanally/matchy.git',
|
13
|
+
'context' => 'git://github.com/jeremymcanally/context.git',
|
14
|
+
'exception-notifier' => 'git://github.com/Lipsiasoft/exception-notifier.git',
|
15
|
+
'asset_packager' => 'git://github.com/sbecker/asset_packager.git',
|
16
|
+
'acts_as_list' => 'git://github.com/rails/acts_as_list.git',
|
17
|
+
'acts_as_tree' => 'git://github.com/rails/acts_as_tree.git',
|
18
|
+
'webrat' => 'git://github.com/brynary/webrat.git',
|
19
|
+
'rcov' => 'git://github.com/relevance/rcov.git',
|
20
|
+
'rcov_plugin' => 'git://github.com/commondream/rcov_plugin.git',
|
21
|
+
'flog' => 'git://github.com/seattlerb/flog.git',
|
22
|
+
'flay' => 'git://github.com/seattlerb/flay.git',
|
23
|
+
'hoe' => 'git://github.com/seattlerb/hoe.git',
|
24
|
+
'integrity' => 'git://github.com/integrity/integrity.git',
|
25
|
+
'active_merchant' => 'git://github.com/Shopify/active_merchant.git',
|
26
|
+
'spree' => 'git://github.com/railsdog/spree.git',
|
27
|
+
'exception_notification' => 'git://github.com/rails/exception_notification.git',
|
28
|
+
'hoptoad_notifier' => 'git://github.com/thoughtbot/hoptoad_notifier.git',
|
29
|
+
'exception_logger' => 'git://github.com/defunkt/exception_logger.git',
|
30
|
+
'jeweler' => 'git://github.com/technicalpickles/jeweler.git',
|
31
|
+
'newgem' => 'git://github.com/drnic/newgem.git',
|
32
|
+
'bones' => 'git://github.com/TwP/bones.git',
|
33
|
+
'echoe' => 'git://github.com/fauna/echoe.git',
|
34
|
+
'nokogiri' => 'git://github.com/tenderlove/nokogiri.git',
|
35
|
+
'hpricot' => 'git://github.com/why/hpricot.git',
|
36
|
+
'httparty' => 'git://github.com/jnunemaker/httparty.git',
|
37
|
+
'rest-client' => 'git://github.com/adamwiggins/rest-client.git',
|
38
|
+
'typoeus' => 'git://github.com/pauldix/typhoeus.git',
|
39
|
+
'redcloth' => 'git://github.com/jgarber/redcloth.git',
|
40
|
+
'rdiscount' => 'git://github.com/rtomayko/rdiscount.git',
|
41
|
+
'bluecloth' => 'git://github.com/mislav/bluecloth.git',
|
42
|
+
'rr' => 'git://github.com/btakita/rr.git',
|
43
|
+
'mocha' => 'git://github.com/floehopper/mocha.git',
|
44
|
+
'stump' => 'git://github.com/jeremymcanally/stump.git',
|
45
|
+
'active_scaffold' => 'git://github.com/activescaffold/active_scaffold.git',
|
46
|
+
'delayed_job' => 'git://github.com/tobi/delayed_job.git',
|
47
|
+
'starling' => 'git://github.com/starling/starling.git',
|
48
|
+
'amqp' => 'git://github.com/tmm1/amqp.git',
|
49
|
+
'negative-captcha' => 'git://github.com/subwindow/negative-captcha.git',
|
50
|
+
'factory_girl' => 'git://github.com/thoughtbot/factory_girl.git',
|
51
|
+
'machinist' => 'git://github.com/notahat/machinist.git',
|
52
|
+
'thinking-sphinx' => 'git://github.com/freelancing-god/thinking-sphinx.git',
|
53
|
+
'acts-as-taggable-on' => 'git://github.com/mbleigh/acts-as-taggable-on.git',
|
54
|
+
'is_taggable' => 'git://github.com/giraffesoft/is_taggable.git',
|
55
|
+
'forgery' => 'git://github.com/sevenwire/forgery.git',
|
56
|
+
'faker' => 'git://github.com/yyyc514/faker.git',
|
57
|
+
'whenever' => 'git://github.com/javan/whenever.git',
|
58
|
+
'aasm' => 'git://github.com/rubyist/aasm.git',
|
59
|
+
'workflow' => 'git://github.com/ryan-allen/workflow.git',
|
60
|
+
'chef' => 'git://github.com/opscode/chef.git',
|
61
|
+
'passenger' => 'git://github.com/FooBarWidget/passenger.git',
|
62
|
+
'thin' => 'git://github.com/macournoyer/thin.git',
|
63
|
+
'happymapper' => 'git://github.com/jnunemaker/happymapper.git',
|
64
|
+
}
|
data/lib/beet.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jackdempsey-beet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack Dempsey
|
@@ -9,10 +9,19 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-05-
|
12
|
+
date: 2009-05-23 00:00:00 -07:00
|
13
13
|
default_executable: beet
|
14
|
-
dependencies:
|
15
|
-
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: thor
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
16
25
|
description:
|
17
26
|
email: jack.dempsey@gmail.com
|
18
27
|
executables:
|
@@ -35,6 +44,7 @@ files:
|
|
35
44
|
- lib/beet/execution.rb
|
36
45
|
- lib/beet/executor.rb
|
37
46
|
- lib/beet/file_system.rb
|
47
|
+
- lib/beet/gem_location_map.rb
|
38
48
|
- lib/beet/interaction.rb
|
39
49
|
- lib/beet/logger.rb
|
40
50
|
- lib/beet/rails.rb
|