dependable 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/dependable.rb CHANGED
@@ -1,35 +1,31 @@
1
1
  module Dependable
2
2
 
3
- module Dependency
4
-
5
- def dependencies=(dependencies)
6
- raise ArgumentError.new('Dependencies must be enumerable') unless dependencies.kind_of?(Enumerable) # TODO debatable whether this should be here
7
- @dependencies = dependencies
8
- end
9
-
10
- def dependencies
11
- @dependencies || []
12
- end
13
-
14
- def load_path(include_self = true)
15
- load = []
16
- @dependencies.each do |dependency|
17
- load.concat dependency.load_path
18
- end if @dependencies
19
- load << self if include_self
20
- load.uniq!
21
- load
22
- end
23
-
24
- def print_load_path(include_self = true)
25
- load = self.load_path(include_self)
26
- load.each_with_index do |thing, index|
27
- print "#{index + 1}) #{thing}"
28
- print " (requires: #{thing.dependencies.join(',')})" unless thing.dependencies.empty?
29
- puts
30
- end
3
+ def dependencies=(dependencies)
4
+ raise ArgumentError.new('Dependencies must be enumerable') unless dependencies.kind_of?(Enumerable) # TODO debatable whether this should be here
5
+ @dependencies = dependencies
6
+ end
7
+
8
+ def dependencies
9
+ @dependencies || []
10
+ end
11
+
12
+ def load_path(include_self = true)
13
+ load = []
14
+ @dependencies.each do |dependency|
15
+ load.concat dependency.load_path
16
+ end if @dependencies
17
+ load << self if include_self
18
+ load.uniq!
19
+ load
20
+ end
21
+
22
+ def print_load_path(include_self = true)
23
+ load = self.load_path(include_self)
24
+ load.each_with_index do |thing, index|
25
+ print "#{index + 1}) #{thing}"
26
+ print " (requires: #{thing.dependencies.join(',')})" unless thing.dependencies.empty?
27
+ puts
31
28
  end
32
-
33
29
  end
34
-
30
+
35
31
  end
@@ -1,5 +1,5 @@
1
1
  module Dependable
2
2
 
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - John Crepezzi