ore 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. data/.document +0 -1
  2. data/ChangeLog.md +28 -18
  3. data/README.md +8 -6
  4. data/Rakefile +10 -0
  5. data/data/ore/templates/base/[name].gemspec.erb +1 -1
  6. data/data/ore/templates/base/_gemfile.erb +1 -1
  7. data/data/ore/templates/base/gemspec.yml.erb +2 -2
  8. data/data/ore/templates/base/template.yml +1 -1
  9. data/data/ore/templates/ore_tasks/template.yml +1 -1
  10. data/gemspec.yml +4 -2
  11. data/lib/ore/generator.rb +1 -1
  12. data/lib/ore/template/helpers.rb +24 -0
  13. data/ore.gemspec +9 -5
  14. data/spec/generator_spec.rb +9 -1
  15. data/spec/spec_helper.rb +2 -0
  16. metadata +43 -80
  17. data/GemspecYML.md +0 -272
  18. data/lib/ore.rb +0 -3
  19. data/lib/ore/checks.rb +0 -88
  20. data/lib/ore/defaults.rb +0 -141
  21. data/lib/ore/dependency.rb +0 -65
  22. data/lib/ore/document_file.rb +0 -118
  23. data/lib/ore/exceptions.rb +0 -3
  24. data/lib/ore/exceptions/exception.rb +0 -4
  25. data/lib/ore/exceptions/invalid_metadata.rb +0 -6
  26. data/lib/ore/exceptions/project_not_found.rb +0 -6
  27. data/lib/ore/naming.rb +0 -113
  28. data/lib/ore/paths.rb +0 -146
  29. data/lib/ore/project.rb +0 -591
  30. data/lib/ore/settings.rb +0 -262
  31. data/lib/ore/specification.rb +0 -29
  32. data/lib/ore/versions.rb +0 -3
  33. data/lib/ore/versions/exceptions.rb +0 -1
  34. data/lib/ore/versions/exceptions/invalid_version.rb +0 -8
  35. data/lib/ore/versions/version.rb +0 -75
  36. data/lib/ore/versions/version_constant.rb +0 -126
  37. data/lib/ore/versions/version_file.rb +0 -66
  38. data/lib/rubygems_plugin.rb +0 -40
  39. data/spec/dependency_spec.rb +0 -36
  40. data/spec/document_file_spec.rb +0 -29
  41. data/spec/helpers/files.rb +0 -7
  42. data/spec/helpers/files/.document +0 -5
  43. data/spec/helpers/files/VERSION +0 -1
  44. data/spec/helpers/files/VERSION.yml +0 -5
  45. data/spec/helpers/projects.rb +0 -13
  46. data/spec/helpers/projects/dm-is-plugin/Gemfile +0 -3
  47. data/spec/helpers/projects/dm-is-plugin/VERSION +0 -1
  48. data/spec/helpers/projects/dm-is-plugin/dm-is-plugin.gemspec +0 -10
  49. data/spec/helpers/projects/dm-is-plugin/gemspec.yml +0 -7
  50. data/spec/helpers/projects/dm-is-plugin/lib/dm-is-plugin.rb +0 -4
  51. data/spec/helpers/projects/dm-is-plugin/lib/dm-is-plugin/is/plugin.rb +0 -6
  52. data/spec/helpers/projects/explicit/gemspec.yml +0 -10
  53. data/spec/helpers/projects/explicit/lib/explicit/version.rb +0 -15
  54. data/spec/helpers/projects/ffi-binding/gemspec.yml +0 -9
  55. data/spec/helpers/projects/ffi-binding/lib/ffi/binding/version.rb +0 -5
  56. data/spec/helpers/projects/jewelery/VERSION +0 -1
  57. data/spec/helpers/projects/jewelery/bin/jewelery +0 -3
  58. data/spec/helpers/projects/jewelery/gemspec.yml +0 -4
  59. data/spec/helpers/projects/jewelery/jewelery.gemspec +0 -10
  60. data/spec/helpers/projects/jewelery/lib/jewelery.rb +0 -4
  61. data/spec/helpers/projects/jewelery/lib/jewelery/rubies.rb +0 -4
  62. data/spec/helpers/projects/minimal/gemspec.yml +0 -4
  63. data/spec/helpers/projects/minimal/lib/minimal.rb +0 -2
  64. data/spec/naming_spec.rb +0 -56
  65. data/spec/projects/dm_plugin_project_spec.rb +0 -29
  66. data/spec/projects/explicit_project_spec.rb +0 -33
  67. data/spec/projects/ffi_binding_project_spec.rb +0 -25
  68. data/spec/projects/jeweler_project_spec.rb +0 -17
  69. data/spec/projects/minimal_project_spec.rb +0 -17
  70. data/spec/projects/project_examples.rb +0 -34
  71. data/spec/versions/version_file_spec.rb +0 -28
  72. data/spec/versions/version_spec.rb +0 -53
data/GemspecYML.md DELETED
@@ -1,272 +0,0 @@
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
- The `version` may also be listed as a Hash:
24
-
25
- version:
26
- major: 1
27
- minor: 2
28
- patch: 3
29
- build: pre
30
-
31
- If the version is not listed, Ore will first search for a `VERSION` or
32
- `VERSION.yml` file in the root of the project. If Ore cannot find any
33
- version files, it will then search within the `lib/` directory for a
34
- `version.rb`. Ore can load both Ruby `VERSION` constants or `Version`
35
- modules that contain `MAJOR`, `MINOR`, `PATCH` and `BUILD` constants.
36
-
37
- ## summary
38
-
39
- The summary of the project can be listed like so:
40
-
41
- summary: My awesome project
42
-
43
- ## description
44
-
45
- The description of the project can be listed in a variety of ways:
46
-
47
- * Single line:
48
-
49
- description: My project, which provides various functionality.
50
-
51
- * Text block:
52
-
53
- description:
54
- My project, which provides the developer with various attributes
55
- and behaviors.
56
-
57
- If the description is not listed, it will default to the `summary`.
58
-
59
- ## license
60
-
61
- The license of the project can be listed like so:
62
-
63
- license: MIT
64
-
65
- Multiple licenses can also be listed:
66
-
67
- license:
68
- - LGPL-2.1
69
- - GPL-2
70
-
71
- ## authors
72
-
73
- The authors of the project can be listed like so:
74
-
75
- author: Alice
76
-
77
- If a project has more than one author, each author can be listed:
78
-
79
- author:
80
- - Alice
81
- - Eve
82
- - Bob
83
-
84
- ## email
85
-
86
- The primary email contact for the project can be listed like so:
87
-
88
- email: alice@example.com
89
-
90
- ## date
91
-
92
- The publish date of the current version can be listed like so:
93
-
94
- date: 2010-10-23
95
-
96
- Ore will use [Date.parse](http://rubydoc.info/docs/ruby-stdlib/1.9.2/Date.parse)
97
- to parse the `date` value.
98
-
99
- If the `date` is not listed, Ore will default it to the current date.
100
-
101
- ## require_paths
102
-
103
- The require_paths of a project can be listed like so:
104
-
105
- require_paths: lib
106
-
107
- If there are more than one require_path that needs listing:
108
-
109
- require_paths:
110
- - ext
111
- - lib
112
-
113
- ## executables
114
-
115
- The names of the executables provided by the project can be listed like so:
116
-
117
- executables: bin/*
118
-
119
- One can also list the executables individually:
120
-
121
- executables:
122
- - util1
123
- - util2
124
-
125
- If the `executables` are not listed, Ore will use the names of any
126
- executable file within the `bin/` directory.
127
-
128
- ## default_executable
129
-
130
- The primary executable of the project can be listed like so:
131
-
132
- default_executable: util1
133
-
134
- If `default_executable` is not listed, Ore will use the first element
135
- in `executables`.
136
-
137
- ## has_rdoc
138
-
139
- One can specify the project contains [RDoc](http://rdoc.rubyforge.org/)
140
- documentation:
141
-
142
- has_rdoc: true
143
-
144
- ## has_yard
145
-
146
- If the project contains [YARD](http://yardoc.org/) and not
147
- [RDoc](http://rdoc.rubyforge.org/) documentation, one can specify this:
148
-
149
- has_yard: true
150
-
151
- If neither `has_yard` or `has_rdoc` are listed, Ore will set `has_yard`
152
- if the `.yardopts` file exists in the root directory of the project.
153
- Otherwise, Ore will default `has_rdoc` to true.
154
-
155
- ## extra_doc_files
156
-
157
- The extra files that should also be scanned for documentation can be listed
158
- like so:
159
-
160
- extra_doc_files:
161
- - ChangeLog.md
162
- - LICENSE.txt
163
-
164
- If `extra_doc_files` is not listed, Ore will use the extra-files listed in
165
- the `.document` file.
166
-
167
- ## files
168
-
169
- The files of the project can be listed like so:
170
-
171
- file: lib/**/*.rb
172
-
173
- More than one file pattern can be specification:
174
-
175
- file:
176
- - lib/**/*.rb
177
- - spec/**/*
178
- - data/**/*
179
-
180
- If `files` is not listed, Ore will check if the project is using
181
- [Git](http://www.git-scm.org/), can will find all tracked files using:
182
-
183
- git ls-files -z
184
-
185
- If the project is not using Git, Ore will default `files` to every file in
186
- the project.
187
-
188
- ## test_files
189
-
190
- The files used to test the project can be listed like so:
191
-
192
- test_files: spec/**/*_spec.rb
193
-
194
- More than one test-file pattern can be supplied:
195
-
196
- test_files:
197
- - spec/**/*_spec.rb
198
- - features/**/*
199
-
200
- If `test_files` is not listed, Ore will default `files` to
201
- `test/{**/}test_*.rb` and `spec/{**/}*_spec.rb`.
202
-
203
- ## requirements
204
-
205
- The external requirements of the project can be listed like so:
206
-
207
- requirements: libcairo >= 1.8
208
-
209
- Multiple external requirements can also be listed:
210
-
211
- requirements:
212
- - libcairo >= 1.8.0
213
- - libclutter >= 1.2.0
214
-
215
- ## required_ruby_version
216
-
217
- The version of Ruby required by the project can be listed like so:
218
-
219
- required_ruby_version: >= 1.9.1
220
-
221
- ## required_rubygems_version
222
-
223
- The version of RubyGems required by the project can be listed like so:
224
-
225
- required_rubygems_version: >= 1.3.7
226
-
227
- If `required_rubygems_version` is not listed and the project uses Bundler,
228
- Ore will default `required_rubygems_version` to `>= 1.3.6`.
229
-
230
- ## dependencies
231
-
232
- The dependencies of the project can be listed like so:
233
-
234
- 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
- dependencies:
241
- foo: ~> 0.1.0, >= 0.0.7
242
- bar: 1.2.3, 1.3.1
243
-
244
- ## runtime_dependencies
245
-
246
- The purely runtime-dependencies for a project can be specified like so:
247
-
248
- runtime_dependencies:
249
- foo: ~> 0.1.0
250
- bar: 1.2.3
251
-
252
- More than one version can be specified for each dependency:
253
-
254
- dependencies:
255
- foo: ~> 0.1.0, >= 0.0.7
256
- bar: 1.2.3, 1.3.1
257
-
258
- ## development_dependencies:
259
-
260
- The purely developmental-dependencies for a project can be specified
261
- like so:
262
-
263
- development_dependencies:
264
- foo: ~> 0.1.0
265
- bar: 1.2.3
266
-
267
- More than one version can be specified for each dependency:
268
-
269
- dependencies:
270
- foo: ~> 0.1.0, >= 0.0.7
271
- bar: 1.2.3, 1.3.1
272
-
data/lib/ore.rb DELETED
@@ -1,3 +0,0 @@
1
- require 'ore/config'
2
- require 'ore/project'
3
- require 'ore/specification'
data/lib/ore/checks.rb DELETED
@@ -1,88 +0,0 @@
1
- module Ore
2
- #
3
- # A mixin for {Project} which provides methods for checking files.
4
- #
5
- module Checks
6
- protected
7
-
8
- #
9
- # Checks if the path is readable.
10
- #
11
- # @yield [path]
12
- # The block will be passed the path, if it is readable.
13
- # Otherwise a warning will be printed.
14
- #
15
- # @yieldparam [String] path
16
- # A readable path.
17
- #
18
- def check_readable(path)
19
- if File.readable?(path)
20
- yield path
21
- else
22
- warn "#{path} is not readable!"
23
- end
24
- end
25
-
26
- #
27
- # Checks if the path is a readable directory.
28
- #
29
- # @yield [path]
30
- # The block will be passed the path, if it is a readable directory.
31
- # Otherwise a warning will be printed.
32
- #
33
- # @yieldparam [String] path
34
- # The directory path.
35
- #
36
- def check_directory(path)
37
- check_readable(path) do |dir|
38
- if File.directory?(dir)
39
- yield dir
40
- else
41
- warn "#{dir} is not a directory!"
42
- end
43
- end
44
- end
45
-
46
- #
47
- # Checks if the path is a readable file.
48
- #
49
- # @yield [path]
50
- # The block will be passed the path, if it is a readable file.
51
- # Otherwise a warning will be printed.
52
- #
53
- # @yieldparam [String] path
54
- # A file path.
55
- #
56
- def check_file(path)
57
- if @project_files.include?(path)
58
- check_readable(path) do |file|
59
- if File.file?(file)
60
- yield file
61
- else
62
- warn "#{file} is not a file!"
63
- end
64
- end
65
- end
66
- end
67
-
68
- #
69
- # Checks if the path is an executable file.
70
- #
71
- # @yield [path]
72
- # The block will be passed the path, if it is an executable file.
73
- # Otherwise a warning will be printed.
74
- #
75
- # @yieldparam [String] path
76
- # An path to an executable file.
77
- #
78
- def check_executable(path)
79
- check_file(path) do |file|
80
- if File.executable?(file)
81
- yield file
82
- else
83
- warn "#{file} is not executable!"
84
- end
85
- end
86
- end
87
- end
88
- end
data/lib/ore/defaults.rb DELETED
@@ -1,141 +0,0 @@
1
- require 'ore/naming'
2
- require 'ore/versions'
3
-
4
- require 'date'
5
-
6
- module Ore
7
- #
8
- # A mixin for {Project} which provides methods for assigning default
9
- # values to project attributes.
10
- #
11
- module Defaults
12
- include Naming
13
-
14
- # The default require-paths
15
- @@require_paths = [@@lib_dir, @@ext_dir]
16
-
17
- # The glob to find default executables
18
- @@executables = "#{@@bin_dir}/*"
19
-
20
- # The globs to find all testing-files
21
- @@test_files = [
22
- "#{@@test_dir}/{**/}*_test.rb",
23
- "#{@@spec_dir}/{**/}*_spec.rb"
24
- ]
25
-
26
- # The files to always exclude
27
- @@exclude_files = %w[
28
- .gitignore
29
- ]
30
-
31
- protected
32
-
33
- #
34
- # Sets the project name using the directory name of the project.
35
- #
36
- def default_name!
37
- @name = @root.basename.to_s
38
- end
39
-
40
- #
41
- # Finds and sets the version of the project.
42
- #
43
- def default_version!
44
- @version = (
45
- Versions::VersionFile.find(self) ||
46
- Versions::VersionConstant.find(self)
47
- )
48
-
49
- unless @version
50
- raise(InvalidMetadata,"no version file or constant in #{@root}")
51
- end
52
- end
53
-
54
- #
55
- # Sets the release date of the project.
56
- #
57
- def default_date!
58
- @date = Date.today
59
- end
60
-
61
- #
62
- # Sets the require-paths of the project.
63
- #
64
- def default_require_paths!
65
- @@require_paths.each do |name|
66
- @require_paths << name if @root.join(name).directory?
67
- end
68
- end
69
-
70
- #
71
- # Sets the executables of the project.
72
- #
73
- def default_executables!
74
- glob(@@executables) do |path|
75
- check_executable(path) { |exe| @executables << File.basename(exe) }
76
- end
77
- end
78
-
79
- #
80
- # sets the default executable of the project.
81
- #
82
- def default_executable!
83
- @default_executable = if @executables.include?(@name)
84
- @name
85
- else
86
- @executables.first
87
- end
88
- end
89
-
90
- #
91
- # Sets the default documentation of the project.
92
- #
93
- def default_documentation!
94
- if file?('.yardopts')
95
- @documentation = :yard
96
- else
97
- @documentation = :rdoc
98
- end
99
- end
100
-
101
- #
102
- # Sets the extra documentation files of the project.
103
- #
104
- def default_extra_doc_files!
105
- glob('README.*') { |path| add_extra_doc_file(path) }
106
-
107
- if @document
108
- @document.each_extra_file { |path| add_extra_doc_file(path) }
109
- end
110
- end
111
-
112
- #
113
- # Sets the files of the project.
114
- #
115
- def default_files!
116
- @project_files.each do |file|
117
- @files << file unless @@exclude_files.include?(file)
118
- end
119
- end
120
-
121
- #
122
- # Sets the test-files of the project.
123
- #
124
- def default_test_files!
125
- @@test_files.each do |pattern|
126
- glob(pattern) { |path| add_test_file(path) }
127
- end
128
- end
129
-
130
- #
131
- # Defaults the required version of RubyGems to `>= 1.3.6`, if the
132
- # project uses Bundler.
133
- #
134
- def default_required_rubygems_version!
135
- if bundler?
136
- @required_rubygems_version = '>= 1.3.6'
137
- end
138
- end
139
-
140
- end
141
- end