ore-core 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. data/.document +4 -0
  2. data/.rspec +1 -0
  3. data/.yardopts +1 -0
  4. data/ChangeLog.md +17 -0
  5. data/GemspecYML.md +284 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +68 -0
  8. data/Rakefile +25 -0
  9. data/gemspec.yml +18 -0
  10. data/lib/ore.rb +3 -0
  11. data/lib/ore/checks.rb +88 -0
  12. data/lib/ore/defaults.rb +140 -0
  13. data/lib/ore/dependency.rb +65 -0
  14. data/lib/ore/document_file.rb +118 -0
  15. data/lib/ore/exceptions.rb +3 -0
  16. data/lib/ore/exceptions/exception.rb +4 -0
  17. data/lib/ore/exceptions/invalid_metadata.rb +6 -0
  18. data/lib/ore/exceptions/project_not_found.rb +6 -0
  19. data/lib/ore/naming.rb +113 -0
  20. data/lib/ore/paths.rb +146 -0
  21. data/lib/ore/project.rb +599 -0
  22. data/lib/ore/settings.rb +274 -0
  23. data/lib/ore/specification.rb +29 -0
  24. data/lib/ore/versions.rb +3 -0
  25. data/lib/ore/versions/exceptions.rb +1 -0
  26. data/lib/ore/versions/exceptions/invalid_version.rb +8 -0
  27. data/lib/ore/versions/version.rb +75 -0
  28. data/lib/ore/versions/version_constant.rb +126 -0
  29. data/lib/ore/versions/version_file.rb +66 -0
  30. data/lib/rubygems_plugin.rb +40 -0
  31. data/ore-core.gemspec +6 -0
  32. data/spec/dependency_spec.rb +36 -0
  33. data/spec/document_file_spec.rb +29 -0
  34. data/spec/helpers/files.rb +7 -0
  35. data/spec/helpers/files/.document +5 -0
  36. data/spec/helpers/files/VERSION +1 -0
  37. data/spec/helpers/files/VERSION.yml +5 -0
  38. data/spec/helpers/projects.rb +13 -0
  39. data/spec/helpers/projects/dm-is-plugin/Gemfile +3 -0
  40. data/spec/helpers/projects/dm-is-plugin/VERSION +1 -0
  41. data/spec/helpers/projects/dm-is-plugin/dm-is-plugin.gemspec +10 -0
  42. data/spec/helpers/projects/dm-is-plugin/gemspec.yml +9 -0
  43. data/spec/helpers/projects/dm-is-plugin/lib/dm-is-plugin.rb +4 -0
  44. data/spec/helpers/projects/dm-is-plugin/lib/dm-is-plugin/is/plugin.rb +6 -0
  45. data/spec/helpers/projects/explicit/gemspec.yml +19 -0
  46. data/spec/helpers/projects/explicit/lib/explicit/version.rb +15 -0
  47. data/spec/helpers/projects/ffi-binding/gemspec.yml +11 -0
  48. data/spec/helpers/projects/ffi-binding/lib/ffi/binding/version.rb +5 -0
  49. data/spec/helpers/projects/jewelery/VERSION +1 -0
  50. data/spec/helpers/projects/jewelery/bin/jewelery +3 -0
  51. data/spec/helpers/projects/jewelery/gemspec.yml +6 -0
  52. data/spec/helpers/projects/jewelery/jewelery.gemspec +10 -0
  53. data/spec/helpers/projects/jewelery/lib/jewelery.rb +4 -0
  54. data/spec/helpers/projects/jewelery/lib/jewelery/rubies.rb +4 -0
  55. data/spec/helpers/projects/minimal/gemspec.yml +4 -0
  56. data/spec/helpers/projects/minimal/lib/minimal.rb +2 -0
  57. data/spec/naming_spec.rb +56 -0
  58. data/spec/projects/dm_plugin_project_spec.rb +29 -0
  59. data/spec/projects/explicit_project_spec.rb +37 -0
  60. data/spec/projects/ffi_binding_project_spec.rb +25 -0
  61. data/spec/projects/jeweler_project_spec.rb +17 -0
  62. data/spec/projects/minimal_project_spec.rb +17 -0
  63. data/spec/projects/project_examples.rb +40 -0
  64. data/spec/spec_helper.rb +4 -0
  65. data/spec/versions/version_file_spec.rb +28 -0
  66. data/spec/versions/version_spec.rb +53 -0
  67. metadata +170 -0
@@ -0,0 +1,4 @@
1
+ -
2
+ ChangeLog.md
3
+ GemspecYML.md
4
+ LICENSE.txt
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --colour --format documentation
@@ -0,0 +1 @@
1
+ --markup markdown --title 'Ore (Core) Documentation' --protected
@@ -0,0 +1,17 @@
1
+ ### 0.1.0 / 2010-11-07
2
+
3
+ * Initial release:
4
+ * Added {Ore::Naming}.
5
+ * Added {Ore::DocumentFile}.
6
+ * Added {Ore::Versions}:
7
+ * Added {Ore::Versions::Version}.
8
+ * Added {Ore::Versions::VersionConstant}.
9
+ * Added {Ore::Versions::VersionFile}.
10
+ * Added {Ore::Project}:
11
+ * Added {Ore::Checks}.
12
+ * Added {Ore::Defaults}.
13
+ * Added {Ore::Settings}.
14
+ * Added {Ore::Specification}.
15
+ * Added {Ore::Project#post_install_message}.
16
+ * Added {Ore::Settings#set_post_install_message!}.
17
+
@@ -0,0 +1,284 @@
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
+ ## post_install_message
204
+
205
+ The post-installation message for a project can be listed like so:
206
+
207
+ post_install_message: |
208
+
209
+ Thank you for installing MyProject 0.1.0. To start MyProject, simply
210
+ run the following command:
211
+
212
+ $ my_project
213
+
214
+
215
+ ## requirements
216
+
217
+ The external requirements of the project can be listed like so:
218
+
219
+ requirements: libcairo >= 1.8
220
+
221
+ Multiple external requirements can also be listed:
222
+
223
+ requirements:
224
+ - libcairo >= 1.8.0
225
+ - libclutter >= 1.2.0
226
+
227
+ ## required_ruby_version
228
+
229
+ The version of Ruby required by the project can be listed like so:
230
+
231
+ required_ruby_version: >= 1.9.1
232
+
233
+ ## required_rubygems_version
234
+
235
+ The version of RubyGems required by the project can be listed like so:
236
+
237
+ required_rubygems_version: >= 1.3.7
238
+
239
+ If `required_rubygems_version` is not listed and the project uses Bundler,
240
+ Ore will default `required_rubygems_version` to `>= 1.3.6`.
241
+
242
+ ## dependencies
243
+
244
+ The dependencies of the project can be listed like so:
245
+
246
+ dependencies:
247
+ foo: ~> 0.1.0
248
+ bar: 1.2.3
249
+
250
+ More than one version can be specified for each dependency:
251
+
252
+ dependencies:
253
+ foo: ~> 0.1.0, >= 0.0.7
254
+ bar: 1.2.3, 1.3.1
255
+
256
+ ## runtime_dependencies
257
+
258
+ The purely runtime-dependencies for a project can be specified like so:
259
+
260
+ runtime_dependencies:
261
+ foo: ~> 0.1.0
262
+ bar: 1.2.3
263
+
264
+ More than one version can be specified for each dependency:
265
+
266
+ dependencies:
267
+ foo: ~> 0.1.0, >= 0.0.7
268
+ bar: 1.2.3, 1.3.1
269
+
270
+ ## development_dependencies:
271
+
272
+ The purely developmental-dependencies for a project can be specified
273
+ like so:
274
+
275
+ development_dependencies:
276
+ foo: ~> 0.1.0
277
+ bar: 1.2.3
278
+
279
+ More than one version can be specified for each dependency:
280
+
281
+ dependencies:
282
+ foo: ~> 0.1.0, >= 0.0.7
283
+ bar: 1.2.3, 1.3.1
284
+
@@ -0,0 +1,21 @@
1
+
2
+ Copyright (c) 2010 Hal Brodigan
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ 'Software'), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,68 @@
1
+ # Ore
2
+
3
+ * [Source](http://github.com/ruby-ore/ore-core)
4
+ * [Issues](http://github.com/ruby-ore/ore-core/issues)
5
+ * [Documentation](http://rubydoc.info/gems/ore-core/file/README.md)
6
+ * IRC: irc.freenode.net #ruby-ore
7
+ * Postmodern (postmodern.mod3 at gmail.com)
8
+
9
+ ## Description
10
+
11
+ Ore is a simple RubyGem building solution. Ore handles the creation of
12
+ `Gem::Specification` objects as well as building `.gem` files. Ore allows
13
+ the developer to keep all of the project information in a single YAML file.
14
+
15
+ ## Features
16
+
17
+ * Stores project information in **one YAML file** (`gemspec.yml`).
18
+ * **Does not** have dependencies.
19
+ * **Does not** impose a development workflow onto the developer. One could
20
+ even use Ore with `Jeweler::Tasks`.
21
+ * **Can** load the project version from:
22
+ * `VERSION` or `VERSION.yml` files.
23
+ * `VERSION` constants or `Version` modules defined in a `version.rb` file.
24
+ * **Can** be used in traditional `.gemspec` files:
25
+
26
+ begin
27
+ Ore::Specification.new do |gemspec|
28
+ # custom logic here
29
+ end
30
+ rescue NameError
31
+ STDERR.puts "The 'my_project.gemspec' file requires Ore."
32
+ STDERR.puts "Run `gem install ore-ore` to install Ore."
33
+ end
34
+
35
+ ## Install
36
+
37
+ $ gem install ore-core
38
+
39
+ ## Example gemspec.yml files
40
+
41
+ The `gemspec.yml` file used to build Ore:
42
+
43
+ name: ore-core
44
+ version: 0.1.0
45
+ summary: Mine raw RubyGems from YAML.
46
+ description:
47
+ Ore is a simple RubyGem building solution. Ore handles the
48
+ creation of Gem::Specification objects as well as building '.gem'
49
+ files. Ore allows the developer to keep all of the project information
50
+ in a single YAML file.
51
+
52
+ license: MIT
53
+ authors: Postmodern
54
+ email: postmodern.mod3@gmail.com
55
+ homepage: http://github.com/ruby-ore/ore-core
56
+ has_yard: true
57
+
58
+ development_dependencies:
59
+ yard: ~> 0.6.1
60
+ rspec: ~> 2.0.0
61
+
62
+ For a complete refrence to the `gemspec.yml` file, please see
63
+ {file:GemspecYML.md}.
64
+
65
+ ## License
66
+
67
+ See {file:LICENSE.txt} for license information.
68
+
@@ -0,0 +1,25 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ gem 'rspec', '~> 2.0.0'
6
+ require 'rspec/core/rake_task'
7
+
8
+ RSpec::Core::RakeTask.new
9
+ rescue LoadError
10
+ task :spec do
11
+ abort "Please run `gem install rspec` to install RSpec."
12
+ end
13
+ end
14
+ task :default => :spec
15
+
16
+ begin
17
+ gem 'yard', '~> 0.6.0'
18
+ require 'yard'
19
+
20
+ YARD::Rake::YardocTask.new
21
+ rescue LoadError
22
+ task :yard do
23
+ abort "Please run `gem install yard` to install YARD."
24
+ end
25
+ end
@@ -0,0 +1,18 @@
1
+ name: ore-core
2
+ version: 0.1.0
3
+ summary: Mine raw RubyGems from YAML
4
+ description:
5
+ Ore is a simple RubyGem building solution. Ore handles the
6
+ creation of Gem::Specification objects as well as building '.gem'
7
+ files. Ore allows the developer to keep all of the project information
8
+ in a single YAML file.
9
+
10
+ license: MIT
11
+ authors: Postmodern
12
+ email: postmodern.mod3@gmail.com
13
+ homepage: http://github.com/ruby-ore/ore-core
14
+ has_yard: true
15
+
16
+ development_dependencies:
17
+ yard: ~> 0.6.1
18
+ rspec: ~> 2.0.0