growl-transfer 0.0.3 → 0.0.4

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -7,8 +7,16 @@ Feature: growl-down downloads a file via scp
7
7
  And not have to watch or check the progress
8
8
 
9
9
  Scenario: Download file assuming ssh keyless authentication
10
- Given I have an available server "ctshryock.com"
11
- And "growl-down-test/unicorns.zip" as the file name
10
+ Given I have ssh keyless auth setup on "ctshryock.com"
11
+ And specify "growl-down-test/unicorns.zip" as the file name
12
+ When I run "download"
13
+ Then I should see "Finished!"
14
+ And TEST_DIR should contains "unicorns.zip" file
15
+
16
+ Scenario: Download file assuming ssh keyless auth, but specify a username
17
+ Given I have ssh keyless auth setup on "ctshryock.com"
18
+ And I specify "clint" as the username before the url
19
+ And specify "growl-down-test/unicorns.zip" as the file name
12
20
  When I run "download"
13
21
  Then I should see "Finished!"
14
22
  And TEST_DIR should contains "unicorns.zip" file
@@ -25,15 +25,19 @@ def output
25
25
  @output ||= Output.new
26
26
  end
27
27
 
28
- Given /^I have an available server "([^"]*)"$/ do |remote_host|
28
+ Given /^I have ssh keyless auth setup on "([^"]*)"$/ do |remote_host|
29
29
  @remote = []
30
30
  @remote << remote_host
31
31
  end
32
32
 
33
- When /^"([^"]*)" as the file name$/ do |remote_path|
33
+ Given /^specify "([^"]*)" as the file name$/ do |remote_path|
34
34
  @remote << remote_path
35
35
  end
36
36
 
37
+ Given /^I specify "([^"]*)" as the username before the url$/ do |arg1|
38
+ @remote[0] = 'clint' + '@' + @remote[0]
39
+ end
40
+
37
41
  When /^I run "([^"]*)"$/ do |arg1|
38
42
  gd_scp = GrowlTransfer::GTScp.new(output)
39
43
  gd_scp.download(@remote.join(':'), TEST_DIR)
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{growl-transfer}
8
- s.version = "0.0.3"
8
+ s.version = "0.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Clint Shryock"]
@@ -8,7 +8,16 @@ module GrowlTransfer
8
8
  @output.puts "Downloading #{remote}"
9
9
  params = remote.split(":")
10
10
  file = params.last.split("/").last
11
- Net::SCP.start(params[0], ENV['USER']) do |scp|
11
+
12
+ if params[0].include? '@'
13
+ server = params[0].split('@').last
14
+ user = params[0].split('@').first
15
+ else
16
+ server = params[0]
17
+ user = ENV['USER']
18
+ end
19
+
20
+ Net::SCP.start(server, user) do |scp|
12
21
  scp.download!(params[1], local_path, {:recursive => true, :verbose => true}) do |ch, name, sent, total|
13
22
  # => progress?
14
23
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: growl-transfer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Clint Shryock