breakneck 1.0.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/.gitignore +1 -0
  2. data/LICENCE +19 -0
  3. data/README.md +8 -0
  4. data/Rakefile +10 -0
  5. data/VERSION +1 -0
  6. data/bin/breakneck +43 -0
  7. metadata +60 -0
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ pkg/*
data/LICENCE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2009 Sam Elliott
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,8 @@
1
+ breakneck
2
+ =========
3
+
4
+ a quick way to serve static html sites immediately. Just serves the files under the directory you run `breakneck` in.
5
+
6
+ Thanks be to [jekyll](http://jekyllrb.com/) for the original code which i have since modified.
7
+
8
+ see LICENCE for licensing details.
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require 'rake'
2
+ require 'jeweler'
3
+
4
+ Jeweler::Tasks.new do |gem|
5
+ gem.name = "breakneck"
6
+ gem.summary = "a quick way to serve static html sites immediately"
7
+ gem.email = "sam@lenary.co.uk"
8
+ gem.homepage = "http://github.com/lenary/breakneck"
9
+ gem.authors = ["Sam Elliott"]
10
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.0
data/bin/breakneck ADDED
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'optparse'
4
+ require 'webrick'
5
+
6
+ options = {}
7
+
8
+ OptionParser.new do |opts|
9
+
10
+ opts.banner = "breakneck: a quick way to serve static html sites immediately"
11
+
12
+ opts.on("--port [PORT]", "Start on a different port (default: 3333)") do |port|
13
+ options[:port] = port.to_i
14
+ end
15
+
16
+ opts.on("--open", "Open in the default browser") do
17
+ options[:open] = true
18
+ end
19
+
20
+ end.parse!
21
+
22
+ options[:port] ||= 3333
23
+ options[:open] ||= false
24
+
25
+ server = WEBrick::HTTPServer.new(
26
+ :Port => options[:port],
27
+ :DocumentRoot => Dir.pwd
28
+ )
29
+
30
+ thread = Thread.new do
31
+ server.start
32
+ end
33
+
34
+ if options[:open]
35
+ host_string = "http://localhost:#{options[:port]}/"
36
+ system("open #{host_string} || firefox #{host_string}")
37
+ end
38
+
39
+ trap("INT") do
40
+ server.shutdown
41
+ end
42
+
43
+ thread.join
metadata ADDED
@@ -0,0 +1,60 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: breakneck
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Sam Elliott
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-12-05 00:00:00 +01:00
13
+ default_executable: breakneck
14
+ dependencies: []
15
+
16
+ description:
17
+ email: sam@lenary.co.uk
18
+ executables:
19
+ - breakneck
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README.md
24
+ files:
25
+ - .gitignore
26
+ - LICENCE
27
+ - README.md
28
+ - Rakefile
29
+ - VERSION
30
+ - bin/breakneck
31
+ has_rdoc: true
32
+ homepage: http://github.com/lenary/breakneck
33
+ licenses: []
34
+
35
+ post_install_message:
36
+ rdoc_options:
37
+ - --charset=UTF-8
38
+ require_paths:
39
+ - lib
40
+ required_ruby_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: "0"
45
+ version:
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: "0"
51
+ version:
52
+ requirements: []
53
+
54
+ rubyforge_project:
55
+ rubygems_version: 1.3.5
56
+ signing_key:
57
+ specification_version: 3
58
+ summary: a quick way to serve static html sites immediately
59
+ test_files: []
60
+