rubigen 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,12 @@
1
+ == 1.0.2 2007-08-22
2
+
3
+ * Renamed rubigen_install_script -> install_rubigen_script
4
+ * install_rubigen_script is now a component generator so can be reused by other generators to create script/generate
5
+ * Added "Thanks to Jeremy Kemper" into website
6
+ * Cleaned up USAGE for test_unit
7
+ * If a generator does not have a USAGE file, then it is invisible from lists of available generators.
8
+ This will be the mechanism for having hidden generators (e.g. install_rubigen_scripts)
9
+
1
10
  == 1.0.1 2007-08-20
2
11
 
3
12
  * Moved builtin generators into root folders, away from lib folder, to protected them
data/Manifest.txt CHANGED
@@ -3,6 +3,7 @@ License.txt
3
3
  Manifest.txt
4
4
  README.txt
5
5
  Rakefile
6
+ Todo.txt
6
7
  app_generators/ruby_app/USAGE
7
8
  app_generators/ruby_app/ruby_app_generator.rb
8
9
  app_generators/ruby_app/templates/README.txt
@@ -84,7 +85,6 @@ examples/rails_generators/components/web_service/templates/api_definition.rb
84
85
  examples/rails_generators/components/web_service/templates/controller.rb
85
86
  examples/rails_generators/components/web_service/templates/functional_test.rb
86
87
  examples/rails_generators/components/web_service/web_service_generator.rb
87
- generators/install_rubigen_scripts/USAGE
88
88
  generators/install_rubigen_scripts/install_rubigen_scripts_generator.rb
89
89
  generators/install_rubigen_scripts/templates/script/destroy
90
90
  generators/install_rubigen_scripts/templates/script/generate
data/README.txt CHANGED
@@ -20,6 +20,10 @@ If you are developing a RubyGem, then you will want a different set of generator
20
20
 
21
21
  RubiGen exists to give different development environments their own generator framework.
22
22
 
23
+ === Thanks go to...
24
+
25
+ Jeremy Kemper wrote the original Rails Generator, which is 95% of the basis of RubiGen. He's awesome.
26
+
23
27
  == Installation
24
28
 
25
29
  RubiGen is only required at development time, and normally isn't required at deployment time
data/Todo.txt ADDED
@@ -0,0 +1,5 @@
1
+ = TODO
2
+
3
+ * Labels for displays based on scope (common, merb, newgem), not rubygems, builtin, etc. Perhaps use one PathSource per scope.
4
+ See RubiGen::Scripts::Base#usage_message
5
+ * Local generators (~/.rubigen) can be scoped (~/.rubigen/merb_generators)
@@ -50,12 +50,12 @@ class RubyAppGenerator < RubiGen::Base
50
50
  "Usage: #{$0} /path/to/your/app [options]"
51
51
  end
52
52
 
53
- def add_options!(opt)
54
- opt.separator ''
55
- opt.separator 'Options:'
56
- opt.on("-r", "--ruby=path", String,
53
+ def add_options!(opts)
54
+ opts.separator ''
55
+ opts.separator 'Options:'
56
+ opts.on("-r", "--ruby=path", String,
57
57
  "Path to the Ruby binary of your choice (otherwise scripts use env, dispatchers current path).",
58
- "Default: #{DEFAULT_SHEBANG}") { |v| options[:shebang] = v }
58
+ "Default: #{DEFAULT_SHEBANG}") { |options[:shebang]| }
59
59
  end
60
60
 
61
61
 
@@ -5,10 +5,10 @@ Description:
5
5
  This generates a unit test in /test.
6
6
 
7
7
  Examples:
8
- `./script/generate test_unit account_receiver`
8
+ script/generate test_unit account_receiver
9
9
 
10
- creates an Account test:
11
- Test: test/test_account_receiver.rb
10
+ creates an Account test:
11
+ Test: test/test_account_receiver.rb
12
12
 
13
- The same result will occur for:
14
- `./script/generate test_unit AccountReceiver`
13
+ The same result will occur for:
14
+ script/generate test_unit AccountReceiver
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/test_helper'
2
2
 
3
- class <%= class_name %> < Test::Unit::TestCase
3
+ class Test<%= class_name %> < Test::Unit::TestCase
4
4
  def setup
5
5
  end
6
6
 
@@ -7,7 +7,7 @@ class TestUnitGenerator < RubiGen::Base
7
7
  usage if args.empty?
8
8
  @name = args.shift
9
9
  @test_name = "test_#{name}".underscore
10
- @class_name = test_name.camelize
10
+ @class_name = name.camelize
11
11
  end
12
12
 
13
13
  def manifest
@@ -9,13 +9,7 @@ module RubiGen
9
9
 
10
10
  # Instatiates the Generator
11
11
  def build_generator(name, params, sources, options)
12
- # if !options.first
13
- # type, sources = :component, []
14
- # elsif options.first.is_a?(Symbol)
15
- # type, sources = options.first, []
16
- # else
17
- # type, sources = :component, options.select { |s| s.is_a?(Source) }
18
- # end
12
+ options.merge!(:collision => :force) # so no questions are prompted
19
13
  if sources.is_a?(Symbol)
20
14
  if sources == :app
21
15
  RubiGen::Base.use_application_sources!
@@ -196,8 +196,16 @@ module RubiGen
196
196
  end
197
197
 
198
198
  # Return a convenient sorted list of all generator names.
199
- def names
200
- map { |spec| spec.name }.sort
199
+ def names(filter = nil)
200
+ inject([]) do |mem, spec|
201
+ case filter
202
+ when :visible
203
+ mem << spec.name if spec.visible?
204
+ else
205
+ usage_message
206
+ end
207
+ mem
208
+ end.sort
201
209
  end
202
210
  end
203
211
 
@@ -45,7 +45,7 @@ module RubiGen
45
45
  RubiGen::Base.sources.inject({}) do |mem, source|
46
46
  label = source.label.to_s.capitalize
47
47
  mem[label] ||= []
48
- mem[label] |= source.names
48
+ mem[label] |= source.names(:visible)
49
49
  mem
50
50
  end.each_pair do |label, names|
51
51
  usage << " #{label}: #{names.join(', ')}\n" unless names.empty?
data/lib/rubigen/spec.rb CHANGED
@@ -27,6 +27,14 @@ module RubiGen
27
27
  def class_name
28
28
  "#{name.camelize}Generator"
29
29
  end
30
+
31
+ def usage_file
32
+ "#{path}/USAGE"
33
+ end
34
+
35
+ def visible?
36
+ File.exists? usage_file
37
+ end
30
38
 
31
39
  private
32
40
  # Search for the first Class descending from RubiGen::Base
@@ -2,7 +2,7 @@ module Rubigen #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 1
4
4
  MINOR = 0
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
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.1</a>
34
+ <a href="http://rubyforge.org/projects/rubigen" class="numbers">1.0.2</a>
35
35
  </div>
36
36
  <h1>Ruby Generator Framework</h1>
37
37
 
@@ -332,6 +332,12 @@ script/generate component_generator
332
332
  The trunk repository is <code>svn://rubyforge.org/var/svn/rubigen/trunk</code> for anonymous access.</p>
333
333
 
334
334
 
335
+ <h2>Thanks go to&#8230;</h2>
336
+
337
+
338
+ <p>Jeremy Kemper (bitsweat) who wrote the original <a href="http://dev.rubyonrails.org">Rails Generator</a>.</p>
339
+
340
+
335
341
  <h2>License</h2>
336
342
 
337
343
 
@@ -343,7 +349,7 @@ The trunk repository is <code>svn://rubyforge.org/var/svn/rubigen/trunk</code> f
343
349
 
344
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>
345
351
  <p class="coda">
346
- <a href="drnicwilliams@gmail.com">Dr Nic Williams</a>, 20th August 2007<br>
352
+ <a href="drnicwilliams@gmail.com">Dr Nic Williams</a>, 22nd August 2007<br>
347
353
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
348
354
  </p>
349
355
  </div>
data/website/index.txt CHANGED
@@ -243,6 +243,10 @@ h2. How to submit patches
243
243
  Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
244
244
  The trunk repository is <code>svn://rubyforge.org/var/svn/rubigen/trunk</code> for anonymous access.
245
245
 
246
+ h2. Thanks go to...
247
+
248
+ Jeremy Kemper (bitsweat) who wrote the original "Rails Generator":http://dev.rubyonrails.org.
249
+
246
250
  h2. License
247
251
 
248
252
  This code is free to use under the terms of the MIT license.
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.1
7
- date: 2007-08-21 00:00:00 +02:00
6
+ version: 1.0.2
7
+ date: 2007-08-22 00:00:00 +02: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
@@ -34,6 +34,7 @@ files:
34
34
  - Manifest.txt
35
35
  - README.txt
36
36
  - Rakefile
37
+ - Todo.txt
37
38
  - app_generators/ruby_app/USAGE
38
39
  - app_generators/ruby_app/ruby_app_generator.rb
39
40
  - app_generators/ruby_app/templates/README.txt
@@ -115,7 +116,6 @@ files:
115
116
  - examples/rails_generators/components/web_service/templates/controller.rb
116
117
  - examples/rails_generators/components/web_service/templates/functional_test.rb
117
118
  - examples/rails_generators/components/web_service/web_service_generator.rb
118
- - generators/install_rubigen_scripts/USAGE
119
119
  - generators/install_rubigen_scripts/install_rubigen_scripts_generator.rb
120
120
  - generators/install_rubigen_scripts/templates/script/destroy
121
121
  - generators/install_rubigen_scripts/templates/script/generate
@@ -173,6 +173,7 @@ extra_rdoc_files:
173
173
  - License.txt
174
174
  - Manifest.txt
175
175
  - README.txt
176
+ - Todo.txt
176
177
  - app_generators/ruby_app/templates/README.txt
177
178
  - website/index.txt
178
179
  executables:
File without changes