binary42-export-http 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 (4) hide show
  1. data/README +1 -0
  2. data/bin/export-http +15 -0
  3. data/lib/export_http.rb +21 -0
  4. metadata +55 -0
data/README ADDED
@@ -0,0 +1 @@
1
+ Share files over HTTP easily with one command.
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Support running this as a gem or for development
4
+ if $0 =~ /-dev$/
5
+ require 'rubygems'
6
+ $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib')
7
+ else
8
+ require 'rubygems'
9
+ end
10
+
11
+ require 'webrick'
12
+
13
+ require 'export_http'
14
+
15
+ ExportHTTP.run
@@ -0,0 +1,21 @@
1
+ class ExportHTTP < WEBrick::HTTPServer
2
+
3
+ def self.run
4
+ dir = Dir.pwd
5
+ port = (dir.hash % 1000) + 6000
6
+ host = `hostname`
7
+ host = '0.0.0.0' if host == ''
8
+ @server = self.new(
9
+ :DocumentRoot => dir,
10
+ :Port => port,
11
+ :Host => host)
12
+ trap("INT") {self.kill}
13
+ puts "Sharing #{File.expand_path(dir)} on http://#{host}:#{port}/"
14
+ @server.start
15
+ end
16
+
17
+ def self.kill
18
+ @server.stop
19
+ end
20
+
21
+ end
metadata ADDED
@@ -0,0 +1,55 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: binary42-export-http
3
+ version: !ruby/object:Gem::Version
4
+ version: "1.0"
5
+ platform: ruby
6
+ authors:
7
+ - Brian Mitchell
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-03-26 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description:
17
+ email: brian.mitchell@excoventures.com
18
+ executables:
19
+ - export-http
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
24
+ files:
25
+ - README
26
+ - lib/export_http.rb
27
+ - bin/export-http
28
+ has_rdoc: false
29
+ homepage: http://export-http.tarball.me/
30
+ post_install_message:
31
+ rdoc_options: []
32
+
33
+ require_paths:
34
+ - lib
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: "0"
40
+ version:
41
+ required_rubygems_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: "0"
46
+ version:
47
+ requirements: []
48
+
49
+ rubyforge_project:
50
+ rubygems_version: 1.2.0
51
+ signing_key:
52
+ specification_version: 2
53
+ summary: Share files over HTTP wih a single command
54
+ test_files: []
55
+