guard-autoupload 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -15,6 +15,8 @@ Sample guardfile:
15
15
  # Of these :scp is the preferred one for
16
16
  # its stability.
17
17
  :host => "remote_host",
18
+ # :port => 22, # Uncomment this if you need to set port to
19
+ # something else than default.
18
20
  :user => "username",
19
21
  :password => "password",
20
22
  :remote => "remote_path",
@@ -38,11 +40,9 @@ Dependencies
38
40
  Installation
39
41
  ------------
40
42
 
41
- For now you need to install `guard-autoupload` by building the gem manually
42
- and installing from that:
43
+ Finally the gem has been uploaded to rubygems. Install it with
43
44
 
44
- gem build guard-autoupload.gemspec
45
- gem install guard-autoupload-0.3.4.gem
45
+ gem install guard-autoupload
46
46
 
47
47
  Author
48
48
  ------
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "guard-autoupload"
6
- s.version = "0.3.4"
6
+ s.version = "0.3.5"
7
7
  s.authors = ["Jyrki Lilja"]
8
8
  s.email = ["jyrki dot lilja at outlook dot com"]
9
9
  s.homepage = "https://github.com/jyrkij/guard-autosync"
@@ -15,6 +15,7 @@ module Guard
15
15
  if options[:protocol] == :scp
16
16
  @session = SCPSession.new(
17
17
  options[:host],
18
+ options[:port] || 22,
18
19
  options[:user],
19
20
  options[:password],
20
21
  self
@@ -22,6 +23,7 @@ module Guard
22
23
  elsif options[:protocol] == :sftp
23
24
  @session = SFTPSession.new(
24
25
  options[:host],
26
+ options[:port] || 22,
25
27
  options[:user],
26
28
  options[:password],
27
29
  @instance
@@ -29,6 +31,7 @@ module Guard
29
31
  elsif options[:protocol] == :ftp
30
32
  @session = FTPSession.new(
31
33
  options[:host],
34
+ options[:port] || 21,
32
35
  options[:user],
33
36
  options[:password]
34
37
  )
@@ -3,7 +3,7 @@ require 'net/ftp'
3
3
  class FTPSession
4
4
  RESPAWN_INTERVAL = 60 # in seconds
5
5
 
6
- def initialize(host, user, password)
6
+ def initialize(host, port, user, password)
7
7
  @session = Net::FTP.new
8
8
  @host = host
9
9
  @user = user
@@ -1,8 +1,9 @@
1
1
  require 'net/ssh/simple'
2
2
 
3
3
  class SCPSession
4
- def initialize(host, user, password, caller_ref)
4
+ def initialize(host, port, user, password, caller_ref)
5
5
  @host = host
6
+ @port = port
6
7
  @user = user
7
8
  @password = password.clone
8
9
  @caller = caller_ref
@@ -16,7 +17,7 @@ class SCPSession
16
17
 
17
18
  def upload!(local, remote)
18
19
  begin
19
- ss.scp_put "#{@host}", "#{local}", "#{remote}"
20
+ ss.scp_put "#{@host}", "#{local}", "#{remote}", :port => @port
20
21
  # This shouldn't be run if we get an exception
21
22
  @retry_count = 0
22
23
  rescue Net::SSH::Simple::Error => e
@@ -36,8 +37,8 @@ class SCPSession
36
37
 
37
38
  def mkdir!(dir)
38
39
  begin
39
- check_exists = ss.ssh "#{@host}", "ls -ld #{dir}"
40
- ss.ssh "#{@host}", "mkdir #{dir}" if check_exists.exit_code
40
+ check_exists = ss.ssh "#{@host}", "ls -ld #{dir}", :port => @port
41
+ ss.ssh "#{@host}", "mkdir #{dir}", :port => @port if check_exists.exit_code
41
42
  # This shouldn't be run if we get an exception
42
43
  @retry_count = 0
43
44
  rescue Net::SSH::Simple::Error => e
@@ -57,7 +58,7 @@ class SCPSession
57
58
 
58
59
  def remove!(remote)
59
60
  begin
60
- ss.ssh @host, "rm #{remote}"
61
+ ss.ssh @host, "rm #{remote}", :port => @port
61
62
  # This shouldn't be run if we get an exception
62
63
  @retry_count = 0
63
64
  rescue Net::SSH::Simple::Error => e
@@ -81,7 +82,7 @@ class SCPSession
81
82
 
82
83
  def ls!(dir)
83
84
  begin
84
- ss.ssh @host, "ls #{dir}"
85
+ ss.ssh @host, "ls #{dir}", :port => @port
85
86
  # This shouldn't be run if we get an exception
86
87
  @retry_count = 0
87
88
  rescue Net::SSH::Simple::Error => e
@@ -1,14 +1,16 @@
1
1
  require 'net/sftp'
2
2
 
3
3
  class SFTPSession
4
- def initialize(host, user, password, caller_ref)
4
+ def initialize(host, port, user, password, caller_ref)
5
5
  @host = host
6
+ @port = port
6
7
  @user = user
7
8
  @password = password
8
9
  @session = Net::SFTP.start(
9
10
  @host,
10
11
  @user,
11
- :password => @password
12
+ :password => @password,
13
+ :port => @port
12
14
  )
13
15
  @caller = caller_ref
14
16
  end
@@ -49,7 +51,8 @@ class SFTPSession
49
51
  @session = Net::SFTP.start(
50
52
  @host,
51
53
  @user,
52
- :password => @password
54
+ :password => @password,
55
+ :port => @port
53
56
  )
54
57
  ret = yield
55
58
  else
@@ -6,6 +6,8 @@ opts = {
6
6
  # Of these :scp is the preferred one for
7
7
  # its stability.
8
8
  :host => "remote_host",
9
+ # :port => 22, # Uncomment this if you need to set port to
10
+ # something else than default.
9
11
  :user => "username",
10
12
  :password => "password",
11
13
  :remote => "remote_path",
metadata CHANGED
@@ -1,55 +1,62 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-autoupload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Jyrki Lilja
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-04-12 00:00:00.000000000 Z
12
+ date: 2013-05-06 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: guard
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - '>='
19
+ - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
21
  version: '0'
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - '>='
27
+ - - ! '>='
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: net-sftp
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - '>='
35
+ - - ! '>='
32
36
  - !ruby/object:Gem::Version
33
37
  version: '0'
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - '>='
43
+ - - ! '>='
39
44
  - !ruby/object:Gem::Version
40
45
  version: '0'
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: net-ssh-simple
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
- - - '>='
51
+ - - ! '>='
46
52
  - !ruby/object:Gem::Version
47
53
  version: '0'
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
- - - '>='
59
+ - - ! '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
62
  description: Uses either SFTP or FTP.
@@ -72,25 +79,26 @@ files:
72
79
  - lib/guard/autoupload/templates/Guardfile
73
80
  homepage: https://github.com/jyrkij/guard-autosync
74
81
  licenses: []
75
- metadata: {}
76
82
  post_install_message:
77
83
  rdoc_options: []
78
84
  require_paths:
79
85
  - lib
80
86
  required_ruby_version: !ruby/object:Gem::Requirement
87
+ none: false
81
88
  requirements:
82
- - - '>='
89
+ - - ! '>='
83
90
  - !ruby/object:Gem::Version
84
91
  version: '0'
85
92
  required_rubygems_version: !ruby/object:Gem::Requirement
93
+ none: false
86
94
  requirements:
87
- - - '>='
95
+ - - ! '>='
88
96
  - !ruby/object:Gem::Version
89
97
  version: '0'
90
98
  requirements: []
91
99
  rubyforge_project: guard-autoupload
92
- rubygems_version: 2.0.3
100
+ rubygems_version: 1.8.24
93
101
  signing_key:
94
- specification_version: 4
102
+ specification_version: 3
95
103
  summary: Autoupload plugin - uploads local changes to remote host.
96
104
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 6e16faa42eba0a9ffb386ddb02c5139554cba0ad
4
- data.tar.gz: 89652a63835b3d2869b979423c512e0248bfcecd
5
- SHA512:
6
- metadata.gz: a8206ff9cddcb9bc16e0651362d11aa95ff8501eaf8a06a7319b330e0a9f320c77923596967a45c9dbeebbcd0e392360fce7c74968d9576f6b9f869d88844afa
7
- data.tar.gz: 71655bc8a80248a5fafe4aa7011e14de66d88c01f7fad686d0635a5b4d54c32364d7e4b38911795defcdbb5f0361bda9bbe682ae25cea769a91f12f313b2b0ae