sanky-pf 0.0.3 → 0.0.4
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 +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +27 -0
- data/Rakefile +10 -0
- data/lib/sanky/pathfinder/finder.rb +23 -19
- data/lib/sanky/pathfinder/version.rb +1 -1
- data/pkg/sanky-pf-0.0.3.gem +0 -0
- data/test/test_finder.rb +6 -5
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9ec9008b12e46dec86fe4455d5bdf3504bd9194
|
4
|
+
data.tar.gz: b5ef0973ce003ebc2b3006a2ab2acef39a3ef22e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6f283860cb74d6934e731287e7ee5937c0a85e51c3bfe50837ba59ab7fea3467b4268e7f57e6ba9e2e55bca923c786c5e65855c8453b1d2b80236a66314a71e
|
7
|
+
data.tar.gz: 47a904550eb1898312471c305751420cb7261f5c4451b571067157511a09359869013a81b8e555fc1615e1a196c079b3ee9d62769c74309cd5a0ac141406c080
|
data/Gemfile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
gemspec
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
sanky-pf (0.0.3)
|
5
|
+
colorize
|
6
|
+
|
7
|
+
GEM
|
8
|
+
specs:
|
9
|
+
activesupport (3.2.12)
|
10
|
+
i18n (~> 0.6)
|
11
|
+
multi_json (~> 1.0)
|
12
|
+
colorize (0.6.0)
|
13
|
+
i18n (0.6.4)
|
14
|
+
multi_json (1.7.1)
|
15
|
+
shoulda (3.5.0)
|
16
|
+
shoulda-context (~> 1.0, >= 1.0.1)
|
17
|
+
shoulda-matchers (>= 1.4.1, < 3.0)
|
18
|
+
shoulda-context (1.1.6)
|
19
|
+
shoulda-matchers (2.4.0)
|
20
|
+
activesupport (>= 3.0.0)
|
21
|
+
|
22
|
+
PLATFORMS
|
23
|
+
ruby
|
24
|
+
|
25
|
+
DEPENDENCIES
|
26
|
+
sanky-pf!
|
27
|
+
shoulda
|
data/Rakefile
ADDED
@@ -13,18 +13,19 @@ module Sanky
|
|
13
13
|
|
14
14
|
def convert
|
15
15
|
@arguments.map! do |original|
|
16
|
-
# subsitute windows backslashes for forwardslashes and strip whitespace
|
16
|
+
# subsitute windows backslashes for forwardslashes and strip whitespace, add leading forwardslash
|
17
17
|
original = original.strip.gsub(/\\/, "/")
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
#
|
23
|
-
original.
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
18
|
+
|
19
|
+
set = {}
|
20
|
+
|
21
|
+
drive = /.{1,3}:/
|
22
|
+
# are we talking about sankynet or sanky direct drives here?
|
23
|
+
if original.match(drive)
|
24
|
+
set[:sanky_net] = original.sub(drive, "/Volumes/SankyNet Drive")
|
25
|
+
set[:sanky_direct] = original.sub(drive, "/Volumes/Sanky Direct Drive/Sanky Shared")
|
26
|
+
end
|
27
|
+
|
28
|
+
set
|
28
29
|
end
|
29
30
|
|
30
31
|
self
|
@@ -32,14 +33,17 @@ module Sanky
|
|
32
33
|
|
33
34
|
def open
|
34
35
|
@arguments.each do |target|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
36
|
+
target.each do |drive, file|
|
37
|
+
begin
|
38
|
+
# pipe STDERR to dev null in favor of custom prompt
|
39
|
+
`open -g '#{file}' > /dev/null 2>/dev/null`
|
40
|
+
ensure
|
41
|
+
if $? == 0
|
42
|
+
puts "Opening the file in the background...".yellow
|
43
|
+
else
|
44
|
+
puts "Failed to find #{file}!".red
|
45
|
+
puts "Trying another likely location...".red
|
46
|
+
end
|
43
47
|
end
|
44
48
|
end
|
45
49
|
end
|
Binary file
|
data/test/test_finder.rb
CHANGED
@@ -22,16 +22,17 @@ class TestFinder < Test::Unit::TestCase
|
|
22
22
|
context "conversion" do
|
23
23
|
should "properly parse paths" do
|
24
24
|
expected_results = [
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
{}, {}, {}, {},
|
26
|
+
{
|
27
|
+
:sanky_net => "/Volumes/SankyNet Drive/CCBQ/0-HTML-CCBQ/Email/2013/2013-12-11_CCBQ_Holiday_Appeal-2",
|
28
|
+
:sanky_direct => "/Volumes/Sanky Direct Drive/Sanky Shared/CCBQ/0-HTML-CCBQ/Email/2013/2013-12-11_CCBQ_Holiday_Appeal-2",
|
29
|
+
}
|
30
30
|
]
|
31
31
|
|
32
32
|
assert_equal expected_results, @finder.convert.to_s
|
33
33
|
end
|
34
34
|
end
|
35
|
+
|
35
36
|
end
|
36
37
|
|
37
38
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sanky-pf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Ryan
|
@@ -55,10 +55,14 @@ extensions: []
|
|
55
55
|
extra_rdoc_files: []
|
56
56
|
files:
|
57
57
|
- bin/sanky-pf
|
58
|
+
- Gemfile
|
59
|
+
- Gemfile.lock
|
58
60
|
- lib/sanky/pathfinder/finder.rb
|
59
61
|
- lib/sanky/pathfinder/options.rb
|
60
62
|
- lib/sanky/pathfinder/runner.rb
|
61
63
|
- lib/sanky/pathfinder/version.rb
|
64
|
+
- pkg/sanky-pf-0.0.3.gem
|
65
|
+
- Rakefile
|
62
66
|
- README.md
|
63
67
|
- sanky-pf.gemspec
|
64
68
|
- test/test_finder.rb
|