guard-sync 0.2.0 → 0.2.2

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.
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Guard::Sync
2
2
 
3
- TODO: Write a gem description
3
+ Watches a directory for changes and synchronizes those changed to a remote directory (using rsync).
4
+
5
+ NOTE: USE AT YOUR OWN RISK! Very little testing has been done with this plugin!
4
6
 
5
7
  ## Installation
6
8
 
@@ -18,7 +20,31 @@ Or install it yourself as:
18
20
 
19
21
  ## Usage
20
22
 
21
- TODO: Write usage instructions here
23
+ `$ guard init guard-sync`
24
+
25
+ Change options as needed in the Guardfile (list of options below)
26
+
27
+ `$ guard`
28
+
29
+ ## Options (and their defaults)
30
+
31
+ :host => 'dev'
32
+ :src => '.'
33
+ :dest => 'app'
34
+ :run_on_start => false
35
+ :archive => false
36
+ :recursive => true
37
+ :compress => true
38
+ :permissions => true
39
+ :delete => false
40
+ :verbose => false
41
+ :quiet => true
42
+
43
+ ## TODO
44
+
45
+ Better errors
46
+
47
+ Ensure valid paths before running
22
48
 
23
49
  ## Contributing
24
50
 
@@ -27,3 +53,7 @@ TODO: Write usage instructions here
27
53
  3. Commit your changes (`git commit -am 'Add some feature'`)
28
54
  4. Push to the branch (`git push origin my-new-feature`)
29
55
  5. Create new Pull Request
56
+
57
+ =======
58
+ guard-sync
59
+ ==========
@@ -6,7 +6,7 @@ module Guard
6
6
  def initialize(watchers = [], options = {})
7
7
  super
8
8
  @options = {
9
- :all_on_start => false,
9
+ :run_on_start => false,
10
10
  :archive => false,
11
11
  :recursive => true,
12
12
  :compress => true,
@@ -20,11 +20,10 @@ module Guard
20
20
  end
21
21
 
22
22
  def start
23
- run_all if @options[:all_on_start]
23
+ run_all if @options[:run_on_start]
24
24
  end
25
25
 
26
26
  def run_all
27
- # UI.info "Guard::Sync is running" if @opts
28
27
  UI.info "#{@action}d #{@options[:include]}"
29
28
  `#{@command}` if @opts
30
29
  end
@@ -38,6 +37,19 @@ module Guard
38
37
  run_all
39
38
  end
40
39
 
40
+ def run_on_changes paths
41
+ @action = "modifie"
42
+ @options[:exclude] = '*'
43
+ @options[:include] = paths.to_s[1..-2]
44
+ @options[:delete] = false
45
+ update
46
+ run_all
47
+ end
48
+
49
+ def run_on_modifications paths
50
+ run_on_changes paths
51
+ end
52
+
41
53
  def run_on_removals paths
42
54
  @action = "remove"
43
55
  @options[:exclude] = '*'
@@ -1,3 +1,3 @@
1
- guard 'sync', :all_on_start => false, :host => 'dev', :dest => 'app' do
1
+ guard 'sync', :run_on_start => false, :host => 'dev', :dest => 'app' do
2
2
  watch(%r{.*})
3
3
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  class SyncVersion
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: