unix_utils 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +7 -0
- data/LICENSE +22 -0
- data/lib/unix_utils/version.rb +1 -1
- data/lib/unix_utils.rb +5 -2
- data/test/helper.rb +2 -2
- data/test/test_unix_utils.rb +2 -2
- data/unix_utils.gemspec +1 -0
- metadata +6 -4
data/CHANGELOG
CHANGED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Brighter Planet, Inc.
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/unix_utils/version.rb
CHANGED
data/lib/unix_utils.rb
CHANGED
@@ -12,9 +12,12 @@ module UnixUtils
|
|
12
12
|
|
13
13
|
def self.curl(url, form_data = nil)
|
14
14
|
outfile = tmp_path url
|
15
|
-
if url.start_with?('file://') or url.
|
15
|
+
if url.start_with?('file://') or not url.include?('://')
|
16
16
|
# deal with local files
|
17
17
|
infile = ::File.expand_path url.sub('file://', '')
|
18
|
+
unless File.readable?(infile)
|
19
|
+
raise "[unix_utils] #{url.inspect} does not exist or is not readable on the local filesystem."
|
20
|
+
end
|
18
21
|
::FileUtils.cp infile, outfile
|
19
22
|
return outfile
|
20
23
|
end
|
@@ -71,7 +74,7 @@ module UnixUtils
|
|
71
74
|
end
|
72
75
|
end
|
73
76
|
|
74
|
-
def self.
|
77
|
+
def self.du(srcdir)
|
75
78
|
srcdir = ::File.expand_path srcdir
|
76
79
|
argv = ['du', '-sk', srcdir]
|
77
80
|
stdout = spawn argv
|
data/test/helper.rb
CHANGED
@@ -23,7 +23,7 @@ module TestHelper
|
|
23
23
|
when :file
|
24
24
|
checksum = UnixUtils.shasum infile_or_srcdir, 256
|
25
25
|
when :directory
|
26
|
-
size = UnixUtils.
|
26
|
+
size = UnixUtils.du infile_or_srcdir
|
27
27
|
end
|
28
28
|
destdir = UnixUtils.send(*([method_id] + args))
|
29
29
|
safe_delete destdir
|
@@ -32,7 +32,7 @@ module TestHelper
|
|
32
32
|
when :file
|
33
33
|
UnixUtils.shasum(infile_or_srcdir, 256).must_equal checksum
|
34
34
|
when :directory
|
35
|
-
UnixUtils.
|
35
|
+
UnixUtils.du(infile_or_srcdir).must_equal size
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
data/test/test_unix_utils.rb
CHANGED
data/unix_utils.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unix_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: posix-spawn
|
@@ -39,6 +39,7 @@ files:
|
|
39
39
|
- .gitignore
|
40
40
|
- CHANGELOG
|
41
41
|
- Gemfile
|
42
|
+
- LICENSE
|
42
43
|
- README.markdown
|
43
44
|
- Rakefile
|
44
45
|
- lib/unix_utils.rb
|
@@ -63,7 +64,8 @@ files:
|
|
63
64
|
- unix-philosophy-quote-pg2.png
|
64
65
|
- unix_utils.gemspec
|
65
66
|
homepage: https://github.com/seamusabshere/unix_utils
|
66
|
-
licenses:
|
67
|
+
licenses:
|
68
|
+
- MIT
|
67
69
|
post_install_message:
|
68
70
|
rdoc_options: []
|
69
71
|
require_paths:
|
@@ -82,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
84
|
version: '0'
|
83
85
|
requirements: []
|
84
86
|
rubyforge_project:
|
85
|
-
rubygems_version: 1.8.
|
87
|
+
rubygems_version: 1.8.24
|
86
88
|
signing_key:
|
87
89
|
specification_version: 3
|
88
90
|
summary: Like FileUtils, but provides zip, unzip, bzip2, bunzip2, tar, untar, sed,
|