ore 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. data/.document +4 -0
  2. data/.rspec +1 -0
  3. data/.yardopts +1 -0
  4. data/ChangeLog.md +31 -0
  5. data/GemspecYML.md +252 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +104 -0
  8. data/Rakefile +9 -0
  9. data/bin/mine +12 -0
  10. data/bin/ore +12 -0
  11. data/data/ore/templates/base/.document +3 -0
  12. data/data/ore/templates/base/.gitignore.erb +3 -0
  13. data/data/ore/templates/base/:name:.gemspec.erb +10 -0
  14. data/data/ore/templates/base/ChangeLog.md.erb +4 -0
  15. data/data/ore/templates/base/ChangeLog.rdoc.erb +4 -0
  16. data/data/ore/templates/base/ChangeLog.tt.erb +4 -0
  17. data/data/ore/templates/base/LICENSE.txt.erb +20 -0
  18. data/data/ore/templates/base/README.md.erb +42 -0
  19. data/data/ore/templates/base/README.rdoc.erb +38 -0
  20. data/data/ore/templates/base/README.tt.erb +44 -0
  21. data/data/ore/templates/base/Rakefile.erb +23 -0
  22. data/data/ore/templates/base/gemspec.yml.erb +23 -0
  23. data/data/ore/templates/base/lib/:namespace_dir:.rb.erb +1 -0
  24. data/data/ore/templates/base/lib/:namespace_dir:/version.rb.erb +8 -0
  25. data/data/ore/templates/bundler/Gemfile.erb +20 -0
  26. data/data/ore/templates/bundler/_dependencies.erb +1 -0
  27. data/data/ore/templates/jeweler_tasks/_dependencies.erb +3 -0
  28. data/data/ore/templates/jeweler_tasks/_tasks.erb +17 -0
  29. data/data/ore/templates/ore_tasks/_dependencies.erb +1 -0
  30. data/data/ore/templates/ore_tasks/_tasks.erb +12 -0
  31. data/data/ore/templates/rdoc/_tasks.erb +6 -0
  32. data/data/ore/templates/rspec/.rspec +1 -0
  33. data/data/ore/templates/rspec/_dependencies.erb +3 -0
  34. data/data/ore/templates/rspec/_tasks.erb +14 -0
  35. data/data/ore/templates/rspec/spec/:namespace_dir:_spec.rb.erb +8 -0
  36. data/data/ore/templates/rspec/spec/spec_helper.rb.erb +7 -0
  37. data/data/ore/templates/test_unit/test/helper.rb.erb +24 -0
  38. data/data/ore/templates/test_unit/test/test_:name:.rb.erb +5 -0
  39. data/data/ore/templates/yard/.yardopts.erb +1 -0
  40. data/data/ore/templates/yard/_dependencies.erb +1 -0
  41. data/data/ore/templates/yard/_gem.erb +1 -0
  42. data/data/ore/templates/yard/_tasks.erb +13 -0
  43. data/gemspec.yml +21 -0
  44. data/lib/ore.rb +3 -0
  45. data/lib/ore/checks.rb +85 -0
  46. data/lib/ore/cli.rb +120 -0
  47. data/lib/ore/config.rb +52 -0
  48. data/lib/ore/defaults.rb +137 -0
  49. data/lib/ore/dependency.rb +62 -0
  50. data/lib/ore/document_file.rb +118 -0
  51. data/lib/ore/exceptions.rb +3 -0
  52. data/lib/ore/exceptions/exception.rb +4 -0
  53. data/lib/ore/exceptions/invalid_metadata.rb +6 -0
  54. data/lib/ore/exceptions/project_not_found.rb +6 -0
  55. data/lib/ore/generator.rb +247 -0
  56. data/lib/ore/naming.rb +95 -0
  57. data/lib/ore/paths.rb +143 -0
  58. data/lib/ore/project.rb +568 -0
  59. data/lib/ore/settings.rb +236 -0
  60. data/lib/ore/specification.rb +29 -0
  61. data/lib/ore/template.rb +3 -0
  62. data/lib/ore/template/directory.rb +179 -0
  63. data/lib/ore/template/helpers.rb +144 -0
  64. data/lib/ore/template/interpolations.rb +31 -0
  65. data/lib/ore/versions.rb +3 -0
  66. data/lib/ore/versions/exceptions.rb +1 -0
  67. data/lib/ore/versions/exceptions/invalid_version.rb +8 -0
  68. data/lib/ore/versions/version.rb +75 -0
  69. data/lib/ore/versions/version_constant.rb +126 -0
  70. data/lib/ore/versions/version_file.rb +66 -0
  71. data/lib/rubygems_plugin.rb +40 -0
  72. data/ore.gemspec +6 -0
  73. data/spec/dependency_spec.rb +36 -0
  74. data/spec/document_file_spec.rb +29 -0
  75. data/spec/helpers/files.rb +7 -0
  76. data/spec/helpers/files/.document +5 -0
  77. data/spec/helpers/files/VERSION +1 -0
  78. data/spec/helpers/files/VERSION.yml +5 -0
  79. data/spec/helpers/projects.rb +13 -0
  80. data/spec/helpers/projects/dm-plugin/Gemfile +3 -0
  81. data/spec/helpers/projects/dm-plugin/VERSION +1 -0
  82. data/spec/helpers/projects/dm-plugin/dm-plugin.gemspec +10 -0
  83. data/spec/helpers/projects/dm-plugin/gemspec.yml +7 -0
  84. data/spec/helpers/projects/dm-plugin/lib/dm-plugin.rb +1 -0
  85. data/spec/helpers/projects/explicit/gemspec.yml +10 -0
  86. data/spec/helpers/projects/explicit/lib/explicit/version.rb +15 -0
  87. data/spec/helpers/projects/ffi-binding/gemspec.yml +7 -0
  88. data/spec/helpers/projects/ffi-binding/lib/ffi/binding/version.rb +5 -0
  89. data/spec/helpers/projects/jewelery/VERSION +1 -0
  90. data/spec/helpers/projects/jewelery/bin/jewelery +3 -0
  91. data/spec/helpers/projects/jewelery/gemspec.yml +4 -0
  92. data/spec/helpers/projects/jewelery/jewelery.gemspec +10 -0
  93. data/spec/helpers/projects/jewelery/lib/jewelery.rb +4 -0
  94. data/spec/helpers/projects/jewelery/lib/jewelery/rubies.rb +4 -0
  95. data/spec/helpers/projects/minimal/gemspec.yml +4 -0
  96. data/spec/helpers/projects/minimal/lib/minimal.rb +2 -0
  97. data/spec/naming_spec.rb +48 -0
  98. data/spec/projects/dm_plugin_project_spec.rb +29 -0
  99. data/spec/projects/explicit_project_spec.rb +33 -0
  100. data/spec/projects/ffi_binding_project_spec.rb +21 -0
  101. data/spec/projects/jeweler_project_spec.rb +17 -0
  102. data/spec/projects/minimal_project_spec.rb +17 -0
  103. data/spec/projects/project_examples.rb +34 -0
  104. data/spec/spec_helper.rb +4 -0
  105. data/spec/versions/version_file_spec.rb +28 -0
  106. data/spec/versions/version_spec.rb +53 -0
  107. metadata +226 -0
data/.document ADDED
@@ -0,0 +1,4 @@
1
+ -
2
+ ChangeLog.md
3
+ GemspecYML.md
4
+ LICENSE.txt
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --colour --format documentation
data/.yardopts ADDED
@@ -0,0 +1 @@
1
+ --markup markdown --title 'Ore Documentation' --protected
data/ChangeLog.md ADDED
@@ -0,0 +1,31 @@
1
+ ### 0.1.2 / 2010-10-25
2
+
3
+ * Renamed `--jeweler` to `--jeweler-tasks` in {Ore::Generator}.
4
+ * Renamed `--ore` to `--ore-tasks` in {Ore::Generator}.
5
+ * Fixed the `remove` task in {Ore::CLI}.
6
+
7
+ ### 0.1.1 / 2010-10-25
8
+
9
+ * Show stopper bug fixed.
10
+
11
+ ### 0.1.0 / 2010-10-25
12
+
13
+ * Initial release:
14
+ * Added {Ore::Config}.
15
+ * Added {Ore::Naming}.
16
+ * Added {Ore::DocumentFile}.
17
+ * Added {Ore::Versions}:
18
+ * Added {Ore::Versions::Version}.
19
+ * Added {Ore::Versions::VersionConstant}.
20
+ * Added {Ore::Versions::VersionFile}.
21
+ * Added {Ore::Project}:
22
+ * Added {Ore::Checks}.
23
+ * Added {Ore::Defaults}.
24
+ * Added {Ore::Settings}.
25
+ * Added {Ore::Specification}.
26
+ * Added {Ore::Template}:
27
+ * Added {Ore::Template::Directory}.
28
+ * Added {Ore::Template::Interpolations}.
29
+ * Added {Ore::Template::Helpers}.
30
+ * Added {Ore::Generator}.
31
+
data/GemspecYML.md ADDED
@@ -0,0 +1,252 @@
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: 0.1.0
22
+
23
+ If the version is not listed, Ore will first search for a `VERSION` or
24
+ `VERSION.yml` file in the root of the project. If Ore cannot find any
25
+ version files, it will then search within the `lib/` directory for a
26
+ `version.rb`. Ore can load both Ruby `VERSION` constants or `Version`
27
+ modules that contain `MAJOR`, `MINOR`, `PATCH` and `BUILD` constants.
28
+
29
+ ## summary
30
+
31
+ The summary of the project can be listed like so:
32
+
33
+ summary: My awesome project
34
+
35
+ ## description
36
+
37
+ The description of the project can be listed in a variety of ways:
38
+
39
+ * Single line:
40
+
41
+ description: My project, which provides various functionality.
42
+
43
+ * Text block:
44
+
45
+ description:
46
+ My project, which provides the developer with various attributes
47
+ and behaviors.
48
+
49
+ If the description is not listed, it will default to the `summary`.
50
+
51
+ ## license
52
+
53
+ The license of the project can be listed like so:
54
+
55
+ license: MIT
56
+
57
+ Multiple licenses can also be listed:
58
+
59
+ license:
60
+ - LGPL-2.1
61
+ - GPL-2
62
+
63
+ ## authors
64
+
65
+ The authors of the project can be listed like so:
66
+
67
+ author: Alice
68
+
69
+ If a project has more than one author, each author can be listed:
70
+
71
+ author:
72
+ - Alice
73
+ - Eve
74
+ - Bob
75
+
76
+ ## email
77
+
78
+ The primary email contact for the project can be listed like so:
79
+
80
+ email: alice@example.com
81
+
82
+ ## date
83
+
84
+ The publish date of the current version can be listed like so:
85
+
86
+ date: 2010-10-23
87
+
88
+ Ore will use [Date.parse](http://rubydoc.info/docs/ruby-stdlib/1.9.2/Date.parse)
89
+ to parse the `date` value.
90
+
91
+ If the `date` is not listed, Ore will default it to the current date.
92
+
93
+ ## require_paths
94
+
95
+ The require_paths of a project can be listed like so:
96
+
97
+ require_paths: lib
98
+
99
+ If there are more than one require_path that needs listing:
100
+
101
+ require_paths:
102
+ - ext
103
+ - lib
104
+
105
+ ## executables
106
+
107
+ The names of the executables provided by the project can be listed like so:
108
+
109
+ executables: bin/*
110
+
111
+ One can also list the executables individually:
112
+
113
+ executables:
114
+ - util1
115
+ - util2
116
+
117
+ If the `executables` are not listed, Ore will use the names of any
118
+ executable file within the `bin/` directory.
119
+
120
+ ## default_executable
121
+
122
+ The primary executable of the project can be listed like so:
123
+
124
+ default_executable: util1
125
+
126
+ If `default_executable` is not listed, Ore will use the first element
127
+ in `executables`.
128
+
129
+ ## has_rdoc
130
+
131
+ One can specify the project contains [RDoc](http://rdoc.rubyforge.org/)
132
+ documentation:
133
+
134
+ has_rdoc: true
135
+
136
+ ## has_yard
137
+
138
+ If the project contains [YARD](http://yardoc.org/) and not
139
+ [RDoc](http://rdoc.rubyforge.org/) documentation, one can specify this:
140
+
141
+ has_yard: true
142
+
143
+ If neither `has_yard` or `has_rdoc` are listed, Ore will set `has_yard`
144
+ if the `.yardopts` file exists in the root directory of the project.
145
+ Otherwise, Ore will default `has_rdoc` to true.
146
+
147
+ ## extra_doc_files
148
+
149
+ The extra files that should also be scanned for documentation can be listed
150
+ like so:
151
+
152
+ extra_doc_files:
153
+ - ChangeLog.md
154
+ - LICENSE.txt
155
+
156
+ If `extra_doc_files` is not listed, Ore will use the extra-files listed in
157
+ the `.document` file.
158
+
159
+ ## files
160
+
161
+ The files of the project can be listed like so:
162
+
163
+ file: lib/**/*.rb
164
+
165
+ More than one file pattern can be specification:
166
+
167
+ file:
168
+ - lib/**/*.rb
169
+ - spec/**/*
170
+ - data/**/*
171
+
172
+ If `files` is not listed, Ore will check if the project is using
173
+ [Git](http://www.git-scm.org/), can will find all tracked files using:
174
+
175
+ git ls-files -z
176
+
177
+ If the project is not using Git, Ore will default `files` to every file in
178
+ the project.
179
+
180
+ ## test_files
181
+
182
+ The files used to test the project can be listed like so:
183
+
184
+ test_files: spec/**/*_spec.rb
185
+
186
+ More than one test-file pattern can be supplied:
187
+
188
+ test_files:
189
+ - spec/**/*_spec.rb
190
+ - features/**/*
191
+
192
+ If `test_files` is not listed, Ore will default `files` to
193
+ `test/{**/}test_*.rb` and `spec/{**/}*_spec.rb`.
194
+
195
+ ## required_ruby_version
196
+
197
+ The version of Ruby required by the project can be listed like so:
198
+
199
+ required_ruby_version: >= 1.9.1
200
+
201
+ ## required_rubygems_version
202
+
203
+ The version of RubyGems required by the project can be listed like so:
204
+
205
+ required_rubygems_version: >= 1.3.7
206
+
207
+ If `required_rubygems_version` is not listed and the project uses Bundler,
208
+ Ore will default `required_rubygems_version` to `>= 1.3.6`.
209
+
210
+ ## dependencies
211
+
212
+ The dependencies of the project can be listed like so:
213
+
214
+ dependencies:
215
+ foo: ~> 0.1.0
216
+ bar: 1.2.3
217
+
218
+ More than one version can be specified for each dependency:
219
+
220
+ dependencies:
221
+ foo: ~> 0.1.0, >= 0.0.7
222
+ bar: 1.2.3, 1.3.1
223
+
224
+ ## runtime_dependencies
225
+
226
+ The purely runtime-dependencies for a project can be specified like so:
227
+
228
+ runtime_dependencies:
229
+ foo: ~> 0.1.0
230
+ bar: 1.2.3
231
+
232
+ More than one version can be specified for each dependency:
233
+
234
+ dependencies:
235
+ foo: ~> 0.1.0, >= 0.0.7
236
+ bar: 1.2.3, 1.3.1
237
+
238
+ ## development_dependencies:
239
+
240
+ The purely developmental-dependencies for a project can be specified
241
+ like so:
242
+
243
+ development_dependencies:
244
+ foo: ~> 0.1.0
245
+ bar: 1.2.3
246
+
247
+ More than one version can be specified for each dependency:
248
+
249
+ dependencies:
250
+ foo: ~> 0.1.0, >= 0.0.7
251
+ bar: 1.2.3, 1.3.1
252
+
data/LICENSE.txt ADDED
@@ -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.
data/README.md ADDED
@@ -0,0 +1,104 @@
1
+ # Ore
2
+
3
+ * [Source](http://github.com/postmodern/ore)
4
+ * [Issues](http://github.com/postmodern/ore/issues)
5
+ * IRC: irc.freenode.net #ruby-ore
6
+ * Postmodern (postmodern.mod3 at gmail.com)
7
+
8
+ ## Description
9
+
10
+ Ore is a simple RubyGem building solution. Ore handles the creation of
11
+ `Gem::Specification` objects as well as building `.gem` files. Ore allows
12
+ the developer to keep all of the project information in a single YAML file.
13
+
14
+ ## Features
15
+
16
+ * Stores project information in **one YAML file** (`gemspec.yml`).
17
+ * Has only **one** dependency ([thor](http://github.com/wycats/thor)).
18
+ * **Does not** impose a development workflow onto the developer. One could
19
+ even use Ore with `Jeweler::Tasks`.
20
+ * **Can** load the project version from:
21
+ * `VERSION` or `VERSION.yml` files.
22
+ * `VERSION` constants or `Version` modules defined in a `version.rb` file.
23
+ * **Can** be used in traditional `.gemspec` files:
24
+
25
+ require 'ore/specification'
26
+
27
+ Ore::Specification.new do |gemspec|
28
+ # custom logic here
29
+ end
30
+
31
+ * Provides an **extendable** project **generator** that supports
32
+ user-installed templates.
33
+
34
+ ## Requirements
35
+
36
+ * [thor](http://github.com/wycats/thor) ~> 0.14.3
37
+
38
+ ## Install
39
+
40
+ $ gem install ore
41
+
42
+ ## Example gemspec.yml files
43
+
44
+ The `gemspec.yml` file used to build Ore:
45
+
46
+ name: ore
47
+ version: 0.1.2
48
+ summary: Cut raw RubyGems from YAML.
49
+ description:
50
+ Ore is a simple RubyGem building solution. Ore handles the
51
+ creation of Gem::Specification objects as well as building '.gem'
52
+ files. Ore allows the developer to keep all of the project information
53
+ in a single YAML file.
54
+
55
+ license: MIT
56
+ authors: Postmodern
57
+ email: postmodern.mod3@gmail.com
58
+ homepage: http://github.com/postmodern/ore
59
+ has_yard: true
60
+
61
+ dependencies:
62
+ thor: ~> 0.14.3
63
+
64
+ development_dependencies:
65
+ yard: ~> 0.6.1
66
+ rspec: ~> 2.0.0
67
+
68
+ For a complete refrence to the `gemspec.yml` file, please see
69
+ {file:GemspecYML.md}.
70
+
71
+ ## Synopsis
72
+
73
+ Install a custom template:
74
+
75
+ $ ore install http://github.com/user/awesometest.git
76
+
77
+ List installed templates:
78
+
79
+ $ ore list
80
+
81
+ Remove a previously installed template:
82
+
83
+ $ ore remove awesometest
84
+
85
+ Generate a new project:
86
+
87
+ $ mine myproj
88
+
89
+ Generate a new customized project:
90
+
91
+ $ mine myproj --bundler --rspec --yard
92
+
93
+ Generate a new project using previously installed templates:
94
+
95
+ $ mine myproj --bundler --rspec --yard -T awesometest
96
+
97
+ Builds a `.gem` file in the `pkg/` directory of a project:
98
+
99
+ $ ore
100
+
101
+ ## License
102
+
103
+ See {file:LICENSE.txt} for license information.
104
+
data/Rakefile ADDED
@@ -0,0 +1,9 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new
6
+ task :default => :spec
7
+
8
+ require 'yard'
9
+ YARD::Rake::YardocTask.new
data/bin/mine ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+
5
+ begin
6
+ require 'ore/generator'
7
+ rescue LoadError => e
8
+ STDERR.puts 'Could not load "ore/generator"'
9
+ exit -1
10
+ end
11
+
12
+ Ore::Generator.start