rubigen 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Manifest.txt +9 -3
- data/Rakefile +3 -143
- data/config/hoe.rb +74 -0
- data/config/requirements.rb +17 -0
- data/lib/rubigen/base.rb +1 -1
- data/lib/rubigen/helpers/generator_test_helper.rb +1 -2
- data/lib/rubigen/lookup.rb +2 -3
- data/lib/rubigen/version.rb +1 -1
- data/log/debug.log +0 -0
- data/script/destroy +7 -2
- data/script/generate +7 -2
- data/script/txt2html +10 -1
- data/tasks/deployment.rake +34 -0
- data/tasks/environment.rake +7 -0
- data/tasks/website.rake +17 -0
- data/test/test_generate_builtin_test_unit.rb +13 -3
- data/{generators → test_unit_generators}/test_unit/USAGE +0 -0
- data/{generators → test_unit_generators}/test_unit/templates/test.rb +0 -0
- data/{generators → test_unit_generators}/test_unit/test_unit_generator.rb +0 -0
- data/website/index.html +2 -2
- metadata +13 -15
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
@@ -13,6 +13,8 @@ app_generators/ruby_app/templates/lib/module.rb
|
|
13
13
|
app_generators/ruby_app/templates/test/test_helper.rb.erb
|
14
14
|
bin/install_rubigen_scripts
|
15
15
|
bin/ruby_app
|
16
|
+
config/hoe.rb
|
17
|
+
config/requirements.rb
|
16
18
|
examples/rails_generators/applications/app/USAGE
|
17
19
|
examples/rails_generators/applications/app/app_generator.rb
|
18
20
|
examples/rails_generators/components/controller/USAGE
|
@@ -88,9 +90,6 @@ generators/install_rubigen_scripts/install_rubigen_scripts_generator.rb
|
|
88
90
|
generators/install_rubigen_scripts/templates/script/destroy
|
89
91
|
generators/install_rubigen_scripts/templates/script/generate
|
90
92
|
generators/install_rubigen_scripts/templates/script/win_script.cmd
|
91
|
-
generators/test_unit/USAGE
|
92
|
-
generators/test_unit/templates/test.rb
|
93
|
-
generators/test_unit/test_unit_generator.rb
|
94
93
|
lib/rubigen.rb
|
95
94
|
lib/rubigen/base.rb
|
96
95
|
lib/rubigen/commands.rb
|
@@ -106,10 +105,14 @@ lib/rubigen/scripts/update.rb
|
|
106
105
|
lib/rubigen/simple_logger.rb
|
107
106
|
lib/rubigen/spec.rb
|
108
107
|
lib/rubigen/version.rb
|
108
|
+
log/debug.log
|
109
109
|
script/destroy
|
110
110
|
script/generate
|
111
111
|
script/txt2html
|
112
112
|
setup.rb
|
113
|
+
tasks/deployment.rake
|
114
|
+
tasks/environment.rake
|
115
|
+
tasks/website.rake
|
113
116
|
test/examples_from_rails/generator_test_helper.rb
|
114
117
|
test/examples_from_rails/test_rails_resource_generator.rb
|
115
118
|
test/examples_from_rails/test_rails_scaffold_generator.rb
|
@@ -119,6 +122,9 @@ test/test_generator_helper.rb
|
|
119
122
|
test/test_helper.rb
|
120
123
|
test/test_install_rubigen_scripts_generator.rb
|
121
124
|
test/test_lookup.rb
|
125
|
+
test_unit_generators/test_unit/USAGE
|
126
|
+
test_unit_generators/test_unit/templates/test.rb
|
127
|
+
test_unit_generators/test_unit/test_unit_generator.rb
|
122
128
|
website/index.html
|
123
129
|
website/index.txt
|
124
130
|
website/javascripts/rounded_corners_lite.inc.js
|
data/Rakefile
CHANGED
@@ -1,144 +1,4 @@
|
|
1
|
-
require '
|
2
|
-
|
3
|
-
require 'rake'
|
4
|
-
rescue LoadError
|
5
|
-
puts 'This script should only be accessed via the "rake" command.'
|
6
|
-
puts 'Installation: gem install rake -y'
|
7
|
-
exit
|
8
|
-
end
|
9
|
-
require 'rake/clean'
|
10
|
-
require 'rake/testtask'
|
11
|
-
require 'rake/packagetask'
|
12
|
-
require 'rake/gempackagetask'
|
13
|
-
require 'rake/rdoctask'
|
14
|
-
require 'rake/contrib/rubyforgepublisher'
|
15
|
-
require 'fileutils'
|
16
|
-
begin
|
17
|
-
require 'hoe'
|
18
|
-
rescue LoadError
|
19
|
-
puts 'This Rakefile requires the "hoe" RubyGem.'
|
20
|
-
puts 'Installation: gem install hoe -y'
|
21
|
-
exit
|
22
|
-
end
|
1
|
+
require 'config/requirements'
|
2
|
+
require 'config/hoe' # setup Hoe + all gem configuration
|
23
3
|
|
24
|
-
|
25
|
-
|
26
|
-
include FileUtils
|
27
|
-
require File.join(File.dirname(__FILE__), 'lib', 'rubigen', 'version')
|
28
|
-
|
29
|
-
AUTHOR = ['Dr Nic Williams', 'Jeremy Kemper'] # can also be an array of Authors
|
30
|
-
EMAIL = "drnicwilliams@gmail.com"
|
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
|
34
|
-
GEM_NAME = 'rubigen' # what ppl will type to install your gem
|
35
|
-
|
36
|
-
@config_file = "~/.rubyforge/user-config.yml"
|
37
|
-
@config = nil
|
38
|
-
def rubyforge_username
|
39
|
-
unless @config
|
40
|
-
begin
|
41
|
-
@config = YAML.load(File.read(File.expand_path(@config_file)))
|
42
|
-
rescue
|
43
|
-
puts <<-EOS
|
44
|
-
ERROR: No rubyforge config file found: #{@config_file}"
|
45
|
-
Run 'rubyforge setup' to prepare your env for access to Rubyforge
|
46
|
-
- See http://newgem.rubyforge.org/rubyforge.html for more details
|
47
|
-
EOS
|
48
|
-
exit
|
49
|
-
end
|
50
|
-
end
|
51
|
-
@rubyforge_username ||= @config["username"]
|
52
|
-
end
|
53
|
-
|
54
|
-
RUBYFORGE_PROJECT = 'rubigen' # The unix name for your project
|
55
|
-
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
56
|
-
DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
|
57
|
-
|
58
|
-
NAME = "rubigen"
|
59
|
-
REV = nil
|
60
|
-
# UNCOMMENT IF REQUIRED:
|
61
|
-
# REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
|
62
|
-
VERS = Rubigen::VERSION::STRING + (REV ? ".#{REV}" : "")
|
63
|
-
CLEAN.include ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store']
|
64
|
-
# RDOC_OPTS = ['--quiet', '--title', 'rubigen documentation',
|
65
|
-
# "--opname", "index.html",
|
66
|
-
# "--line-numbers",
|
67
|
-
# "--main", "README",
|
68
|
-
# "--inline-source"]
|
69
|
-
|
70
|
-
class Hoe
|
71
|
-
def extra_deps
|
72
|
-
@extra_deps.reject! { |x| Array(x).first == 'hoe' }
|
73
|
-
@extra_deps
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
# Generate all the Rake tasks
|
78
|
-
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
79
|
-
hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
80
|
-
p.author = AUTHOR
|
81
|
-
p.description = DESCRIPTION
|
82
|
-
p.email = EMAIL
|
83
|
-
p.summary = DESCRIPTION
|
84
|
-
p.url = HOMEPATH
|
85
|
-
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
|
86
|
-
p.test_globs = ["test/**/test_*.rb"]
|
87
|
-
p.clean_globs |= CLEAN #An array of file patterns to delete on clean.
|
88
|
-
|
89
|
-
# == Optional
|
90
|
-
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
91
|
-
# An array of rubygem dependencies [name, version], e.g. [ ['activesupport', '>= 1.3.1'] ]
|
92
|
-
p.extra_deps = [['activesupport', '>= 1.3.1']]
|
93
|
-
|
94
|
-
end
|
95
|
-
|
96
|
-
CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\n\n")
|
97
|
-
PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
|
98
|
-
hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
|
99
|
-
|
100
|
-
desc 'Generate website files'
|
101
|
-
task :website_generate do
|
102
|
-
Dir['website/**/*.txt'].each do |txt|
|
103
|
-
sh %{ ruby script/txt2html #{txt} > #{txt.gsub(/txt$/,'html')} }
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
desc 'Upload website files to rubyforge'
|
108
|
-
task :website_upload do
|
109
|
-
host = "#{rubyforge_username}@rubyforge.org"
|
110
|
-
remote_dir = "/var/www/gforge-projects/#{PATH}/"
|
111
|
-
local_dir = 'website'
|
112
|
-
sh %{rsync -aCv #{local_dir}/ #{host}:#{remote_dir}}
|
113
|
-
end
|
114
|
-
|
115
|
-
desc 'Generate and upload website files'
|
116
|
-
task :website => [:website_generate, :website_upload, :publish_docs]
|
117
|
-
|
118
|
-
desc 'Release the website and new gem version'
|
119
|
-
task :deploy => [:check_version, :website, :release] do
|
120
|
-
puts "Remember to create SVN tag:"
|
121
|
-
puts "svn copy svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/trunk " +
|
122
|
-
"svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
|
123
|
-
puts "Suggested comment:"
|
124
|
-
puts "Tagging release #{CHANGES}"
|
125
|
-
end
|
126
|
-
|
127
|
-
desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
|
128
|
-
task :local_deploy => [:website_generate, :install_gem]
|
129
|
-
|
130
|
-
task :check_version do
|
131
|
-
unless ENV['VERSION']
|
132
|
-
puts 'Must pass a VERSION=x.y.z release version'
|
133
|
-
exit
|
134
|
-
end
|
135
|
-
unless ENV['VERSION'] == VERS
|
136
|
-
puts "Please update your version.rb to match the release version, currently #{VERS}"
|
137
|
-
exit
|
138
|
-
end
|
139
|
-
end
|
140
|
-
|
141
|
-
desc 'Install the package as a gem'
|
142
|
-
task :install_gem_no_doc => [:clean, :package] do
|
143
|
-
sh "#{'sudo ' unless Hoe::WINDOZE }gem install pkg/*.gem --no-rdoc --no-ri"
|
144
|
-
end
|
4
|
+
Dir['tasks/**/*.rake'].each { |rake| load rake }
|
data/config/hoe.rb
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
require 'rubigen/version'
|
2
|
+
|
3
|
+
AUTHOR = ['Dr Nic Williams', 'Jeremy Kemper'] # can also be an array of Authors
|
4
|
+
EMAIL = "drnicwilliams@gmail.com"
|
5
|
+
DESCRIPTION = <<-EOS
|
6
|
+
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).
|
7
|
+
EOS
|
8
|
+
GEM_NAME = 'rubigen' # what ppl will type to install your gem
|
9
|
+
|
10
|
+
RUBYFORGE_PROJECT = 'rubigen' # The unix name for your project
|
11
|
+
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
12
|
+
DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
|
13
|
+
|
14
|
+
@config_file = "~/.rubyforge/user-config.yml"
|
15
|
+
@config = nil
|
16
|
+
RUBYFORGE_USERNAME = "unknown"
|
17
|
+
def rubyforge_username
|
18
|
+
unless @config
|
19
|
+
begin
|
20
|
+
@config = YAML.load(File.read(File.expand_path(@config_file)))
|
21
|
+
rescue
|
22
|
+
puts <<-EOS
|
23
|
+
ERROR: No rubyforge config file found: #{@config_file}
|
24
|
+
Run 'rubyforge setup' to prepare your env for access to Rubyforge
|
25
|
+
- See http://newgem.rubyforge.org/rubyforge.html for more details
|
26
|
+
EOS
|
27
|
+
exit
|
28
|
+
end
|
29
|
+
end
|
30
|
+
RUBYFORGE_USERNAME.replace @config["username"]
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
REV = nil
|
35
|
+
# UNCOMMENT IF REQUIRED:
|
36
|
+
# REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
|
37
|
+
VERS = Rubigen::VERSION::STRING + (REV ? ".#{REV}" : "")
|
38
|
+
RDOC_OPTS = ['--quiet', '--title', 'rubigen documentation',
|
39
|
+
"--opname", "index.html",
|
40
|
+
"--line-numbers",
|
41
|
+
"--main", "README",
|
42
|
+
"--inline-source"]
|
43
|
+
|
44
|
+
class Hoe
|
45
|
+
def extra_deps
|
46
|
+
@extra_deps.reject! { |x| Array(x).first == 'hoe' }
|
47
|
+
@extra_deps
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# Generate all the Rake tasks
|
52
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
53
|
+
hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
54
|
+
p.author = AUTHOR
|
55
|
+
p.description = DESCRIPTION
|
56
|
+
p.email = EMAIL
|
57
|
+
p.summary = DESCRIPTION
|
58
|
+
p.url = HOMEPATH
|
59
|
+
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
|
60
|
+
p.test_globs = ["test/**/test_*.rb"]
|
61
|
+
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
|
62
|
+
|
63
|
+
# == Optional
|
64
|
+
p.changes = p.paragraphs_of("History.txt", 0..1).join("\\n\\n")
|
65
|
+
#p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
|
66
|
+
|
67
|
+
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
|
72
|
+
PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
|
73
|
+
hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
|
74
|
+
hoe.rsync_args = '-av --delete --ignore-errors'
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
include FileUtils
|
3
|
+
|
4
|
+
require 'rubygems'
|
5
|
+
%w[rake hoe newgem rubigen].each do |req_gem|
|
6
|
+
begin
|
7
|
+
require req_gem
|
8
|
+
rescue LoadError
|
9
|
+
puts "This Rakefile requires the '#{req_gem}' RubyGem."
|
10
|
+
puts "Installation: gem install #{req_gem} -y"
|
11
|
+
exit
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
|
16
|
+
|
17
|
+
require 'rubigen'
|
data/lib/rubigen/base.rb
CHANGED
@@ -20,9 +20,8 @@ module RubiGen
|
|
20
20
|
end
|
21
21
|
else
|
22
22
|
RubiGen::Base.reset_sources
|
23
|
-
RubiGen::Base.
|
23
|
+
RubiGen::Base.prepend_sources(*sources) unless sources.blank?
|
24
24
|
end
|
25
|
-
# generator_options = options.find { |o| o.is_a?(Hash) } || {}
|
26
25
|
RubiGen::Base.instance(name, params, options)
|
27
26
|
end
|
28
27
|
|
data/lib/rubigen/lookup.rb
CHANGED
@@ -113,8 +113,8 @@ module RubiGen
|
|
113
113
|
# generating in the context of this application, so search
|
114
114
|
# APP_ROOT/generators.
|
115
115
|
# 2. User home directory. Search ~/.rubigen/generators.
|
116
|
-
# 3. RubyGems. Search for gems containing /
|
117
|
-
# 4. Builtins.
|
116
|
+
# 3. RubyGems. Search for gems containing /{scope}_generators folder.
|
117
|
+
# 4. Builtins. None currently.
|
118
118
|
#
|
119
119
|
# Search can be filtered by passing one or more prefixes.
|
120
120
|
# e.g. use_component_sources!(:rubygems) means it will also search in the following
|
@@ -129,7 +129,6 @@ 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, File.join(File.dirname(__FILE__), %w[.. .. generators]))
|
133
132
|
new_sources << filtered_sources(filters)
|
134
133
|
write_inheritable_attribute(:sources, new_sources.flatten)
|
135
134
|
end
|
data/lib/rubigen/version.rb
CHANGED
data/log/debug.log
ADDED
File without changes
|
data/script/destroy
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
APP_ROOT = File.join(File.dirname(__FILE__), '..')
|
3
3
|
|
4
|
-
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
5
10
|
require 'rubigen/scripts/destroy'
|
6
11
|
|
7
12
|
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
8
|
-
RubiGen::Base.use_component_sources! :rubygems, :
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme]
|
9
14
|
RubiGen::Scripts::Destroy.new.run(ARGV)
|
data/script/generate
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
APP_ROOT = File.join(File.dirname(__FILE__), '..')
|
3
3
|
|
4
|
-
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
5
10
|
require 'rubigen/scripts/generate'
|
6
11
|
|
7
12
|
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
8
|
-
RubiGen::Base.use_component_sources! :rubygems, :newgem
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme]
|
9
14
|
RubiGen::Scripts::Generate.new.run(ARGV)
|
data/script/txt2html
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
|
2
3
|
require 'rubygems'
|
3
4
|
begin
|
4
5
|
require 'newgem'
|
@@ -11,8 +12,10 @@ require 'redcloth'
|
|
11
12
|
require 'syntax/convertors/html'
|
12
13
|
require 'erb'
|
13
14
|
require File.dirname(__FILE__) + '/../lib/rubigen/version.rb'
|
15
|
+
|
14
16
|
version = Rubigen::VERSION::STRING
|
15
17
|
download = 'http://rubyforge.org/projects/rubigen'
|
18
|
+
|
16
19
|
class Fixnum
|
17
20
|
def ordinal
|
18
21
|
# teens
|
@@ -26,14 +29,17 @@ class Fixnum
|
|
26
29
|
end
|
27
30
|
end
|
28
31
|
end
|
32
|
+
|
29
33
|
class Time
|
30
34
|
def pretty
|
31
35
|
return "#{mday}#{mday.ordinal} #{strftime('%B')} #{year}"
|
32
36
|
end
|
33
37
|
end
|
38
|
+
|
34
39
|
def convert_syntax(syntax, source)
|
35
40
|
return Syntax::Convertors::HTML.for_syntax(syntax).convert(source).gsub(%r!^<pre>|</pre>$!,'')
|
36
41
|
end
|
42
|
+
|
37
43
|
if ARGV.length >= 1
|
38
44
|
src, template = ARGV
|
39
45
|
template ||= File.join(File.dirname(__FILE__), '/../website/template.rhtml')
|
@@ -42,7 +48,9 @@ else
|
|
42
48
|
puts("Usage: #{File.split($0).last} source.txt [template.rhtml] > output.html")
|
43
49
|
exit!
|
44
50
|
end
|
51
|
+
|
45
52
|
template = ERB.new(File.open(template).read)
|
53
|
+
|
46
54
|
title = nil
|
47
55
|
body = nil
|
48
56
|
File.open(src) do |fsrc|
|
@@ -62,4 +70,5 @@ end
|
|
62
70
|
stat = File.stat(src)
|
63
71
|
created = stat.ctime
|
64
72
|
modified = stat.mtime
|
65
|
-
|
73
|
+
|
74
|
+
$stdout << template.result(binding)
|
@@ -0,0 +1,34 @@
|
|
1
|
+
desc 'Release the website and new gem version'
|
2
|
+
task :deploy => [:check_version, :website, :release] do
|
3
|
+
puts "Remember to create SVN tag:"
|
4
|
+
puts "svn copy svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/trunk " +
|
5
|
+
"svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
|
6
|
+
puts "Suggested comment:"
|
7
|
+
puts "Tagging release #{CHANGES}"
|
8
|
+
end
|
9
|
+
|
10
|
+
desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
|
11
|
+
task :local_deploy => [:website_generate, :install_gem]
|
12
|
+
|
13
|
+
task :check_version do
|
14
|
+
unless ENV['VERSION']
|
15
|
+
puts 'Must pass a VERSION=x.y.z release version'
|
16
|
+
exit
|
17
|
+
end
|
18
|
+
unless ENV['VERSION'] == VERS
|
19
|
+
puts "Please update your version.rb to match the release version, currently #{VERS}"
|
20
|
+
exit
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
desc 'Install the package as a gem, without generating documentation(ri/rdoc)'
|
25
|
+
task :install_gem_no_doc => [:clean, :package] do
|
26
|
+
sh "#{'sudo ' unless Hoe::WINDOZE }gem install pkg/*.gem --no-rdoc --no-ri"
|
27
|
+
end
|
28
|
+
|
29
|
+
namespace :manifest do
|
30
|
+
desc 'Recreate Manifest.txt to include ALL files'
|
31
|
+
task :refresh do
|
32
|
+
`rake check_manifest | patch -p0 > Manifest.txt`
|
33
|
+
end
|
34
|
+
end
|
data/tasks/website.rake
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
desc 'Generate website files'
|
2
|
+
task :website_generate => :ruby_env do
|
3
|
+
(Dir['website/**/*.txt'] - Dir['website/version*.txt']).each do |txt|
|
4
|
+
sh %{ #{RUBY_APP} script/txt2html #{txt} > #{txt.gsub(/txt$/,'html')} }
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
desc 'Upload website files to rubyforge'
|
9
|
+
task :website_upload do
|
10
|
+
host = "#{rubyforge_username}@rubyforge.org"
|
11
|
+
remote_dir = "/var/www/gforge-projects/#{PATH}/"
|
12
|
+
local_dir = 'website'
|
13
|
+
sh %{rsync -aCv #{local_dir}/ #{host}:#{remote_dir}}
|
14
|
+
end
|
15
|
+
|
16
|
+
desc 'Generate and upload website files'
|
17
|
+
task :website => [:website_generate, :website_upload, :publish_docs]
|
@@ -4,15 +4,15 @@ class TestGenerateBuiltinTestUnit < Test::Unit::TestCase
|
|
4
4
|
include RubiGen::GeneratorTestHelper
|
5
5
|
|
6
6
|
def setup
|
7
|
-
|
7
|
+
bare_teardown
|
8
8
|
end
|
9
9
|
|
10
10
|
def teardown
|
11
|
-
|
11
|
+
bare_teardown
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_with_no_options
|
15
|
-
run_generator('test_unit', %w[AccountReceiver],
|
15
|
+
run_generator('test_unit', %w[AccountReceiver], sources)
|
16
16
|
assert_generated_file("test/test_account_receiver.rb")
|
17
17
|
assert_generated_class("test/test_account_receiver", "Test::Unit::TestCase") do
|
18
18
|
assert_has_method("setup")
|
@@ -20,4 +20,14 @@ class TestGenerateBuiltinTestUnit < Test::Unit::TestCase
|
|
20
20
|
assert_has_method("test_truth")
|
21
21
|
end
|
22
22
|
end
|
23
|
+
|
24
|
+
private
|
25
|
+
def sources
|
26
|
+
[RubiGen::PathSource.new(:testing, File.join(File.dirname(__FILE__),"..", generator_path))
|
27
|
+
]
|
28
|
+
end
|
29
|
+
|
30
|
+
def generator_path
|
31
|
+
"test_unit_generators"
|
32
|
+
end
|
23
33
|
end
|
File without changes
|
File without changes
|
File without changes
|
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.7</a>
|
35
35
|
</div>
|
36
36
|
<h1>Ruby Generator Framework</h1>
|
37
37
|
|
@@ -349,7 +349,7 @@ The trunk repository is <code>svn://rubyforge.org/var/svn/rubigen/trunk</code> f
|
|
349
349
|
|
350
350
|
<p>Comments are welcome. Send an email to <a href="mailto:drnicwilliams@gmail.com">Dr Nic Williams</a> via the <a href="http://groups.google.com/group/rubigen">forum</a></p>
|
351
351
|
<p class="coda">
|
352
|
-
<a href="drnicwilliams@gmail.com">Dr Nic Williams</a>,
|
352
|
+
<a href="drnicwilliams@gmail.com">Dr Nic Williams</a>, 2nd November 2007<br>
|
353
353
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
354
354
|
</p>
|
355
355
|
</div>
|
metadata
CHANGED
@@ -3,8 +3,8 @@ 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-
|
6
|
+
version: 1.0.7
|
7
|
+
date: 2007-11-02 00:00:00 -04:00
|
8
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
|
@@ -45,6 +45,8 @@ files:
|
|
45
45
|
- app_generators/ruby_app/templates/test/test_helper.rb.erb
|
46
46
|
- bin/install_rubigen_scripts
|
47
47
|
- bin/ruby_app
|
48
|
+
- config/hoe.rb
|
49
|
+
- config/requirements.rb
|
48
50
|
- examples/rails_generators/applications/app/USAGE
|
49
51
|
- examples/rails_generators/applications/app/app_generator.rb
|
50
52
|
- examples/rails_generators/components/controller/USAGE
|
@@ -120,9 +122,6 @@ files:
|
|
120
122
|
- generators/install_rubigen_scripts/templates/script/destroy
|
121
123
|
- generators/install_rubigen_scripts/templates/script/generate
|
122
124
|
- 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
|
126
125
|
- lib/rubigen.rb
|
127
126
|
- lib/rubigen/base.rb
|
128
127
|
- lib/rubigen/commands.rb
|
@@ -138,10 +137,14 @@ files:
|
|
138
137
|
- lib/rubigen/simple_logger.rb
|
139
138
|
- lib/rubigen/spec.rb
|
140
139
|
- lib/rubigen/version.rb
|
140
|
+
- log/debug.log
|
141
141
|
- script/destroy
|
142
142
|
- script/generate
|
143
143
|
- script/txt2html
|
144
144
|
- setup.rb
|
145
|
+
- tasks/deployment.rake
|
146
|
+
- tasks/environment.rake
|
147
|
+
- tasks/website.rake
|
145
148
|
- test/examples_from_rails/generator_test_helper.rb
|
146
149
|
- test/examples_from_rails/test_rails_resource_generator.rb
|
147
150
|
- test/examples_from_rails/test_rails_scaffold_generator.rb
|
@@ -151,6 +154,9 @@ files:
|
|
151
154
|
- test/test_helper.rb
|
152
155
|
- test/test_install_rubigen_scripts_generator.rb
|
153
156
|
- test/test_lookup.rb
|
157
|
+
- test_unit_generators/test_unit/USAGE
|
158
|
+
- test_unit_generators/test_unit/templates/test.rb
|
159
|
+
- test_unit_generators/test_unit/test_unit_generator.rb
|
154
160
|
- website/index.html
|
155
161
|
- website/index.txt
|
156
162
|
- website/javascripts/rounded_corners_lite.inc.js
|
@@ -183,13 +189,5 @@ extensions: []
|
|
183
189
|
|
184
190
|
requirements: []
|
185
191
|
|
186
|
-
dependencies:
|
187
|
-
|
188
|
-
name: activesupport
|
189
|
-
version_requirement:
|
190
|
-
version_requirements: !ruby/object:Gem::Version::Requirement
|
191
|
-
requirements:
|
192
|
-
- - ">="
|
193
|
-
- !ruby/object:Gem::Version
|
194
|
-
version: 1.3.1
|
195
|
-
version:
|
192
|
+
dependencies: []
|
193
|
+
|