build-files 0.2.8 → 0.2.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6da1f224c99e4155b32783bcfdb5af363d2f1008
4
- data.tar.gz: f94a00b03d6ba769008948cd266dc5c156cc9fea
3
+ metadata.gz: 130ed7e444f0f892eb13d423522cf1474f8dc08f
4
+ data.tar.gz: 0807096d74e6d2cdb5d4d84edf6ea42490181048
5
5
  SHA512:
6
- metadata.gz: 31ad2ca9bb26c86819dcdceb4f5ed9e942f7d970a711cba57deb73e4765430f4aeb7163c78802cf859bfb50c8647852c95c01d0aab2c634465204b80d96898cc
7
- data.tar.gz: 409d79a9e4bf960dd32c28f6ae956e4c8c4b0d9984c1df6a50094ebf5574284b4dcaea31b5c86c06a83d7d62b8e6f88dc053bdcee59167165614444fc2223ecb
6
+ metadata.gz: 05789c4a0450ec6fb506f9aa06dc31591e7fb1862ad686c55fe3265ddcd1e96a134fa6a6eb91d903c35213aa56fb9157b245371c77779084098741db5b694deb
7
+ data.tar.gz: 4e3d50d571f258afae6f633c3e5c59766d8a5e4566d589d8c196cd12dd60c0fd0f98bb021ad72a598ec6c90261c5229b14bd5e81c33a1a7168af43f5115cbdb1
@@ -27,14 +27,12 @@ module Build
27
27
  self.new(Path.join(*args))
28
28
  end
29
29
 
30
- def initialize(path)
31
- @path = path
30
+ def initialize(root)
31
+ @root = root
32
32
  end
33
33
 
34
- attr :path
35
-
36
34
  def root
37
- @path.root
35
+ @root
38
36
  end
39
37
 
40
38
  def roots
@@ -44,34 +42,34 @@ module Build
44
42
  def each
45
43
  return to_enum(:each) unless block_given?
46
44
 
47
- Dir.glob(@path + "**/*") do |path|
48
- yield Path.new(path, @path.root)
45
+ Dir.glob(@root + "**/*") do |path|
46
+ yield Path.new(path, @root)
49
47
  end
50
48
  end
51
49
 
52
50
  def eql?(other)
53
- self.class.eql?(other.class) and @path.eql?(other.path)
51
+ self.class.eql?(other.class) and @root.eql?(other.root)
54
52
  end
55
53
 
56
54
  def hash
57
- @path.hash
55
+ @root.hash
58
56
  end
59
57
 
60
58
  def include?(path)
61
59
  # Would be true if path is a descendant of full_path.
62
- path.start_with?(@path)
60
+ path.start_with?(@root)
63
61
  end
64
62
 
65
63
  def rebase(root)
66
- self.class.new(@path.rebase(root))
64
+ self.class.new(@root.rebase(root))
67
65
  end
68
66
 
69
67
  def to_str
70
- @path.to_str
68
+ @root.to_str
71
69
  end
72
70
 
73
71
  def to_path
74
- @path
72
+ @root
75
73
  end
76
74
  end
77
75
  end
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Build
22
22
  module Files
23
- VERSION = "0.2.8"
23
+ VERSION = "0.2.9"
24
24
  end
25
25
  end
@@ -28,8 +28,8 @@ module Build::Files::DirectorySpec
28
28
  let(:directory) {Directory.new(path)}
29
29
 
30
30
  it "has a root and path component" do
31
- expect(directory.root).to be == path.root
32
- expect(directory.path).to be == path
31
+ expect(directory.root).to be == path
32
+ expect(directory.roots).to be_include(path)
33
33
  end
34
34
 
35
35
  it "includes subpaths" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build-files
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-19 00:00:00.000000000 Z
11
+ date: 2014-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler