ore 0.9.4 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,21 @@
1
+ ### 0.10.0 / 2012-10-14
2
+
3
+ * Require thor ~> 0.15.
4
+ * Strip the `ore-` prefix from the template name in {Ore::Template.register}.
5
+ * Allow {Ore::Generator#disable_template} to disable templates that are not
6
+ installed.
7
+
8
+ #### Templates
9
+
10
+ * Added the [mini_test] template.
11
+ * Moved the `rvmrc` template out into the [rvm] template.
12
+ * Moved the `jeweler_tasks` template out into the [jeweler] template.
13
+ * Removed the `gem_test` template.
14
+
15
+ #### CLI
16
+
17
+ * Added a `--version` option to the `ore` command.
18
+
1
19
  ### 0.9.4 / 2012-07-23
2
20
 
3
21
  * Do not initialize the repository, if .git or .hg directories already exist.
@@ -337,13 +355,14 @@
337
355
  [gemspec]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/gemspec
338
356
  [gemspec_yml]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/gemspec_yml
339
357
  [gem\_package\_task]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/gem_package_task
340
- [gem_test]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/gem_test
341
358
  [git]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/git
342
359
  [hg]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/hg
343
- [jeweler_tasks]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/jeweler_tasks
344
360
  [rdoc]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/rdoc
345
361
  [rspec]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/rspec
346
362
  [rubygems_tasks]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/rubygems_tasks
347
- [rvmrc]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/rvmrc
348
363
  [test_unit]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/test_unit
364
+ [mini_test]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/mini_test
349
365
  [yard]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/yard
366
+
367
+ [rvm]: https://github.com/ruby-ore/rvm
368
+ [jeweler_tasks]: https://github.com/ruby-ore/jeweler_tasks
data/README.md CHANGED
@@ -28,13 +28,9 @@ Ore generates a pure-Ruby gemspec by default. Ore can also generate a
28
28
  ### Tasks
29
29
 
30
30
  Ore supports generating projects using [Gem::Tasks][rubygems_tasks],
31
- [Bundler::GemHelper][bundler], [Jeweler::Tasks][jeweler] and even
32
- [Gem::PackageTask][gem_package_task].
31
+ [Bundler::GemHelper][bundler] and even [Gem::PackageTask][gem_package_task].
33
32
 
34
- $ mine my-project [--rubygems-tasks |
35
- --bundler-tasks |
36
- --jeweler-tasks |
37
- --gem-package-task]
33
+ $ mine my-project [--rubygems-tasks | --bundler-tasks | --gem-package-task]
38
34
 
39
35
  ### Bundler
40
36
 
@@ -42,12 +38,6 @@ Ore can also generate a [Bundler][bundler] project.
42
38
 
43
39
  $ mine my-project --bundler
44
40
 
45
- ### RVM
46
-
47
- Ore also includes an [.rvmrc] template.
48
-
49
- $ mine my-project --rvmrc
50
-
51
41
  ### Markup
52
42
 
53
43
  Ore supports [RDoc][rdoc], [Markdown][markdown] and [Textile][textile] markup.
@@ -63,20 +53,21 @@ documentation.
63
53
 
64
54
  ### Testing
65
55
 
66
- Ore supports generating [RSpec][rspec] or [Test::Unit][test_unit] tests.
56
+ Ore supports generating [RSpec][rspec], [MiniTest][mini_test] or
57
+ [Test::Unit][test_unit] tests.
67
58
 
68
- $ mine my-project [--test-unit | --rspec]
59
+ $ mine my-project [--test-unit | --mini-test | --rspec]
69
60
 
70
61
  ### Custom Templates
71
62
 
72
63
  Additional templates can also be installed from Git:
73
64
 
74
- $ ore install git://github.com/ruby-ore/mini_test.git
75
- $ mine my-project --mini-test
65
+ $ ore install git://github.com/ruby-ore/rbenv.git
66
+ $ mine my-project --rbenv
76
67
 
77
68
  ## Requirements
78
69
 
79
- * [thor](http://github.com/wycats/thor) ~> 0.14
70
+ * [thor](https://github.com/wycats/thor#readme) ~> 0.15
80
71
 
81
72
  ## Install
82
73
 
@@ -94,7 +85,7 @@ Generate a new customized project:
94
85
 
95
86
  Generate a new project using previously installed templates:
96
87
 
97
- $ mine my_project --bundler --rspec --yard --templates mini_test
88
+ $ mine my_project --bundler --rspec --yard --templates rbenv
98
89
 
99
90
  Set your github username, so `mine` can generate GitHub project URLs:
100
91
 
@@ -103,7 +94,7 @@ Set your github username, so `mine` can generate GitHub project URLs:
103
94
 
104
95
  Install a custom template:
105
96
 
106
- $ ore install git://github.com/ruby-ore/mini_test.git
97
+ $ ore install git://github.com/ruby-ore/rbenv.git
107
98
 
108
99
  List installed templates:
109
100
 
@@ -111,7 +102,7 @@ List installed templates:
111
102
 
112
103
  Remove a previously installed template:
113
104
 
114
- $ ore remove mini_test
105
+ $ ore remove rbenv
115
106
 
116
107
  Add default generator options to `~/.ore/options.yml`:
117
108
 
@@ -136,12 +127,11 @@ See {file:LICENSE.txt} for license information.
136
127
  [gemspec.yml]: https://github.com/ruby-ore/ore/blob/master/gemspec.yml
137
128
  [rubygems_tasks]: https://github.com/postmodern/rubygems-tasks#readme
138
129
  [bundler]: http://gembundler.com/
139
- [jeweler]: https://github.com/technicalpickles/jeweler#readme
140
130
  [gem_package_task]: http://rubygems.rubyforge.org/rubygems-update/Gem/PackageTask.html
141
- [.rvmrc]: https://rvm.io/workflow/rvmrc/#project
142
131
  [rdoc]: http://rdoc.rubyforge.org/
143
132
  [markdown]: http://daringfireball.net/projects/markdown/
144
133
  [textile]: http://textile.sitemonks.com/
145
134
  [yard]: http://yardoc.org/
146
135
  [rspec]: http://rspec.info/
147
136
  [test_unit]: http://test-unit.rubyforge.org/
137
+ [mini_test]: https://github.com/seattlerb/minitest#readme
data/Rakefile CHANGED
@@ -25,7 +25,7 @@ task :test => :spec
25
25
  task :default => :spec
26
26
 
27
27
  begin
28
- gem 'yard', '~> 0.7'
28
+ gem 'yard', '~> 0.8'
29
29
  require 'yard'
30
30
 
31
31
  YARD::Rake::YardocTask.new
data/bin/mine CHANGED
@@ -5,8 +5,7 @@ require 'rubygems'
5
5
  begin
6
6
  require 'ore/generator'
7
7
  rescue LoadError => e
8
- warn 'Could not load "ore/generator"'
9
- exit -1
8
+ abort 'Could not load "ore/generator"'
10
9
  end
11
10
 
12
11
  Ore::Generator.start
data/bin/ore CHANGED
@@ -5,8 +5,7 @@ require 'rubygems'
5
5
  begin
6
6
  require 'ore/cli'
7
7
  rescue LoadError => e
8
- warn 'Could not load "ore/cli"'
9
- exit -1
8
+ abort 'Could not load "ore/cli"'
10
9
  end
11
10
 
12
11
  Ore::CLI.start
@@ -0,0 +1,3 @@
1
+ disable:
2
+ - test_unit
3
+ - rspec
@@ -0,0 +1,26 @@
1
+ require 'rubygems'
2
+ <%- if bundler? -%>
3
+
4
+ begin
5
+ require 'bundler'
6
+ rescue LoadError => e
7
+ STDERR.puts e.message
8
+ STDERR.puts "Run `gem install bundler` to install Bundler."
9
+ exit e.status_code
10
+ end
11
+
12
+ begin
13
+ Bundler.setup(:default, :development, :test)
14
+ rescue Bundler::BundlerError => e
15
+ STDERR.puts e.message
16
+ STDERR.puts "Run `bundle install` to install missing gems."
17
+ exit e.status_code
18
+ end
19
+
20
+ <%- end -%>
21
+ require 'minitest/unit'
22
+
23
+ class MiniTest::Unit::TestCase
24
+ end
25
+
26
+ MiniTest::Unit.autorun
@@ -0,0 +1,12 @@
1
+ require 'helper'
2
+ require '<%= @namespace_path %>'
3
+
4
+ class Test<%= @namespace %> < MiniTest::Unit::TestCase
5
+
6
+ def test_version
7
+ version = <%= @namespace %>.const_get('VERSION')
8
+
9
+ assert(!version.empty?, 'should have a VERSION constant')
10
+ end
11
+
12
+ end
@@ -1,5 +1,6 @@
1
1
  disable:
2
2
  - test_unit
3
+ - mini_test
3
4
 
4
5
  development_dependencies:
5
6
  rspec: ~> 2.4
@@ -1,2 +1,3 @@
1
1
  disable:
2
+ - mini_test
2
3
  - rspec
@@ -1,5 +1,4 @@
1
1
  name: ore
2
- version: 0.9.4
3
2
  summary: Mine beautiful RubyGems from Ore
4
3
  description:
5
4
  Ore is a flexible Ruby project generator. Unlike other Ruby project
@@ -27,9 +26,9 @@ post_install_message: |
27
26
  **************************************************************************
28
27
 
29
28
  dependencies:
30
- thor: ~> 0.14
29
+ thor: ~> 0.15
31
30
 
32
31
  development_dependencies:
33
32
  rubygems-tasks: ~> 0.2
34
33
  rspec: ~> 2.4
35
- yard: ~> 0.7
34
+ yard: ~> 0.8
@@ -1,4 +1,5 @@
1
1
  require 'ore/config'
2
+ require 'ore/version'
2
3
 
3
4
  require 'thor'
4
5
  require 'fileutils'
@@ -11,6 +12,9 @@ module Ore
11
12
  map '-u' => :update
12
13
  map '-r' => :remove
13
14
 
15
+ # add a --version option
16
+ map '--version' => :version
17
+
14
18
  desc 'list', 'List installed Ore templates'
15
19
 
16
20
  #
@@ -86,5 +90,14 @@ module Ore
86
90
  FileUtils.rm_rf(path)
87
91
  end
88
92
 
93
+ desc 'version', 'Prints the version'
94
+
95
+ #
96
+ # Prints {Ore::VERSION}.
97
+ #
98
+ def version
99
+ puts "ore #{Ore::VERSION}"
100
+ end
101
+
89
102
  end
90
103
  end
@@ -157,15 +157,13 @@ module Ore
157
157
 
158
158
  return false if @disabled_templates.include?(name)
159
159
 
160
- unless (template_dir = Template.templates[name])
161
- say "Unknown template #{name}", :red
162
- exit -1
163
- end
160
+ if (template_dir = Template.templates[name])
161
+ source_paths.delete(template_dir)
164
162
 
165
- source_paths.delete(template_dir)
163
+ @templates.delete_if { |template| template.path == template_dir }
164
+ @enabled_templates.delete(name)
165
+ end
166
166
 
167
- @templates.delete_if { |template| template.path == template_dir }
168
- @enabled_templates.delete(name)
169
167
  @disabled_templates << name
170
168
  return true
171
169
  end
@@ -211,11 +209,11 @@ module Ore
211
209
  @project_dir = File.basename(@root)
212
210
  @name = (options.name || @project_dir)
213
211
 
214
- @scm = if File.directory?(File.join(@root,'.git')) then :git
212
+ @scm = if File.directory?(File.join(@root,'.git')) then :git
215
213
  elsif File.directory?(File.join(@root,'.hg')) then :hg
216
214
  elsif File.directory?(File.join(@root,'.svn')) then :svn
217
- elsif options.hg? then :hg
218
- elsif options.git? then :git
215
+ elsif options.hg? then :hg
216
+ elsif options.git? then :git
219
217
  end
220
218
 
221
219
  case @scm
@@ -264,12 +262,9 @@ module Ore
264
262
  "https://#{@uri.host}#{@uri.path}/issues"
265
263
  end
266
264
 
267
- @markup, @markup_ext = if options.markdown?
268
- [:markdown, 'md']
269
- elsif options.textile?
270
- [:textile, 'tt']
271
- else
272
- [:rdoc, 'rdoc']
265
+ @markup, @markup_ext = if options.markdown? then [:markdown, 'md']
266
+ elsif options.textile? then [:textile, 'tt']
267
+ else [:rdoc, 'rdoc']
273
268
  end
274
269
 
275
270
  @date = Date.today
@@ -52,7 +52,7 @@ module Ore
52
52
  raise(StandardError,"#{path.dump} is must be a directory")
53
53
  end
54
54
 
55
- name = File.basename(path).to_sym
55
+ name = File.basename(path).sub(/^ore-/,'').to_sym
56
56
 
57
57
  self.templates[name] = path
58
58
  return name
@@ -0,0 +1,4 @@
1
+ module Ore
2
+ # ore version
3
+ VERSION = '0.10.0'
4
+ end
@@ -203,18 +203,6 @@ describe Generator do
203
203
  end
204
204
  end
205
205
 
206
- context "gem test" do
207
- let(:name) { 'gem_test_project' }
208
-
209
- before(:all) do
210
- generate!(name, :gem_test => true)
211
- end
212
-
213
- it "should add a .gemtest file" do
214
- @path.should have_file('.gemtest')
215
- end
216
- end
217
-
218
206
  context "bundler" do
219
207
  let(:name) { 'bundled_project' }
220
208
 
@@ -407,6 +395,10 @@ gemspec
407
395
  generate!(name, :test_unit => true)
408
396
  end
409
397
 
398
+ it "should disable the mini_test template" do
399
+ @generator.disabled_templates.should include(:mini_test)
400
+ end
401
+
410
402
  it "should disable the rspec template" do
411
403
  @generator.disabled_templates.should include(:rspec)
412
404
  end
@@ -420,7 +412,35 @@ gemspec
420
412
  end
421
413
 
422
414
  it "should add a single test_*.rb file" do
423
- @path.should have_file('test','test_test_unit_project.rb')
415
+ @path.should have_file('test',"test_#{name}.rb")
416
+ end
417
+ end
418
+
419
+ context "mini_test" do
420
+ let(:name) { 'mini_test_project' }
421
+
422
+ before(:all) do
423
+ generate!(name, :mini_test => true)
424
+ end
425
+
426
+ it "should disable the test_unit template" do
427
+ @generator.disabled_templates.should include(:test_unit)
428
+ end
429
+
430
+ it "should disable the rspec template" do
431
+ @generator.disabled_templates.should include(:rspec)
432
+ end
433
+
434
+ it "should create the test/ directory" do
435
+ @path.should have_directory('test')
436
+ end
437
+
438
+ it "should create the test/helper.rb file" do
439
+ @path.should have_file('test','helper.rb')
440
+ end
441
+
442
+ it "should add a single test_*.rb file" do
443
+ @path.should have_file('test',"test_#{name}.rb")
424
444
  end
425
445
  end
426
446
 
@@ -435,6 +455,10 @@ gemspec
435
455
  @generator.disabled_templates.should include(:test_unit)
436
456
  end
437
457
 
458
+ it "should disable the mini_test template" do
459
+ @generator.disabled_templates.should include(:mini_test)
460
+ end
461
+
438
462
  it "should not create the test/ directory" do
439
463
  @path.should_not have_directory('test')
440
464
  end
@@ -472,38 +496,6 @@ gemspec
472
496
  end
473
497
  end
474
498
 
475
- context "jeweler tasks" do
476
- let(:name) { 'jewelery_project' }
477
-
478
- before(:all) do
479
- generate!(name, :jeweler_tasks => true)
480
- end
481
-
482
- it "should disable the rubygems_tasks template" do
483
- @generator.disabled_templates.should include(:rubygems_tasks)
484
- end
485
-
486
- it "should disable the bundler_tasks template" do
487
- @generator.disabled_templates.should include(:bundler_tasks)
488
- end
489
-
490
- it "should add 'jeweler' as a development dependency" do
491
- @gemspec.should have_development_dependency('jeweler')
492
- end
493
- end
494
-
495
- context "jeweler tasks with bundler" do
496
- let(:name) { 'bundled_jewelery_project' }
497
-
498
- before(:all) do
499
- generate!(name, :bundler => true, :jeweler_tasks => true)
500
- end
501
-
502
- it "should add 'jeweler' as a development dependency" do
503
- @gemspec.should have_development_dependency('jeweler')
504
- end
505
- end
506
-
507
499
  context "rubygems-tasks" do
508
500
  let(:name) { 'rubygems_tasks_project' }
509
501
 
@@ -511,10 +503,6 @@ gemspec
511
503
  generate!(name, :rubygems_tasks => true)
512
504
  end
513
505
 
514
- it "should disable the jeweler_tasks template" do
515
- @generator.disabled_templates.should include(:jeweler_tasks)
516
- end
517
-
518
506
  it "should disable the bundler_tasks template" do
519
507
  @generator.disabled_templates.should include(:bundler_tasks)
520
508
  end
@@ -543,10 +531,6 @@ gemspec
543
531
  generate!(name, :bundler_tasks => true)
544
532
  end
545
533
 
546
- it "should disable the jeweler_tasks template" do
547
- @generator.disabled_templates.should include(:jeweler_tasks)
548
- end
549
-
550
534
  it "should disable the rubygems_tasks template" do
551
535
  @generator.disabled_templates.should include(:rubygems_tasks)
552
536
  end
@@ -567,10 +551,6 @@ gemspec
567
551
  @generator.disabled_templates.should include(:rubygems_tasks)
568
552
  end
569
553
 
570
- it "should disable the jeweler_tasks template" do
571
- @generator.disabled_templates.should include(:jeweler_tasks)
572
- end
573
-
574
554
  it "should disable the bundler_tasks template" do
575
555
  @generator.disabled_templates.should include(:bundler_tasks)
576
556
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.10.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-24 00:00:00.000000000 Z
12
+ date: 2012-10-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: '0.14'
21
+ version: '0.15'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: '0.14'
29
+ version: '0.15'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: rubygems-tasks
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: '0.7'
69
+ version: '0.8'
70
70
  type: :development
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ dependencies:
74
74
  requirements:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: '0.7'
77
+ version: '0.8'
78
78
  description: Ore is a flexible Ruby project generator. Unlike other Ruby project generators,
79
79
  Ore provides many builtin templates and allows custom templates to be installed
80
80
  from Git repositories.
@@ -119,7 +119,6 @@ files:
119
119
  - data/ore/templates/bundler_tasks/template.yml
120
120
  - data/ore/templates/gem_package_task/_tasks.erb
121
121
  - data/ore/templates/gem_package_task/template.yml
122
- - data/ore/templates/gem_test/.gemtest
123
122
  - data/ore/templates/gemspec/[name].gemspec.erb
124
123
  - data/ore/templates/gemspec/template.yml
125
124
  - data/ore/templates/gemspec_yml/[name].gemspec.erb
@@ -129,8 +128,9 @@ files:
129
128
  - data/ore/templates/git/template.yml
130
129
  - data/ore/templates/hg/.hgignore.erb
131
130
  - data/ore/templates/hg/template.yml
132
- - data/ore/templates/jeweler_tasks/_tasks.erb
133
- - data/ore/templates/jeweler_tasks/template.yml
131
+ - data/ore/templates/mini_test/template.yml
132
+ - data/ore/templates/mini_test/test/helper.rb.erb
133
+ - data/ore/templates/mini_test/test/test_[name].rb.erb
134
134
  - data/ore/templates/rdoc/.document
135
135
  - data/ore/templates/rdoc/_tasks.erb
136
136
  - data/ore/templates/rdoc/template.yml
@@ -141,7 +141,6 @@ files:
141
141
  - data/ore/templates/rspec/template.yml
142
142
  - data/ore/templates/rubygems_tasks/_tasks.erb
143
143
  - data/ore/templates/rubygems_tasks/template.yml
144
- - data/ore/templates/rvmrc/.rvmrc.erb
145
144
  - data/ore/templates/test_unit/_tasks.erb
146
145
  - data/ore/templates/test_unit/template.yml
147
146
  - data/ore/templates/test_unit/test/helper.rb.erb
@@ -166,6 +165,7 @@ files:
166
165
  - lib/ore/template/helpers.rb
167
166
  - lib/ore/template/interpolations.rb
168
167
  - lib/ore/template/template.rb
168
+ - lib/ore/version.rb
169
169
  - ore.gemspec
170
170
  - spec/gemspec_examples.rb
171
171
  - spec/generator_spec.rb
File without changes
@@ -1,13 +0,0 @@
1
- <%- if bundler? -%>
2
- require 'jeweler'
3
- Jeweler::Tasks.new(Gem::Specification.load('<%= @name %>.gemspec'))
4
- <%- else -%>
5
- begin
6
- gem 'jeweler', '<%= @development_dependencies['jeweler'] %>'
7
- require 'jeweler'
8
-
9
- Jeweler::Tasks.new(Gem::Specification.load('<%= @name %>.gemspec'))
10
- rescue LoadError
11
- warn 'Jeweler (or a dependency) not available. Install it with: gem install jeweler'
12
- end
13
- <%- end -%>
@@ -1,6 +0,0 @@
1
- disable:
2
- - rubygems_tasks
3
- - bundler_tasks
4
-
5
- development_dependencies:
6
- jeweler: ~> 1.5.0
@@ -1 +0,0 @@
1
- rvm use --create @<%= @name %>