build-files 1.0.0 → 1.0.1

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: 175cf300ef1bb7f8873e0932c313a2d43ec1fdaf
4
- data.tar.gz: 12f0e5f2dac80a6f59c7e1945fe6a04467604e39
3
+ metadata.gz: 1f34f08a51af0bb5ea2b5d9c9a0db153043814c2
4
+ data.tar.gz: e04880fa3fcead461fa957855ae762aa0954101a
5
5
  SHA512:
6
- metadata.gz: 19cbf2b9570233c4cd423f53e9c59e4053c6e3cf020157bcf1c2cae28389996872351cb374b9001ede12070de73b0a625d06ce5a0f56e8e8306e1c0576429b80
7
- data.tar.gz: bac413fc3b5e4503d6ea4d85c8b2632134d8e603c0fdb84d5411f8b12412d84a3f2de673cca28b56c7427ca94723d1f93fbf097dc8a3b4df3d84965262294d25
6
+ metadata.gz: cf6faf14761ae2b0b4856e9669687ec676d1462080ea4150ec32a213e2a6ad6f6e66cfa880a24ab2459e91cfeedb76043511add720cb4e7b7a632d36aa7c335f
7
+ data.tar.gz: 2f27d02ca86929aa603c4f02f7462fb1b0a337065ce8ffed855f7204d39da025b346489538a7a04acdec06eccaf44d0f546188ee7d95ae5cd7f8f54b98775dd8
@@ -64,10 +64,15 @@ module Build
64
64
  self.class.new(@root.rebase(root))
65
65
  end
66
66
 
67
+ # Convert a Directory into a String, can be used as an argument to a command.
67
68
  def to_str
68
69
  @root.to_str
69
70
  end
70
71
 
72
+ def to_s
73
+ to_str
74
+ end
75
+
71
76
  def to_path
72
77
  @root
73
78
  end
@@ -73,7 +73,6 @@ module Build
73
73
  def inspect
74
74
  "<Glob #{full_pattern.inspect}>"
75
75
  end
76
-
77
76
  end
78
77
  end
79
78
  end
@@ -86,6 +86,10 @@ module Build
86
86
  Paths.new(arg)
87
87
  end
88
88
  end
89
+
90
+ def to_s
91
+ inspect
92
+ end
89
93
  end
90
94
 
91
95
  class Composite < List
@@ -66,14 +66,18 @@ module Build
66
66
  end
67
67
 
68
68
  # Recursively create a directory hierarchy for the given path.
69
- def create
69
+ def mkpath
70
70
  FileUtils.mkpath self
71
71
  end
72
72
 
73
+ alias create mkpath
74
+
73
75
  # Recursively delete the given path and all contents.
74
- def delete
76
+ def rm
75
77
  FileUtils.rm_rf self
76
78
  end
79
+
80
+ alias delete rm
77
81
  end
78
82
 
79
83
  class List
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Build
22
22
  module Files
23
- VERSION = "1.0.0"
23
+ VERSION = "1.0.1"
24
24
  end
25
25
  end
@@ -39,5 +39,11 @@ module Build::Files::GlobSpec
39
39
 
40
40
  expect(cache).to be_include(path.glob("*.rb"))
41
41
  end
42
+
43
+ it "should print nice string represenation" do
44
+ glob = Build::Files::Glob.new(".", "*.rb")
45
+
46
+ expect("#{glob}").to be == '<Glob "."/"*.rb">'
47
+ end
42
48
  end
43
49
  end
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: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-28 00:00:00.000000000 Z
11
+ date: 2015-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler