ore 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog.md CHANGED
@@ -1,3 +1,14 @@
1
+ ### 0.9.4 / 2012-07-23
2
+
3
+ * Do not initialize the repository, if .git or .hg directories already exist.
4
+
5
+ #### Templates
6
+
7
+ * List all development dependencies in the [gemspec] and [gemspec_yml]
8
+ templates.
9
+ * Sort dependencies alphabetically.
10
+ * Require `bundler/setup` in the [bin] script, if Bundler is enabled.
11
+
1
12
  ### 0.9.3 / 2012-05-28
2
13
 
3
14
  * Added the following template variables to {Ore::Generator}:
data/GemspecYML.md CHANGED
@@ -227,22 +227,6 @@ More than one version can be specified for each dependency:
227
227
  - 1.2.3
228
228
  - 1.3.1
229
229
 
230
- ## runtime_dependencies
231
-
232
- The purely runtime-dependencies for a project can be specified like so:
233
-
234
- runtime_dependencies:
235
- foo: ~> 0.1.0
236
- bar: 1.2.3
237
-
238
- More than one version can be specified for each dependency:
239
-
240
- runtime_dependencies:
241
- foo: ~> 0.1.0, >= 0.0.7
242
- bar:
243
- - 1.2.3
244
- - 1.3.1
245
-
246
230
  ## development_dependencies
247
231
 
248
232
  The purely developmental-dependencies for a project can be specified
@@ -8,7 +8,7 @@ begin
8
8
  rescue LoadError => e
9
9
  warn e.message
10
10
  warn "Run `gem install bundler` to install Bundler."
11
- exit e.status_code
11
+ exit -1
12
12
  end
13
13
 
14
14
  begin
@@ -1,21 +1,16 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- <%- if (bundler? && (git? || hg?)) -%>
4
- root_dir = File.expand_path(File.join(File.dirname(__FILE__),'..'))
5
- if File.directory?(File.join(root_dir,'.git'))
6
- Dir.chdir(root_dir) do |path|
7
- require 'bundler'
8
-
3
+ <%- if (bundler? && (git? || hg? || svn?)) -%>
4
+ root = File.expand_path(File.join(File.dirname(__FILE__),'..'))
5
+ if File.directory?(File.join(root,'.<%= @scm %>'))
6
+ Dir.chdir(root) do
9
7
  begin
10
- Bundler.setup(:default)
11
- rescue Bundler::BundlerError => e
8
+ require 'bundler/setup'
9
+ rescue LoadError => e
12
10
  warn e.message
13
- warn "Run `bundle install` to install missing gems"
14
- exit e.status_code
11
+ warn "Run `gem install bundler` to install Bundler"
12
+ exit -1
15
13
  end
16
14
  end
17
-
18
- lib_dir = File.join(root_dir,'lib')
19
- $LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
20
15
  end
21
16
  <%- end -%>
@@ -1,27 +1,17 @@
1
1
  source :rubygems
2
2
  <%- includes(:gemfile_prelude,'') do |prelude| -%>
3
3
 
4
- <%= prelude %>
4
+ <%= prelude -%>
5
5
  <%- end -%>
6
6
 
7
7
  gemspec
8
8
  <%- includes(:gemfile,'') do |gemfile| -%>
9
9
 
10
- <%= gemfile %>
11
- <%- end -%>
12
- <%- unless @dependencies.empty? -%>
13
-
14
- <%- @dependencies.each do |name,version| -%>
15
- gem '<%= name %>', '<%= version %>'
16
- <%- end -%>
10
+ <%= gemfile -%>
17
11
  <%- end -%>
12
+ <%- includes(:gemfile_development,'') do |gemfile| -%>
18
13
 
19
14
  group :development do
20
- <%= includes(:gemfile_development,'') -%>
21
- <%- unless @development_dependencies.empty? -%>
22
-
23
- <%- @development_dependencies.each do |name,version| -%>
24
- gem '<%= name %>', '<%= version %>'
25
- <%- end -%>
26
- <%- end -%>
15
+ <%= gemfile -%>
27
16
  end
17
+ <%- end -%>
@@ -28,20 +28,13 @@ Gem::Specification.new do |gem|
28
28
  gem.require_paths = ['lib']
29
29
  <%- unless @dependencies.empty? -%>
30
30
 
31
- <%- @dependencies.each do |name,version| -%>
31
+ <%- @dependencies.sort.each do |name,version| -%>
32
32
  gem.add_dependency '<%= name %>', '<%= version %>'
33
33
  <%- end -%>
34
34
  <%- end -%>
35
35
 
36
- <%- if bundler? -%>
37
- gem.add_development_dependency 'bundler', '<%= @development_dependencies['bundler'] %>'
38
- <%- if yard? -%>
39
- gem.add_development_dependency 'yard', '<%= @development_dependencies['yard'] %>'
40
- <%- end -%>
41
- <%- else -%>
42
- <%- unless @development_dependencies.empty? -%>
43
- <%- @development_dependencies.each do |name,version| -%>
36
+ <%- unless @development_dependencies.empty? -%>
37
+ <%- @development_dependencies.sort.each do |name,version| -%>
44
38
  gem.add_development_dependency '<%= name%>', '<%= version %>'
45
- <%- end -%>
46
39
  <%- end -%>
47
40
  <%- end -%>end
@@ -20,22 +20,14 @@ homepage: <%= @homepage %>
20
20
  <%- unless @dependencies.empty? -%>
21
21
 
22
22
  dependencies:
23
- <%- @dependencies.each do |name,version| -%>
23
+ <%- @dependencies.sort.each do |name,version| -%>
24
24
  <%= name %>: <%= version %>
25
25
  <%- end -%>
26
26
  <%- end -%>
27
27
 
28
- <%- if bundler? -%>
28
+ <%- unless @development_dependencies.empty? -%>
29
29
  development_dependencies:
30
- bundler: <%= @development_dependencies['bundler'] %>
31
- <%- if yard? -%>
32
- yard: <%= @development_dependencies['yard'] %>
33
- <%- end -%>
34
- <%- else -%>
35
- <%- unless @development_dependencies.empty? -%>
36
- development_dependencies:
37
- <%- @development_dependencies.each do |name,version| -%>
30
+ <%- @development_dependencies.sort.each do |name,version| -%>
38
31
  <%= name %>: <%= version %>
39
- <%- end -%>
40
32
  <%- end -%>
41
33
  <%- end -%>
@@ -9,6 +9,6 @@ begin
9
9
  Gem::Tasks.new
10
10
  rescue LoadError => e
11
11
  warn e.message
12
- warn "Run `gem install rubygems-tasks` to install 'rubygems/tasks'."
12
+ warn "Run `gem install rubygems-tasks` to install Gem::Tasks."
13
13
  end
14
14
  <%- end -%>
@@ -5,4 +5,4 @@ ignore:
5
5
  - doc/
6
6
 
7
7
  development_dependencies:
8
- yard: ~> 0.7
8
+ yard: ~> 0.8
data/gemspec.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  name: ore
2
- version: 0.9.3
2
+ version: 0.9.4
3
3
  summary: Mine beautiful RubyGems from Ore
4
4
  description:
5
5
  Ore is a flexible Ruby project generator. Unlike other Ruby project
data/lib/ore/generator.rb CHANGED
@@ -83,13 +83,17 @@ module Ore
83
83
  in_root do
84
84
  case @scm
85
85
  when :git
86
- run 'git init' unless File.directory?('.git')
87
- run 'git add .'
88
- run 'git commit -m "Initial commit."'
86
+ unless File.directory?('.git')
87
+ run 'git init'
88
+ run 'git add .'
89
+ run 'git commit -m "Initial commit."'
90
+ end
89
91
  when :hg
90
- run 'hg init' unless File.directory?('.hg')
91
- run 'hg add .'
92
- run 'hg commit -m "Initial commit."'
92
+ unless File.directory?('.hg')
93
+ run 'hg init'
94
+ run 'hg add .'
95
+ run 'hg commit -m "Initial commit."'
96
+ end
93
97
  when :svn
94
98
  @ignore.each do |pattern|
95
99
  run "svn propset svn:ignore #{pattern.dump}"
@@ -230,6 +230,15 @@ describe Generator do
230
230
  @gemspec.should have_development_dependency('bundler')
231
231
  end
232
232
 
233
+ it "should not have any dependencies in the Gemfile" do
234
+ gemfile = (@path + 'Gemfile').read
235
+ gemfile.should eq(<<-GEMFILE)
236
+ source :rubygems
237
+
238
+ gemspec
239
+ GEMFILE
240
+ end
241
+
233
242
  it "should add 'Gemfile.lock' to the .gitignore file" do
234
243
  gitignore.should include('Gemfile.lock')
235
244
  end
@@ -458,8 +467,8 @@ describe Generator do
458
467
  generate!(name, :bundler => true, :rspec => true)
459
468
  end
460
469
 
461
- it "should not add 'rspec' as a development dependency" do
462
- @gemspec.should_not have_development_dependency('rspec')
470
+ it "should add 'rspec' as a development dependency" do
471
+ @gemspec.should have_development_dependency('rspec')
463
472
  end
464
473
  end
465
474
 
@@ -490,8 +499,8 @@ describe Generator do
490
499
  generate!(name, :bundler => true, :jeweler_tasks => true)
491
500
  end
492
501
 
493
- it "should not add 'jeweler' as a development dependency" do
494
- @gemspec.should_not have_development_dependency('jeweler')
502
+ it "should add 'jeweler' as a development dependency" do
503
+ @gemspec.should have_development_dependency('jeweler')
495
504
  end
496
505
  end
497
506
 
@@ -522,8 +531,8 @@ describe Generator do
522
531
  generate!(name, :bundler => true, :rubygems_tasks => true)
523
532
  end
524
533
 
525
- it "should not add 'rubygems-tasks' as a development dependency" do
526
- @gemspec.should_not have_development_dependency('rubygems-tasks')
534
+ it "should add 'rubygems-tasks' as a development dependency" do
535
+ @gemspec.should have_development_dependency('rubygems-tasks')
527
536
  end
528
537
  end
529
538
 
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.3
4
+ version: 0.9.4
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-05-28 00:00:00.000000000 Z
12
+ date: 2012-07-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor