newgem 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,62 +1,74 @@
1
- +++ 0.10.0 2007-05-19
2
-
3
- + 3 major enhancements
4
- + can generate rspec default tests (or still test::unit tests) using --with-test=rspec [thx Robby Russell]
5
- + fetches your full name and email from ~/.rubyforge/user-config.yml (add keys user_name and email)
6
- + 2 minor enhancements
7
- + Generated lib/#{gem_name}.rb includes an empty module
8
- + Generated lib/#{gem_name}.rb does not include "require all", instead you do it manually for each included file
9
-
10
- +++ 0.9.4 2007-05-18
11
-
12
- + 5 minor enhancements
13
- + Pass your full name into the generator to be inserted into License.txt, index.txt, Rakefile etc
14
- + 'Licence' => 'License' (thx Peter Burns)
15
- + Generates a blank index.html so that 'rake package' works straight away
16
- + Includes :local_deploy which does tasks :website_generate and :install_gem
17
- + License.txt generated + this gem has a License.txt file (MIT license)
18
-
19
- +++ 0.9.3 20/4/2007
20
-
21
- + 1 minor enhancement
22
- + Added 'deploy' task that generates website AND release new gem
23
- + 1 website fix
24
- + Fixed download link
25
-
26
- +++ 0.9.2 18/4/2007
27
-
28
- + 1 minor improvement:
29
- + Generated apps include a "require 'rubygems' line at the top"
30
- + 1 website fix
31
- + Notes that the index.txt file includes Dr Nic details, not their own.[FIXME!!]
32
-
33
- +++ 0.9.1 16/4/2007
34
-
35
- + 1 bugfix:
36
- + I thoughtfully added an extra line (commented out) for sending the website to a subfolder... it caused grief at the 13th hour
37
-
38
- +++ 0.9.0 12/4/2007
39
-
40
- + 3 major enhancements:
41
- + Includes a basic website template, with rake tasks for generation and upload to rubyforge
42
- + Generates a History.txt file, and automatically uses it in Hoe task
43
- + Generated applications include framework for supporting command line options
44
- + 3 minor enhancements:
45
- + Include History.txt in this gem
46
- + test files ordered correctly in generated Manifest.txt
47
- + no blank line in Manifest.txt if no bin apps
48
-
49
- +++ 0.8.1
1
+ == 0.10.1 2007-05-24
2
+
3
+ * 4 minor enhancements
4
+ * Fixed the generation of test files in the manifest
5
+ * Generated rakefile#deploy prompts user to do svn tag
6
+ * Renamed README -> README.txt to conform to new hoe change
7
+ * Changed History.txt markup (+++ => ==; + => *) [Thx Jeroen Janssen]
8
+ * 1 dependency update:
9
+ * Hoe 1.2.1
10
+ * Still being worked on:
11
+ * Gems using rspec include a #spec task to run all spec tests; currently tests aren't working.
12
+
13
+ == 0.10.0 2007-05-19
14
+
15
+ * 3 major enhancements
16
+ * can generate rspec default tests (or still test::unit tests) using --with-test=rspec [thx Robby Russell]
17
+ * fetches your full name and email from ~/.rubyforge/user-config.yml (add keys user_name and email)
18
+ * 2 minor enhancements
19
+ * Generated lib/#{gem_name}.rb includes an empty module
20
+ * Generated lib/#{gem_name}.rb does not include "require all", instead you do it manually for each included file
21
+
22
+ == 0.9.4 2007-05-18
23
+
24
+ * 5 minor enhancements
25
+ * Pass your full name into the generator to be inserted into License.txt, index.txt, Rakefile etc
26
+ * 'Licence' => 'License' (thx Peter Burns)
27
+ * Generates a blank index.html so that 'rake package' works straight away
28
+ * Includes :local_deploy which does tasks :website_generate and :install_gem
29
+ * License.txt generated * this gem has a License.txt file (MIT license)
30
+
31
+ == 0.9.3 20/4/2007
32
+
33
+ * 1 minor enhancement
34
+ * Added 'deploy' task that generates website AND release new gem
35
+ * 1 website fix
36
+ * Fixed download link
37
+
38
+ == 0.9.2 18/4/2007
39
+
40
+ * 1 minor improvement:
41
+ * Generated apps include a "require 'rubygems' line at the top"
42
+ * 1 website fix
43
+ * Notes that the index.txt file includes Dr Nic details, not their own.[FIXME!!]
44
+
45
+ == 0.9.1 16/4/2007
46
+
47
+ * 1 bugfix:
48
+ * I thoughtfully added an extra line (commented out) for sending the website to a subfolder... it caused grief at the 13th hour
49
+
50
+ == 0.9.0 12/4/2007
51
+
52
+ * 3 major enhancements:
53
+ * Includes a basic website template, with rake tasks for generation and upload to rubyforge
54
+ * Generates a History.txt file, and automatically uses it in Hoe task
55
+ * Generated applications include framework for supporting command line options
56
+ * 3 minor enhancements:
57
+ * Include History.txt in this gem
58
+ * test files ordered correctly in generated Manifest.txt
59
+ * no blank line in Manifest.txt if no bin apps
60
+
61
+ == 0.8.1
50
62
 
51
63
  - Generated test file's class name now prefixed with Test, instead of suffixed
52
64
 
53
- +++ 0.8.0
65
+ == 0.8.0
54
66
 
55
67
  - Uses hoe itself - less hypocritical
56
68
  - Generated test files use name 'test_<gemname>.rb' instead of '<gemname>_test.rb' to support
57
69
  ZenTest's autotest expectations of naming. Manifest updated too.
58
70
 
59
- +++ 0.7.1
71
+ == 0.7.1
60
72
 
61
73
  - Installed gems now don't require 'hoe' (based on comments at http://blog.evanweaver.com/articles/2007/01/10/if-you-dont-want-to-hoe-echoe)
62
74
 
data/Manifest.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  History.txt
2
2
  License.txt
3
3
  Manifest.txt
4
- README
4
+ README.txt
5
5
  Rakefile
6
6
  Todo.txt
7
7
  bin/newgem
@@ -19,6 +19,7 @@ templates/Rakefile
19
19
  templates/app.rb
20
20
  templates/scripts/txt2html
21
21
  templates/setup.rb
22
+ templates/spec.opts
22
23
  templates/spec.rb
23
24
  templates/test.rb
24
25
  templates/website/index.html
File without changes
data/Rakefile CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'rubygems'
2
2
  require 'rake'
3
3
  require 'rake/clean'
4
+ require 'rake/testtask'
4
5
  require 'rake/packagetask'
5
6
  require 'rake/gempackagetask'
6
7
  require 'rake/rdoctask'
@@ -14,6 +15,8 @@ AUTHOR = "Dr Nic Williams"
14
15
  EMAIL = "drnicwilliams@gmail.com"
15
16
  DESCRIPTION = "Make your own gems at home"
16
17
  GEM_NAME = "newgem" # what ppl will type to install your gem
18
+ config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
19
+ RUBYFORGE_USERNAME = config["username"]
17
20
  RUBYFORGE_PROJECT = "newgem"
18
21
  HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
19
22
  DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
@@ -42,13 +45,17 @@ hoe = Hoe.new(GEM_NAME, VERS) do |p|
42
45
  # == Optional
43
46
  p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
44
47
  p.extra_deps = [
45
- ['hoe', '>=1.2.0'],
48
+ ['hoe', '>=1.2.1'],
46
49
  ['RedCloth','>=3.0.4'],
47
50
  ['syntax','>=1.0.0']
48
51
  ]
49
52
  #p.spec_extras - A hash of extra values to set in the gemspec.
50
53
  end
51
54
 
55
+ CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
56
+ PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "\#{RUBYFORGE_PROJECT}/\#{GEM_NAME}"
57
+ hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}/,''), 'rdoc')
58
+
52
59
  desc 'Generate website files'
53
60
  task :website_generate => :load_consts do
54
61
  (Dir['website/**/*.txt'] - Dir['website/version*.txt']).each do |txt|
@@ -81,7 +88,13 @@ task :load_consts do
81
88
  end
82
89
 
83
90
  desc 'Release the website and new gem version'
84
- task :deploy => [:check_version, :website, :release]
91
+ task :deploy => [:check_version, :website, :publish_docs, :release] do
92
+ puts "Remember to create SVN tag:"
93
+ puts "svn copy svn+ssh://#{RUBYFORGE_USERNAME}@rubyforge.org/var/svn/#{PATH}/trunk " +
94
+ "svn+ssh://#{RUBYFORGE_USERNAME}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
95
+ puts "Suggested comment:"
96
+ puts "Tagging release #{CHANGES}"
97
+ end
85
98
 
86
99
  desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
87
100
  task :local_deploy => [:website_generate, :install_gem]
data/bin/newgem CHANGED
@@ -167,10 +167,20 @@ if test_framework == 'rspec'
167
167
  test_template = 'spec.rb'
168
168
  unit_test = test + "/" + project_name + "_spec.rb"
169
169
  test_file_prefix = 'spec/NAME_spec'
170
+ spec_opts = 'spec.opts'
170
171
  unit_test_template = <<-eos
171
172
  require 'spec'
172
- require File.dirname(__FILE__) + '/../lib/#{project_name}'
173
173
  eos
174
+ requirements = <<-eos
175
+ require 'spec/rake/spectest'
176
+ eos
177
+ test_task = <<-eos
178
+ desc "Run the specs under spec/models"
179
+ Spec::Rake::SpecTask.new do |t|
180
+ t.spec_opts = ['--options', "spec/spec.opts"]
181
+ t.spec_files = FileList['spec/*_spec.rb']
182
+ end
183
+ eos
174
184
  else
175
185
  test = project_name + "/test"
176
186
  test_helper = test + "/test_helper.rb"
@@ -181,6 +191,8 @@ else
181
191
  require 'test/unit'
182
192
  require File.dirname(__FILE__) + '/../lib/#{project_name}'
183
193
  eos
194
+ requirements = ''
195
+ test_task = ''
184
196
  end
185
197
 
186
198
  puts "creating: " + test
@@ -198,6 +210,15 @@ File.open(unit_test, 'w') do |file|
198
210
  file << eval('"' + template.gsub(/"/, '\"') + '"')
199
211
  end
200
212
 
213
+ if test_framework == 'rspec'
214
+ spec_opts_file = test + "/" + spec_opts
215
+ puts "creating: " + spec_opts_file
216
+ template = File.open(templates + spec_opts, 'r') { |f| f.readlines.join }
217
+ File.open(spec_opts_file, 'w') do |file|
218
+ file << eval('"' + template.gsub(/"/, '\""') + '"')
219
+ end
220
+ end
221
+
201
222
  puts "creating: " + examples
202
223
  Dir.mkdir examples
203
224
 
@@ -209,7 +230,7 @@ end
209
230
 
210
231
  bin_names_list = bin_names_list.collect {|name| 'bin/' + name }.join("\n")
211
232
  bin_names_list += "\n" if bin_names_list.size > 0
212
- test_names_list = ['helper.rb',"#{project_name}.rb"].sort.collect {|name| test_file_prefix.gsub('NAME', name) + name }.join("\n")
233
+ test_names_list = ['helper.rb',"#{project_name}.rb"].sort.collect {|name| test_file_prefix.gsub('NAME', name) }.join("\n")
213
234
 
214
235
  template_files.each do |template_file|
215
236
  puts "creating: " + project_name + '/' + template_file
@@ -2,7 +2,7 @@ module Newgem #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 10
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -1,4 +1,4 @@
1
- +++ #{version_str} #{Date.today}
1
+ == #{version_str} #{Date.today}
2
2
 
3
- + 1 major enhancement:
4
- + Initial release
3
+ * 1 major enhancement:
4
+ * Initial release
@@ -1,4 +1,5 @@
1
1
  History.txt
2
+ License.txt
2
3
  Manifest.txt
3
4
  README.txt
4
5
  Rakefile
data/templates/Rakefile CHANGED
@@ -8,6 +8,7 @@ require 'rake/rdoctask'
8
8
  require 'rake/contrib/rubyforgepublisher'
9
9
  require 'fileutils'
10
10
  require 'hoe'
11
+ #{requirements}
11
12
  include FileUtils
12
13
  require File.join(File.dirname(__FILE__), 'lib', '#{gem_name}', 'version')
13
14
 
@@ -15,6 +16,8 @@ AUTHOR = '#{author}' # can also be an array of Authors
15
16
  EMAIL = "#{email}"
16
17
  DESCRIPTION = "description of gem"
17
18
  GEM_NAME = '#{gem_name}' # what ppl will type to install your gem
19
+ config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
20
+ RUBYFORGE_USERNAME = config["username"]
18
21
  RUBYFORGE_PROJECT = '#{gem_name}' # The unix name for your project
19
22
  HOMEPATH = "http://\#{RUBYFORGE_PROJECT}.rubyforge.org"
20
23
  DOWNLOAD_PATH = "http://rubyforge.org/projects/\#{RUBYFORGE_PROJECT}"
@@ -53,6 +56,9 @@ hoe = Hoe.new(GEM_NAME, VERS) do |p|
53
56
  #p.spec_extras = {} # A hash of extra values to set in the gemspec.
54
57
  end
55
58
 
59
+ CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
60
+ PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "\#{RUBYFORGE_PROJECT}/\#{GEM_NAME}"
61
+ hoe.remote_rdoc_dir = File.join(PATH.gsub(/^\#{RUBYFORGE_PROJECT}/,''), 'rdoc')
56
62
 
57
63
  desc 'Generate website files'
58
64
  task :website_generate do
@@ -65,8 +71,7 @@ desc 'Upload website files to rubyforge'
65
71
  task :website_upload do
66
72
  config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
67
73
  host = "\#{config["username"]}@rubyforge.org"
68
- remote_dir = "/var/www/gforge-projects/\#{RUBYFORGE_PROJECT}/"
69
- # remote_dir = "/var/www/gforge-projects/\#{RUBYFORGE_PROJECT}/\#{GEM_NAME}"
74
+ remote_dir = "/var/www/gforge-projects/\#{PATH}/"
70
75
  local_dir = 'website'
71
76
  sh %{rsync -av \#{local_dir}/ \#{host}:\#{remote_dir}}
72
77
  end
@@ -75,7 +80,13 @@ desc 'Generate and upload website files'
75
80
  task :website => [:website_generate, :website_upload]
76
81
 
77
82
  desc 'Release the website and new gem version'
78
- task :deploy => [:check_version, :website, :release]
83
+ task :deploy => [:check_version, :website, :release] do
84
+ puts "Remember to create SVN tag:"
85
+ puts "svn copy svn+ssh://\#{RUBYFORGE_USERNAME}@rubyforge.org/var/svn/\#{PATH}/trunk " +
86
+ "svn+ssh://\#{RUBYFORGE_USERNAME}@rubyforge.org/var/svn/\#{PATH}/tags/REL-\#{VERS} "
87
+ puts "Suggested comment:"
88
+ puts "Tagging release \#{CHANGES}"
89
+ end
79
90
 
80
91
  desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
81
92
  task :local_deploy => [:website_generate, :install_gem]
@@ -91,3 +102,4 @@ task :check_version do
91
102
  end
92
103
  end
93
104
 
105
+ #{test_task}
@@ -0,0 +1 @@
1
+ --colour
data/templates/spec.rb CHANGED
@@ -1,4 +1,11 @@
1
1
  require File.dirname(__FILE__) + '/spec_helper.rb'
2
2
 
3
3
  # Time to add your specs!
4
- # http://rspec.rubyforge.org/
4
+ # http://rspec.rubyforge.org/
5
+ context "Place your specs here" do
6
+
7
+ specify "find this spec in spec directory" do
8
+ violate "Be sure to write your specs"
9
+ end
10
+
11
+ end
data/website/index.html CHANGED
@@ -33,7 +33,7 @@
33
33
  <h1>New Gem Generator</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/newgem"; return false'>
35
35
  Get Version
36
- <a href="http://rubyforge.org/projects/newgem" class="numbers">0.10.0</a>
36
+ <a href="http://rubyforge.org/projects/newgem" class="numbers">0.10.1</a>
37
37
  </div>
38
38
  <h1>&#x2192; &#8216;newgem&#8217;</h1>
39
39
 
@@ -290,7 +290,7 @@ other stories and things.</p>
290
290
 
291
291
  <p>Comments are welcome. Send an email to <a href="mailto:drnicwilliams@gmail.com">Dr Nic Williams</a>.</p>
292
292
  <p class="coda">
293
- <a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>, 19th May 2007<br>
293
+ <a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>, 20th May 2007<br>
294
294
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
295
295
  </p>
296
296
  </div>
@@ -33,7 +33,7 @@
33
33
  <h1>New Gem Generator</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/newgem"; return false'>
35
35
  Get Version
36
- <a href="http://rubyforge.org/projects/newgem" class="numbers">0.10.0</a>
36
+ <a href="http://rubyforge.org/projects/newgem" class="numbers">0.10.1</a>
37
37
  </div>
38
38
  <h1>&#x2192; using &#8216;rubyforge&#8217;</h1>
39
39
 
@@ -1,3 +1,3 @@
1
1
  // Announcement JS file
2
- var version = "0.10.0";
2
+ var version = "0.10.1";
3
3
  MagicAnnouncement.show('compositekeys', version);
data/website/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // Version JS file
2
- var version = "0.10.0";
2
+ var version = "0.10.1";
3
3
 
4
4
  document.write(" - " + version);
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.2
2
+ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: newgem
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.10.0
7
- date: 2007-05-19 00:00:00 -07:00
6
+ version: 0.10.1
7
+ date: 2007-05-24 00:00:00 +02:00
8
8
  summary: Make your own gems at home
9
9
  require_paths:
10
10
  - lib
@@ -32,7 +32,7 @@ files:
32
32
  - History.txt
33
33
  - License.txt
34
34
  - Manifest.txt
35
- - README
35
+ - README.txt
36
36
  - Rakefile
37
37
  - Todo.txt
38
38
  - bin/newgem
@@ -50,6 +50,7 @@ files:
50
50
  - templates/app.rb
51
51
  - templates/scripts/txt2html
52
52
  - templates/setup.rb
53
+ - templates/spec.opts
53
54
  - templates/spec.rb
54
55
  - templates/test.rb
55
56
  - templates/website/index.html
@@ -74,10 +75,23 @@ files:
74
75
  test_files:
75
76
  - test/test_helper.rb
76
77
  - test/test_newgem.rb
77
- rdoc_options: []
78
-
79
- extra_rdoc_files: []
80
-
78
+ rdoc_options:
79
+ - --main
80
+ - README.txt
81
+ extra_rdoc_files:
82
+ - History.txt
83
+ - License.txt
84
+ - Manifest.txt
85
+ - README.txt
86
+ - Todo.txt
87
+ - templates/History.txt
88
+ - templates/License.txt
89
+ - templates/Manifest.txt
90
+ - templates/website/index.txt
91
+ - website/index.txt
92
+ - website/rubyforge.txt
93
+ - website/version-raw.txt
94
+ - website/version.txt
81
95
  executables:
82
96
  - newgem
83
97
  extensions: []
@@ -92,7 +106,7 @@ dependencies:
92
106
  requirements:
93
107
  - - ">="
94
108
  - !ruby/object:Gem::Version
95
- version: 1.2.0
109
+ version: 1.2.1
96
110
  version:
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: RedCloth
@@ -119,5 +133,5 @@ dependencies:
119
133
  requirements:
120
134
  - - ">="
121
135
  - !ruby/object:Gem::Version
122
- version: 1.2.0
136
+ version: 1.2.1
123
137
  version: