yarg 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,14 @@
1
+ bin/yarg
2
+ lib/yarg/file_actions.rb
3
+ lib/yarg/rails.rb
4
+ lib/yarg/scm/git.rb
5
+ lib/yarg/scm.rb
6
+ lib/yarg.rb
7
+ Manifest
8
+ Rakefile
9
+ README.markdown
10
+ test/file_actions_test.rb
11
+ test/rails_test.rb
12
+ test/scm_test.rb
13
+ test/test_helper.rb
14
+ yarg.gemspec
@@ -0,0 +1,58 @@
1
+ # yarg: Yet Another Ruby Generator
2
+
3
+ Yarg is Yet Another Ruby Generator. It allows you to customize existing project
4
+ generators to fit your personality or common scaffolding. In other words, it
5
+ allows you to bootstrap new projects without the typical mundane setup.
6
+
7
+ **While I still have a fondness for the approach taken here, I've abandoned this project (for now). My original need for this project was mostly fulfilled when [Rails Templates](http://m.onkey.org/2008/12/4/rails-templates) were introduced in Rails 2.3. _When you can't beat 'em, join 'em._**
8
+
9
+ **Yarg is still in its infancy. It currently works for rails generation, but use it at your own risk.**
10
+
11
+ ## Usage
12
+
13
+ Install:
14
+
15
+ $ sudo gem install rmm5t-yarg --source http://gems.github.com
16
+
17
+ Configure by placing a <tt>~/.yarg</tt> file in your home directory. Here's a simple example
18
+
19
+ Yarg::Rails.new do |rg|
20
+ rg.scm :git
21
+ rg.delete "public/index.html"
22
+ rg.plugin "git://github.com/thoughtbot/shoulda.git"
23
+ end
24
+
25
+ Here's another example:
26
+
27
+ Yarg::Rails.new do |rg|
28
+ rg.scm :git, :using => :submodules
29
+ rg.template "~/.yarg.d/rails"
30
+ rg.delete "public/index.html"
31
+ rg.delete "public/dispatch.*"
32
+ rg.plugin "git://github.com/thoughtbot/shoulda.git"
33
+ rg.plugin "git://github.com/nex3/haml.git"
34
+ rg.plugin "git://github.com/rmm5t/strip_attributes.git"
35
+ rg.plugin "git://github.com/github/hubahuba.git"
36
+ rg.freeze :version => :edge
37
+ end
38
+
39
+ Afterwards, you should be able to launch a new Rails project easily:
40
+
41
+ $ yarg my_new_project
42
+
43
+ ## TODO
44
+
45
+ * Add better option parsing support in script (including a template name option)
46
+ * Add better handling of error conditions
47
+ * Add rails gem freezing support
48
+ * Add newgem support
49
+ * Add merb support
50
+ * Add webby support
51
+ * Add staticmatic support
52
+ * Add svn support (?)
53
+
54
+ ## Other
55
+
56
+ [MIT License](http://www.opensource.org/licenses/mit-license.php)
57
+
58
+ Copyright (c) 2008, Ryan McGeary (ryanonruby -[at]- mcgeary [*dot*] org)
@@ -0,0 +1,19 @@
1
+ require 'rake'
2
+ require 'rake/testtask'
3
+ require 'lib/yarg'
4
+
5
+ begin
6
+ require 'echoe'
7
+
8
+ Echoe.new('yarg', Yarg::VERSION) do |p|
9
+ # p.rubyforge_name = 'yarg'
10
+ p.summary = "Yet Another Ruby Generator"
11
+ p.description = "Yet Another Ruby Generator: Customize existing project generators to fit your personality."
12
+ p.url = "http://github.com/rmm5t/yarg"
13
+ p.author = ["Ryan McGeary"]
14
+ end
15
+
16
+ rescue LoadError => boom
17
+ puts "You are missing a dependency required for meta-operations on this gem."
18
+ puts "#{boom.to_s.capitalize}."
19
+ end
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'optparse'
4
+ require 'yarg'
5
+ require 'yarg/rails'
6
+
7
+ OptionParser.new do |opts|
8
+ opts.banner = "Usage: #{File.basename($0)} /path/to/your/project"
9
+
10
+ opts.on("-h", "--help", "Show this help info and quit") do
11
+ puts opts
12
+ exit 0
13
+ end
14
+
15
+ opts.on("-v", "--version", "Show the Yarg version number and quit") do
16
+ puts "Yarg #{Yarg::VERSION}"
17
+ exit 0
18
+ end
19
+
20
+ begin
21
+ opts.parse!(ARGV)
22
+ rescue OptionParser::ParseError => e
23
+ warn e.message
24
+ puts opts
25
+ exit 1
26
+ end
27
+ end
28
+
29
+ #TODO test if file exists
30
+ load "~/.yarg"
31
+
32
+ #TODO check ARGV size
33
+ ENV["PROJECT_NAME"] = ARGV[0]
34
+
35
+ #TODO allow for default or for named task
36
+ Rake::Task[:rails].invoke
@@ -0,0 +1,9 @@
1
+ require 'rake'
2
+ require 'rake/tasklib'
3
+ #require 'active_support'
4
+
5
+ module Yarg
6
+ VERSION = "0.1.3"
7
+
8
+ class Error < RuntimeError; end
9
+ end
@@ -0,0 +1,68 @@
1
+ require 'yarg/scm'
2
+
3
+ module Yarg
4
+ module FileActions
5
+ # List of paths to delete. (default is NONE)
6
+ attr_accessor :deletions
7
+
8
+ # List of source template paths to overwrite files in the destination
9
+ # project. (default is NONE)
10
+ attr_accessor :templates
11
+
12
+ # Source control management module to use (default is NONE)
13
+ attr_accessor :scm_module
14
+
15
+ def initialize_file_actions
16
+ self.deletions = []
17
+ self.templates = []
18
+ end
19
+
20
+ def delete(relative_path)
21
+ self.deletions << relative_path
22
+ end
23
+
24
+ def template(absolute_path)
25
+ self.templates << absolute_path
26
+ end
27
+
28
+ def scm(scm, options = {})
29
+ self.scm_module = Scm.new(scm, options)
30
+ end
31
+
32
+ private
33
+
34
+ def apply_file_actions
35
+ apply_deletions
36
+ apply_templates
37
+ apply_scm_init
38
+ end
39
+
40
+ def apply_deletions
41
+ self.deletions.each do |path|
42
+ File.delete(*Dir.glob(path))
43
+ end
44
+ end
45
+
46
+ def apply_templates
47
+ self.templates.each do |path|
48
+ everything_including_dotfiles = "{.[!.]*,*}"
49
+ sources = Dir.glob(File.join(File.expand_path(path), everything_including_dotfiles))
50
+ FileUtils.cp_r(sources, ".", :verbose => true)
51
+ end
52
+ end
53
+
54
+ def apply_scm_init
55
+ exec_commands(self.scm_module.init_commands) if self.scm_module
56
+ end
57
+
58
+ def apply_scm_commit
59
+ exec_commands(self.scm_module.commit_commands) if self.scm_module
60
+ end
61
+
62
+ def exec_commands(commands)
63
+ commands.each do |command|
64
+ sh(command)
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,86 @@
1
+ require 'yarg'
2
+ require 'yarg/file_actions'
3
+ require 'rake/tasklib'
4
+
5
+ module Yarg
6
+ # Create a task that customizes a Rails project generation bootstrap.
7
+ #
8
+ # Example (<tt>~/.yarg</tt>):
9
+ #
10
+ # Yarg::Rails.new do |rg|
11
+ # rg.template "~/.yarg.d/default"
12
+ # rg.delete "public/index.html"
13
+ # rg.delete "public/dispatch.*"
14
+ # rg.plugin "git://github.com/thoughtbot/shoulda.git"
15
+ # rg.plugin "git://github.com/nex3/haml.git"
16
+ # rg.freeze :version => :edge
17
+ # end
18
+ class Rails < Rake::TaskLib
19
+ include Yarg::FileActions
20
+
21
+ # Name of rails generator task. (default is :rails)
22
+ attr_accessor :name
23
+
24
+ # List of plugins to install. (default is NONE)
25
+ attr_accessor :plugins
26
+
27
+ # True if freezing rails under vendor/rails is desired. (default is false)
28
+ attr_accessor :frozen
29
+
30
+ # Version to freeze rails if frozen is true. (default is :gems)
31
+ attr_accessor :freeze_version
32
+
33
+ def initialize(name = :rails)
34
+ self.name = name
35
+ self.plugins = []
36
+ self.frozen = false
37
+ initialize_file_actions
38
+ yield self if block_given?
39
+ define
40
+ end
41
+
42
+ def plugin(repository)
43
+ self.plugins << repository
44
+ end
45
+
46
+ def freeze(options = {})
47
+ self.frozen = true
48
+ self.freeze_version = options[:version] || :gems
49
+ end
50
+
51
+ private
52
+
53
+ def define
54
+ task self.name do
55
+ app_name = ENV["PROJECT_NAME"]
56
+ sh("rails #{app_name}")
57
+ Dir.chdir(app_name)
58
+ apply_file_actions
59
+ apply_plugins
60
+ apply_freeze
61
+ apply_scm_commit
62
+ end
63
+ self
64
+ end
65
+
66
+ def apply_plugins
67
+ plugins.each do |plugin|
68
+ if scm_module && scm_module.using
69
+ plugin_name = File.basename(plugin, ".*")
70
+ exec_commands(scm_module.install_commands(plugin, "vendor/plugins/#{plugin_name}"))
71
+ else
72
+ sh("./script/plugin install #{plugin}")
73
+ end
74
+ end
75
+ end
76
+
77
+ def apply_freeze
78
+ return unless frozen
79
+ if scm_module && scm_module.using
80
+ exec_commands(scm_module.install_commands("git://github.com/rails/rails.git", "vendor/rails"))
81
+ elsif [:gems, :edge].include?(freeze_version.to_sym)
82
+ sh("rake rails:freeze:#{freeze_version}")
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,48 @@
1
+ module Yarg
2
+ module Scm
3
+ class Base
4
+ attr_accessor :using
5
+
6
+ def initialize(options = {})
7
+ self.using = options[:using]
8
+ end
9
+
10
+ def init_commands
11
+ []
12
+ end
13
+
14
+ def commit_commands
15
+ []
16
+ end
17
+
18
+ def install(repository, destination)
19
+ raise NotImplementedError, "install is not implemented by #{self.class.name}"
20
+ end
21
+ end
22
+
23
+ def self.new(scm, options = {})
24
+ scm_const = scm.to_s.capitalize.gsub(/_(.)/) { $1.upcase }
25
+ load_scm(scm) unless const_defined?(scm_const)
26
+ initialize_scm(scm_const, options)
27
+ end
28
+
29
+ private
30
+
31
+ def self.load_scm(scm)
32
+ scm_path = "yarg/scm/#{scm}"
33
+ begin
34
+ require(scm_path)
35
+ rescue LoadError
36
+ raise Yarg::Error, "could not find an SCM at #{scm_path}"
37
+ end
38
+ end
39
+
40
+ def self.initialize_scm(scm_const, options)
41
+ if const_defined?(scm_const)
42
+ const_get(scm_const).new(options)
43
+ else
44
+ raise Yarg::Error, "could not find #{name}::#{scm_const}"
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,21 @@
1
+ module Yarg
2
+ module Scm
3
+ class Git < Base
4
+ def initialize(options = {})
5
+ super
6
+ end
7
+
8
+ def init_commands
9
+ ["git init"]
10
+ end
11
+
12
+ def commit_commands
13
+ ["git add .", "git commit -m 'Initial commit. Yarg!'"]
14
+ end
15
+
16
+ def install_commands(repository, destination)
17
+ ["git submodule add #{repository} #{destination}"]
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,102 @@
1
+ require 'test_helper'
2
+ require 'yarg/file_actions'
3
+ require 'yarg/scm/git'
4
+
5
+ class FakeGen < Rake::TaskLib
6
+ include Yarg::FileActions
7
+
8
+ def initialize(name = :fake)
9
+ @name = name
10
+ initialize_file_actions
11
+ yield self if block_given?
12
+ define
13
+ end
14
+
15
+ private
16
+
17
+ def define
18
+ task @name do
19
+ project_name = ENV["PROJECT_NAME"]
20
+ Dir.mkdir(project_name)
21
+ Dir.chdir(project_name)
22
+ apply_file_actions
23
+ apply_scm_commit
24
+ end
25
+ self
26
+ end
27
+ end
28
+
29
+ class FileActionsTest < Test::Unit::TestCase
30
+ def setup
31
+ Rake::Task.clear
32
+ end
33
+
34
+ context "An empty Fake generator" do
35
+ setup do
36
+ @generator = FakeGen.new do |rg| end
37
+ stub_fake_system_calls("my_app")
38
+ end
39
+
40
+ should_define_task :fake
41
+ should_have_generator_attribute_of :scm_module, nil
42
+
43
+ context "once invoked" do
44
+ setup do
45
+ Rake::Task[:fake].invoke
46
+ end
47
+
48
+ should_cd_into "my_app"
49
+ should_not_delete_any_files
50
+ should_not_invoke %r{^git}
51
+ should_not_invoke %r{^svn}
52
+ end
53
+ end
54
+
55
+ context "An Fake generator using GIT" do
56
+ setup do
57
+ @generator = FakeGen.new do |rg|
58
+ rg.scm :git
59
+ end
60
+ stub_fake_system_calls("my_app")
61
+ end
62
+
63
+ should_define_task :fake
64
+ should_have_generator_attribute_of :scm_module, Yarg::Scm::Git
65
+
66
+ context "once invoked" do
67
+ setup do
68
+ Rake::Task[:fake].invoke
69
+ end
70
+
71
+ should_cd_into "my_app"
72
+ should_not_delete_any_files
73
+ should_invoke %r{^git init}
74
+ should_invoke %r{^git add}
75
+ should_invoke %r{^git commit}
76
+ end
77
+ end
78
+
79
+ context "A Fake generator with a template" do
80
+ setup do
81
+ @generator = FakeGen.new do |rg|
82
+ rg.template "/tmp/.yarg.d/rails"
83
+ end
84
+ stub_fake_system_calls("my_app")
85
+ end
86
+
87
+ should_have_generator_attribute_of :templates, %w(/tmp/.yarg.d/rails)
88
+
89
+ context "once invoked" do
90
+ setup do
91
+ Rake::Task[:fake].invoke
92
+ end
93
+
94
+ should_cd_into "my_app"
95
+ should_not_delete_any_files
96
+
97
+ before_should "copy template files from" do
98
+ FileUtils.expects(:cp_r).with(["/tmp/.yarg.d/rails"], ".", :verbose => true)
99
+ end
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,131 @@
1
+ require 'test_helper'
2
+ require 'yarg/rails'
3
+
4
+ class RailsTest < Test::Unit::TestCase
5
+ def setup
6
+ Rake::Task.clear
7
+ end
8
+
9
+ context "A missing Rails generator" do
10
+ should_not_define_task :rails
11
+ end
12
+
13
+ context "An empty default Rails generator" do
14
+ setup do
15
+ @generator = Yarg::Rails.new do |rg| end
16
+ stub_fake_system_calls("my_app")
17
+ end
18
+
19
+ should_define_task :rails
20
+ should_have_generator_attribute_of :name, :rails
21
+ should_have_generator_attribute_of :deletions, []
22
+ should_have_generator_attribute_of :plugins, []
23
+ should_have_generator_attribute_of :templates, []
24
+ should_have_generator_attribute_of :frozen, false
25
+ should_have_generator_attribute_of :freeze_version, nil
26
+
27
+ context "once invoked" do
28
+ setup do
29
+ Rake::Task[:rails].invoke
30
+ end
31
+
32
+ should_run_rails_command_for_app "my_app"
33
+ should_cd_into "my_app"
34
+ should_not_delete_any_files
35
+ should_not_invoke %r{^\./script/plugin install}
36
+ should_not_invoke %r{^rake rails:freeze}
37
+ should_eventually "not overwrite with any templates"
38
+ end
39
+ end
40
+
41
+ context "A Rails generator with multiple options set" do
42
+ setup do
43
+ @generator = Yarg::Rails.new(:template) do |rg|
44
+ rg.scm :git, :using => :submodules
45
+ rg.delete "public/index.html"
46
+ rg.delete "public/dispatch.*"
47
+ rg.plugin "git://github.com/thoughtbot/shoulda.git"
48
+ rg.plugin "git://github.com/nex3/haml.git"
49
+ rg.template "/tmp/.yarg.d/rails"
50
+ rg.freeze :version => :edge
51
+ end
52
+ stub_fake_system_calls("my_rails_project")
53
+ end
54
+
55
+ should_define_task :template
56
+ should_have_generator_attribute_of :name, :template
57
+ should_have_generator_attribute_of :scm_module, Yarg::Scm::Git
58
+ should_have_generator_attribute_of :deletions, %w(public/index.html public/dispatch.*)
59
+ should_have_generator_attribute_of :plugins, %w(git://github.com/thoughtbot/shoulda.git git://github.com/nex3/haml.git)
60
+ should_have_generator_attribute_of :templates, %w(/tmp/.yarg.d/rails)
61
+ should_have_generator_attribute_of :frozen, true
62
+ should_have_generator_attribute_of :freeze_version, :edge
63
+
64
+ context "once invoked" do
65
+ setup do
66
+ Rake::Task[:template].invoke
67
+ end
68
+
69
+ should_run_rails_command_for_app "my_rails_project"
70
+ should_cd_into "my_rails_project"
71
+ should_delete "public/index.html"
72
+ should_delete "public/dispatch.cgi", "public/dispatch.fcgi", "public/dispatch.rb"
73
+ should_invoke "git submodule add git://github.com/thoughtbot/shoulda.git vendor/plugins/shoulda"
74
+ should_invoke "git submodule add git://github.com/nex3/haml.git vendor/plugins/haml"
75
+ should_invoke "git submodule add git://github.com/rails/rails.git vendor/rails"
76
+ should_invoke %r{^git init}
77
+ should_invoke %r{^git add}
78
+ should_invoke %r{^git commit}
79
+ should_eventually "overwrite with the template"
80
+ end
81
+ end
82
+
83
+ context "A Rails generator with a default freeze" do
84
+ setup do
85
+ @generator = Yarg::Rails.new do |rg|
86
+ rg.freeze
87
+ end
88
+ stub_fake_system_calls("my_app")
89
+ end
90
+
91
+ should_have_generator_attribute_of :frozen, true
92
+ should_have_generator_attribute_of :freeze_version, :gems
93
+
94
+ context "once invoked" do
95
+ setup do
96
+ Rake::Task[:rails].invoke
97
+ end
98
+
99
+ should_run_rails_command_for_app "my_app"
100
+ should_cd_into "my_app"
101
+ should_not_invoke %r{^\./script/plugin install}
102
+ should_invoke "rake rails:freeze:gems"
103
+ should_eventually "not overwrite with any templates"
104
+ end
105
+ end
106
+
107
+ context "A Rails generator with a default scm" do
108
+ setup do
109
+ @generator = Yarg::Rails.new do |rg|
110
+ rg.scm :git
111
+ rg.plugin "git://github.com/nex3/haml.git"
112
+ rg.freeze :version => :edge
113
+ end
114
+ stub_fake_system_calls("my_app")
115
+ end
116
+
117
+ should_have_generator_attribute_of :scm_module, Yarg::Scm::Git
118
+
119
+ context "once invoked" do
120
+ setup do
121
+ Rake::Task[:rails].invoke
122
+ end
123
+
124
+ should_invoke "./script/plugin install git://github.com/nex3/haml.git"
125
+ should_invoke "rake rails:freeze:edge"
126
+ should_invoke %r{^git init}
127
+ should_invoke %r{^git add}
128
+ should_invoke %r{^git commit}
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,64 @@
1
+ require 'test_helper'
2
+ require 'yarg/scm'
3
+ require 'yarg/scm/git'
4
+
5
+ class Yarg::Scm::Custom < Yarg::Scm::Base
6
+ def initialize(options = {})
7
+ end
8
+ end
9
+
10
+ class ScmTest < Test::Unit::TestCase
11
+ def setup
12
+ Rake::Task.clear
13
+ end
14
+
15
+ context "Creating a new git SCM" do
16
+ setup do
17
+ @scm = Yarg::Scm.new(:git)
18
+ end
19
+
20
+ should_change "@scm", :to => Yarg::Scm::Git
21
+
22
+ should "return git init commands" do
23
+ assert_equal ["git init"], @scm.init_commands
24
+ end
25
+
26
+ should "return git commit commands" do
27
+ assert_equal ["git add .", "git commit -m 'Initial commit. Yarg!'"], @scm.commit_commands
28
+ end
29
+
30
+ should "return git install commands" do
31
+ assert_equal ["git submodule add git://example.com/foo.git vendor/plugins/foo"], @scm.install_commands("git://example.com/foo.git", "vendor/plugins/foo")
32
+ end
33
+ end
34
+
35
+ context "Creating a new custom SCM" do
36
+ setup do
37
+ @scm = Yarg::Scm.new(:custom)
38
+ end
39
+
40
+ should_change "@scm", :to => Yarg::Scm::Custom
41
+
42
+ should "return empty init commands" do
43
+ assert @scm.init_commands.empty?
44
+ end
45
+
46
+ should "return empty commit commands" do
47
+ assert @scm.commit_commands.empty?
48
+ end
49
+
50
+ should "raise error on install request" do
51
+ assert_raise NotImplementedError do
52
+ @scm.install(:a, :b)
53
+ end
54
+ end
55
+ end
56
+
57
+ context "Creating a new unknown SCM" do
58
+ should "fail" do
59
+ assert_raise Yarg::Error do
60
+ @scm = Yarg::Scm.new(:unknown)
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,85 @@
1
+ require 'test/unit'
2
+ require 'rubygems'
3
+ require 'shoulda'
4
+ require 'mocha'
5
+ begin require 'redgreen' unless ENV['TM_FILENAME']; rescue LoadError; end
6
+ require 'yarg'
7
+
8
+ module ShouldaHelper
9
+ module Macros
10
+ def should_define_task(task)
11
+ should "define the task #{task.inspect}" do
12
+ assert Rake::Task.task_defined?(task)
13
+ end
14
+ end
15
+
16
+ def should_not_define_task(task)
17
+ should "not define the task #{task.inspect}" do
18
+ assert !Rake::Task.task_defined?(task)
19
+ end
20
+ end
21
+
22
+ def should_cd_into(directory)
23
+ before_should "chdir into #{directory}" do
24
+ Dir.expects(:chdir).with(directory)
25
+ end
26
+ end
27
+
28
+ def should_have_generator_attribute_of(attribute, expected)
29
+ should "have attribute of #{attribute.inspect} matching #{expected.inspect}" do
30
+ assert_operator expected, :===, @generator.send(attribute)
31
+ end
32
+ end
33
+
34
+ def should_run_rails_command_for_app(app_name)
35
+ before_should "execute rails system call for #{app_name}" do
36
+ @generator.expects(:sh).with("rails #{app_name}")
37
+ end
38
+ end
39
+
40
+ def should_delete(*files)
41
+ before_should "delete #{files.inspect}" do
42
+ File.expects(:delete).with(*files)
43
+ end
44
+ end
45
+
46
+ def should_not_delete_any_files
47
+ before_should "not delete any files" do
48
+ File.expects(:delete).never
49
+ end
50
+ end
51
+
52
+ def should_invoke(matching_command)
53
+ before_should "invoke #{matching_command.inspect}" do
54
+ @generator.expects(:sh).with { |value|
55
+ matching_command === value
56
+ }
57
+ end
58
+ end
59
+
60
+ def should_not_invoke(matching_command)
61
+ before_should "not invoke #{matching_command.inspect}" do
62
+ @generator.expects(:sh).with { |value|
63
+ matching_command === value
64
+ }.never
65
+ end
66
+ end
67
+ end
68
+ end
69
+
70
+ class Test::Unit::TestCase
71
+ extend ShouldaHelper::Macros
72
+
73
+ def stub_fake_system_calls(project_name)
74
+ ENV["PROJECT_NAME"] = project_name
75
+ @generator.stubs(:sh)
76
+ Dir.stubs(:mkdir)
77
+ Dir.stubs(:chdir)
78
+ Dir.stubs(:glob)
79
+ Dir.stubs(:glob).with("public/index.html").returns(%w(public/index.html))
80
+ Dir.stubs(:glob).with("public/dispatch.*").returns(%w(public/dispatch.cgi public/dispatch.fcgi public/dispatch.rb))
81
+ Dir.stubs(:glob).with("/tmp/.yarg.d/rails/{.[!.]*,*}").returns(["/tmp/.yarg.d/rails"])
82
+ File.stubs(:delete)
83
+ FileUtils.stubs(:cp_r)
84
+ end
85
+ end
@@ -0,0 +1,33 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{yarg}
5
+ s.version = "0.1.3"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Ryan McGeary"]
9
+ s.date = %q{2009-09-26}
10
+ s.default_executable = %q{yarg}
11
+ s.description = %q{Yet Another Ruby Generator: Customize existing project generators to fit your personality.}
12
+ s.email = %q{}
13
+ s.executables = ["yarg"]
14
+ s.extra_rdoc_files = ["bin/yarg", "lib/yarg/file_actions.rb", "lib/yarg/rails.rb", "lib/yarg/scm/git.rb", "lib/yarg/scm.rb", "lib/yarg.rb", "README.markdown"]
15
+ s.files = ["bin/yarg", "lib/yarg/file_actions.rb", "lib/yarg/rails.rb", "lib/yarg/scm/git.rb", "lib/yarg/scm.rb", "lib/yarg.rb", "Manifest", "Rakefile", "README.markdown", "test/file_actions_test.rb", "test/rails_test.rb", "test/scm_test.rb", "test/test_helper.rb", "yarg.gemspec"]
16
+ s.homepage = %q{http://github.com/rmm5t/yarg}
17
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Yarg", "--main", "README.markdown"]
18
+ s.require_paths = ["lib"]
19
+ s.rubyforge_project = %q{yarg}
20
+ s.rubygems_version = %q{1.3.5}
21
+ s.summary = %q{Yet Another Ruby Generator}
22
+ s.test_files = ["test/file_actions_test.rb", "test/rails_test.rb", "test/scm_test.rb", "test/test_helper.rb"]
23
+
24
+ if s.respond_to? :specification_version then
25
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
26
+ s.specification_version = 3
27
+
28
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
29
+ else
30
+ end
31
+ else
32
+ end
33
+ end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: yarg
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.3
5
+ platform: ruby
6
+ authors:
7
+ - Ryan McGeary
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-09-26 00:00:00 -04:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: "Yet Another Ruby Generator: Customize existing project generators to fit your personality."
17
+ email: ""
18
+ executables:
19
+ - yarg
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - bin/yarg
24
+ - lib/yarg/file_actions.rb
25
+ - lib/yarg/rails.rb
26
+ - lib/yarg/scm/git.rb
27
+ - lib/yarg/scm.rb
28
+ - lib/yarg.rb
29
+ - README.markdown
30
+ files:
31
+ - bin/yarg
32
+ - lib/yarg/file_actions.rb
33
+ - lib/yarg/rails.rb
34
+ - lib/yarg/scm/git.rb
35
+ - lib/yarg/scm.rb
36
+ - lib/yarg.rb
37
+ - Manifest
38
+ - Rakefile
39
+ - README.markdown
40
+ - test/file_actions_test.rb
41
+ - test/rails_test.rb
42
+ - test/scm_test.rb
43
+ - test/test_helper.rb
44
+ - yarg.gemspec
45
+ has_rdoc: true
46
+ homepage: http://github.com/rmm5t/yarg
47
+ licenses: []
48
+
49
+ post_install_message:
50
+ rdoc_options:
51
+ - --line-numbers
52
+ - --inline-source
53
+ - --title
54
+ - Yarg
55
+ - --main
56
+ - README.markdown
57
+ require_paths:
58
+ - lib
59
+ required_ruby_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: "0"
64
+ version:
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: "1.2"
70
+ version:
71
+ requirements: []
72
+
73
+ rubyforge_project: yarg
74
+ rubygems_version: 1.3.5
75
+ signing_key:
76
+ specification_version: 3
77
+ summary: Yet Another Ruby Generator
78
+ test_files:
79
+ - test/file_actions_test.rb
80
+ - test/rails_test.rb
81
+ - test/scm_test.rb
82
+ - test/test_helper.rb