guard-copy2 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +15 -0
  2. data/lib/guard/copy.rb +22 -0
  3. metadata +72 -0
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ Njk3MThhZjY0MDNjMzJiM2Q3MjliYTEwMzY0ZjlmNTU3YmVlODhlMQ==
5
+ data.tar.gz: !binary |-
6
+ NDkzNjU2ZTg5NjRlYjgyODEzZmY5OTgwODQ3ODQ0NTM5MTQ2NjU3ZA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ MDY3YTgxMDEyOTkzODAwYzhmNjEyZDdiODg0NzJkYTIwM2VlNDQ4NjJhNDMw
10
+ Njc2YWQzNmM1NWZhNGZhYzY1NGY3NTJiNDhkNGRjZjkzNDJlYTE4OTdmOGU2
11
+ MjZlNjMwNjlmYjAyOTEwMmVlMThlODhlYmVlZDY0YzEzNGZmYjU=
12
+ data.tar.gz: !binary |-
13
+ OWJkOWJmZWI2ZGE5NDQ4NmY4NDEyMTk5MzhhN2FiYzA2MDNjNDA5NmQ2Y2Iw
14
+ MDIxZDMwODY3ZTFmNjBmODljYjU2OGJlMjdiYTM5NDhkOGU2MTAyMmViODZm
15
+ Y2RmZWM0OWFlMjQ4MGY0Y2EyYzMwZmM5MTZlOWI5YWIzMjg4MzI=
data/lib/guard/copy.rb ADDED
@@ -0,0 +1,22 @@
1
+ require 'guard'
2
+ require 'guard/guard'
3
+ require 'guard/watcher'
4
+ require 'guard/helpers/starter'
5
+
6
+ module Guard
7
+ class Copy < Guard
8
+ include ::Guard::Helpers::Starter
9
+
10
+ def act_on(directory, file)
11
+ target = target_filename(directory, file)
12
+ FileUtils.mkdir_p(File.dirname(target))
13
+
14
+ if FileUtils.cp(file, target, preserve: true)
15
+ file
16
+ else
17
+ raise Exception.new("Copying failed.")
18
+ end
19
+ end
20
+ end
21
+ end
22
+
metadata ADDED
@@ -0,0 +1,72 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guard-copy2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Tim Joseph dumol
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-04-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: guard
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 1.7.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 1.7.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: guard-helpers
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 0.0.3
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 0.0.3
41
+ description: A Guard plugin to watch and copy files
42
+ email: tim@timdumol.com
43
+ executables: []
44
+ extensions: []
45
+ extra_rdoc_files: []
46
+ files:
47
+ - lib/guard/copy.rb
48
+ homepage: https://github.com/TimDumol/guard-stylus
49
+ licenses:
50
+ - Apache 2.0
51
+ metadata: {}
52
+ post_install_message:
53
+ rdoc_options: []
54
+ require_paths:
55
+ - lib
56
+ required_ruby_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ requirements: []
67
+ rubyforge_project:
68
+ rubygems_version: 2.0.3
69
+ signing_key:
70
+ specification_version: 4
71
+ summary: A Guard plugin to watch and copy files
72
+ test_files: []