ore 0.1.3 → 0.1.4
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 +8 -0
- data/GemspecYML.md +9 -1
- data/gemspec.yml +1 -1
- data/lib/ore/checks.rb +3 -0
- data/lib/ore/config.rb +8 -4
- data/lib/ore/defaults.rb +5 -1
- data/lib/ore/dependency.rb +3 -0
- data/lib/ore/paths.rb +3 -0
- data/lib/ore/project.rb +4 -0
- data/lib/ore/settings.rb +13 -3
- data/lib/ore/template/directory.rb +4 -0
- data/lib/ore/template/helpers.rb +3 -0
- data/lib/ore/template/interpolations.rb +29 -0
- data/lib/rubygems_plugin.rb +1 -1
- metadata +3 -3
data/ChangeLog.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
### 0.1.4 / 2010-10-26
|
2
|
+
|
3
|
+
* Increased documentation coverage.
|
4
|
+
* Make sure {Ore::Config.builtin_templates} and
|
5
|
+
{Ore::Config.installed_templates} only yield valid directories.
|
6
|
+
* Ensure that {Ore::Settings} handles versions as Strings.
|
7
|
+
* Fixed two typos.
|
8
|
+
|
1
9
|
### 0.1.3 / 2010-10-25
|
2
10
|
|
3
11
|
* Fixed URLs in the `gemspec.yml` and {file:README.md}.
|
data/GemspecYML.md
CHANGED
@@ -18,7 +18,15 @@ directory.
|
|
18
18
|
|
19
19
|
The version of the project can be listed like so:
|
20
20
|
|
21
|
-
version:
|
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
|
22
30
|
|
23
31
|
If the version is not listed, Ore will first search for a `VERSION` or
|
24
32
|
`VERSION.yml` file in the root of the project. If Ore cannot find any
|
data/gemspec.yml
CHANGED
data/lib/ore/checks.rb
CHANGED
data/lib/ore/config.rb
CHANGED
@@ -26,11 +26,13 @@ module Ore
|
|
26
26
|
# @yieldparam [String] path
|
27
27
|
# The path of a Ore template directory.
|
28
28
|
#
|
29
|
-
def Config.builtin_templates
|
29
|
+
def Config.builtin_templates
|
30
30
|
path = File.join(@@data_dir,'ore','templates')
|
31
31
|
|
32
32
|
if File.directory?(path)
|
33
|
-
Dir.glob("#{path}/*"
|
33
|
+
Dir.glob("#{path}/*") do |template|
|
34
|
+
yield template if File.directory?(template)
|
35
|
+
end
|
34
36
|
end
|
35
37
|
end
|
36
38
|
|
@@ -43,9 +45,11 @@ module Ore
|
|
43
45
|
# @yieldparam [String] path
|
44
46
|
# The path of a Ore template directory.
|
45
47
|
#
|
46
|
-
def Config.installed_templates
|
48
|
+
def Config.installed_templates
|
47
49
|
if File.directory?(@@templates_dir)
|
48
|
-
Dir.glob("#{@@templates_dir}/*"
|
50
|
+
Dir.glob("#{@@templates_dir}/*") do |template|
|
51
|
+
yield template if File.directory?(template)
|
52
|
+
end
|
49
53
|
end
|
50
54
|
end
|
51
55
|
end
|
data/lib/ore/defaults.rb
CHANGED
@@ -4,6 +4,10 @@ require 'ore/versions'
|
|
4
4
|
require 'date'
|
5
5
|
|
6
6
|
module Ore
|
7
|
+
#
|
8
|
+
# A mixin for {Project} which provides methods for assigning default
|
9
|
+
# values to project attributes.
|
10
|
+
#
|
7
11
|
module Defaults
|
8
12
|
include Naming
|
9
13
|
|
@@ -43,7 +47,7 @@ module Ore
|
|
43
47
|
)
|
44
48
|
|
45
49
|
unless @version
|
46
|
-
|
50
|
+
raise(InvalidMetadata,"no version file or constant in #{@root}")
|
47
51
|
end
|
48
52
|
end
|
49
53
|
|
data/lib/ore/dependency.rb
CHANGED
data/lib/ore/paths.rb
CHANGED
data/lib/ore/project.rb
CHANGED
data/lib/ore/settings.rb
CHANGED
@@ -3,6 +3,10 @@ require 'ore/versions/version'
|
|
3
3
|
require 'ore/dependency'
|
4
4
|
|
5
5
|
module Ore
|
6
|
+
#
|
7
|
+
# A mixin for {Project} which provides methods for normalizing and
|
8
|
+
# setting project attributes.
|
9
|
+
#
|
6
10
|
module Settings
|
7
11
|
protected
|
8
12
|
|
@@ -25,7 +29,7 @@ module Ore
|
|
25
29
|
|
26
30
|
@version = Versions::Version.new(major,minor,patch,build)
|
27
31
|
when String
|
28
|
-
@version = Versions::Version.parse(version)
|
32
|
+
@version = Versions::Version.parse(version.to_s)
|
29
33
|
else
|
30
34
|
raise(InvalidMetadata,"version must be a Hash or a String")
|
31
35
|
end
|
@@ -39,9 +43,9 @@ module Ore
|
|
39
43
|
#
|
40
44
|
def set_license!(license)
|
41
45
|
if license.kind_of?(Array)
|
42
|
-
|
46
|
+
@licenses += license
|
43
47
|
else
|
44
|
-
@licenses << license
|
48
|
+
@licenses << license
|
45
49
|
end
|
46
50
|
end
|
47
51
|
|
@@ -189,6 +193,8 @@ module Ore
|
|
189
193
|
end
|
190
194
|
|
191
195
|
dependencies.each do |name,versions|
|
196
|
+
versions = versions.to_s
|
197
|
+
|
192
198
|
@dependencies << Dependency.parse_versions(name,versions)
|
193
199
|
end
|
194
200
|
end
|
@@ -209,6 +215,8 @@ module Ore
|
|
209
215
|
end
|
210
216
|
|
211
217
|
dependencies.each do |name,versions|
|
218
|
+
versions = versions.to_s
|
219
|
+
|
212
220
|
@runtime_dependencies << Dependency.parse_versions(name,versions)
|
213
221
|
end
|
214
222
|
end
|
@@ -229,6 +237,8 @@ module Ore
|
|
229
237
|
end
|
230
238
|
|
231
239
|
dependencies.each do |name,versions|
|
240
|
+
versions = versions.to_s
|
241
|
+
|
232
242
|
@development_dependencies << Dependency.parse_versions(name,versions)
|
233
243
|
end
|
234
244
|
end
|
data/lib/ore/template/helpers.rb
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
module Ore
|
2
2
|
module Template
|
3
|
+
#
|
4
|
+
# Handles the expansion of paths and substitution of path keywords.
|
5
|
+
# The following keywords are supported:
|
6
|
+
#
|
7
|
+
# * `:name:` - The name of the project.
|
8
|
+
# * `:project_dir:` - The directory base-name derived from the project
|
9
|
+
# name.
|
10
|
+
# * `:namespace_dir:` - The full directory path derived from the
|
11
|
+
# project name.
|
12
|
+
#
|
3
13
|
module Interpolations
|
14
|
+
# The accepted interpolation keywords that may be used in paths
|
4
15
|
@@keywords = %w[
|
5
16
|
name
|
6
17
|
project_dir
|
@@ -9,6 +20,24 @@ module Ore
|
|
9
20
|
|
10
21
|
protected
|
11
22
|
|
23
|
+
#
|
24
|
+
# Expands the given path by substituting the interpolation keywords
|
25
|
+
# for the related instance variables.
|
26
|
+
#
|
27
|
+
# @param [String] path
|
28
|
+
# The path to expand.
|
29
|
+
#
|
30
|
+
# @return [String]
|
31
|
+
# The expanded path.
|
32
|
+
#
|
33
|
+
# @example Assuming `@project_dir` contains `my_project`.
|
34
|
+
# interpolate "lib/:project_dir:.rb"
|
35
|
+
# # => "lib/my_project.rb"
|
36
|
+
#
|
37
|
+
# @example Assuming `@namespace_dir` contains `my/project`.
|
38
|
+
# interpolate "spec/:namespace_dir:_spec.rb"
|
39
|
+
# # => "spec/my/project_spec.rb"
|
40
|
+
#
|
12
41
|
def interpolate(path)
|
13
42
|
dirs = path.split(File::SEPARATOR)
|
14
43
|
|
data/lib/rubygems_plugin.rb
CHANGED
@@ -21,7 +21,7 @@ module Ore
|
|
21
21
|
lib_dir = File.expand_path(File.dirname(__FILE__))
|
22
22
|
|
23
23
|
# modify the $LOAD_PATH is 'ore/specification' is not available
|
24
|
-
$LOAD_PATH <<
|
24
|
+
$LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
|
25
25
|
|
26
26
|
begin
|
27
27
|
# attempt loading 'ore/specification' again
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 4
|
9
|
+
version: 0.1.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Postmodern
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-10-
|
17
|
+
date: 2010-10-26 00:00:00 -07:00
|
18
18
|
default_executable: ore
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|