newgem 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/.test-result/TestExecutableGenerator/test_generator_without_options/passed +0 -0
  2. data/.test-result/TestExtconfGenerator/test_generator_for_rspec_project/passed +0 -0
  3. data/.test-result/TestExtconfGenerator/test_generator_without_options/passed +0 -0
  4. data/.test-result/TestFeatureGenerator/test_generator_without_options/passed +0 -0
  5. data/.test-result/TestInstallCucumberGenerator/test_generator_without_options/passed +0 -0
  6. data/.test-result/TestInstallJrubyGenerator/test_generator_without_options/passed +0 -0
  7. data/.test-result/TestInstallRspecGenerator/test_generator_without_options/passed +0 -0
  8. data/.test-result/TestInstallTestUnitGenerator/test_generator_without_options/passed +0 -0
  9. data/.test-result/TestInstallWebsiteGenerator/test_generator_without_options/passed +0 -0
  10. data/.test-result/TestNewgemGenerator/test_gem_name_does_not_change_if_project_name_is_overriden/passed +0 -0
  11. data/.test-result/TestNewgemGenerator/test_gem_name_should_come_from_project/passed +0 -0
  12. data/.test-result/TestNewgemGenerator/test_module_name_does_not_change_if_project_name_is_overriden/passed +0 -0
  13. data/.test-result/TestNewgemGenerator/test_module_name_should_come_from_gem_name/passed +0 -0
  14. data/.test-result/TestNewgemGenerator/test_newgem_with_executable/passed +0 -0
  15. data/.test-result/TestNewgemGenerator/test_newgem_with_jruby/passed +0 -0
  16. data/.test-result/TestNewgemGenerator/test_newgem_with_no_website/passed +0 -0
  17. data/.test-result/TestNewgemGenerator/test_newgem_with_rspec/passed +0 -0
  18. data/.test-result/TestNewgemGenerator/test_newgem_with_website/passed +0 -0
  19. data/.test-result/TestNewgemGenerator/test_project_name_can_be_overriden/passed +0 -0
  20. data/.test-result/TestNewgemGenerator/test_project_name_should_default_to_gem_name/passed +0 -0
  21. data/.test-result/TestNewgemGenerator/test_run_in_trunk_path_finds_parent_path_for_gem_name/passed +0 -0
  22. data/.test-result/TestNewgemSimpleGenerator/test_generator_without_options/passed +0 -0
  23. data/.test-result/TestPlainThemeGenerator/test_generator_with_author_and_email/passed +0 -0
  24. data/.test-result/TestPlainThemeGenerator/test_generator_without_options/passed +0 -0
  25. data/.test-result/TestRubyforge/test_email_should_be_placeholder_if_nothing_found/passed +0 -0
  26. data/.test-result/TestRubyforge/test_email_should_come_from_environment/passed +0 -0
  27. data/.test-result/TestRubyforge/test_email_should_come_from_user_config/passed +0 -0
  28. data/.test-result/TestRubyforge/test_full_name_should_be_placeholder_if_nothing_found/passed +0 -0
  29. data/.test-result/TestRubyforge/test_full_name_should_come_from_environment/passed +0 -0
  30. data/.test-result/TestRubyforge/test_full_name_should_come_from_user_config/passed +0 -0
  31. data/.test-result/TestRubyforge/test_github_username_should_be_placeholder_if_nothing_found/passed +0 -0
  32. data/.test-result/TestRubyforge/test_github_username_should_come_from_environment/passed +0 -0
  33. data/.test-result/TestRubyforge/test_github_username_should_come_from_user_config/passed +0 -0
  34. data/History.txt +4 -0
  35. data/Manifest.txt +34 -1
  36. data/app_generators/newgem/newgem_generator.rb +1 -1
  37. data/features/executable_generator.feature +2 -2
  38. data/features/steps/cli.rb +9 -5
  39. data/features/steps/common.rb +8 -3
  40. data/lib/newgem.rb +1 -1
  41. data/lib/newgem/{rubyforge.rb → rubyforge-ext.rb} +7 -2
  42. data/newgem_generators/install_website/install_website_generator.rb +1 -1
  43. data/rubygems_generators/install_cucumber/templates/features/steps/common.rb +8 -3
  44. data/test/test_newgem_generator.rb +1 -0
  45. data/test/test_rubyforge.rb +1 -1
  46. data/website/index.html +1 -1
  47. data/website/rubyforge.html +2 -2
  48. metadata +37 -4
@@ -1,3 +1,7 @@
1
+ == 1.2.0 2008-12-11
2
+
3
+ * Newgem + RubiGen are Ruby 1.9.1 compliant.
4
+
1
5
  == 1.1.0 2008-11-11
2
6
 
3
7
  * Support for ~/.newgem.yml file for default CLI arguments
@@ -1,3 +1,36 @@
1
+ .test-result/TestExecutableGenerator/test_generator_without_options/passed
2
+ .test-result/TestExtconfGenerator/test_generator_for_rspec_project/passed
3
+ .test-result/TestExtconfGenerator/test_generator_without_options/passed
4
+ .test-result/TestFeatureGenerator/test_generator_without_options/passed
5
+ .test-result/TestInstallCucumberGenerator/test_generator_without_options/passed
6
+ .test-result/TestInstallJrubyGenerator/test_generator_without_options/passed
7
+ .test-result/TestInstallRspecGenerator/test_generator_without_options/passed
8
+ .test-result/TestInstallTestUnitGenerator/test_generator_without_options/passed
9
+ .test-result/TestInstallWebsiteGenerator/test_generator_without_options/passed
10
+ .test-result/TestNewgemGenerator/test_gem_name_does_not_change_if_project_name_is_overriden/passed
11
+ .test-result/TestNewgemGenerator/test_gem_name_should_come_from_project/passed
12
+ .test-result/TestNewgemGenerator/test_module_name_does_not_change_if_project_name_is_overriden/passed
13
+ .test-result/TestNewgemGenerator/test_module_name_should_come_from_gem_name/passed
14
+ .test-result/TestNewgemGenerator/test_newgem_with_executable/passed
15
+ .test-result/TestNewgemGenerator/test_newgem_with_jruby/passed
16
+ .test-result/TestNewgemGenerator/test_newgem_with_no_website/passed
17
+ .test-result/TestNewgemGenerator/test_newgem_with_rspec/passed
18
+ .test-result/TestNewgemGenerator/test_newgem_with_website/passed
19
+ .test-result/TestNewgemGenerator/test_project_name_can_be_overriden/passed
20
+ .test-result/TestNewgemGenerator/test_project_name_should_default_to_gem_name/passed
21
+ .test-result/TestNewgemGenerator/test_run_in_trunk_path_finds_parent_path_for_gem_name/passed
22
+ .test-result/TestNewgemSimpleGenerator/test_generator_without_options/passed
23
+ .test-result/TestPlainThemeGenerator/test_generator_with_author_and_email/passed
24
+ .test-result/TestPlainThemeGenerator/test_generator_without_options/passed
25
+ .test-result/TestRubyforge/test_email_should_be_placeholder_if_nothing_found/passed
26
+ .test-result/TestRubyforge/test_email_should_come_from_environment/passed
27
+ .test-result/TestRubyforge/test_email_should_come_from_user_config/passed
28
+ .test-result/TestRubyforge/test_full_name_should_be_placeholder_if_nothing_found/passed
29
+ .test-result/TestRubyforge/test_full_name_should_come_from_environment/passed
30
+ .test-result/TestRubyforge/test_full_name_should_come_from_user_config/passed
31
+ .test-result/TestRubyforge/test_github_username_should_be_placeholder_if_nothing_found/passed
32
+ .test-result/TestRubyforge/test_github_username_should_come_from_environment/passed
33
+ .test-result/TestRubyforge/test_github_username_should_come_from_user_config/passed
1
34
  History.txt
2
35
  Manifest.txt
3
36
  PostInstall.txt
@@ -47,7 +80,7 @@ features/steps/rubygems.rb
47
80
  lib/hoe-patched.rb
48
81
  lib/newgem.rb
49
82
  lib/newgem/quick_template.rb
50
- lib/newgem/rubyforge.rb
83
+ lib/newgem/rubyforge-ext.rb
51
84
  lib/newgem/support/tasks.rb
52
85
  lib/newgem/tasks.rb
53
86
  newgem_generators/install_website/USAGE
@@ -151,7 +151,7 @@ EOS
151
151
  @author = options[:author]
152
152
  @email = options[:email]
153
153
  unless @author && @email
154
- require File.dirname(__FILE__) + '/../../lib/newgem/rubyforge'
154
+ require File.dirname(__FILE__) + '/../../lib/newgem/rubyforge-ext' unless Newgem.const_defined?("Rubyforge")
155
155
  rubyforge_config = Newgem::Rubyforge.new
156
156
  @author ||= rubyforge_config.full_name
157
157
  @email ||= rubyforge_config.email
@@ -23,14 +23,14 @@ Feature: Generate an executable/CLI scaffold
23
23
  Scenario: Run CLI app from executable generator to show help
24
24
  Given an existing newgem scaffold [called 'my_project']
25
25
  Given 'executable' generator is invoked with arguments 'my_app'
26
- When run executable 'bin/my_app' with arguments '-h'
26
+ When run project executable 'bin/my_app' with arguments '-h'
27
27
  Then help options '-h' and '--help' are displayed
28
28
  Then help options '-p' and '--path' are displayed
29
29
 
30
30
  Scenario: Run CLI app from executable generator should not fail
31
31
  Given an existing newgem scaffold [called 'my_project']
32
32
  Given 'executable' generator is invoked with arguments 'my_app'
33
- When run executable 'bin/my_app' with arguments ''
33
+ When run project executable 'bin/my_app' with arguments ''
34
34
  Then output does match /lib\/my_app\/cli.rb/
35
35
 
36
36
  Scenario: Run unit tests after executable generator should all pass for test/unit
@@ -1,8 +1,12 @@
1
+ def in_tmp_folder(&block)
2
+ FileUtils.chdir(@tmp_root, &block)
3
+ end
4
+
1
5
  Given %r{^an existing newgem scaffold \[called '(.*)'\]} do |project_name|
2
6
  Given "a safe folder"
3
7
  newgem = File.expand_path(File.dirname(__FILE__) + "/../../bin/newgem")
4
8
  setup_active_project_folder project_name
5
- FileUtils.chdir @tmp_root do
9
+ in_tmp_folder do
6
10
  @stdout = "newgem.out"
7
11
  system "ruby #{newgem} #{project_name} > #{@stdout} 2> #{@stdout}"
8
12
  force_local_lib_override
@@ -13,7 +17,7 @@ Given %r{^an existing newgem scaffold using options '(.*)' \[called '(.*)'\]} do
13
17
  Given "a safe folder"
14
18
  newgem = File.expand_path(File.dirname(__FILE__) + "/../../bin/newgem")
15
19
  setup_active_project_folder project_name
16
- FileUtils.chdir @tmp_root do
20
+ in_tmp_folder do
17
21
  @stdout = "newgem.out"
18
22
  system "ruby #{newgem} #{arguments} #{project_name} > #{@stdout} 2> #{@stdout}"
19
23
  force_local_lib_override
@@ -48,7 +52,7 @@ end
48
52
  When %r{^newgem is executed for project '(.*)' with no options$} do |project_name|
49
53
  @newgem_cmd = newgem_cmd
50
54
  setup_active_project_folder project_name
51
- FileUtils.chdir @tmp_root do
55
+ in_tmp_folder do
52
56
  @stdout = "newgem.out"
53
57
  system "ruby #{@newgem_cmd} #{project_name} > #{@stdout}"
54
58
  force_local_lib_override
@@ -58,7 +62,7 @@ end
58
62
  When %r{^newgem is executed for project '(.*)' with options '(.*)'$} do |project_name, arguments|
59
63
  @newgem_cmd = newgem_cmd
60
64
  setup_active_project_folder project_name
61
- FileUtils.chdir @tmp_root do
65
+ in_tmp_folder do
62
66
  @stdout = "newgem.out"
63
67
  system "ruby #{@newgem_cmd} #{arguments} #{project_name} > #{@stdout}"
64
68
  force_local_lib_override
@@ -67,7 +71,7 @@ end
67
71
 
68
72
  When /^newgem is executed only with options '(.*)'$/ do |arguments|
69
73
  @newgem_cmd = newgem_cmd
70
- FileUtils.chdir @tmp_root do
74
+ in_tmp_folder do
71
75
  @stdout = "newgem.out"
72
76
  system "ruby #{@newgem_cmd} #{arguments} > #{@stdout}"
73
77
  end
@@ -54,13 +54,18 @@ When %r{^'(.*)' generator is invoked with arguments '(.*)'$} do |generator, argu
54
54
  end
55
55
  end
56
56
 
57
- When %r{run executable '(.*)' with arguments '(.*)'} do |executable, arguments|
57
+ When %r{run project executable '(.*)' with arguments '(.*)'} do |executable, arguments|
58
58
  @stdout = File.expand_path(File.join(@tmp_root, "executable.out"))
59
- FileUtils.chdir(@active_project_folder) do
60
- system "ruby #{executable} #{arguments} > #{@stdout}"
59
+ in_project_folder do
60
+ system "ruby #{executable} #{arguments} > #{@stdout} 2> #{@stdout}"
61
61
  end
62
62
  end
63
63
 
64
+ When %r{run local executable '(.*)' with arguments '(.*)'} do |executable, arguments|
65
+ @stdout = File.expand_path(File.join(@tmp_root, "executable.out"))
66
+ system "ruby bin/#{executable} #{arguments} > #{@stdout} 2> #{@stdout}"
67
+ end
68
+
64
69
  When %r{^task 'rake (.*)' is invoked$} do |task|
65
70
  @stdout = File.expand_path(File.join(@tmp_root, "tests.out"))
66
71
  FileUtils.chdir(@active_project_folder) do
@@ -4,5 +4,5 @@ $:.unshift(File.dirname(__FILE__)) unless
4
4
  require "hoe-patched"
5
5
 
6
6
  module Newgem
7
- VERSION = '1.1.0'
7
+ VERSION = '1.2.0'
8
8
  end
@@ -1,5 +1,10 @@
1
- require 'rubygems'
2
- require 'rubyforge'
1
+ begin
2
+ require 'rubyforge'
3
+ rescue LoadError
4
+ require 'rubygems'
5
+ gem 'rubyforge'
6
+ require 'rubyforge'
7
+ end
3
8
 
4
9
  module Newgem
5
10
  class Rubyforge
@@ -87,7 +87,7 @@ EOS
87
87
 
88
88
  def github_username
89
89
  @github_username ||= begin
90
- require File.dirname(__FILE__) + '/../../lib/newgem/rubyforge'
90
+ require File.dirname(__FILE__) + '/../../lib/newgem/rubyforge-ext' unless Newgem.const_defined?("Rubyforge")
91
91
  rubyforge_config = Newgem::Rubyforge.new
92
92
  rubyforge_config.github_username
93
93
  end
@@ -54,13 +54,18 @@ When %r{^'(.*)' generator is invoked with arguments '(.*)'$} do |generator, argu
54
54
  end
55
55
  end
56
56
 
57
- When %r{run executable '(.*)' with arguments '(.*)'} do |executable, arguments|
57
+ When %r{run project executable '(.*)' with arguments '(.*)'} do |executable, arguments|
58
58
  @stdout = File.expand_path(File.join(@tmp_root, "executable.out"))
59
- FileUtils.chdir(@active_project_folder) do
60
- system "ruby #{executable} #{arguments} > #{@stdout}"
59
+ in_project_folder do
60
+ system "ruby #{executable} #{arguments} > #{@stdout} 2> #{@stdout}"
61
61
  end
62
62
  end
63
63
 
64
+ When %r{run local executable '(.*)' with arguments '(.*)'} do |executable, arguments|
65
+ @stdout = File.expand_path(File.join(@tmp_root, "executable.out"))
66
+ system "ruby bin/#{executable} #{arguments} > #{@stdout} 2> #{@stdout}"
67
+ end
68
+
64
69
  When %r{^task 'rake (.*)' is invoked$} do |task|
65
70
  @stdout = File.expand_path(File.join(@tmp_root, "tests.out"))
66
71
  FileUtils.chdir(@active_project_folder) do
@@ -7,6 +7,7 @@ class TestNewgemGenerator < Test::Unit::TestCase
7
7
  def setup
8
8
  bare_setup
9
9
  @gem_name = File.basename(File.expand_path(APP_ROOT))
10
+ ENV['HOME'] = "/some/path" # so it doesn't find dev's local ~/.newgem.yml
10
11
  end
11
12
 
12
13
  def teardown
@@ -1,5 +1,5 @@
1
1
  require File.join(File.dirname(__FILE__), "test_helper.rb")
2
- require 'newgem/rubyforge'
2
+ require 'newgem/rubyforge-ext'
3
3
 
4
4
  class TestRubyforge < Test::Unit::TestCase
5
5
 
@@ -39,7 +39,7 @@
39
39
 
40
40
  <div id="version"> <!-- class="clickable" onclick='document.location = "http://rubyforge.org/projects/newgem"; return true' -->
41
41
  <p>Get Version</p>
42
- <a href="http://rubyforge.org/projects/newgem" class="numbers">1.1.0</a>
42
+ <a href="http://rubyforge.org/projects/newgem" class="numbers">1.2.0</a>
43
43
  <p>Featured in</p>
44
44
  <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2FBeginning-Ruby-Novice-Professional-Experts%2Fdp%2F1590597664%2F&tag=drnic-20&linkCode=ur2&camp=1789&creative=9325" class="book"><img src="images/beginning-ruby.jpg" /></a>
45
45
  </div>
@@ -39,7 +39,7 @@
39
39
 
40
40
  <div id="version"> <!-- class="clickable" onclick='document.location = "http://rubyforge.org/projects/newgem"; return true' -->
41
41
  <p>Get Version</p>
42
- <a href="http://rubyforge.org/projects/newgem" class="numbers">1.1.0</a>
42
+ <a href="http://rubyforge.org/projects/newgem" class="numbers">1.2.0</a>
43
43
  <p>Featured in</p>
44
44
  <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2FBeginning-Ruby-Novice-Professional-Experts%2Fdp%2F1590597664%2F&tag=drnic-20&linkCode=ur2&camp=1789&creative=9325" class="book"><img src="images/beginning-ruby.jpg" /></a>
45
45
  </div>
@@ -72,7 +72,7 @@
72
72
  $ rubyforge setup
73
73
  $ mate ~/.rubyforge/user-config.yml
74
74
  </pre>
75
- <p>This creates a configuration folder <code>.rubyforge</code> in your home folder (on Windows it is XXXXXX). The last line is to edit the config file.</p>
75
+ <p>This creates a configuration folder <code>.rubyforge</code> in your home folder (on Windows it is <span class="caps">XXXXXX</span>). The last line is to edit the config file.</p>
76
76
  <p>The only two lines to set are your RubyForge <strong>username</strong> and <strong>password</strong>. Ignore the rest.</p>
77
77
  <pre>$ rubyforge config</pre>
78
78
  <p>This generates a file <code>~/.rubyforge/auto-config.yml</code> which will be mostly empty now, but one day will be full of projects and all the releases of different versions of gems. One day soon I hope.</p>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newgem
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dr Nic Williams
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-11 00:00:00 +10:00
12
+ date: 2008-12-11 00:00:00 +10:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.3.3
33
+ version: 1.4.0
34
34
  version:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: hoe
@@ -106,6 +106,39 @@ extra_rdoc_files:
106
106
  - website/version-raw.txt
107
107
  - website/version.txt
108
108
  files:
109
+ - .test-result/TestExecutableGenerator/test_generator_without_options/passed
110
+ - .test-result/TestExtconfGenerator/test_generator_for_rspec_project/passed
111
+ - .test-result/TestExtconfGenerator/test_generator_without_options/passed
112
+ - .test-result/TestFeatureGenerator/test_generator_without_options/passed
113
+ - .test-result/TestInstallCucumberGenerator/test_generator_without_options/passed
114
+ - .test-result/TestInstallJrubyGenerator/test_generator_without_options/passed
115
+ - .test-result/TestInstallRspecGenerator/test_generator_without_options/passed
116
+ - .test-result/TestInstallTestUnitGenerator/test_generator_without_options/passed
117
+ - .test-result/TestInstallWebsiteGenerator/test_generator_without_options/passed
118
+ - .test-result/TestNewgemGenerator/test_gem_name_does_not_change_if_project_name_is_overriden/passed
119
+ - .test-result/TestNewgemGenerator/test_gem_name_should_come_from_project/passed
120
+ - .test-result/TestNewgemGenerator/test_module_name_does_not_change_if_project_name_is_overriden/passed
121
+ - .test-result/TestNewgemGenerator/test_module_name_should_come_from_gem_name/passed
122
+ - .test-result/TestNewgemGenerator/test_newgem_with_executable/passed
123
+ - .test-result/TestNewgemGenerator/test_newgem_with_jruby/passed
124
+ - .test-result/TestNewgemGenerator/test_newgem_with_no_website/passed
125
+ - .test-result/TestNewgemGenerator/test_newgem_with_rspec/passed
126
+ - .test-result/TestNewgemGenerator/test_newgem_with_website/passed
127
+ - .test-result/TestNewgemGenerator/test_project_name_can_be_overriden/passed
128
+ - .test-result/TestNewgemGenerator/test_project_name_should_default_to_gem_name/passed
129
+ - .test-result/TestNewgemGenerator/test_run_in_trunk_path_finds_parent_path_for_gem_name/passed
130
+ - .test-result/TestNewgemSimpleGenerator/test_generator_without_options/passed
131
+ - .test-result/TestPlainThemeGenerator/test_generator_with_author_and_email/passed
132
+ - .test-result/TestPlainThemeGenerator/test_generator_without_options/passed
133
+ - .test-result/TestRubyforge/test_email_should_be_placeholder_if_nothing_found/passed
134
+ - .test-result/TestRubyforge/test_email_should_come_from_environment/passed
135
+ - .test-result/TestRubyforge/test_email_should_come_from_user_config/passed
136
+ - .test-result/TestRubyforge/test_full_name_should_be_placeholder_if_nothing_found/passed
137
+ - .test-result/TestRubyforge/test_full_name_should_come_from_environment/passed
138
+ - .test-result/TestRubyforge/test_full_name_should_come_from_user_config/passed
139
+ - .test-result/TestRubyforge/test_github_username_should_be_placeholder_if_nothing_found/passed
140
+ - .test-result/TestRubyforge/test_github_username_should_come_from_environment/passed
141
+ - .test-result/TestRubyforge/test_github_username_should_come_from_user_config/passed
109
142
  - History.txt
110
143
  - Manifest.txt
111
144
  - PostInstall.txt
@@ -155,7 +188,7 @@ files:
155
188
  - lib/hoe-patched.rb
156
189
  - lib/newgem.rb
157
190
  - lib/newgem/quick_template.rb
158
- - lib/newgem/rubyforge.rb
191
+ - lib/newgem/rubyforge-ext.rb
159
192
  - lib/newgem/support/tasks.rb
160
193
  - lib/newgem/tasks.rb
161
194
  - newgem_generators/install_website/USAGE