ore 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog.md CHANGED
@@ -1,3 +1,15 @@
1
+ ### 0.7.0 / 2011-02-19
2
+
3
+ * Require ore-core ~> 0.1, >= 0.1.2.
4
+ * Added {Ore::Template::Helpers#git?}.
5
+ * Added {Ore::Template::Helpers#bin?}.
6
+ * Added the `bin` template and `--bin` option to {Ore::Generator}.
7
+ * Enable `--ore-tasks` by default.
8
+ * Allow `--jeweler-tasks` to disable `--ore-tasks`.
9
+ * Relax ore-tasks dependency to `~> 0.4`.
10
+ * Relax rspec dependency to `~> 2.4`.
11
+ * Relax ore-core dependency to `~> 0.1`.
12
+
1
13
  ### 0.6.0 / 2011-02-12
2
14
 
3
15
  * Require ore-core ~> 0.1.2.
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  * [Source](http://github.com/ruby-ore/ore)
4
4
  * [Issues](http://github.com/ruby-ore/ore/issues)
5
- * [Documentation](http://rubydoc.info/gems/ore/file/README.md)
5
+ * [Documentation](http://rubydoc.info/gems/ore/frames)
6
6
  * [Email](mailto:postmodern.mod3 at gmail.com)
7
7
  * IRC: irc.freenode.net #ruby-ore
8
8
 
@@ -24,8 +24,18 @@ the developer to keep all of the project information in a single YAML file.
24
24
 
25
25
  require 'ore/specification'
26
26
 
27
- Ore::Specification.new do |gemspec|
28
- # custom logic here
27
+ begin
28
+ Ore::Specification.new do |gemspec|
29
+ # custom logic here
30
+ end
31
+ rescue NameError
32
+ begin
33
+ require 'ore/specification'
34
+ retry
35
+ rescue LoadError
36
+ STDERR.puts "The '#{__FILE__}' file requires Ore."
37
+ STDERR.puts "Run `gem install ore-core` to install Ore."
38
+ end
29
39
  end
30
40
 
31
41
  * Provides an **extendable** project **generator** that supports
@@ -33,7 +43,7 @@ the developer to keep all of the project information in a single YAML file.
33
43
 
34
44
  ## Requirements
35
45
 
36
- * [ore-core](http://github.com/ruby-ore/ore-core) ~> 0.1.2
46
+ * [ore-core](http://github.com/ruby-ore/ore-core) ~> 0.1, >= 0.1.2
37
47
  * [thor](http://github.com/wycats/thor) ~> 0.14.3
38
48
 
39
49
  ## Install
@@ -45,7 +55,7 @@ the developer to keep all of the project information in a single YAML file.
45
55
  The `gemspec.yml` file used to build Ore:
46
56
 
47
57
  name: ore
48
- version: 0.5.0
58
+ version: 0.7.0
49
59
  summary: Mine raw RubyGems from YAML.
50
60
  description:
51
61
  Ore is a simple RubyGem building solution. Ore handles the
@@ -62,7 +72,7 @@ The `gemspec.yml` file used to build Ore:
62
72
  **************************************************************************
63
73
  Generate a new Ruby library:
64
74
 
65
- $ mine my_library --ore-tasks --rspec
75
+ $ mine my_library --rspec
66
76
 
67
77
  Build the library:
68
78
 
@@ -75,12 +85,12 @@ The `gemspec.yml` file used to build Ore:
75
85
  **************************************************************************
76
86
 
77
87
  dependencies:
78
- ore-core: ~> 0.1.2
88
+ ore-core: ~> 0.1, >= 0.1.2
79
89
  thor: ~> 0.14.3
80
90
 
81
91
  development_dependencies:
82
- ore-tasks: ~> 0.4.0
83
- rspec: ~> 2.4.0
92
+ ore-tasks: ~> 0.4
93
+ rspec: ~> 2.4
84
94
  yard: ~> 0.6.1
85
95
 
86
96
  For a complete refrence to the `gemspec.yml` file, please see the
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
 
4
4
  begin
5
- gem 'ore-tasks', '~> 0.4.0'
5
+ gem 'ore-tasks', '~> 0.4'
6
6
  require 'ore/tasks'
7
7
 
8
8
  Ore::Tasks.new
@@ -12,7 +12,7 @@ rescue LoadError => e
12
12
  end
13
13
 
14
14
  begin
15
- gem 'rspec', '~> 2.4.0'
15
+ gem 'rspec', '~> 2.4'
16
16
  require 'rspec/core/rake_task'
17
17
 
18
18
  RSpec::Core::RakeTask.new
@@ -3,7 +3,7 @@
3
3
  <%- if @homepage -%>
4
4
  * [Homepage](<%= @homepage %>)
5
5
  <%- end -%>
6
- * [Documentation](http://rubydoc.info/gems/<%= @name %>)
6
+ * [Documentation](http://rubydoc.info/gems/<%= @name %>/frames)
7
7
  <%- if @safe_email -%>
8
8
  * [Email](mailto:<%= @safe_email %>)
9
9
  <%- end -%>
@@ -24,7 +24,7 @@
24
24
 
25
25
  $ gem install <%= @name %>
26
26
 
27
- <%- if @bin -%>
27
+ <%- if bin? -%>
28
28
  ## Synopsis
29
29
 
30
30
  $ <%= @name %>
@@ -3,7 +3,7 @@
3
3
  <%- if @homepage -%>
4
4
  * {Homepage}[<%= @homepage %>]
5
5
  <%- end -%>
6
- * {Documentation}[http://rubydoc.info/gems/<%= @name %>]
6
+ * {Documentation}[http://rubydoc.info/gems/<%= @name %>/frames]
7
7
  <%- if @safe_email -%>
8
8
  * {Email}[mailto:<%= @safe_email %>]
9
9
  <%- end -%>
@@ -24,7 +24,7 @@
24
24
 
25
25
  $ gem install <%= @name %>
26
26
 
27
- <%- if @bin -%>
27
+ <%- if bin? -%>
28
28
  == Synopsis
29
29
 
30
30
  $ <%= @name %>
@@ -3,7 +3,7 @@ h1. <%= @name %>
3
3
  <%- if @homepage -%>
4
4
  * "Homepage":<%= @homepage %>
5
5
  <%- end -%>
6
- * "Documentation":http://rubydoc.info/gems/<%= @name %>
6
+ * "Documentation":http://rubydoc.info/gems/<%= @name %>/frames
7
7
  <%- if @safe_email -%>
8
8
  * "Email":mailto:<%= @safe_email %>
9
9
  <%- end -%>
@@ -26,7 +26,7 @@ h2. Install
26
26
  bc.
27
27
  $ gem install <%= @name %>
28
28
 
29
- <%- if @bin -%>
29
+ <%- if bin? -%>
30
30
  h2. Synopsis
31
31
 
32
32
  bc.
@@ -1,2 +1,2 @@
1
1
  variables:
2
- ore_core_dependency: ~> 0.1.0
2
+ ore_core_dependency: ~> 0.1
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ <%- if (bundler? && git?) -%>
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
+
9
+ begin
10
+ Bundler.setup(:default)
11
+ rescue Bundler::BundlerError => e
12
+ STDERR.puts e.message
13
+ STDERR.puts "Run `bundle install` to install missing gems"
14
+ exit e.status_code
15
+ end
16
+ end
17
+
18
+ lib_dir = File.join(root_dir,'lib')
19
+ $LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
20
+ end
21
+ <%- end -%>
@@ -1,2 +1,5 @@
1
+ disables:
2
+ - ore_tasks
3
+
1
4
  variables:
2
5
  jeweler_dependency: ~> 1.5.0
@@ -1,2 +1,2 @@
1
1
  variables:
2
- ore_tasks_dependency: ~> 0.4.0
2
+ ore_tasks_dependency: ~> 0.4
@@ -1,4 +1,5 @@
1
1
  disable:
2
2
  - test_unit
3
+
3
4
  variables:
4
- rspec_dependency: ~> 2.4.0
5
+ rspec_dependency: ~> 2.4
@@ -1,4 +1,5 @@
1
1
  disable:
2
2
  - rdoc
3
+
3
4
  variables:
4
5
  yard_dependency: ~> 0.6.0
data/gemspec.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  name: ore
2
- version: 0.6.0
2
+ version: 0.7.0
3
3
  summary: Mine raw RubyGems from YAML
4
4
  description:
5
5
  Ore is a simple RubyGem building solution. Ore handles the
@@ -16,7 +16,7 @@ post_install_message: |
16
16
  **************************************************************************
17
17
  Generate a new Ruby library:
18
18
 
19
- $ mine my_library --ore-tasks --rspec
19
+ $ mine my_library --rspec
20
20
 
21
21
  Build the library:
22
22
 
@@ -29,10 +29,10 @@ post_install_message: |
29
29
  **************************************************************************
30
30
 
31
31
  dependencies:
32
- ore-core: ~> 0.1.2
32
+ ore-core: ~> 0.1, >= 0.1.2
33
33
  thor: ~> 0.14.3
34
34
 
35
35
  development_dependencies:
36
- ore-tasks: ~> 0.4.0
37
- rspec: ~> 2.4.0
36
+ ore-tasks: ~> 0.4
37
+ rspec: ~> 2.4
38
38
  yard: ~> 0.6.1
data/lib/ore/generator.rb CHANGED
@@ -62,6 +62,7 @@ module Ore
62
62
  :description => 'TODO: Description',
63
63
  :license => 'MIT',
64
64
  :authors => [ENV['USER']],
65
+ :ore_tasks => true,
65
66
  :rdoc => true,
66
67
  :rspec => true,
67
68
  :git => true
@@ -312,7 +313,9 @@ module Ore
312
313
  template.each_file(@markup) do |dest,file|
313
314
  unless generated.include?(dest)
314
315
  path = interpolate(dest)
316
+
315
317
  copy_file file, path
318
+ chmod path, File.stat(file).mode
316
319
 
317
320
  generated << dest
318
321
  end
@@ -322,11 +325,12 @@ module Ore
322
325
  template.each_template(@markup) do |dest,file|
323
326
  unless generated.include?(dest)
324
327
  path = interpolate(dest)
325
-
326
328
  @current_template_dir = File.dirname(dest)
329
+
327
330
  template file, path
328
- @current_template_dir = nil
331
+ chmod path, File.stat(file).mode
329
332
 
333
+ @current_template_dir = nil
330
334
  generated << dest
331
335
  end
332
336
  end
@@ -37,6 +37,18 @@ module Ore
37
37
  return output_buffer.join(separator)
38
38
  end
39
39
 
40
+ #
41
+ # Determines if Git is enabled.
42
+ #
43
+ # @return [Boolean]
44
+ # Specifies whether Git was enabled.
45
+ #
46
+ # @since 0.7.0
47
+ #
48
+ def git?
49
+ options.git?
50
+ end
51
+
40
52
  #
41
53
  # Determines if a template was enabled.
42
54
  #
@@ -47,6 +59,18 @@ module Ore
47
59
  @enabled_templates.include?(name.to_sym)
48
60
  end
49
61
 
62
+ #
63
+ # Determines whether the project will have a bin script.
64
+ #
65
+ # @return [Boolean]
66
+ # Specifies whether the project will have a bin script.
67
+ #
68
+ # @since 0.7.0
69
+ #
70
+ def bin?
71
+ enabled?(:bin)
72
+ end
73
+
50
74
  #
51
75
  # Determines if the project will contain RDoc documented.
52
76
  #
@@ -75,8 +75,8 @@ describe Generator do
75
75
  subject['homepage'].should_not be_empty
76
76
  end
77
77
 
78
- it "should have 'ore' as a development dependency" do
79
- subject['development_dependencies'].should have_key('ore-core')
78
+ it "should have 'ore-tasks' as a development dependency" do
79
+ subject['development_dependencies'].should have_key('ore-tasks')
80
80
  end
81
81
  end
82
82
 
@@ -105,6 +105,26 @@ describe Generator do
105
105
  end
106
106
  end
107
107
 
108
+ context "bin" do
109
+ let(:name) { 'script-project' }
110
+
111
+ before(:all) do
112
+ generate!(name, :bin => true)
113
+ end
114
+
115
+ it "should add a 'bin/' directory" do
116
+ @path.join('bin').should be_directory
117
+ end
118
+
119
+ it "should add a bin/script-project file" do
120
+ @path.join('bin',name).should be_file
121
+ end
122
+
123
+ it "should make the bin/script-project file executable" do
124
+ @path.join('bin',name).should be_executable
125
+ end
126
+ end
127
+
108
128
  context "gem test" do
109
129
  let(:name) { 'gem_test_project' }
110
130
 
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,4 @@
1
- gem 'rspec', '~> 2.4.0'
1
+ gem 'rspec', '~> 2.4'
2
2
  require 'rspec'
3
3
 
4
4
  gem 'ore-core', '~> 0.1.0'
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: ore
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.6.0
5
+ version: 0.7.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Postmodern
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-02-12 00:00:00 -08:00
13
+ date: 2011-02-19 00:00:00 -08:00
14
14
  default_executable: ore
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -20,6 +20,9 @@ dependencies:
20
20
  none: false
21
21
  requirements:
22
22
  - - ~>
23
+ - !ruby/object:Gem::Version
24
+ version: "0.1"
25
+ - - ">="
23
26
  - !ruby/object:Gem::Version
24
27
  version: 0.1.2
25
28
  type: :runtime
@@ -43,7 +46,7 @@ dependencies:
43
46
  requirements:
44
47
  - - ~>
45
48
  - !ruby/object:Gem::Version
46
- version: 0.4.0
49
+ version: "0.4"
47
50
  type: :development
48
51
  version_requirements: *id003
49
52
  - !ruby/object:Gem::Dependency
@@ -54,7 +57,7 @@ dependencies:
54
57
  requirements:
55
58
  - - ~>
56
59
  - !ruby/object:Gem::Version
57
- version: 2.4.0
60
+ version: "2.4"
58
61
  type: :development
59
62
  version_requirements: *id004
60
63
  - !ruby/object:Gem::Dependency
@@ -107,6 +110,7 @@ files:
107
110
  - data/ore/templates/base/lib/[namespace_path].rb.erb
108
111
  - data/ore/templates/base/lib/[namespace_path]/version.rb.erb
109
112
  - data/ore/templates/base/template.yml
113
+ - data/ore/templates/bin/bin/[name].erb
110
114
  - data/ore/templates/bundler/Gemfile.erb
111
115
  - data/ore/templates/bundler/_development_dependencies.erb
112
116
  - data/ore/templates/bundler/_gitignore.erb
@@ -161,7 +165,7 @@ post_install_message: |
161
165
  **************************************************************************
162
166
  Generate a new Ruby library:
163
167
 
164
- $ mine my_library --ore-tasks --rspec
168
+ $ mine my_library --rspec
165
169
 
166
170
  Build the library:
167
171
 
@@ -192,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
196
  requirements: []
193
197
 
194
198
  rubyforge_project: ore
195
- rubygems_version: 1.5.0
199
+ rubygems_version: 1.5.2
196
200
  signing_key:
197
201
  specification_version: 3
198
202
  summary: Mine raw RubyGems from YAML