drop 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +6 -0
- data/README +3 -0
- data/Rakefile +22 -0
- data/bin/drop +39 -0
- data/example.yml +4 -0
- data/lib/drop.rb +0 -0
- metadata +68 -0
data/Manifest
ADDED
data/README
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'rake'
|
2
|
+
|
3
|
+
Version = '0.1.0'
|
4
|
+
|
5
|
+
begin
|
6
|
+
require 'rubygems'
|
7
|
+
gem 'echoe', '=1.3'
|
8
|
+
ENV['RUBY_FLAGS'] = ""
|
9
|
+
require 'echoe'
|
10
|
+
|
11
|
+
Echoe.new('drop', Version) do |p|
|
12
|
+
p.rubyforge_name = 'err'
|
13
|
+
p.summary = "drop is a simple command line utility to help you upload files"
|
14
|
+
p.url = "http://errtheblog.com/"
|
15
|
+
p.author = 'Chris Wanstrath'
|
16
|
+
p.email = "chris@ozmm.org"
|
17
|
+
p.extra_deps << 'net-ssh'
|
18
|
+
p.extra_deps << 'net-sftp'
|
19
|
+
end
|
20
|
+
|
21
|
+
rescue LoadError
|
22
|
+
end
|
data/bin/drop
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
%w( rubygems net/ssh net/sftp yaml ).each { |f| require f }
|
3
|
+
|
4
|
+
begin
|
5
|
+
config = YAML.load_file(File.expand_path('~') + '/.drop.yml')
|
6
|
+
raise if config.empty?
|
7
|
+
rescue
|
8
|
+
yaml = <<-yaml
|
9
|
+
host: hostname.com
|
10
|
+
user: username.com
|
11
|
+
# pass: leave_blank_to_try_ssh_key
|
12
|
+
path: /remote/path
|
13
|
+
url: http://where.it.com/will/show/up
|
14
|
+
yaml
|
15
|
+
puts "# Stick this in ~/.drop.yml: ", yaml
|
16
|
+
exit
|
17
|
+
end
|
18
|
+
|
19
|
+
files = *ARGV
|
20
|
+
host = config['host']
|
21
|
+
user = config['user']
|
22
|
+
path = config['path']
|
23
|
+
url = config['url']
|
24
|
+
|
25
|
+
puts("Pass me a file: $ drop file.png") || exit(0) if files.nil? || files.empty?
|
26
|
+
|
27
|
+
Net::SSH.start(host, user) do |ssh|
|
28
|
+
ssh.sftp.connect do |sftp|
|
29
|
+
files.each do |file|
|
30
|
+
sftp.put_file(file, remote = "#{path.chomp('/')}/#{file}")
|
31
|
+
sftp.setstat(remote, :permissions => 0755)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
files.each do |file|
|
37
|
+
puts file = "#{url.chomp('/')}/#{file}"
|
38
|
+
`echo #{file} | pbcopy`
|
39
|
+
end
|
data/example.yml
ADDED
data/lib/drop.rb
ADDED
File without changes
|
metadata
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.9.0
|
3
|
+
specification_version: 1
|
4
|
+
name: drop
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 0.1.0
|
7
|
+
date: 2007-11-13 00:00:00 -08:00
|
8
|
+
summary: drop is a simple command line utility to help you upload files
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email: chris@ozmm.org
|
12
|
+
homepage: http://errtheblog.com/
|
13
|
+
rubyforge_project: err
|
14
|
+
description: ""
|
15
|
+
autorequire:
|
16
|
+
default_executable:
|
17
|
+
bindir: bin
|
18
|
+
has_rdoc: true
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
24
|
+
version:
|
25
|
+
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
28
|
+
post_install_message:
|
29
|
+
authors:
|
30
|
+
- Chris Wanstrath
|
31
|
+
files:
|
32
|
+
- ./bin/drop
|
33
|
+
- ./example.yml
|
34
|
+
- ./lib/drop.rb
|
35
|
+
- ./Rakefile
|
36
|
+
- ./README
|
37
|
+
- ./Manifest
|
38
|
+
test_files: []
|
39
|
+
|
40
|
+
rdoc_options: []
|
41
|
+
|
42
|
+
extra_rdoc_files: []
|
43
|
+
|
44
|
+
executables:
|
45
|
+
- drop
|
46
|
+
extensions: []
|
47
|
+
|
48
|
+
requirements: []
|
49
|
+
|
50
|
+
dependencies:
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
name: net-ssh
|
53
|
+
version_requirement:
|
54
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">"
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: 0.0.0
|
59
|
+
version:
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: net-sftp
|
62
|
+
version_requirement:
|
63
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: 0.0.0
|
68
|
+
version:
|