newgem 0.29.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/History.txt +15 -1
  2. data/Manifest.txt +7 -22
  3. data/README.rdoc +55 -33
  4. data/Rakefile +22 -7
  5. data/app_generators/newgem/newgem_generator.rb +23 -23
  6. data/app_generators/newgem/templates/Rakefile +27 -3
  7. data/app_generators/newgem/templates/lib/module.rb +1 -1
  8. data/bin/newgem +12 -2
  9. data/config/website.yml +2 -0
  10. data/features/development.feature +22 -0
  11. data/features/executable_generator.feature +6 -6
  12. data/features/expected_outputs/newgem.out +2 -9
  13. data/features/install_cucumber.feature +11 -0
  14. data/features/install_website.feature +13 -0
  15. data/features/newgem_cli.feature +60 -0
  16. data/features/steps/cli.rb +125 -36
  17. data/features/steps/env.rb +4 -2
  18. data/lib/newgem/support/tasks.rb +10 -0
  19. data/lib/newgem/tasks.rb +1 -0
  20. data/lib/newgem.rb +5 -5
  21. data/newgem_generators/install_website/install_website_generator.rb +12 -9
  22. data/newgem_generators/install_website/templates/config/website.yml.sample.erb +2 -0
  23. data/newgem_generators/install_website/templates/script/txt2html +5 -16
  24. data/newgem_generators/install_website/templates/tasks/website.rake +34 -4
  25. data/rubygems_generators/executable/templates/test/test_cli.rb.erb +1 -1
  26. data/script/txt2html +5 -16
  27. data/tasks/deployment.rake +5 -6
  28. data/tasks/website.rake +34 -6
  29. data/test/test_install_website_generator.rb +1 -0
  30. data/test/test_newgem_generator.rb +0 -10
  31. data/website/index.html +27 -22
  32. data/website/index.txt +30 -19
  33. data/website/rubyforge.html +2 -2
  34. data/website/version.js +0 -4
  35. metadata +35 -67
  36. data/Todo.txt +0 -4
  37. data/app_generators/newgem/templates/config/hoe.rb +0 -82
  38. data/app_generators/newgem/templates/config/requirements.rb +0 -15
  39. data/app_generators/newgem/templates/lib/version.rb +0 -10
  40. data/app_generators/newgem/templates/setup.rb +0 -1585
  41. data/app_generators/newgem/templates/tasks/deployment.rake +0 -34
  42. data/app_generators/newgem/templates/tasks/environment.rake +0 -7
  43. data/app_generators/newgem/templates/tasks/website.rake +0 -9
  44. data/config/hoe.rb +0 -62
  45. data/features/cli.feature +0 -28
  46. data/features/steps/executable_generator.rb +0 -0
  47. data/lib/newgem/version.rb +0 -9
  48. data/rubygems_generators/install_rspec_stories/USAGE +0 -5
  49. data/rubygems_generators/install_rspec_stories/install_rspec_stories_generator.rb +0 -54
  50. data/rubygems_generators/install_rspec_stories/templates/all.rb +0 -8
  51. data/rubygems_generators/install_rspec_stories/templates/steps.rb +0 -13
  52. data/rubygems_generators/install_rspec_stories/templates/story.story +0 -9
  53. data/script/txt2html.rb +0 -70
  54. data/script/txt2js +0 -59
  55. data/setup.rb +0 -1585
  56. data/tasks/generator_report.rake +0 -19
  57. data/test/test_install_rspec_stories_generator.rb +0 -45
data/History.txt CHANGED
@@ -1,4 +1,18 @@
1
- == 0.29.0 2008-10-18 NOT RELEASED
1
+ == 1.0.0 2008-10-21
2
+
3
+ * Yay for 1.0.0 of New Gem Generator!
4
+ * massive overhaul of Hoe definition and rake tasks
5
+ * config/hoe.rb is gone, a more condensed version is back in Rakefile
6
+ * config/dependencies.rb is gone, this functionality is now supported by RubyGems 1.2's dev dependency mechanism
7
+ * generated gems no longer have generated tasks; rather they reuse those in newgem itself
8
+ * to override a task, use the help method +remove_task+
9
+ * Hoe declaration is more concise and reuses the available defaults by Hoe
10
+ * No more wacky CONSTANTS in hoe declaration; reusing $hoe to access these values
11
+ * no more version.rb; the VERSION constant is in lib/+gemname+.rb
12
+ * install_website: uses a config/website.yml for username/host/remote_dir (defaults to rubyforge)
13
+ * Removed install_rspec_stories which was superseded by install_cucumber
14
+
15
+ == 0.29.0 2008-10-18
2
16
 
3
17
  * execute generator uses a lib/appname/cli.rb file
4
18
  * basic feature descriptions for newgem and executable generators
data/Manifest.txt CHANGED
@@ -3,23 +3,15 @@ Manifest.txt
3
3
  PostInstall.txt
4
4
  README.rdoc
5
5
  Rakefile
6
- Todo.txt
7
6
  app_generators/newgem/newgem_generator.rb
8
7
  app_generators/newgem/templates/History.txt
9
8
  app_generators/newgem/templates/PostInstall.txt
10
9
  app_generators/newgem/templates/README.rdoc
11
10
  app_generators/newgem/templates/Rakefile
12
- app_generators/newgem/templates/config/hoe.rb
13
- app_generators/newgem/templates/config/requirements.rb
14
11
  app_generators/newgem/templates/lib/module.rb
15
- app_generators/newgem/templates/lib/version.rb
16
12
  app_generators/newgem/templates/readme
17
13
  app_generators/newgem/templates/script/console.erb
18
14
  app_generators/newgem/templates/script/win_script.cmd
19
- app_generators/newgem/templates/setup.rb
20
- app_generators/newgem/templates/tasks/deployment.rake
21
- app_generators/newgem/templates/tasks/environment.rake
22
- app_generators/newgem/templates/tasks/website.rake
23
15
  app_generators/newgem_simple/USAGE
24
16
  app_generators/newgem_simple/newgem_simple_generator.rb
25
17
  app_generators/newgem_simple/templates/LICENSE
@@ -34,24 +26,27 @@ bundles/RubyGem.tmbundle/Snippets/History header trunk.tmSnippet
34
26
  bundles/RubyGem.tmbundle/Snippets/History header.tmSnippet
35
27
  bundles/RubyGem.tmbundle/Syntaxes/Rdoc.tmLanguage
36
28
  bundles/RubyGem.tmbundle/info.plist
37
- config/hoe.rb
29
+ config/website.yml
38
30
  cucumber_generators/feature/USAGE
39
31
  cucumber_generators/feature/feature_generator.rb
40
32
  cucumber_generators/feature/templates/feature.erb
41
33
  cucumber_generators/feature/templates/steps.erb
42
- features/cli.feature
34
+ features/development.feature
43
35
  features/executable_generator.feature
44
36
  features/expected_outputs/newgem.out
37
+ features/install_cucumber.feature
38
+ features/install_website.feature
39
+ features/newgem_cli.feature
45
40
  features/steps/cli.rb
46
41
  features/steps/env.rb
47
- features/steps/executable_generator.rb
48
42
  lib/newgem.rb
49
43
  lib/newgem/quick_template.rb
50
44
  lib/newgem/rubyforge.rb
45
+ lib/newgem/support/tasks.rb
51
46
  lib/newgem/tasks.rb
52
- lib/newgem/version.rb
53
47
  newgem_generators/install_website/USAGE
54
48
  newgem_generators/install_website/install_website_generator.rb
49
+ newgem_generators/install_website/templates/config/website.yml.sample.erb
55
50
  newgem_generators/install_website/templates/script/txt2html
56
51
  newgem_generators/install_website/templates/script/win_script.cmd
57
52
  newgem_generators/install_website/templates/tasks/website.rake
@@ -94,11 +89,6 @@ rubygems_generators/install_rspec/templates/spec.rb
94
89
  rubygems_generators/install_rspec/templates/spec/spec.opts
95
90
  rubygems_generators/install_rspec/templates/spec/spec_helper.rb
96
91
  rubygems_generators/install_rspec/templates/tasks/rspec.rake
97
- rubygems_generators/install_rspec_stories/USAGE
98
- rubygems_generators/install_rspec_stories/install_rspec_stories_generator.rb
99
- rubygems_generators/install_rspec_stories/templates/all.rb
100
- rubygems_generators/install_rspec_stories/templates/steps.rb
101
- rubygems_generators/install_rspec_stories/templates/story.story
102
92
  rubygems_generators/install_test_unit/USAGE
103
93
  rubygems_generators/install_test_unit/install_test_unit_generator.rb
104
94
  rubygems_generators/install_test_unit/templates/test/test.rb
@@ -106,14 +96,10 @@ rubygems_generators/install_test_unit/templates/test/test_helper.rb
106
96
  script/destroy
107
97
  script/generate
108
98
  script/txt2html
109
- script/txt2html.rb
110
- script/txt2js
111
- setup.rb
112
99
  tasks/bundles.rake
113
100
  tasks/cucumber.rake
114
101
  tasks/deployment.rake
115
102
  tasks/environment.rake
116
- tasks/generator_report.rake
117
103
  tasks/website.rake
118
104
  test/fixtures/home/.rubyforge/auto-config.yml
119
105
  test/fixtures/home/.rubyforge/user-config.yml
@@ -125,7 +111,6 @@ test/test_helper.rb
125
111
  test/test_install_cucumber_generator.rb
126
112
  test/test_install_jruby_generator.rb
127
113
  test/test_install_rspec_generator.rb
128
- test/test_install_rspec_stories_generator.rb
129
114
  test/test_install_test_unit_generator.rb
130
115
  test/test_install_website_generator.rb
131
116
  test/test_newgem_generator.rb
data/README.rdoc CHANGED
@@ -14,38 +14,59 @@ Within this gem, you get one thing - <code>newgem</code> - an executable to crea
14
14
 
15
15
  Go to the folder where you want to create your new gem folder structure, and run the <code>newgem</code> command to generate your gem scaffolding.
16
16
 
17
- cd ~/ruby_projects
18
- $ newgem wizzo
19
- creating: wizzo
20
- creating: wizzo/CHANGELOG.txt
21
- creating: wizzo/README.txt
22
- creating: wizzo/lib
23
- creating: wizzo/script
24
- creating: wizzo/website
25
- creating: wizzo/website/javascripts
26
- creating: wizzo/website/stylesheets
27
- creating: wizzo/lib/wizzo
28
- creating: wizzo/lib/wizzo.rb
29
- creating: wizzo/lib/wizzo/version.rb
30
- creating: wizzo/bin
31
- creating: wizzo/test
32
- creating: wizzo/test/test_helper.rb
33
- creating: wizzo/test/test_wizzo.rb
34
- creating: wizzo/examples
35
- creating: wizzo/setup.rb
36
- creating: wizzo/Rakefile
37
- creating: wizzo/Manifest.txt
38
- creating: wizzo/History.txt
39
- creating: wizzo/script/generate
40
- creating: wizzo/script/txt2html
41
- creating: wizzo/website/index.txt
42
- creating: wizzo/website/template.html.erb
43
- copying: wizzo/website/javascripts/rounded_corners_lite.inc.js
44
- copying: wizzo/website/stylesheets/screen.css
45
- NOW - update wizzo/Rakefile with gem description, etc
46
-
47
-
48
- As of 0.10.0 - you can generate test::unit or rspec test stubs via the -t, --test-with options
17
+ cd ~/ruby_projects
18
+ $ newgem wizzo
19
+ create
20
+ create config
21
+ create doc
22
+ create lib
23
+ create script
24
+ create tasks
25
+ create lib/wizzo
26
+ create History.txt
27
+ create Rakefile
28
+ create README.rdoc
29
+ create PostInstall.txt
30
+ create lib/wizzo.rb
31
+ create lib/wizzo/version.rb
32
+ create config/hoe.rb
33
+ create config/requirements.rb
34
+ create tasks/deployment.rake
35
+ create tasks/environment.rake
36
+ create tasks/website.rake
37
+ dependency install_test_unit
38
+ create test
39
+ create test/test_helper.rb
40
+ create test/test_wizzo.rb
41
+ dependency install_website
42
+ create website/javascripts
43
+ create website/stylesheets
44
+ exists script
45
+ exists tasks
46
+ create website/index.txt
47
+ create website/index.html
48
+ create script/txt2html
49
+ force tasks/website.rake
50
+ dependency plain_theme
51
+ exists website/javascripts
52
+ exists website/stylesheets
53
+ create website/template.html.erb
54
+ create website/stylesheets/screen.css
55
+ create website/javascripts/rounded_corners_lite.inc.js
56
+ dependency install_rubigen_scripts
57
+ exists script
58
+ create script/generate
59
+ create script/destroy
60
+ create script/console
61
+ create Manifest.txt
62
+ readme readme
63
+ Important
64
+ =========
65
+
66
+ * Open config/hoe.rb
67
+ * Update missing details (gem description, dependent gems, etc.)
68
+
69
+ You can generate test::unit or rspec test stubs via the -T, --test-with options (shoulda coming soon)
49
70
 
50
71
  == SYNOPSIS:
51
72
 
@@ -60,12 +81,13 @@ Now modify the constants at the top of *config/hoe.rb*, with your name, email an
60
81
 
61
82
  The <code>newgem</code> application is distributed itself as a RubyGem and is available immediately after installation.
62
83
 
63
- <pre syntax="ruby">sudo gem install newgem</pre>
84
+ sudo gem install newgem
64
85
 
65
86
  Alternately, download the gem and install manually.
66
87
 
67
88
  == TUTORIALS:
68
89
 
90
+ * Home page is a full tutorial - http://newgem.rubyforge.org
69
91
  * Original blog article and tutorial - http://drnicwilliams.com/2006/10/11/generating-new-gems/
70
92
  * Tutorial: Publishing RubyGems with Hoe - http://nubyonrails.com/articles/2007/06/15/tutorial-publishing-rubygems-with-hoe by Geoffrey Grosenbach
71
93
  * Using New Gem Generator in Windows - http://codeconversations.blogspot.com/2007/07/using-new-gem-generator-in-windows_8009.html by Jorge Cangas
data/Rakefile CHANGED
@@ -1,10 +1,25 @@
1
- require 'rubygems'
2
- require 'rake'
3
- require 'rake/clean'
4
- require 'fileutils'
5
- include FileUtils
1
+ %w[rubygems rake rake/clean fileutils hoe rubigen].each { |f| require f }
2
+ require File.dirname(__FILE__) + '/lib/newgem'
3
+
4
+ # Generate all the Rake tasks
5
+ # Run 'rake -T' to see list of generated tasks (from gem root directory)
6
+ $hoe = Hoe.new('newgem', Newgem::VERSION) do |p|
7
+ p.developer('Dr Nic Williams', 'drnicwilliams@gmail.com')
8
+ p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
9
+ p.post_install_message = 'PostInstall.txt'
10
+ p.extra_deps = [
11
+ ['activesupport','>= 2.0.2'],
12
+ ['rubigen',">= #{RubiGen::VERSION}"],
13
+ ['hoe', ">= #{Hoe::VERSION}"],
14
+ ['RedCloth','>= 4.0.0'], # for website generation
15
+ ['syntax','>= 1.0.0']
16
+ ]
17
+ p.spec_extras['rdoc_options'] = ['--main', Dir['README*'].first] # hopefully fixed in future hoe > 1.8
18
+ p.clean_globs |= %w[**/.DS_Store tmp *.log]
19
+ path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
20
+ p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
21
+ p.rsync_args = '-av --delete --ignore-errors'
22
+ end
6
23
 
7
- $:.unshift 'lib'
8
- require 'config/hoe' # setup Hoe + all gem configuration
9
24
  require 'newgem/tasks' # load /tasks/*.rake
10
25
 
@@ -31,7 +31,7 @@ class NewgemGenerator < RubiGen::Base
31
31
  usage if args.empty?
32
32
  @destination_root = File.expand_path(args.shift)
33
33
  @gem_name = base_name
34
- @module_name = gem_name.camelize
34
+ @module_name = gem_name.gsub('-','_').camelize
35
35
  @project_name = @gem_name
36
36
  extract_options
37
37
  end
@@ -50,17 +50,9 @@ class NewgemGenerator < RubiGen::Base
50
50
 
51
51
  # Root
52
52
  m.template_copy_each %w( History.txt Rakefile README.rdoc PostInstall.txt )
53
- m.file_copy_each %w( setup.rb )
54
53
 
55
54
  # Default module for app
56
55
  m.template "lib/module.rb", "lib/#{gem_name}.rb"
57
- m.template "lib/version.rb", "lib/#{gem_name}/version.rb"
58
-
59
- # Config
60
- m.template_copy_each %w( hoe.rb requirements.rb ), "config"
61
-
62
- # Tasks
63
- m.file_copy_each %w( deployment.rake environment.rake website.rake ), "tasks"
64
56
 
65
57
  # Selecting a test framework
66
58
  case test_framework
@@ -74,14 +66,18 @@ class NewgemGenerator < RubiGen::Base
74
66
  m.dependency "install_website", [gem_name],
75
67
  :author => author, :email => email, :destination => destination_root, :collision => :force unless disable_website
76
68
 
77
- # JRuby
78
- m.dependency "install_jruby", [gem_name], :destination => destination_root, :collision => :force if is_jruby
69
+ # JRuby
70
+ m.dependency "install_jruby", [gem_name], :destination => destination_root, :collision => :force if is_jruby
79
71
 
80
72
  # Executables
81
73
  for bin_name in bin_names_list
82
74
  m.dependency "executable", [bin_name], :destination => destination_root, :collision => :force
83
75
  end
84
-
76
+
77
+ for generator in @install_generators
78
+ m.dependency "install_#{generator}", [], :destination => destination_root, :collision => :force
79
+ end
80
+
85
81
  m.dependency "install_rubigen_scripts", [destination_root, "rubygems", "newgem", "newgem_theme"], :shebang => options[:shebang], :collision => :force
86
82
 
87
83
  %w( console ).each do |file|
@@ -115,10 +111,15 @@ EOS
115
111
  opts.on("-e", "--email=PATH", String,
116
112
  "Your email to be inserted into generated files.",
117
113
  "Default: ~/.rubyforge/user-config.yml[email]") { |x| options[:email] = x }
118
- # TODO --import_path
119
- # opts.on("-i", "--import_path=PATH", String,
120
- # "Path where your files could be copied from.",
121
- # "Default: none") { |x| options[:import_path] = x }
114
+ opts.on("-i", "--install=generator", String,
115
+ "Installs a generator called install_<generator>.",
116
+ "For example, '-i cucumber' runs the install_cucumber generator.",
117
+ "Can be used multiple times for different generators.",
118
+ "Cannot be used for generators that require argumnts.",
119
+ "Default: none") do |generator|
120
+ options[:install] ||= []
121
+ options[:install] << generator
122
+ end
122
123
  opts.on("-j", "--jruby",
123
124
  "Use if gem is for jruby.") { |x| options[:jruby] = x }
124
125
  opts.on("-a", "--author=PATH", String,
@@ -154,18 +155,17 @@ EOS
154
155
  @author ||= rubyforge_config.full_name
155
156
  @email ||= rubyforge_config.email
156
157
  end
157
- @bin_names_list = (options[:bin_name] || "").split(',')
158
- @disable_website = options[:disable_website]
159
-
160
- @test_framework = options[:test_framework] || "test_unit"
161
- @is_jruby = options[:jruby]
162
- @project_name = options[:project] if options.include?(:project)
158
+ @bin_names_list = (options[:bin_name] || "").split(',')
159
+ @disable_website = options[:disable_website]
160
+ @test_framework = options[:test_framework] || "test_unit"
161
+ @is_jruby = options[:jruby]
162
+ @project_name = options[:project] if options.include?(:project)
163
+ @install_generators = options[:install] || []
163
164
  end
164
165
 
165
166
  # Installation skeleton. Intermediate directories are automatically
166
167
  # created so don't sweat their absence here.
167
168
  BASEDIRS = %w(
168
- config
169
169
  doc
170
170
  lib
171
171
  script
@@ -1,4 +1,28 @@
1
- require 'config/requirements'
2
- require 'config/hoe' # setup Hoe + all gem configuration
1
+ %w[rubygems rake rake/clean fileutils hoe newgem rubigen].each { |f| require f }
2
+ require File.dirname(__FILE__) + '/lib/<%= gem_name %>'
3
+
4
+ # Generate all the Rake tasks
5
+ # Run 'rake -T' to see list of generated tasks (from gem root directory)
6
+ $hoe = Hoe.new('<%= gem_name %>', <%= module_name %>::VERSION) do |p|
7
+ p.developer('<%= author %>', '<%= email %>')
8
+ p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
9
+ p.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
10
+ p.rubyforge_name = p.name # TODO this is default value
11
+ # p.extra_deps = [
12
+ # ['activesupport','>= 2.0.2'],
13
+ # ]
14
+ p.extra_dev_deps = [
15
+ ['newgem', ">= #{::Newgem::VERSION}"]
16
+ ]
17
+ <% if is_jruby -%>
18
+ p.spec_extras['platform'] = 'jruby' # JRuby gem created, e.g. <%= gem_name %>-X.Y.Z-jruby.gem
19
+ <% end -%>
20
+ p.spec_extras['rdoc_options'] = ['--main', Dir['README*'].first] # hopefully fixed in future hoe > 1.8
21
+ p.clean_globs |= %w[**/.DS_Store tmp *.log]
22
+ path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
23
+ p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
24
+ p.rsync_args = '-av --delete --ignore-errors'
25
+ end
26
+
27
+ require 'newgem/tasks' # load /tasks/*.rake
3
28
 
4
- Dir['tasks/**/*.rake'].each { |rake| load rake }
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  module <%= module_name %>
5
-
5
+ VERSION = '<%= version.join('.') %>'
6
6
  end
data/bin/newgem CHANGED
@@ -5,12 +5,22 @@ require 'rubigen'
5
5
 
6
6
  if %w(-v --version).include? ARGV.first
7
7
  require 'newgem/version'
8
- puts "#{File.basename($0)} #{Newgem::VERSION::STRING}"
8
+ puts "#{File.basename($0)} #{Newgem::VERSION}"
9
9
  exit(0)
10
10
  end
11
11
 
12
12
  require 'rubigen/scripts/generate'
13
- RubiGen::Base.use_application_sources! :rubygems, :newgem, :newgem_theme
13
+
14
+ require "pp"
15
+ RubiGen::Base.use_application_sources! :rubygems
16
+ RubiGen::Base.prepend_sources(*[
17
+ RubiGen::PathSource.new(:app, File.join(File.dirname(__FILE__), "..", "app_generators")),
18
+ RubiGen::PathSource.new(:app, File.join(File.dirname(__FILE__), "..", "newgem_generators")),
19
+ RubiGen::PathSource.new(:app, File.join(File.dirname(__FILE__), "..", "newgem_theme_generators")),
20
+ RubiGen::PathSource.new(:app, File.join(File.dirname(__FILE__), "..", "rubygems_generators"))
21
+ ])
22
+ #
23
+ # pp RubiGen::Base.sources
14
24
 
15
25
  if ARGV.delete "--simple"
16
26
  RubiGen::Scripts::Generate.new.run(ARGV, :generator => 'newgem_simple')
@@ -0,0 +1,2 @@
1
+ host: nicwilliams@rubyforge.org
2
+ remote_dir: /var/www/gforge-projects/newgem/
@@ -0,0 +1,22 @@
1
+ Feature: Development processes of newgem itself (rake tasks)
2
+
3
+ As a Newgem maintainer or contributor
4
+ I want rake tasks to maintain and release the gem
5
+ So that I can spend time on the tests and code, and not excessive time on maintenance processes
6
+
7
+ # Scenario: Deploy project website via local rsync
8
+ # Given copy this project for test
9
+ # Given a safe folder for dummy deployment
10
+ # Given project website configuration for safe folder on local machine
11
+ # When task 'rake website' is invoked
12
+ # Then file 'website/index.html' is created
13
+ # Then remote file 'index.html' is created after local rsync
14
+ # Then remote folder 'rdoc' is created after local rsync
15
+ #
16
+ Scenario: Generate RubyGem
17
+ Given this project is active project folder
18
+ And 'pkg' folder is deleted
19
+ When task 'rake gem' is invoked
20
+ Then folder 'pkg' is created
21
+ And file matching 'pkg/newgem-*.gem' is created
22
+ And gem spec key 'rdoc_options' contains /--mainREADME.rdoc/
@@ -7,22 +7,22 @@ Feature: Generate an executable/CLI scaffold
7
7
  Scenario: Run executable generator with name of executable
8
8
  Given an existing newgem scaffold [called 'my_project']
9
9
  When 'executable' generator is invoked with arguments 'my_app'
10
- Then folder 'my_project/bin/my_app' is created
11
- And file 'my_project/bin/my_app' is created
12
- And file 'my_project/lib/my_app/cli.rb' is created
13
- And file 'my_project/test/test_my_app_cli.rb' is created
10
+ Then folder 'bin/my_app' is created
11
+ And file 'bin/my_app' is created
12
+ And file 'lib/my_app/cli.rb' is created
13
+ And file 'test/test_my_app_cli.rb' is created
14
14
 
15
15
  Scenario: Run CLI app from executable generator to show help
16
16
  Given an existing newgem scaffold [called 'my_project']
17
17
  Given 'executable' generator is invoked with arguments 'my_app'
18
- When run executable 'my_project/bin/my_app' with arguments '-h'
18
+ When run executable 'bin/my_app' with arguments '-h'
19
19
  Then help options '-h' and '--help' are displayed
20
20
  Then help options '-p' and '--path' are displayed
21
21
 
22
22
  Scenario: Run CLI app from executable generator should not fail
23
23
  Given an existing newgem scaffold [called 'my_project']
24
24
  Given 'executable' generator is invoked with arguments 'my_app'
25
- When run executable 'my_project/bin/my_app' with arguments ''
25
+ When run executable 'bin/my_app' with arguments ''
26
26
  Then output matches /lib\/my_app\/cli.rb/
27
27
 
28
28
  Scenario: Run unit tests after executable generator should all pass
@@ -1,5 +1,4 @@
1
1
  create
2
- create config
3
2
  create doc
4
3
  create lib
5
4
  create script
@@ -9,14 +8,7 @@
9
8
  create Rakefile
10
9
  create README.rdoc
11
10
  create PostInstall.txt
12
- create setup.rb
13
11
  create lib/my_project.rb
14
- create lib/my_project/version.rb
15
- create config/hoe.rb
16
- create config/requirements.rb
17
- create tasks/deployment.rake
18
- create tasks/environment.rake
19
- create tasks/website.rake
20
12
  dependency install_test_unit
21
13
  create test
22
14
  create test/test_helper.rb
@@ -24,12 +16,13 @@
24
16
  dependency install_website
25
17
  create website/javascripts
26
18
  create website/stylesheets
19
+ create config
27
20
  exists script
28
21
  exists tasks
29
22
  create website/index.txt
30
23
  create website/index.html
24
+ create config/website.yml.sample
31
25
  create script/txt2html
32
- force tasks/website.rake
33
26
  dependency plain_theme
34
27
  exists website/javascripts
35
28
  exists website/stylesheets
@@ -0,0 +1,11 @@
1
+ Feature: RubyGems have features to be described and tested
2
+
3
+ As a RubyGem developer
4
+ I want to describe the project's features using Cucumber
5
+ So that I can describe each feature of the project in readable text
6
+
7
+ Scenario: Install Cucumber into a RubyGem
8
+ Given an existing newgem scaffold [called 'my_project']
9
+ When 'install_cucumber' generator is invoked with arguments ''
10
+ Then folder 'features/steps' is created
11
+ And file 'tasks/cucumber.rake' is created
@@ -0,0 +1,13 @@
1
+ Feature: RubyGems can have a website to promote and teach
2
+
3
+ As a RubyGem developer
4
+ I want rake tasks to help development and deployment of a website for the project
5
+ So that I can spend time on the tests and code, and not excessive time on maintenance processes
6
+
7
+ Scenario: Deploy project website via local rsync
8
+ Given an existing newgem scaffold [called 'my_project']
9
+ Given project website configuration for safe folder on local machine
10
+ When task 'rake website' is invoked
11
+ Then file 'website/index.html' is created
12
+ Then remote file 'index.html' is created after local rsync
13
+ Then remote folder 'rdoc' is created after local rsync
@@ -0,0 +1,60 @@
1
+ Feature: Can run create RubyGem scaffolds
2
+
3
+ As a developer of RubyGems
4
+ I want to create RubyGem scaffolds
5
+ So that I can rapidly produce specs and code for encapsulated applications and libraries
6
+
7
+ Scenario: Run newgem without any arguments
8
+ Given a safe folder
9
+ Given env variable $RUBYFORGE_USERNAME set to ''
10
+ When newgem is executed for project 'my_project' with no options
11
+ Then file 'Rakefile' is created
12
+ And does invoke generator 'install_test_unit'
13
+ And does not invoke generator 'install_rspec'
14
+ And does not invoke generator 'install_shoulda'
15
+ And does not invoke generator 'install_cucumber'
16
+ And does invoke generator 'install_website'
17
+ And does invoke generator 'install_rubigen_scripts'
18
+ And file 'config/website.yml.sample' is created
19
+ And yaml file 'config/website.yml.sample' contains {"host" => "unknown@rubyforge.org", "remote_dir" => "/var/www/gforge-projects/my_project"}
20
+ And output same as contents of 'newgem.out'
21
+ And Rakefile can display tasks successfully
22
+
23
+ Scenario: Run newgem with project name containing hypens
24
+ Given a safe folder
25
+ Given env variable $RUBYFORGE_USERNAME set to ''
26
+ When newgem is executed for project 'my-project' with no options
27
+ Then Rakefile can display tasks successfully
28
+
29
+ Scenario: Run newgem without any arguments, with env $RUBYFORGE_USERNAME set
30
+ Given a safe folder
31
+ Given env variable $RUBYFORGE_USERNAME set to 'nicwilliams'
32
+ When newgem is executed for project 'my_project' with no options
33
+ Then file 'config/website.yml.sample' is created
34
+ And yaml file 'config/website.yml.sample' contains {"host" => "nicwilliams@rubyforge.org", "remote_dir" => "/var/www/gforge-projects/my_project"}
35
+ And Rakefile can display tasks successfully
36
+
37
+ Scenario: Run newgem to include rspec
38
+ Given a safe folder
39
+ When newgem is executed for project 'my_rspec_project' with options '-T rspec'
40
+ Then does invoke generator 'install_rspec'
41
+ And does not invoke generator 'install_test_unit'
42
+ And does not invoke generator 'install_shoulda'
43
+ And does not invoke generator 'install_cucumber'
44
+ And Rakefile can display tasks successfully
45
+
46
+ Scenario: Run newgem to disable website
47
+ Given a safe folder
48
+ When newgem is executed for project 'my_project' with options '-W'
49
+ Then does not invoke generator 'install_website'
50
+ And file 'config/website.yml' is not created
51
+ And Rakefile can display tasks successfully
52
+
53
+ Scenario: Run newgem to install misc generators on top of unit test framework
54
+ Given a safe folder
55
+ When newgem is executed for project 'my_project' with options '-i cucumber'
56
+ Then does invoke generator 'install_test_unit'
57
+ And does invoke generator 'install_cucumber'
58
+ And does not invoke generator 'install_rspec'
59
+ And Rakefile can display tasks successfully
60
+