guard-copy 0.0.8 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +9 -9
- data/README.md +1 -1
- data/lib/guard/copy.rb +23 -11
- data/lib/guard/copy/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTFmYjQ2ZDExYmEwODNkNDI2NmQyOThkNThjMGQyZTZlZDg3OGI5ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
7
|
-
|
6
|
+
YzMyODZlZmZkMWM0MjE2MzYyOWMxNDAzZTU2NGE1NTdlM2Q2Mzk4MA==
|
7
|
+
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTQ0ZWU4NTQyZDExZmIxOTI1ZjlkNjIxNDVlOGZmMjkyOTAwNzFjZGU3ODA2
|
10
|
+
MWRjNGUxZDFlODVhMmU1Y2UwYmU1NDBiODZiMDdmNzc4OTQyYWIyMjJmZmQz
|
11
|
+
OWNlMzZkNDYzMTNiMjIwYTA2ZTIxNjVlMjQ5MjM3MmQxNGFlOTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
N2FkNjAyNWRjODMxYTY4ZDlkMzZjNzVmMGI3MDQ0NTY5MTg0MjUxNzIzNDZl
|
14
|
+
NWI4MzA1YTcxMzNjODQwMTg2YTIxZTM3ZTkzYTE4OTFiNjNiNjJkN2YwMjdj
|
15
|
+
OGI1YjAzY2VlMTE1YzA3YzcyYmIzNmEzMjM0Y2E1MTBiM2Q0ZTU=
|
data/README.md
CHANGED
data/lib/guard/copy.rb
CHANGED
@@ -1,24 +1,28 @@
|
|
1
1
|
require 'guard'
|
2
|
-
require 'guard/
|
2
|
+
require 'guard/plugin'
|
3
3
|
require 'fileutils'
|
4
4
|
|
5
5
|
module Guard
|
6
|
-
class Copy <
|
6
|
+
class Copy < Plugin
|
7
7
|
|
8
8
|
autoload :Target, 'guard/copy/target'
|
9
9
|
|
10
10
|
attr_reader :targets
|
11
11
|
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
|
12
|
+
# Initializes a Guard plugin.
|
13
|
+
# Don't do any work here, especially as Guard plugins get initialized even
|
14
|
+
# if they are not in an active group!
|
15
|
+
#
|
16
|
+
# @param [Hash] options the Guard plugin options
|
17
|
+
# @option options [Array<Guard::Watcher>] watchers the Guard plugin file
|
18
|
+
# watchers
|
19
|
+
# @option options [Symbol] group the group this Guard plugin belongs to
|
20
|
+
# @option options [Boolean] any_return allow any object to be returned from
|
21
|
+
# a watcher
|
22
|
+
#
|
23
|
+
def initialize(options = {})
|
24
|
+
inject_watchers(options)
|
16
25
|
super
|
17
|
-
if watchers.empty?
|
18
|
-
watchers << ::Guard::Watcher.new(%r{^#{options[:from]}/.*$})
|
19
|
-
else
|
20
|
-
watchers.each { |w| normalize_watcher(w, options[:from]) }
|
21
|
-
end
|
22
26
|
@targets = Array(options[:to]).map { |to| Target.new(to, options) }
|
23
27
|
end
|
24
28
|
|
@@ -76,6 +80,14 @@ module Guard
|
|
76
80
|
|
77
81
|
private
|
78
82
|
|
83
|
+
def inject_watchers(options)
|
84
|
+
if !options[:watchers] || options[:watchers].empty?
|
85
|
+
options[:watchers] = [::Guard::Watcher.new(%r{^#{options[:from]}/.*$})]
|
86
|
+
else
|
87
|
+
options[:watchers].each { |w| normalize_watcher(w, options[:from]) }
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
79
91
|
def target_paths
|
80
92
|
@targets.map { |t| t.paths }.flatten
|
81
93
|
end
|
data/lib/guard/copy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-copy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marc Schwieterman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.0'
|
27
27
|
description: Guard::Copy automatically copies files.
|
28
28
|
email:
|
29
29
|
- marc.schwieterman@gmail.com
|
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
56
|
version: '0'
|
57
57
|
requirements: []
|
58
58
|
rubyforge_project:
|
59
|
-
rubygems_version: 2.
|
59
|
+
rubygems_version: 2.1.5
|
60
60
|
signing_key:
|
61
61
|
specification_version: 4
|
62
62
|
summary: Guard gem for copy
|