ore 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -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}.
@@ -18,7 +18,15 @@ directory.
18
18
 
19
19
  The version of the project can be listed like so:
20
20
 
21
- version: 0.1.0
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
@@ -1,5 +1,5 @@
1
1
  name: ore
2
- version: 0.1.3
2
+ version: 0.1.4
3
3
  summary: Cut raw RubyGems from YAML
4
4
  description:
5
5
  Ore is a simple RubyGem building solution. Ore handles the
@@ -1,4 +1,7 @@
1
1
  module Ore
2
+ #
3
+ # A mixin for {Project} which provides methods for checking files.
4
+ #
2
5
  module Checks
3
6
  protected
4
7
 
@@ -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(&block)
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}/*",&block)
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(&block)
48
+ def Config.installed_templates
47
49
  if File.directory?(@@templates_dir)
48
- Dir.glob("#{@@templates_dir}/*",&block)
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
@@ -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
- #raise(InvalidMetadata,"no version file or constant in #{@root}")
50
+ raise(InvalidMetadata,"no version file or constant in #{@root}")
47
51
  end
48
52
  end
49
53
 
@@ -1,4 +1,7 @@
1
1
  module Ore
2
+ #
3
+ # Represents a RubyGem dependency.
4
+ #
2
5
  class Dependency
3
6
 
4
7
  # The name of the dependency
@@ -1,6 +1,9 @@
1
1
  require 'ore/naming'
2
2
 
3
3
  module Ore
4
+ #
5
+ # A mixin for {Project} which provides methods for working with paths.
6
+ #
4
7
  module Paths
5
8
  include Naming
6
9
 
@@ -13,6 +13,10 @@ require 'find'
13
13
  require 'fileutils'
14
14
 
15
15
  module Ore
16
+ #
17
+ # Combinds the metadata from the `gemspec.yml` file and the inferred
18
+ # information from the project directory.
19
+ #
16
20
  class Project
17
21
 
18
22
  include Naming
@@ -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
- license.each { |name| @licenses << name.to_s }
46
+ @licenses += license
43
47
  else
44
- @licenses << license.to_s
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
@@ -2,6 +2,10 @@ require 'find'
2
2
 
3
3
  module Ore
4
4
  module Template
5
+ #
6
+ # Represents a template directory and the static files, ERb files
7
+ # and sub-directories within it.
8
+ #
5
9
  class Directory
6
10
 
7
11
  # Files or directory names to ignore
@@ -1,5 +1,8 @@
1
1
  module Ore
2
2
  module Template
3
+ #
4
+ # Helper methods that can be used within ERb templates.
5
+ #
3
6
  module Helpers
4
7
  protected
5
8
 
@@ -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
 
@@ -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 << ORE_LIB_DIR unless $LOAD_PATH.include?(ORE_LIB_DIR)
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
- - 3
9
- version: 0.1.3
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-25 00:00:00 -07:00
17
+ date: 2010-10-26 00:00:00 -07:00
18
18
  default_executable: ore
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency