guard-copy 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MzMyNDhjMzRjMjViNzRjMWU5YjhmYWZiNmM3YmM3NTYyM2M1ZTFlZQ==
5
+ data.tar.gz: !binary |-
6
+ YjU4YTc0ZmRmYWI2MGY2NGMyNDM5NjhiMmRlNmY2Mjc4ZWU3YWE3Yw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ MTVjNzRhMTkwNzYyZjBjNmMzNWMyZGFjNjZmZGU3ZDE4YWFkZDJhNTM4YWMw
10
+ MTI2YmEzNWJlMDk3YmJmYWM2Mjk2OWQxMTY5ODUzYjhmYTQ5NWE3MGU3ZGYw
11
+ NWZhZjE5MTQxZDY2Yjg3N2QxY2JjYzljMDJmMzQ2ZjA0ZDYzMWM=
12
+ data.tar.gz: !binary |-
13
+ ZDIyYmYzM2E4M2Q0MzgzMDI5YmM2ZDc1MmFjOWQwMDkwODU4ZjA0YTJmNTU0
14
+ ZTJlYjAwZTBiZTVlOTkxMTg5ZGZkZTE3YzJlYTlhZTgxNzE4Zjc0NjZiZDk0
15
+ OTNjODlhODljMDQ0M2NmNjZmZmRiMmQzOGNkODhhZTRlOGMzYWE=
@@ -29,7 +29,7 @@ module Guard
29
29
  validate_from_is_directory
30
30
  validate_presence_of(:to)
31
31
  validate_to_patterns_are_not_absolute
32
- validate_to_does_not_include_from
32
+ validate_to_does_not_start_with_from
33
33
  resolve_targets!
34
34
  validate_no_targets_are_files
35
35
  display_target_paths
@@ -57,7 +57,7 @@ module Guard
57
57
  end
58
58
  validate_to_path(to_path)
59
59
  UI.info("copying to #{to_path}") if options[:verbose]
60
- FileUtils.cp(from_path, to_path)
60
+ copy(from_path, to_path)
61
61
  end
62
62
  end
63
63
 
@@ -120,9 +120,9 @@ module Guard
120
120
  end
121
121
  end
122
122
 
123
- def validate_to_does_not_include_from
124
- if options[:to].include?(options[:from])
125
- UI.error('Guard::Copy - :to must not include :from')
123
+ def validate_to_does_not_start_with_from
124
+ if Array(options[:to]).any? { |to| to.start_with?(options[:from]) }
125
+ UI.error('Guard::Copy - :to must not start with :from')
126
126
  throw :task_has_failed
127
127
  end
128
128
  end
@@ -184,5 +184,14 @@ module Guard
184
184
  end
185
185
  end
186
186
 
187
+ def copy(from_path, to_path)
188
+ begin
189
+ FileUtils.cp(from_path, to_path)
190
+ rescue Errno::EISDIR
191
+ UI.warning("matched path is a directory; skipping")
192
+ UI.warning(" #{ from_path }")
193
+ end
194
+ end
195
+
187
196
  end
188
197
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module CopyVersion
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-copy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
5
- prerelease:
4
+ version: 0.0.8
6
5
  platform: ruby
7
6
  authors:
8
7
  - Marc Schwieterman
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-12-14 00:00:00.000000000 Z
11
+ date: 2013-05-05 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: guard
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -42,32 +39,25 @@ files:
42
39
  - README.md
43
40
  homepage: https://github.com/marcisme/guard-copy
44
41
  licenses: []
42
+ metadata: {}
45
43
  post_install_message:
46
44
  rdoc_options: []
47
45
  require_paths:
48
46
  - lib
49
47
  required_ruby_version: !ruby/object:Gem::Requirement
50
- none: false
51
48
  requirements:
52
49
  - - ! '>='
53
50
  - !ruby/object:Gem::Version
54
51
  version: '0'
55
- segments:
56
- - 0
57
- hash: 3047131128220204407
58
52
  required_rubygems_version: !ruby/object:Gem::Requirement
59
- none: false
60
53
  requirements:
61
54
  - - ! '>='
62
55
  - !ruby/object:Gem::Version
63
56
  version: '0'
64
- segments:
65
- - 0
66
- hash: 3047131128220204407
67
57
  requirements: []
68
58
  rubyforge_project:
69
- rubygems_version: 1.8.24
59
+ rubygems_version: 2.0.2
70
60
  signing_key:
71
- specification_version: 3
61
+ specification_version: 4
72
62
  summary: Guard gem for copy
73
63
  test_files: []