guard-remote-sync 0.0.4 → 0.0.5

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,4 +1,4 @@
1
- #Guard::RemoteSync [![Build Status](https://secure.travis-ci.org/pmcjury/guard-remote-sync.png)](http://travis-ci.org/pmcjury/guard-remote-sync)
1
+ #Guard::RemoteSync [![Build Status](https://secure.travis-ci.org/pmcjury/guard-remote-sync.png)](http://travis-ci.org/pmcjury/guard-remote-sync) [![Dependency Status](https://gemnasium.com/pmcjury/guard-remote-sync.png)](https://gemnasium.com/pmcjury/guard-remote-sync) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/pmcjury/guard-remote-sync)
2
2
 
3
3
  ## Install
4
4
 
@@ -84,7 +84,9 @@ possible to be more verbose
84
84
  :destination => nil # the directory to sync to
85
85
  :user => nil # the user to use if remote syncing to another machine
86
86
  :remote_address => nil # the remote address to the other machine ip|url
87
+ :remote_port => nil # the port to use for ssh connetions
87
88
  :ssh => false # see rsync options : "$ man rsync"
89
+ :auth_key => nil # the identity file to use for ssh authentication
88
90
  :cli_options => nil # used if you want to pass your own rsyn command
89
91
  :archive => true # see rsync options : "$ man rsync"
90
92
  :recursive => true # see rsync options : "$ man rsync"
@@ -97,9 +99,9 @@ possible to be more verbose
97
99
  :progress => true # see rsync options : "$ man rsync"
98
100
  :sync_on_start => false # rsycn when the guard starts instead of waiting for a watcher to trigger guard
99
101
  :dry_run => false # see rsync options : "$ man rsync"
100
- :cvs_exclude => true # see rsync options : "$ man rsync"
102
+ :cvs_exclude => false # see rsync options : "$ man rsync"
101
103
  :password_file => nil # see rsync options : "$ man rsync"
102
- :timeout => 10 # see rsync options : "$ man rsync"
104
+ :timeout => 9999 # see rsync options : "$ man rsync"
103
105
  ```
104
106
 
105
107
  Development
@@ -19,6 +19,7 @@ module Guard
19
19
  :destination => nil,
20
20
  :user => nil,
21
21
  :remote_address => nil,
22
+ :remote_port => nil,
22
23
  :ssh => false,
23
24
  :cli_options => nil,
24
25
  :archive => true,
@@ -29,12 +30,13 @@ module Guard
29
30
  :include_from => nil,
30
31
  :exclude => nil,
31
32
  :exclude_from => ".rsync-filter",
33
+ :auth_key => nil,
32
34
  :progress => true,
33
35
  :sync_on_start => false,
34
36
  :dry_run => false,
35
- :cvs_exclude => true,
37
+ :cvs_exclude => false,
36
38
  :password_file => nil,
37
- :timeout => 10
39
+ :timeout => 9999
38
40
  }.merge(options)
39
41
 
40
42
  @source = Source.new(options[:source])
@@ -78,8 +78,10 @@ module Guard
78
78
  UI.debug "Guard::RemoteSync building rsync options from specified options" if @options[:verbose]
79
79
  @command_options = build_options
80
80
  @remote_options = check_remote_options
81
+ @ssh_options = check_ssh_options
81
82
  destination = @remote_options.nil? ? "#{@destination.directory}" : "#{@remote_options}:#{@destination.directory}"
82
83
  command = "#{rsync_command} #{@command_options}#{@source.directory} #{destination}"
84
+ command << " #{@ssh_options}" unless @ssh_options.nil?
83
85
  end
84
86
  command
85
87
  end
@@ -120,6 +122,20 @@ module Guard
120
122
  value
121
123
  end
122
124
 
125
+ def check_ssh_options
126
+ unless @options[:remote_port].nil? && @options[:auth_key].nil?
127
+ raise ":remote_port is an invalid option for local destinations" if !@options[:remote_port].nil? && @remote_options.nil?
128
+ raise ":auth_key is an invalid option for local destinations" if !@options[:auth_key].nil? && @remote_options.nil?
129
+ value = "-e \"ssh"
130
+ value << " -i #{@options[:auth_key]}" if !@options[:auth_key].nil?
131
+ value << " -p #{@options[:remote_port]}" if !@options[:remote_port].nil?
132
+ value << "\""
133
+ else
134
+ value = nil
135
+ end
136
+ value
137
+ end
138
+
123
139
  def check_boolean_option(option)
124
140
  @options[option] ? "--#{option.to_s.gsub(/_/, '-')}" : nil
125
141
  end
@@ -7,5 +7,5 @@ guard 'remote-sync',
7
7
  :cli => "--color",
8
8
  :sync_on_start => true do
9
9
 
10
- watch(%r{^.+\.(js|xml|php|class|config)$})
10
+ watch(%r{^.+\.(.*)$})
11
11
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module RemoteSyncVersion
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-remote-sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-06 00:00:00.000000000 Z
12
+ date: 2012-11-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: guard
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.1.0
21
+ version: 1.5.3
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,55 +26,71 @@ dependencies:
26
26
  requirements:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 1.1.0
29
+ version: 1.5.3
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: bundler
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ! '>='
35
+ - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: '0'
37
+ version: '1.0'
38
38
  type: :development
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ! '>='
43
+ - - ~>
44
44
  - !ruby/object:Gem::Version
45
- version: '0'
45
+ version: '1.0'
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: rspec
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
51
- - - ! '>='
51
+ - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: 0.9.2.2
53
+ version: 2.11.0
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
59
- - - ! '>='
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 0.9.2.2
61
+ version: 2.11.0
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: guard-rspec
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
67
- - - ! '>='
67
+ - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: '0'
69
+ version: 2.1.0
70
70
  type: :development
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
- - - ! '>='
75
+ - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: '0'
77
+ version: 2.1.0
78
+ - !ruby/object:Gem::Dependency
79
+ name: rspec-mocks
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: 2.11.3
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 2.11.3
78
94
  description: Guard::RemoteSync to automatically rsync your files.
79
95
  email:
80
96
  - pmcjury@mcjent.com
@@ -82,11 +98,11 @@ executables: []
82
98
  extensions: []
83
99
  extra_rdoc_files: []
84
100
  files:
85
- - lib/guard/remote-sync.rb
86
101
  - lib/guard/remote-sync/command.rb
87
- - lib/guard/remote-sync/version.rb
88
- - lib/guard/remote-sync/templates/Guardfile
89
102
  - lib/guard/remote-sync/source.rb
103
+ - lib/guard/remote-sync/templates/Guardfile
104
+ - lib/guard/remote-sync/version.rb
105
+ - lib/guard/remote-sync.rb
90
106
  - LICENSE
91
107
  - README.md
92
108
  homepage: https://github.com/pmcjury/guard-remote-sync