steamy 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/steamy.rb +14 -3
  2. data/lib/steamy/version.rb +1 -1
  3. metadata +4 -4
@@ -21,9 +21,20 @@ module Steamy
21
21
  end
22
22
 
23
23
  @ssh = "ssh #{@host}"
24
- @user = (@connections[@host]['user'].nil?) ? '' : "-u #{@connections[@host]['user']}"
25
- @password = (@connections[@host]['password'].nil?) ? '' : "-p\"#{@connections[@host]['password']}\""
26
- @database = database
24
+ @user = (@connections[@host]['user'].empty?) ? '' : "-u #{@connections[@host]['user']}"
25
+ @password = (@connections[@host]['password'].empty?) ? '' : "-p\"#{@connections[@host]['password']}\""
26
+ @database = set_database(host, database)
27
+ end
28
+
29
+ def set_database(host, database)
30
+ if host.nil? || @connections[@host]['database'].nil? || database
31
+ database = database
32
+ else
33
+ puts "This user can only access '#{@connections[@host]['database']}', update credentials to access other databases or specify database to dump."
34
+ exit 1
35
+ end
36
+
37
+ database
27
38
  end
28
39
 
29
40
  def remote_exec(command)
@@ -1,3 +1,3 @@
1
1
  module Steamy
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: steamy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ben Ubois
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-22 00:00:00 Z
18
+ date: 2011-09-27 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: plist