httplz 1.0.1

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 (8) hide show
  1. data/.gitignore +48 -0
  2. data/.rvmrc +1 -0
  3. data/LICENSE.txt +20 -0
  4. data/README.md +46 -0
  5. data/Rakefile +2 -0
  6. data/bin/httplz +25 -0
  7. data/httplz.gemspec +16 -0
  8. metadata +55 -0
data/.gitignore ADDED
@@ -0,0 +1,48 @@
1
+ # rcov generated
2
+ coverage
3
+
4
+ # rdoc generated
5
+ rdoc
6
+
7
+ # yard generated
8
+ doc
9
+ .yardoc
10
+
11
+ # bundler
12
+ .bundle
13
+
14
+ # jeweler generated
15
+ pkg
16
+
17
+ # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
18
+ #
19
+ # * Create a file at ~/.gitignore
20
+ # * Include files you want ignored
21
+ # * Run: git config --global core.excludesfile ~/.gitignore
22
+ #
23
+ # After doing this, these files will be ignored in all your git projects,
24
+ # saving you from having to 'pollute' every project you touch with them
25
+ #
26
+ # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
27
+ #
28
+ # For MacOS:
29
+ #
30
+ #.DS_Store
31
+
32
+ # For TextMate
33
+ #*.tmproj
34
+ #tmtags
35
+
36
+ # For emacs:
37
+ #*~
38
+ #\#*
39
+ #.\#*
40
+
41
+ # For vim:
42
+ #*.swp
43
+
44
+ # For redcar:
45
+ #.redcar
46
+
47
+ # For rubinius:
48
+ #*.rbc
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm gemset use httplz
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Sean Moon
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # httplz
2
+
3
+ easy http file serving
4
+
5
+ ## dependencies
6
+
7
+ - ruby
8
+
9
+ ## why?
10
+
11
+ test your HTML files without copying/symlinking to where your webserver is configured to serve content from.
12
+
13
+ also, for those of us who are too lazy to type/remember `python -m SimpleHTTPServer` as that does pretty much the same thing this does.
14
+
15
+ ## example run
16
+
17
+ $ pwd
18
+ /Users/moon/workspace/seanmoon.com
19
+ $ httplz
20
+ Document root is /Users/moon/workspace/seanmoon.com, using port 2999
21
+ [2011-07-22 06:47:31] INFO WEBrick 1.3.10
22
+ [2011-07-22 06:47:31] INFO ruby 1.9.2 (2011-02-18) [x86_64-darwin10.8.0]
23
+ [2011-07-22 06:47:31] INFO WEBrick::HTTPServer#start: pid=88585 port=2999
24
+
25
+ ## installation
26
+
27
+ for system wide use
28
+
29
+ $ cd /usr/local/bin && curl -L http://github.com/seanmoon/httplz/tarball/master | gunzip | tar xvf - --strip=2
30
+
31
+ otherwise (you'll need rvm or your rubygem installation's bin directory in your PATH)
32
+
33
+ $ gem install httplz
34
+
35
+ ## usage
36
+
37
+ Usage: httplz [directory] [options]
38
+ -p, --port [PORT] Port to run WEBrick on
39
+ -h, --help Print this help text
40
+
41
+ - if no directory is specified, the current working directory will be used.
42
+ - the default port is 2999
43
+
44
+ ## thanks
45
+
46
+ - [Gnome's guide to WEBRick](http://microjet.ath.cx/webrickguide/html/html_webrick.html)
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
data/bin/httplz ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'webrick'
4
+ require 'optparse'
5
+
6
+ port = 2999
7
+
8
+ OptionParser.new do |o|
9
+ o.banner = "Usage: httplz [directory] [options]"
10
+ o.on("-p", "--port [PORT]", "Port to run WEBrick on (default 2999)") { |p| port = p }
11
+ o.on("-h", "--help", "Print this help text") { puts o; exit }
12
+ end.parse!
13
+
14
+ doc_root = Dir.pwd
15
+ if ARGV[0]
16
+ doc_root = File.expand_path(ARGV[0]) unless ARGV[0] == ("-p" || "--port")
17
+ end
18
+
19
+ abort "No directory #{doc_root}, exiting..." unless File.directory?(doc_root)
20
+ puts "Document root is #{doc_root}, using port #{port}"
21
+
22
+ server = WEBrick::HTTPServer.new(:DocumentRoot => doc_root, :Port => port)
23
+ ['INT', 'TERM'].each { |signal| trap(signal) { server.shutdown } }
24
+
25
+ server.start
data/httplz.gemspec ADDED
@@ -0,0 +1,16 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "httplz"
5
+ s.version = "1.0.1"
6
+ s.date = Time.now.strftime('%Y-%m-%d')
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ["Sean Moon"]
9
+ s.email = ["seanmoon@seanmoon.com"]
10
+ s.homepage = "http://github.com/seanmoon/httplz"
11
+ s.summary = %Q{easy http file serving}
12
+ s.description = %Q{serve the files in the specified directory over http with a simple command}
13
+ s.has_rdoc = false
14
+ s.files = `git ls-files`.split("\n")
15
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
16
+ end
metadata ADDED
@@ -0,0 +1,55 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: httplz
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Sean Moon
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-07-22 00:00:00.000000000 -04:00
13
+ default_executable:
14
+ dependencies: []
15
+ description: serve the files in the specified directory over http with a simple command
16
+ email:
17
+ - seanmoon@seanmoon.com
18
+ executables:
19
+ - httplz
20
+ extensions: []
21
+ extra_rdoc_files: []
22
+ files:
23
+ - .gitignore
24
+ - .rvmrc
25
+ - LICENSE.txt
26
+ - README.md
27
+ - Rakefile
28
+ - bin/httplz
29
+ - httplz.gemspec
30
+ has_rdoc: true
31
+ homepage: http://github.com/seanmoon/httplz
32
+ licenses: []
33
+ post_install_message:
34
+ rdoc_options: []
35
+ require_paths:
36
+ - lib
37
+ required_ruby_version: !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ! '>='
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ required_rubygems_version: !ruby/object:Gem::Requirement
44
+ none: false
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ requirements: []
50
+ rubyforge_project:
51
+ rubygems_version: 1.6.2
52
+ signing_key:
53
+ specification_version: 3
54
+ summary: easy http file serving
55
+ test_files: []