ore 0.7.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog.md +10 -0
- data/GemspecYML.md +263 -0
- data/README.md +26 -34
- data/data/ore/templates/base/Rakefile.erb +2 -0
- data/data/ore/templates/base/[name].gemspec.erb +125 -13
- data/data/ore/templates/test_unit/_tasks.erb +2 -2
- data/data/ore/templates/yard/template.yml +1 -1
- data/gemspec.yml +6 -7
- data/lib/ore/config.rb +2 -1
- data/lib/ore/generator.rb +16 -12
- data/lib/ore/template/interpolations.rb +6 -0
- data/spec/generator_spec.rb +0 -4
- data/spec/helpers/generator.rb +10 -6
- metadata +28 -19
- data/data/ore/templates/yard/_gemspec.erb +0 -1
data/ChangeLog.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
### 0.8.0 / 2011-06-18
|
2
|
+
|
3
|
+
* Added the `markup`, `date`, `year`, `month` and `day` keywords to
|
4
|
+
{Ore::Template::Interpolations}.
|
5
|
+
* Added `encoding` comments to generated `Rakefile` and `*.gemspec` files.
|
6
|
+
* Fixed chmoding of bin files.
|
7
|
+
* Updated the generated `yard` dependency to `~> 0.7.0`.
|
8
|
+
* No longer add `has_yard: true` to generated `gemspec.yml` files.
|
9
|
+
* Generate a pure-Ruby `*.gemspec` file, which loads `gemspec.yml`.
|
10
|
+
|
1
11
|
### 0.7.2 / 2011-02-26
|
2
12
|
|
3
13
|
* Require ore-core ~> 0.1, >= 0.1.4.
|
data/GemspecYML.md
ADDED
@@ -0,0 +1,263 @@
|
|
1
|
+
# gemspec.yml
|
2
|
+
|
3
|
+
Ore uses the `gemspec.yml` file to store all static data about a project.
|
4
|
+
The `gemspec.yml` is a simple YAML file, which contains the same data
|
5
|
+
that a normal Ruby `.gemspec` file would. Below is the complete listing
|
6
|
+
of valid data that can be listed in a `gemspec.yml` file.
|
7
|
+
|
8
|
+
## name
|
9
|
+
|
10
|
+
The name of the project can be listed like so:
|
11
|
+
|
12
|
+
name: foo
|
13
|
+
|
14
|
+
If the name is not listed, Ore will use the base-name of the project
|
15
|
+
directory.
|
16
|
+
|
17
|
+
## version
|
18
|
+
|
19
|
+
The version of the project can be listed like so:
|
20
|
+
|
21
|
+
version: 1.2.3
|
22
|
+
|
23
|
+
If the version is not listed, Ore will first search for a `VERSION`
|
24
|
+
file in the root of the project. If Ore cannot find any version files,
|
25
|
+
it will then search within the `lib/` directory for a `version.rb`.
|
26
|
+
|
27
|
+
## summary
|
28
|
+
|
29
|
+
The summary of the project can be listed like so:
|
30
|
+
|
31
|
+
summary: My awesome project
|
32
|
+
|
33
|
+
## description
|
34
|
+
|
35
|
+
The description of the project can be listed in a variety of ways:
|
36
|
+
|
37
|
+
* Single line:
|
38
|
+
|
39
|
+
description: My project, which provides various functionality.
|
40
|
+
|
41
|
+
* Text block:
|
42
|
+
|
43
|
+
description:
|
44
|
+
My project, which provides the developer with various attributes
|
45
|
+
and behaviors.
|
46
|
+
|
47
|
+
If the description is not listed, it will default to the `summary`.
|
48
|
+
|
49
|
+
## license
|
50
|
+
|
51
|
+
The license of the project can be listed like so:
|
52
|
+
|
53
|
+
license: MIT
|
54
|
+
|
55
|
+
Multiple licenses can also be listed:
|
56
|
+
|
57
|
+
license:
|
58
|
+
- LGPL-2.1
|
59
|
+
- GPL-2
|
60
|
+
|
61
|
+
## authors
|
62
|
+
|
63
|
+
The authors of the project can be listed like so:
|
64
|
+
|
65
|
+
authors: Alice
|
66
|
+
|
67
|
+
If a project has more than one author, each author can be listed:
|
68
|
+
|
69
|
+
authors:
|
70
|
+
- Alice
|
71
|
+
- Eve
|
72
|
+
- Bob
|
73
|
+
|
74
|
+
## email
|
75
|
+
|
76
|
+
The primary email contact for the project can be listed like so:
|
77
|
+
|
78
|
+
email: alice@example.com
|
79
|
+
|
80
|
+
If a project has more than one email contact, each email address can be
|
81
|
+
listed:
|
82
|
+
|
83
|
+
email:
|
84
|
+
- alice@example.com
|
85
|
+
- eve@example.com
|
86
|
+
- bob@example.com
|
87
|
+
|
88
|
+
## require_paths
|
89
|
+
|
90
|
+
The require_paths of a project can be listed like so:
|
91
|
+
|
92
|
+
require_paths: lib
|
93
|
+
|
94
|
+
If there are more than one require_path that needs listing:
|
95
|
+
|
96
|
+
require_paths:
|
97
|
+
- ext
|
98
|
+
- lib
|
99
|
+
|
100
|
+
## executables
|
101
|
+
|
102
|
+
The names of the executables provided by the project can be listed like so:
|
103
|
+
|
104
|
+
executables: bin/*
|
105
|
+
|
106
|
+
One can also list the executables individually:
|
107
|
+
|
108
|
+
executables:
|
109
|
+
- util1
|
110
|
+
- util2
|
111
|
+
|
112
|
+
If the `executables` are not listed, Ore will use the names of any
|
113
|
+
executable file within the `bin/` directory.
|
114
|
+
|
115
|
+
## extensions
|
116
|
+
|
117
|
+
Any Ruby C-extensions can be listed like so:
|
118
|
+
|
119
|
+
extensions: ext/foo/extconf.rb
|
120
|
+
|
121
|
+
## documentation
|
122
|
+
|
123
|
+
The format of the documentation can be listed like so:
|
124
|
+
|
125
|
+
documentation: yard
|
126
|
+
|
127
|
+
## extra_doc_files
|
128
|
+
|
129
|
+
The extra files that should also be scanned for documentation can be listed
|
130
|
+
like so:
|
131
|
+
|
132
|
+
extra_doc_files:
|
133
|
+
- ChangeLog.md
|
134
|
+
- LICENSE.txt
|
135
|
+
|
136
|
+
If `extra_doc_files` is not listed, Ore will use the extra-files listed in
|
137
|
+
the `.document` file.
|
138
|
+
|
139
|
+
## files
|
140
|
+
|
141
|
+
The files of the project can be listed like so:
|
142
|
+
|
143
|
+
files: lib/**/*.rb
|
144
|
+
|
145
|
+
More than one file pattern can be specification:
|
146
|
+
|
147
|
+
files:
|
148
|
+
- lib/**/*.rb
|
149
|
+
- spec/**/*
|
150
|
+
- data/**/*
|
151
|
+
|
152
|
+
If `files` is not listed, Ore will check if the project is using
|
153
|
+
[Git](http://www.git-scm.org/), can will find all tracked files using:
|
154
|
+
|
155
|
+
git ls-files -z
|
156
|
+
|
157
|
+
If the project is not using Git, Ore will default `files` to every file in
|
158
|
+
the project.
|
159
|
+
|
160
|
+
## test_files
|
161
|
+
|
162
|
+
The files used to test the project can be listed like so:
|
163
|
+
|
164
|
+
test_files: spec/**/*_spec.rb
|
165
|
+
|
166
|
+
More than one test-file pattern can be supplied:
|
167
|
+
|
168
|
+
test_files:
|
169
|
+
- spec/**/*_spec.rb
|
170
|
+
- features/**/*
|
171
|
+
|
172
|
+
If `test_files` is not listed, Ore will default `files` to
|
173
|
+
`test/{**/}test_*.rb` and `spec/{**/}*_spec.rb`.
|
174
|
+
|
175
|
+
## post_install_message
|
176
|
+
|
177
|
+
The post-installation message for a project can be listed like so:
|
178
|
+
|
179
|
+
post_install_message: |
|
180
|
+
|
181
|
+
Thank you for installing MyProject 0.1.0. To start MyProject, simply
|
182
|
+
run the following command:
|
183
|
+
|
184
|
+
$ my_project
|
185
|
+
|
186
|
+
|
187
|
+
## requirements
|
188
|
+
|
189
|
+
The external requirements of the project can be listed like so:
|
190
|
+
|
191
|
+
requirements: libcairo >= 1.8
|
192
|
+
|
193
|
+
Multiple external requirements can also be listed:
|
194
|
+
|
195
|
+
requirements:
|
196
|
+
- libcairo >= 1.8.0
|
197
|
+
- libclutter >= 1.2.0
|
198
|
+
|
199
|
+
## required_ruby_version
|
200
|
+
|
201
|
+
The version of Ruby required by the project can be listed like so:
|
202
|
+
|
203
|
+
required_ruby_version: >= 1.9.1
|
204
|
+
|
205
|
+
## required_rubygems_version
|
206
|
+
|
207
|
+
The version of RubyGems required by the project can be listed like so:
|
208
|
+
|
209
|
+
required_rubygems_version: >= 1.3.7
|
210
|
+
|
211
|
+
If `required_rubygems_version` is not listed and the project uses
|
212
|
+
[Bundler](http://gembundler.com/), Ore will default `required_rubygems_version`
|
213
|
+
to `>= 1.3.6`.
|
214
|
+
|
215
|
+
## dependencies
|
216
|
+
|
217
|
+
The dependencies of the project can be listed like so:
|
218
|
+
|
219
|
+
dependencies:
|
220
|
+
foo: ~> 0.1.0
|
221
|
+
bar: 1.2.3
|
222
|
+
|
223
|
+
More than one version can be specified for each dependency:
|
224
|
+
|
225
|
+
dependencies:
|
226
|
+
foo: ~> 0.1.0, >= 0.0.7
|
227
|
+
bar:
|
228
|
+
- 1.2.3
|
229
|
+
- 1.3.1
|
230
|
+
|
231
|
+
## runtime_dependencies
|
232
|
+
|
233
|
+
The purely runtime-dependencies for a project can be specified like so:
|
234
|
+
|
235
|
+
runtime_dependencies:
|
236
|
+
foo: ~> 0.1.0
|
237
|
+
bar: 1.2.3
|
238
|
+
|
239
|
+
More than one version can be specified for each dependency:
|
240
|
+
|
241
|
+
runtime_dependencies:
|
242
|
+
foo: ~> 0.1.0, >= 0.0.7
|
243
|
+
bar:
|
244
|
+
- 1.2.3
|
245
|
+
- 1.3.1
|
246
|
+
|
247
|
+
## development_dependencies
|
248
|
+
|
249
|
+
The purely developmental-dependencies for a project can be specified
|
250
|
+
like so:
|
251
|
+
|
252
|
+
development_dependencies:
|
253
|
+
foo: ~> 0.1.0
|
254
|
+
bar: 1.2.3
|
255
|
+
|
256
|
+
More than one version can be specified for each dependency:
|
257
|
+
|
258
|
+
development_dependencies:
|
259
|
+
foo: ~> 0.1.0, >= 0.0.7
|
260
|
+
bar:
|
261
|
+
- 1.2.3
|
262
|
+
- 1.3.1
|
263
|
+
|
data/README.md
CHANGED
@@ -8,42 +8,34 @@
|
|
8
8
|
|
9
9
|
## Description
|
10
10
|
|
11
|
-
Ore is a
|
12
|
-
|
13
|
-
|
11
|
+
Ore is a flexible Ruby project generator. Unlike other Ruby project
|
12
|
+
generators, Ore provides many builtin templates and allows custom
|
13
|
+
templates to be installed from Git repositories.
|
14
14
|
|
15
15
|
## Features
|
16
16
|
|
17
|
-
* Stores project
|
18
|
-
*
|
19
|
-
|
20
|
-
*
|
21
|
-
* `VERSION` or `
|
22
|
-
|
23
|
-
*
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
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
|
39
|
-
end
|
40
|
-
|
41
|
-
* Provides an **extendable** project **generator** that supports
|
42
|
-
user-installed templates.
|
17
|
+
* Stores project metadata in **one YAML file** (`gemspec.yml`).
|
18
|
+
* Generates a **pure Ruby** `.gemspec` supporting:
|
19
|
+
* Git
|
20
|
+
* `gemspec.yml`
|
21
|
+
* `VERSION` or `version.rb` files
|
22
|
+
* Provides many builtin templates:
|
23
|
+
* bundler
|
24
|
+
* rvmrc
|
25
|
+
* jeweler
|
26
|
+
* rdoc
|
27
|
+
* yard
|
28
|
+
* test_unit
|
29
|
+
* rspec
|
30
|
+
* gem_test
|
31
|
+
* Allows installing custom templates from Git repositories:
|
32
|
+
|
33
|
+
$ ore install git://github.com/ruby-ore/cucumber.git
|
43
34
|
|
44
35
|
## Requirements
|
45
36
|
|
46
37
|
* [ore-core](http://github.com/ruby-ore/ore-core) ~> 0.1, >= 0.1.4
|
38
|
+
* [env](http://github.com/postmodern/env) ~> 0.1.2
|
47
39
|
* [thor](http://github.com/wycats/thor) ~> 0.14.3
|
48
40
|
|
49
41
|
## Install
|
@@ -55,7 +47,7 @@ the developer to keep all of the project information in a single YAML file.
|
|
55
47
|
The `gemspec.yml` file used to build Ore:
|
56
48
|
|
57
49
|
name: ore
|
58
|
-
version: 0.
|
50
|
+
version: 0.8.0
|
59
51
|
summary: Mine raw RubyGems from YAML.
|
60
52
|
description:
|
61
53
|
Ore is a simple RubyGem building solution. Ore handles the
|
@@ -67,7 +59,6 @@ The `gemspec.yml` file used to build Ore:
|
|
67
59
|
authors: Postmodern
|
68
60
|
email: postmodern.mod3@gmail.com
|
69
61
|
homepage: http://github.com/ruby-ore/ore
|
70
|
-
has_yard: true
|
71
62
|
post_install_message: |
|
72
63
|
**************************************************************************
|
73
64
|
Generate a new Ruby library:
|
@@ -86,15 +77,16 @@ The `gemspec.yml` file used to build Ore:
|
|
86
77
|
|
87
78
|
dependencies:
|
88
79
|
ore-core: ~> 0.1, >= 0.1.4
|
80
|
+
env: ~> 0.1.2
|
89
81
|
thor: ~> 0.14.3
|
90
82
|
|
91
83
|
development_dependencies:
|
92
84
|
ore-tasks: ~> 0.4
|
93
85
|
rspec: ~> 2.4
|
94
|
-
yard: ~> 0.
|
86
|
+
yard: ~> 0.7.0
|
95
87
|
|
96
88
|
For a complete refrence to the `gemspec.yml` file, please see the
|
97
|
-
[GemspecYML Reference](http://rubydoc.info/gems/ore
|
89
|
+
[GemspecYML Reference](http://rubydoc.info/gems/ore/file/GemspecYML.html).
|
98
90
|
|
99
91
|
## Synopsis
|
100
92
|
|
@@ -120,7 +112,7 @@ Generate a new customized project:
|
|
120
112
|
|
121
113
|
Generate a new project using previously installed templates:
|
122
114
|
|
123
|
-
$ mine my_project --bundler --rspec --yard --
|
115
|
+
$ mine my_project --bundler --rspec --yard --templates mini_test
|
124
116
|
|
125
117
|
Add default generator options to `~/.ore/options.yml`:
|
126
118
|
|
@@ -1,15 +1,127 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
Gem::Specification.new do |gemspec|
|
6
|
+
files = if File.directory?('.git')
|
7
|
+
`git ls-files`.split($/)
|
8
|
+
elsif File.directory?('.hg')
|
9
|
+
`hg manifest`.split($/)
|
10
|
+
elsif File.directory?('.svn')
|
11
|
+
`svn ls -R`.split($/).select { |path| File.file?(path) }
|
12
|
+
else
|
13
|
+
Dir['{**/}{.*,*}'].select { |path| File.file?(path) }
|
14
|
+
end
|
15
|
+
|
16
|
+
filter_files = lambda { |paths|
|
17
|
+
case paths
|
18
|
+
when Array
|
19
|
+
(files & paths)
|
20
|
+
when String
|
21
|
+
(files & Dir[paths])
|
22
|
+
end
|
23
|
+
}
|
24
|
+
|
25
|
+
version = {
|
26
|
+
:file => 'lib/<%= @namespace_dir %>/version.rb',
|
27
|
+
:constant => '<%= @namespace %>::VERSION'
|
28
|
+
}
|
29
|
+
|
30
|
+
defaults = {
|
31
|
+
'name' => File.basename(File.dirname(__FILE__)),
|
32
|
+
'files' => files,
|
33
|
+
'executables' => filter_files['bin/*'].map { |path| File.basename(path) },
|
34
|
+
'test_files' => filter_files['{test/{**/}*_test.rb,spec/{**/}*_spec.rb}'],
|
35
|
+
'extra_doc_files' => filter_files['*.{txt,rdoc,md,markdown,tt,textile}'],
|
36
|
+
}
|
37
|
+
|
38
|
+
metadata = defaults.merge(YAML.load_file('gemspec.yml'))
|
39
|
+
|
40
|
+
gemspec.name = metadata.fetch('name',defaults[:name])
|
41
|
+
gemspec.version = if metadata['version']
|
42
|
+
metadata['version']
|
43
|
+
elsif File.file?(version[:file])
|
44
|
+
require File.join('.',version[:file])
|
45
|
+
eval(version[:constant])
|
46
|
+
end
|
47
|
+
|
48
|
+
gemspec.summary = metadata.fetch('summary',metadata['description'])
|
49
|
+
gemspec.description = metadata.fetch('description',metadata['summary'])
|
50
|
+
|
51
|
+
case metadata['license']
|
52
|
+
when Array
|
53
|
+
gemspec.licenses = metadata['license']
|
54
|
+
when String
|
55
|
+
gemspec.license = metadata['license']
|
56
|
+
end
|
57
|
+
|
58
|
+
case metadata['authors']
|
59
|
+
when Array
|
60
|
+
gemspec.authors = metadata['authors']
|
61
|
+
when String
|
62
|
+
gemspec.author = metadata['authors']
|
63
|
+
end
|
64
|
+
|
65
|
+
gemspec.email = metadata['email']
|
66
|
+
gemspec.homepage = metadata['homepage']
|
67
|
+
|
68
|
+
case metadata['require_paths']
|
69
|
+
when Array
|
70
|
+
gemspec.require_paths = metadata['require_paths']
|
71
|
+
when String
|
72
|
+
gemspec.require_path = metadata['require_paths']
|
73
|
+
end
|
74
|
+
|
75
|
+
gemspec.files = filter_files[metadata['files']]
|
76
|
+
|
77
|
+
gemspec.executables = metadata['executables']
|
78
|
+
gemspec.extensions = metadata['extensions']
|
79
|
+
|
80
|
+
if Gem::VERSION < '1.7.'
|
81
|
+
gemspec.default_executable = gemspec.executables.first
|
82
|
+
end
|
83
|
+
|
84
|
+
gemspec.test_files = filter_files[metadata['test_files']]
|
85
|
+
|
86
|
+
unless gemspec.files.include?('.document')
|
87
|
+
gemspec.extra_rdoc_files = metadata['extra_doc_files']
|
88
|
+
end
|
89
|
+
|
90
|
+
gemspec.post_install_message = metadata['post_install_message']
|
91
|
+
gemspec.requirements = metadata['requirements']
|
92
|
+
|
93
|
+
if gemspec.respond_to?(:required_ruby_version=)
|
94
|
+
gemspec.required_ruby_version = metadata['required_ruby_version']
|
95
|
+
end
|
96
|
+
|
97
|
+
if gemspec.respond_to?(:required_rubygems_version=)
|
98
|
+
gemspec.required_rubygems_version = metadata['required_ruby_version']
|
99
|
+
end
|
100
|
+
|
101
|
+
parse_versions = lambda { |versions|
|
102
|
+
case versions
|
103
|
+
when Array
|
104
|
+
versions.map { |v| v.to_s }
|
105
|
+
when String
|
106
|
+
versions.split(/,\s*/)
|
107
|
+
end
|
108
|
+
}
|
109
|
+
|
110
|
+
if metadata['dependencies']
|
111
|
+
metadata['dependencies'].each do |name,versions|
|
112
|
+
gemspec.add_dependency(name,parse_versions[versions])
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
if metadata['runtime_dependencies']
|
117
|
+
metadata['runtime_dependencies'].each do |name,versions|
|
118
|
+
gemspec.add_runtime_dependency(name,parse_versions[versions])
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
if metadata['development_dependencies']
|
123
|
+
metadata['development_dependencies'].each do |name,versions|
|
124
|
+
gemspec.add_development_dependency(name,parse_versions[versions])
|
125
|
+
end
|
14
126
|
end
|
15
127
|
end
|
data/gemspec.yml
CHANGED
@@ -1,17 +1,15 @@
|
|
1
1
|
name: ore
|
2
|
-
version: 0.
|
2
|
+
version: 0.8.0
|
3
3
|
summary: Mine raw RubyGems from YAML
|
4
4
|
description:
|
5
|
-
Ore is a
|
6
|
-
|
7
|
-
|
8
|
-
in a single YAML file.
|
5
|
+
Ore is a flexible Ruby project generator. Unlike other Ruby project
|
6
|
+
generators, Ore provides many builtin templates and allows custom
|
7
|
+
templates to be installed from Git repositories.
|
9
8
|
|
10
9
|
license: MIT
|
11
10
|
authors: Postmodern
|
12
11
|
email: postmodern.mod3@gmail.com
|
13
12
|
homepage: http://github.com/ruby-ore/ore
|
14
|
-
has_yard: true
|
15
13
|
post_install_message: |
|
16
14
|
**************************************************************************
|
17
15
|
Generate a new Ruby library:
|
@@ -30,9 +28,10 @@ post_install_message: |
|
|
30
28
|
|
31
29
|
dependencies:
|
32
30
|
ore-core: ~> 0.1, >= 0.1.4
|
31
|
+
env: ~> 0.1.2
|
33
32
|
thor: ~> 0.14.3
|
34
33
|
|
35
34
|
development_dependencies:
|
36
35
|
ore-tasks: ~> 0.4
|
37
36
|
rspec: ~> 2.4
|
38
|
-
yard: ~> 0.
|
37
|
+
yard: ~> 0.7.0
|
data/lib/ore/config.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'pathname'
|
2
|
+
require 'env'
|
2
3
|
|
3
4
|
module Ore
|
4
5
|
module Config
|
@@ -6,7 +7,7 @@ module Ore
|
|
6
7
|
@@enabled = true
|
7
8
|
|
8
9
|
# The users home directory
|
9
|
-
@@home =
|
10
|
+
@@home = Env.home
|
10
11
|
|
11
12
|
# Ore config directory
|
12
13
|
@@path = File.join(@@home,'.ore')
|
data/lib/ore/generator.rb
CHANGED
@@ -7,6 +7,7 @@ require 'ore/config'
|
|
7
7
|
require 'thor/group'
|
8
8
|
require 'date'
|
9
9
|
require 'set'
|
10
|
+
require 'env'
|
10
11
|
|
11
12
|
module Ore
|
12
13
|
class Generator < Thor::Group
|
@@ -76,7 +77,7 @@ module Ore
|
|
76
77
|
:summary => 'TODO: Summary',
|
77
78
|
:description => 'TODO: Description',
|
78
79
|
:license => 'MIT',
|
79
|
-
:authors => [
|
80
|
+
:authors => [Env.user],
|
80
81
|
:ore_tasks => true,
|
81
82
|
:rdoc => true,
|
82
83
|
:rspec => true,
|
@@ -193,12 +194,12 @@ module Ore
|
|
193
194
|
# @since 0.7.1
|
194
195
|
#
|
195
196
|
def generate_dir(dest)
|
196
|
-
return if @generated_dirs.
|
197
|
+
return if @generated_dirs.has_key?(dest)
|
197
198
|
|
198
199
|
path = interpolate(dest)
|
199
200
|
empty_directory path
|
200
201
|
|
201
|
-
@generated_dirs
|
202
|
+
@generated_dirs[dest] = path
|
202
203
|
return path
|
203
204
|
end
|
204
205
|
|
@@ -223,7 +224,7 @@ module Ore
|
|
223
224
|
# @since 0.7.1
|
224
225
|
#
|
225
226
|
def generate_file(dest,file,options={})
|
226
|
-
return if @generated_files.
|
227
|
+
return if @generated_files.has_key?(dest)
|
227
228
|
|
228
229
|
path = interpolate(dest)
|
229
230
|
|
@@ -235,12 +236,7 @@ module Ore
|
|
235
236
|
copy_file file, path
|
236
237
|
end
|
237
238
|
|
238
|
-
|
239
|
-
umask = File.stat(File.join(destination_root,path)).mode
|
240
|
-
chmod path, (umask | 0111)
|
241
|
-
end
|
242
|
-
|
243
|
-
@generated_files << dest
|
239
|
+
@generated_files[dest] = path
|
244
240
|
return path
|
245
241
|
end
|
246
242
|
|
@@ -385,8 +381,8 @@ module Ore
|
|
385
381
|
end
|
386
382
|
end
|
387
383
|
|
388
|
-
@generated_dirs =
|
389
|
-
@generated_files =
|
384
|
+
@generated_dirs = {}
|
385
|
+
@generated_files = {}
|
390
386
|
end
|
391
387
|
|
392
388
|
#
|
@@ -417,6 +413,14 @@ module Ore
|
|
417
413
|
generate_file dest, file, :template => true
|
418
414
|
end
|
419
415
|
end
|
416
|
+
|
417
|
+
@generated_files.each_value do |path|
|
418
|
+
dir = path.split(File::SEPARATOR,2).first
|
419
|
+
|
420
|
+
if dir == 'bin'
|
421
|
+
chmod path, 0755
|
422
|
+
end
|
423
|
+
end
|
420
424
|
end
|
421
425
|
|
422
426
|
end
|
data/spec/generator_spec.rb
CHANGED
@@ -214,10 +214,6 @@ describe Generator do
|
|
214
214
|
@path.join('.yardopts').should be_file
|
215
215
|
end
|
216
216
|
|
217
|
-
it "should set 'has_yard' to 'true' in the gemspec.yml file" do
|
218
|
-
@gemspec['has_yard'].should == true
|
219
|
-
end
|
220
|
-
|
221
217
|
it "should add a '.document' file" do
|
222
218
|
@path.join('.document').should be_file
|
223
219
|
end
|
data/spec/helpers/generator.rb
CHANGED
@@ -32,9 +32,11 @@ module Helpers
|
|
32
32
|
unless @document
|
33
33
|
@document = []
|
34
34
|
|
35
|
-
@path.join('.document').
|
36
|
-
|
37
|
-
|
35
|
+
@path.join('.document').open do |file|
|
36
|
+
file.each_line do |line|
|
37
|
+
unless (line.empty? && line =~ /\s*\#/)
|
38
|
+
@document << line.strip
|
39
|
+
end
|
38
40
|
end
|
39
41
|
end
|
40
42
|
end
|
@@ -46,9 +48,11 @@ module Helpers
|
|
46
48
|
unless @gitignore
|
47
49
|
@gitignore = []
|
48
50
|
|
49
|
-
@path.join('.gitignore').
|
50
|
-
|
51
|
-
|
51
|
+
@path.join('.gitignore').open do |file|
|
52
|
+
file.each_line do |line|
|
53
|
+
unless (line.empty? && line =~ /\s*\#/)
|
54
|
+
@gitignore << line.strip
|
55
|
+
end
|
52
56
|
end
|
53
57
|
end
|
54
58
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: ore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.8.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Postmodern
|
@@ -10,8 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
14
|
-
default_executable: ore
|
13
|
+
date: 2011-06-18 00:00:00 Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
16
|
name: ore-core
|
@@ -19,59 +18,70 @@ dependencies:
|
|
19
18
|
requirement: &id001 !ruby/object:Gem::Requirement
|
20
19
|
none: false
|
21
20
|
requirements:
|
22
|
-
- - ~>
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version: "0.1"
|
25
21
|
- - ">="
|
26
22
|
- !ruby/object:Gem::Version
|
27
23
|
version: 0.1.4
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: "0.1"
|
28
27
|
type: :runtime
|
29
28
|
version_requirements: *id001
|
30
29
|
- !ruby/object:Gem::Dependency
|
31
|
-
name:
|
30
|
+
name: env
|
32
31
|
prerelease: false
|
33
32
|
requirement: &id002 !ruby/object:Gem::Requirement
|
34
33
|
none: false
|
35
34
|
requirements:
|
36
35
|
- - ~>
|
37
36
|
- !ruby/object:Gem::Version
|
38
|
-
version: 0.
|
37
|
+
version: 0.1.2
|
39
38
|
type: :runtime
|
40
39
|
version_requirements: *id002
|
41
40
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
41
|
+
name: thor
|
43
42
|
prerelease: false
|
44
43
|
requirement: &id003 !ruby/object:Gem::Requirement
|
45
44
|
none: false
|
46
45
|
requirements:
|
47
46
|
- - ~>
|
48
47
|
- !ruby/object:Gem::Version
|
49
|
-
version:
|
50
|
-
type: :
|
48
|
+
version: 0.14.3
|
49
|
+
type: :runtime
|
51
50
|
version_requirements: *id003
|
52
51
|
- !ruby/object:Gem::Dependency
|
53
|
-
name:
|
52
|
+
name: ore-tasks
|
54
53
|
prerelease: false
|
55
54
|
requirement: &id004 !ruby/object:Gem::Requirement
|
56
55
|
none: false
|
57
56
|
requirements:
|
58
57
|
- - ~>
|
59
58
|
- !ruby/object:Gem::Version
|
60
|
-
version: "
|
59
|
+
version: "0.4"
|
61
60
|
type: :development
|
62
61
|
version_requirements: *id004
|
63
62
|
- !ruby/object:Gem::Dependency
|
64
|
-
name:
|
63
|
+
name: rspec
|
65
64
|
prerelease: false
|
66
65
|
requirement: &id005 !ruby/object:Gem::Requirement
|
67
66
|
none: false
|
68
67
|
requirements:
|
69
68
|
- - ~>
|
70
69
|
- !ruby/object:Gem::Version
|
71
|
-
version:
|
70
|
+
version: "2.4"
|
72
71
|
type: :development
|
73
72
|
version_requirements: *id005
|
74
|
-
|
73
|
+
- !ruby/object:Gem::Dependency
|
74
|
+
name: yard
|
75
|
+
prerelease: false
|
76
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
77
|
+
none: false
|
78
|
+
requirements:
|
79
|
+
- - ~>
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 0.7.0
|
82
|
+
type: :development
|
83
|
+
version_requirements: *id006
|
84
|
+
description: Ore is a flexible Ruby project generator. Unlike other Ruby project generators, Ore provides many builtin templates and allows custom templates to be installed from Git repositories.
|
75
85
|
email:
|
76
86
|
- postmodern.mod3@gmail.com
|
77
87
|
executables:
|
@@ -89,6 +99,7 @@ files:
|
|
89
99
|
- .rspec
|
90
100
|
- .yardopts
|
91
101
|
- ChangeLog.md
|
102
|
+
- GemspecYML.md
|
92
103
|
- LICENSE.txt
|
93
104
|
- README.md
|
94
105
|
- Rakefile
|
@@ -144,7 +155,6 @@ files:
|
|
144
155
|
- data/ore/templates/yard/.yardopts.erb
|
145
156
|
- data/ore/templates/yard/_development_dependencies.erb
|
146
157
|
- data/ore/templates/yard/_gemfile_development.erb
|
147
|
-
- data/ore/templates/yard/_gemspec.erb
|
148
158
|
- data/ore/templates/yard/_tasks.erb
|
149
159
|
- data/ore/templates/yard/template.yml
|
150
160
|
- gemspec.yml
|
@@ -162,7 +172,6 @@ files:
|
|
162
172
|
- spec/generator_spec.rb
|
163
173
|
- spec/helpers/generator.rb
|
164
174
|
- spec/spec_helper.rb
|
165
|
-
has_rdoc: yard
|
166
175
|
homepage: http://github.com/ruby-ore/ore
|
167
176
|
licenses:
|
168
177
|
- MIT
|
@@ -201,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
210
|
requirements: []
|
202
211
|
|
203
212
|
rubyforge_project: ore
|
204
|
-
rubygems_version: 1.5
|
213
|
+
rubygems_version: 1.8.5
|
205
214
|
signing_key:
|
206
215
|
specification_version: 3
|
207
216
|
summary: Mine raw RubyGems from YAML
|
@@ -1 +0,0 @@
|
|
1
|
-
has_yard: true
|