rubigen 1.0.0 → 1.0.1
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/History.txt +8 -1
- data/Manifest.txt +19 -11
- data/Rakefile +3 -1
- data/{lib/rubigen/generators/applications → app_generators}/ruby_app/USAGE +0 -0
- data/{lib/rubigen/generators/applications → app_generators}/ruby_app/ruby_app_generator.rb +4 -10
- data/{lib/rubigen/generators/applications → app_generators}/ruby_app/templates/README.txt +0 -0
- data/{lib/rubigen/generators/applications → app_generators}/ruby_app/templates/configs/empty.log +0 -0
- data/{lib/rubigen/generators/applications → app_generators}/ruby_app/templates/fresh_rakefile +0 -0
- data/{lib/rubigen/generators/applications → app_generators}/ruby_app/templates/module.rb +0 -0
- data/{lib/rubigen/generators/applications → app_generators}/ruby_app/templates/script/generate +0 -0
- data/{lib/rubigen/generators/applications → app_generators}/ruby_app/templates/test_helper.rb +0 -0
- data/bin/install_rubigen_scripts +12 -0
- data/generators/install_rubigen_scripts/USAGE +0 -0
- data/generators/install_rubigen_scripts/install_rubigen_scripts_generator.rb +65 -0
- data/generators/install_rubigen_scripts/templates/script/destroy +14 -0
- data/generators/install_rubigen_scripts/templates/script/generate +14 -0
- data/generators/install_rubigen_scripts/templates/script/win_script.cmd +1 -0
- data/{lib/rubigen/generators/components → generators}/test_unit/USAGE +0 -0
- data/{lib/rubigen/generators/components/test_unit/templates/test → generators/test_unit/templates/test.rb} +0 -0
- data/{lib/rubigen/generators/components → generators}/test_unit/test_unit_generator.rb +1 -1
- data/lib/rubigen/helpers/generator_test_helper.rb +2 -0
- data/lib/rubigen/lookup.rb +3 -3
- data/lib/rubigen/version.rb +1 -1
- data/script/destroy +1 -1
- data/test/test_generate_builtin_application.rb +20 -9
- data/test/test_generate_builtin_test_unit.rb +2 -1
- data/test/test_generator_helper.rb +14 -0
- data/test/test_helper.rb +0 -11
- data/test/test_install_rubigen_scripts_generator.rb +44 -0
- data/test/test_lookup.rb +6 -2
- data/website/index.html +1 -1
- metadata +27 -16
data/History.txt
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
-
==
|
1
|
+
== 1.0.1 2007-08-20
|
2
|
+
|
3
|
+
* Moved builtin generators into root folders, away from lib folder, to protected them
|
4
|
+
from ri/rdocs processes (which didn't like ERb <%= %> inside Ruby files)
|
5
|
+
* New app: rubigen_install_script
|
6
|
+
* adds script/generate and script/destroy to current folder
|
7
|
+
|
8
|
+
== 1.0.0 2007-08-17
|
2
9
|
* 1 major enhancement:
|
3
10
|
* Initial release
|
data/Manifest.txt
CHANGED
@@ -3,6 +3,15 @@ License.txt
|
|
3
3
|
Manifest.txt
|
4
4
|
README.txt
|
5
5
|
Rakefile
|
6
|
+
app_generators/ruby_app/USAGE
|
7
|
+
app_generators/ruby_app/ruby_app_generator.rb
|
8
|
+
app_generators/ruby_app/templates/README.txt
|
9
|
+
app_generators/ruby_app/templates/configs/empty.log
|
10
|
+
app_generators/ruby_app/templates/fresh_rakefile
|
11
|
+
app_generators/ruby_app/templates/module.rb
|
12
|
+
app_generators/ruby_app/templates/script/generate
|
13
|
+
app_generators/ruby_app/templates/test_helper.rb
|
14
|
+
bin/install_rubigen_scripts
|
6
15
|
bin/ruby_app
|
7
16
|
examples/rails_generators/applications/app/USAGE
|
8
17
|
examples/rails_generators/applications/app/app_generator.rb
|
@@ -75,21 +84,18 @@ examples/rails_generators/components/web_service/templates/api_definition.rb
|
|
75
84
|
examples/rails_generators/components/web_service/templates/controller.rb
|
76
85
|
examples/rails_generators/components/web_service/templates/functional_test.rb
|
77
86
|
examples/rails_generators/components/web_service/web_service_generator.rb
|
87
|
+
generators/install_rubigen_scripts/USAGE
|
88
|
+
generators/install_rubigen_scripts/install_rubigen_scripts_generator.rb
|
89
|
+
generators/install_rubigen_scripts/templates/script/destroy
|
90
|
+
generators/install_rubigen_scripts/templates/script/generate
|
91
|
+
generators/install_rubigen_scripts/templates/script/win_script.cmd
|
92
|
+
generators/test_unit/USAGE
|
93
|
+
generators/test_unit/templates/test.rb
|
94
|
+
generators/test_unit/test_unit_generator.rb
|
78
95
|
lib/rubigen.rb
|
79
96
|
lib/rubigen/base.rb
|
80
97
|
lib/rubigen/commands.rb
|
81
98
|
lib/rubigen/generated_attribute.rb
|
82
|
-
lib/rubigen/generators/applications/ruby_app/USAGE
|
83
|
-
lib/rubigen/generators/applications/ruby_app/ruby_app_generator.rb
|
84
|
-
lib/rubigen/generators/applications/ruby_app/templates/README.txt
|
85
|
-
lib/rubigen/generators/applications/ruby_app/templates/configs/empty.log
|
86
|
-
lib/rubigen/generators/applications/ruby_app/templates/fresh_rakefile
|
87
|
-
lib/rubigen/generators/applications/ruby_app/templates/module.rb
|
88
|
-
lib/rubigen/generators/applications/ruby_app/templates/script/generate
|
89
|
-
lib/rubigen/generators/applications/ruby_app/templates/test_helper.rb
|
90
|
-
lib/rubigen/generators/components/test_unit/USAGE
|
91
|
-
lib/rubigen/generators/components/test_unit/templates/test
|
92
|
-
lib/rubigen/generators/components/test_unit/test_unit_generator.rb
|
93
99
|
lib/rubigen/helpers/generator_test_helper.rb
|
94
100
|
lib/rubigen/lookup.rb
|
95
101
|
lib/rubigen/manifest.rb
|
@@ -110,7 +116,9 @@ test/examples_from_rails/test_rails_resource_generator.rb
|
|
110
116
|
test/examples_from_rails/test_rails_scaffold_generator.rb
|
111
117
|
test/test_generate_builtin_application.rb
|
112
118
|
test/test_generate_builtin_test_unit.rb
|
119
|
+
test/test_generator_helper.rb
|
113
120
|
test/test_helper.rb
|
121
|
+
test/test_install_rubigen_scripts_generator.rb
|
114
122
|
test/test_lookup.rb
|
115
123
|
website/index.html
|
116
124
|
website/index.txt
|
data/Rakefile
CHANGED
@@ -28,7 +28,9 @@ require File.join(File.dirname(__FILE__), 'lib', 'rubigen', 'version')
|
|
28
28
|
|
29
29
|
AUTHOR = 'Dr Nic Williams' # can also be an array of Authors
|
30
30
|
EMAIL = "drnicwilliams@gmail.com"
|
31
|
-
DESCRIPTION =
|
31
|
+
DESCRIPTION = <<-EOS
|
32
|
+
A framework to allow Ruby applications to generate file/folder stubs (like the rails command does for Ruby on Rails, and the ‘script/generate’ command within a Rails application during development).
|
33
|
+
EOS
|
32
34
|
GEM_NAME = 'rubigen' # what ppl will type to install your gem
|
33
35
|
|
34
36
|
@config_file = "~/.rubyforge/user-config.yml"
|
File without changes
|
@@ -20,7 +20,6 @@ class RubyAppGenerator < RubiGen::Base
|
|
20
20
|
def manifest
|
21
21
|
# Use /usr/bin/env if no special shebang was specified
|
22
22
|
script_options = { :chmod => 0755, :shebang => options[:shebang] == DEFAULT_SHEBANG ? nil : options[:shebang] }
|
23
|
-
dispatcher_options = { :chmod => 0755, :shebang => options[:shebang] }
|
24
23
|
windows = (RUBY_PLATFORM =~ /dos|win32|cygwin/i) || (RUBY_PLATFORM =~ /(:?mswin|mingw)/)
|
25
24
|
|
26
25
|
record do |m|
|
@@ -32,22 +31,17 @@ class RubyAppGenerator < RubiGen::Base
|
|
32
31
|
m.file "fresh_rakefile", "Rakefile"
|
33
32
|
m.file "README.txt", "README.txt"
|
34
33
|
|
35
|
-
# Scripts
|
36
|
-
%w( generate ).each do |file|
|
37
|
-
m.file "script/#{file}", "script/#{file}", script_options
|
38
|
-
m.template "script/win_script.cmd", "script/#{file}.cmd",
|
39
|
-
:assigns => { :filename => file } if windows
|
40
|
-
end
|
41
|
-
|
42
34
|
# Default module for app
|
43
|
-
m.template "module.rb", "lib/#{app_name}.rb"
|
35
|
+
m.template "module.rb", "lib/#{app_name}.rb"
|
44
36
|
|
45
37
|
# Test helper
|
46
|
-
m.template "test_helper.rb", "test/test_helper.rb"
|
38
|
+
m.template "test_helper.rb", "test/test_helper.rb"
|
47
39
|
|
48
40
|
%w(debug).each { |file|
|
49
41
|
m.file "configs/empty.log", "log/#{file}.log", :chmod => 0666
|
50
42
|
}
|
43
|
+
|
44
|
+
m.dependency "install_rubigen_scripts", [destination_root, "rubygems"], :shebang => options[:shebang]
|
51
45
|
end
|
52
46
|
end
|
53
47
|
|
File without changes
|
data/{lib/rubigen/generators/applications → app_generators}/ruby_app/templates/configs/empty.log
RENAMED
File without changes
|
data/{lib/rubigen/generators/applications → app_generators}/ruby_app/templates/fresh_rakefile
RENAMED
File without changes
|
File without changes
|
data/{lib/rubigen/generators/applications → app_generators}/ruby_app/templates/script/generate
RENAMED
File without changes
|
data/{lib/rubigen/generators/applications → app_generators}/ruby_app/templates/test_helper.rb
RENAMED
File without changes
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rubigen'
|
3
|
+
|
4
|
+
if %w(-v --version).include? ARGV.first
|
5
|
+
require 'newgem/version'
|
6
|
+
puts "#{File.basename($0)} #{Newgem::VERSION::STRING}"
|
7
|
+
exit(0)
|
8
|
+
end
|
9
|
+
|
10
|
+
require 'rubigen/scripts/generate'
|
11
|
+
RubiGen::Base.use_component_sources!
|
12
|
+
RubiGen::Scripts::Generate.new.run(ARGV, :generator => 'install_rubigen_scripts')
|
File without changes
|
@@ -0,0 +1,65 @@
|
|
1
|
+
class InstallRubigenScriptsGenerator < RubiGen::Base
|
2
|
+
DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
|
3
|
+
Config::CONFIG['ruby_install_name'])
|
4
|
+
|
5
|
+
default_options :shebang => DEFAULT_SHEBANG
|
6
|
+
|
7
|
+
attr_reader :path, :scopes
|
8
|
+
|
9
|
+
def initialize(runtime_args, runtime_options = {})
|
10
|
+
super
|
11
|
+
usage if args.length < 2 # requires path and at least one scope
|
12
|
+
@path = args.shift
|
13
|
+
@destination_root = File.expand_path(path)
|
14
|
+
@scopes = args.map { |scope| scope.to_sym }
|
15
|
+
extract_options
|
16
|
+
end
|
17
|
+
|
18
|
+
def manifest
|
19
|
+
script_options = { :chmod => 0755, :shebang => options[:shebang] == DEFAULT_SHEBANG ? nil : options[:shebang] }
|
20
|
+
windows = (RUBY_PLATFORM =~ /dos|win32|cygwin/i) || (RUBY_PLATFORM =~ /(:?mswin|mingw)/)
|
21
|
+
|
22
|
+
record do |m|
|
23
|
+
# Ensure appropriate folder(s) exists
|
24
|
+
m.directory "script"
|
25
|
+
|
26
|
+
%w( generate destroy ).each do |file|
|
27
|
+
m.template "script/#{file}", "script/#{file}", script_options
|
28
|
+
m.template "script/win_script.cmd", "script/#{file}.cmd",
|
29
|
+
:assigns => { :filename => file } if windows
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def scopes_str
|
35
|
+
scopes.inspect
|
36
|
+
end
|
37
|
+
|
38
|
+
protected
|
39
|
+
def banner
|
40
|
+
<<-EOS
|
41
|
+
Installs script/generate and script/destroy scripts into current folder
|
42
|
+
|
43
|
+
USAGE: #{spec.name} install_path scope[ scope]
|
44
|
+
|
45
|
+
For example: #{spec.name} . rails rubygems
|
46
|
+
EOS
|
47
|
+
end
|
48
|
+
|
49
|
+
def add_options!(opts)
|
50
|
+
opts.separator ''
|
51
|
+
opts.separator 'Options:'
|
52
|
+
opts.on("-r", "--ruby=path", String,
|
53
|
+
"Path to the Ruby binary of your choice (otherwise scripts use env, dispatchers current path).",
|
54
|
+
"Default: #{DEFAULT_SHEBANG}") { |v| options[:shebang] = v }
|
55
|
+
opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
|
56
|
+
end
|
57
|
+
|
58
|
+
def extract_options
|
59
|
+
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
60
|
+
# Templates can access these value via the attr_reader-generated methods, but not the
|
61
|
+
# raw instance variable value.
|
62
|
+
# @author = options[:author]
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.join(File.dirname(__FILE__), '..')
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/destroy'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! <%= scopes_str %>
|
14
|
+
RubiGen::Scripts::Destroy.new.run(ARGV)
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.join(File.dirname(__FILE__), '..')
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/generate'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! <%= scopes_str %>
|
14
|
+
RubiGen::Scripts::Generate.new.run(ARGV)
|
@@ -0,0 +1 @@
|
|
1
|
+
@ruby <%= File.join("script", filename) %> %*
|
File without changes
|
File without changes
|
@@ -35,8 +35,10 @@ module RubiGen
|
|
35
35
|
logger_original=RubiGen::Base.logger
|
36
36
|
myout=StringIO.new
|
37
37
|
RubiGen::Base.logger=RubiGen::SimpleLogger.new(myout)
|
38
|
+
# TODO redirect $stdout to myout
|
38
39
|
yield if block_given?
|
39
40
|
RubiGen::Base.logger=logger_original
|
41
|
+
# TODO fix $stdout again
|
40
42
|
myout.string
|
41
43
|
end
|
42
44
|
|
data/lib/rubigen/lookup.rb
CHANGED
@@ -103,7 +103,7 @@ module RubiGen
|
|
103
103
|
def application_sources(filters = [])
|
104
104
|
filters.unshift 'app'
|
105
105
|
app_sources = []
|
106
|
-
app_sources << PathSource.new(:builtin,
|
106
|
+
app_sources << PathSource.new(:builtin, File.join(File.dirname(__FILE__), %w[.. .. app_generators]))
|
107
107
|
app_sources << filtered_sources(filters)
|
108
108
|
app_sources.flatten
|
109
109
|
end
|
@@ -129,7 +129,7 @@ module RubiGen
|
|
129
129
|
new_sources << PathSource.new(:vendor, "#{::APP_ROOT}/vendor/generators")
|
130
130
|
new_sources << PathSource.new(:plugins, "#{::APP_ROOT}/vendor/plugins/*/**/generators")
|
131
131
|
end
|
132
|
-
new_sources << PathSource.new(:builtin,
|
132
|
+
new_sources << PathSource.new(:builtin, File.join(File.dirname(__FILE__), %w[.. .. generators]))
|
133
133
|
new_sources << filtered_sources(filters)
|
134
134
|
write_inheritable_attribute(:sources, new_sources.flatten)
|
135
135
|
end
|
@@ -240,7 +240,7 @@ module RubiGen
|
|
240
240
|
end
|
241
241
|
|
242
242
|
def ==(source)
|
243
|
-
self.class == source.class && path == source.path && filters == source.filters
|
243
|
+
self.class == source.class && path == source.path && filters == source.filters && label == source.label
|
244
244
|
end
|
245
245
|
end
|
246
246
|
|
data/lib/rubigen/version.rb
CHANGED
data/script/destroy
CHANGED
@@ -5,5 +5,5 @@ require File.join(File.dirname(__FILE__), %w[.. lib rubigen])
|
|
5
5
|
require 'rubigen/scripts/destroy'
|
6
6
|
|
7
7
|
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
8
|
-
RubiGen::Base.use_component_sources! :rubygems, :
|
8
|
+
RubiGen::Base.use_component_sources! :rubygems, :merb
|
9
9
|
RubiGen::Scripts::Destroy.new.run(ARGV)
|
@@ -1,6 +1,7 @@
|
|
1
|
-
require File.dirname(__FILE__)
|
1
|
+
require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
|
2
2
|
|
3
3
|
class TestGenerateBuiltinApplication < Test::Unit::TestCase
|
4
|
+
include RubiGen::GeneratorTestHelper
|
4
5
|
|
5
6
|
def setup
|
6
7
|
bare_setup
|
@@ -11,14 +12,24 @@ class TestGenerateBuiltinApplication < Test::Unit::TestCase
|
|
11
12
|
end
|
12
13
|
|
13
14
|
def test_ruby_app
|
14
|
-
|
15
|
-
|
16
|
-
assert_generated_file("
|
17
|
-
assert_generated_file("
|
18
|
-
assert_generated_file("
|
19
|
-
assert_generated_file("
|
20
|
-
assert_generated_file("
|
15
|
+
run_generator('ruby_app', [APP_ROOT], sources)
|
16
|
+
assert_generated_file("Rakefile")
|
17
|
+
assert_generated_file("README.txt")
|
18
|
+
assert_generated_file("lib/#{PROJECT_NAME}.rb")
|
19
|
+
assert_generated_file("test/test_helper.rb")
|
20
|
+
assert_generated_file("script/generate")
|
21
|
+
assert_generated_file("script/destroy")
|
21
22
|
|
22
|
-
assert_generated_module("
|
23
|
+
assert_generated_module("lib/#{PROJECT_NAME}")
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
def sources
|
28
|
+
[RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", generator_path))
|
29
|
+
]
|
30
|
+
end
|
31
|
+
|
32
|
+
def generator_path
|
33
|
+
"app_generators"
|
23
34
|
end
|
24
35
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
# Must set before requiring generator libs.
|
5
|
+
TMP_ROOT = File.dirname(__FILE__) + "/tmp" unless defined?(TMP_ROOT)
|
6
|
+
PROJECT_NAME = "myproject" unless defined?(PROJECT_NAME)
|
7
|
+
app_root = File.join(TMP_ROOT, PROJECT_NAME)
|
8
|
+
if defined?(APP_ROOT)
|
9
|
+
APP_ROOT.replace(app_root)
|
10
|
+
else
|
11
|
+
APP_ROOT = app_root
|
12
|
+
end
|
13
|
+
|
14
|
+
require 'rubigen/helpers/generator_test_helper'
|
data/test/test_helper.rb
CHANGED
@@ -1,17 +1,6 @@
|
|
1
1
|
require 'test/unit'
|
2
|
-
|
3
|
-
# Must set before requiring generator libs.
|
4
|
-
TMP_ROOT = File.dirname(__FILE__) + "/tmp" unless defined?(TMP_ROOT)
|
5
|
-
app_root = File.join(TMP_ROOT, "myproject")
|
6
|
-
if defined?(APP_ROOT)
|
7
|
-
APP_ROOT.replace(app_root)
|
8
|
-
else
|
9
|
-
APP_ROOT = app_root
|
10
|
-
end
|
11
|
-
|
12
2
|
require File.dirname(__FILE__) + '/../lib/rubigen'
|
13
3
|
require 'rubigen/helpers/generator_test_helper'
|
14
|
-
Test::Unit::TestCase.send(:include, RubiGen::GeneratorTestHelper)
|
15
4
|
include RubiGen
|
16
5
|
|
17
6
|
begin
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
|
2
|
+
|
3
|
+
class TestInstallRubigenScriptsGenerator < Test::Unit::TestCase
|
4
|
+
include RubiGen::GeneratorTestHelper
|
5
|
+
|
6
|
+
def setup
|
7
|
+
bare_setup
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
bare_teardown
|
12
|
+
end
|
13
|
+
|
14
|
+
# Some generator-related assertions:
|
15
|
+
# assert_generated_file(name, &block) # block passed the file contents
|
16
|
+
# assert_directory_exists(name)
|
17
|
+
# assert_generated_class(name, &block)
|
18
|
+
# assert_generated_module(name, &block)
|
19
|
+
# assert_generated_test_for(name, &block)
|
20
|
+
# The assert_generated_(class|module|test_for) &block is passed the body of the class/module within the file
|
21
|
+
# assert_has_method(body, *methods) # check that the body has a list of methods (methods with parentheses not supported yet)
|
22
|
+
#
|
23
|
+
# Other helper methods are:
|
24
|
+
# app_root_files - put this in teardown to show files generated by the test method (e.g. p app_root_files)
|
25
|
+
# bare_setup - place this in setup method to create the APP_ROOT folder for each test
|
26
|
+
# bare_teardown - place this in teardown method to destroy the TMP_ROOT or APP_ROOT folder after each test
|
27
|
+
|
28
|
+
def test_install_rubigen_scripts_should_create_script_generate
|
29
|
+
run_generator('install_rubigen_scripts', [APP_ROOT] + %w(rubygems merb), sources)
|
30
|
+
assert_directory_exists "script"
|
31
|
+
assert_generated_file "script/generate"
|
32
|
+
assert_generated_file "script/destroy"
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
def sources
|
37
|
+
[RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", generator_path))
|
38
|
+
]
|
39
|
+
end
|
40
|
+
|
41
|
+
def generator_path
|
42
|
+
"app_generators"
|
43
|
+
end
|
44
|
+
end
|
data/test/test_lookup.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
-
require File.dirname(__FILE__) + "/
|
1
|
+
require File.dirname(__FILE__) + "/test_generator_helper"
|
2
2
|
|
3
3
|
class TestLookup < Test::Unit::TestCase
|
4
4
|
include RubiGen
|
5
5
|
|
6
|
+
def setup
|
7
|
+
Base.reset_sources
|
8
|
+
end
|
9
|
+
|
6
10
|
def test_lookup_component
|
7
11
|
assert_nothing_raised(GeneratorError, "Could not find test_unit generator") { Base.lookup('test_unit') }
|
8
12
|
end
|
@@ -83,7 +87,7 @@ class TestLookup < Test::Unit::TestCase
|
|
83
87
|
|
84
88
|
def test_use_application_sources
|
85
89
|
Base.use_application_sources!
|
86
|
-
expected_path = File.expand_path(File.join(File.dirname(__FILE__), %w[..
|
90
|
+
expected_path = File.expand_path(File.join(File.dirname(__FILE__), %w[.. app_generators]))
|
87
91
|
builtin_source = Base.sources.find { |s| s.path == expected_path if s.respond_to?(:path) }
|
88
92
|
assert_not_nil(builtin_source, "Cannot find builtin generators")
|
89
93
|
assert_nothing_raised(GeneratorError) do
|
data/website/index.html
CHANGED
@@ -31,7 +31,7 @@
|
|
31
31
|
<h1>rubigen</h1>
|
32
32
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/rubigen"; return false'>
|
33
33
|
<p>Get Version</p>
|
34
|
-
<a href="http://rubyforge.org/projects/rubigen" class="numbers">1.0.
|
34
|
+
<a href="http://rubyforge.org/projects/rubigen" class="numbers">1.0.1</a>
|
35
35
|
</div>
|
36
36
|
<h1>Ruby Generator Framework</h1>
|
37
37
|
|
metadata
CHANGED
@@ -3,15 +3,15 @@ rubygems_version: 0.9.4.3
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rubigen
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.0.
|
7
|
-
date: 2007-08-
|
8
|
-
summary:
|
6
|
+
version: 1.0.1
|
7
|
+
date: 2007-08-21 00:00:00 +02:00
|
8
|
+
summary: "A framework to allow Ruby applications to generate file/folder stubs (like the rails command does for Ruby on Rails, and the \xE2\x80\x98script/generate\xE2\x80\x99 command within a Rails application during development)."
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
11
|
email: drnicwilliams@gmail.com
|
12
12
|
homepage: http://rubigen.rubyforge.org
|
13
13
|
rubyforge_project: rubigen
|
14
|
-
description:
|
14
|
+
description: "A framework to allow Ruby applications to generate file/folder stubs (like the rails command does for Ruby on Rails, and the \xE2\x80\x98script/generate\xE2\x80\x99 command within a Rails application during development)."
|
15
15
|
autorequire:
|
16
16
|
default_executable:
|
17
17
|
bindir: bin
|
@@ -34,6 +34,15 @@ files:
|
|
34
34
|
- Manifest.txt
|
35
35
|
- README.txt
|
36
36
|
- Rakefile
|
37
|
+
- app_generators/ruby_app/USAGE
|
38
|
+
- app_generators/ruby_app/ruby_app_generator.rb
|
39
|
+
- app_generators/ruby_app/templates/README.txt
|
40
|
+
- app_generators/ruby_app/templates/configs/empty.log
|
41
|
+
- app_generators/ruby_app/templates/fresh_rakefile
|
42
|
+
- app_generators/ruby_app/templates/module.rb
|
43
|
+
- app_generators/ruby_app/templates/script/generate
|
44
|
+
- app_generators/ruby_app/templates/test_helper.rb
|
45
|
+
- bin/install_rubigen_scripts
|
37
46
|
- bin/ruby_app
|
38
47
|
- examples/rails_generators/applications/app/USAGE
|
39
48
|
- examples/rails_generators/applications/app/app_generator.rb
|
@@ -106,21 +115,18 @@ files:
|
|
106
115
|
- examples/rails_generators/components/web_service/templates/controller.rb
|
107
116
|
- examples/rails_generators/components/web_service/templates/functional_test.rb
|
108
117
|
- examples/rails_generators/components/web_service/web_service_generator.rb
|
118
|
+
- generators/install_rubigen_scripts/USAGE
|
119
|
+
- generators/install_rubigen_scripts/install_rubigen_scripts_generator.rb
|
120
|
+
- generators/install_rubigen_scripts/templates/script/destroy
|
121
|
+
- generators/install_rubigen_scripts/templates/script/generate
|
122
|
+
- generators/install_rubigen_scripts/templates/script/win_script.cmd
|
123
|
+
- generators/test_unit/USAGE
|
124
|
+
- generators/test_unit/templates/test.rb
|
125
|
+
- generators/test_unit/test_unit_generator.rb
|
109
126
|
- lib/rubigen.rb
|
110
127
|
- lib/rubigen/base.rb
|
111
128
|
- lib/rubigen/commands.rb
|
112
129
|
- lib/rubigen/generated_attribute.rb
|
113
|
-
- lib/rubigen/generators/applications/ruby_app/USAGE
|
114
|
-
- lib/rubigen/generators/applications/ruby_app/ruby_app_generator.rb
|
115
|
-
- lib/rubigen/generators/applications/ruby_app/templates/README.txt
|
116
|
-
- lib/rubigen/generators/applications/ruby_app/templates/configs/empty.log
|
117
|
-
- lib/rubigen/generators/applications/ruby_app/templates/fresh_rakefile
|
118
|
-
- lib/rubigen/generators/applications/ruby_app/templates/module.rb
|
119
|
-
- lib/rubigen/generators/applications/ruby_app/templates/script/generate
|
120
|
-
- lib/rubigen/generators/applications/ruby_app/templates/test_helper.rb
|
121
|
-
- lib/rubigen/generators/components/test_unit/USAGE
|
122
|
-
- lib/rubigen/generators/components/test_unit/templates/test
|
123
|
-
- lib/rubigen/generators/components/test_unit/test_unit_generator.rb
|
124
130
|
- lib/rubigen/helpers/generator_test_helper.rb
|
125
131
|
- lib/rubigen/lookup.rb
|
126
132
|
- lib/rubigen/manifest.rb
|
@@ -141,7 +147,9 @@ files:
|
|
141
147
|
- test/examples_from_rails/test_rails_scaffold_generator.rb
|
142
148
|
- test/test_generate_builtin_application.rb
|
143
149
|
- test/test_generate_builtin_test_unit.rb
|
150
|
+
- test/test_generator_helper.rb
|
144
151
|
- test/test_helper.rb
|
152
|
+
- test/test_install_rubigen_scripts_generator.rb
|
145
153
|
- test/test_lookup.rb
|
146
154
|
- website/index.html
|
147
155
|
- website/index.txt
|
@@ -153,7 +161,9 @@ test_files:
|
|
153
161
|
- test/examples_from_rails/test_rails_scaffold_generator.rb
|
154
162
|
- test/test_generate_builtin_application.rb
|
155
163
|
- test/test_generate_builtin_test_unit.rb
|
164
|
+
- test/test_generator_helper.rb
|
156
165
|
- test/test_helper.rb
|
166
|
+
- test/test_install_rubigen_scripts_generator.rb
|
157
167
|
- test/test_lookup.rb
|
158
168
|
rdoc_options:
|
159
169
|
- --main
|
@@ -163,9 +173,10 @@ extra_rdoc_files:
|
|
163
173
|
- License.txt
|
164
174
|
- Manifest.txt
|
165
175
|
- README.txt
|
166
|
-
-
|
176
|
+
- app_generators/ruby_app/templates/README.txt
|
167
177
|
- website/index.txt
|
168
178
|
executables:
|
179
|
+
- install_rubigen_scripts
|
169
180
|
- ruby_app
|
170
181
|
extensions: []
|
171
182
|
|