photocopier 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  spec
2
+ pkg
data/README.md CHANGED
@@ -39,6 +39,9 @@ ssh.put('foobar!', 'remote_file.txt')
39
39
  # uploads a file
40
40
  ssh.put('./local_file.txt', 'remote_file.txt')
41
41
 
42
+ # deletes a file
43
+ ssh.delete('remote_file.txt')
44
+
42
45
  # mirros the remote directory into the local machine (needs rsync on the local machine)
43
46
  ssh.get_directory('remote_dir', './local_dir')
44
47
 
@@ -60,9 +63,9 @@ all).
60
63
  }
61
64
  ```
62
65
  For performance reasons, the `.get_directory` and `.put_directory` commands make
63
- use of `lftp`.
66
+ use of `lftp`, so you need to have it installed on your machine.
64
67
 
65
- ## SSH Gotchas
68
+ ## SSH
66
69
 
67
70
  `Photocopier::SSH.new` accepts the following parameters (you DON'T need
68
71
  to pass them all).
@@ -82,14 +85,16 @@ to pass them all).
82
85
  }
83
86
  ```
84
87
 
85
- **TL;DR:** Avoid specifying passwords on Photocopier::SSH, and use more secure
86
- and reliable ways to authenticate (`ssh-copy-id` anyone?).
88
+ For performance reasons, the `.get_directory` and `.put_directory` commands make
89
+ use of `rsync`, so you need to have it installed on your machine.
90
+
91
+ ### Password gotchas
92
+ **TL;DR:** Avoid specifying the `password` argument on Photocopier::SSH, and
93
+ use more secure and reliable ways to authenticate (`ssh-copy-id` anyone?).
87
94
 
88
- The passwords specified will be used during `.get` and `.put` commands (which use
89
- the pure-ruby `net-ssh` gem). For performance reasons, the `.get_directory` and
90
- `.put_directory` commands make use of `rsync`. There's no easy way to pass SSH
91
- passwords to `rsync`: the only way is to install a tool called [`sshpass`](http://sourceforge.net/projects/sshpass/)
92
- on your machine (and on the gateway machine, if you also need to specify the password
95
+ There's no easy way to pass SSH passwords to `rsync`: the only way is to install
96
+ a tool called [`sshpass`](http://sourceforge.net/projects/sshpass/) on your
97
+ machine (and on the gateway machine, if you also need to specify the password
93
98
  of the final machine).
94
99
 
95
100
  On Linux, you can install it with your standard package manager. On Mac, you can
@@ -7,6 +7,7 @@ require 'photocopier/adapter'
7
7
 
8
8
  module Photocopier
9
9
  class SSH < Adapter
10
+ attr_reader :session
10
11
 
11
12
  def initialize(options)
12
13
  @options = options
@@ -1,3 +1,3 @@
1
1
  module Photocopier
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: photocopier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: