drop 0.1.0

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.
Files changed (7) hide show
  1. data/Manifest +6 -0
  2. data/README +3 -0
  3. data/Rakefile +22 -0
  4. data/bin/drop +39 -0
  5. data/example.yml +4 -0
  6. data/lib/drop.rb +0 -0
  7. metadata +68 -0
@@ -0,0 +1,6 @@
1
+ ./bin/drop
2
+ ./example.yml
3
+ ./lib/drop.rb
4
+ ./Rakefile
5
+ ./README
6
+ ./Manifest
data/README ADDED
@@ -0,0 +1,3 @@
1
+ > drop
2
+ -> chris wanstrath
3
+ --> chris@ozmm.org
@@ -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
@@ -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
@@ -0,0 +1,4 @@
1
+ host: errtheblog.com
2
+ user: deploy
3
+ path: /var/www/ozmm
4
+ url : http://ozmm.org
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: