jobim 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c53a0409767a1c2ba03e60a52afdecfe7e82958c
4
+ data.tar.gz: 08dacd1d9fae76790d526405a636ce77f71d5dc0
5
+ SHA512:
6
+ metadata.gz: be8a4079c34e8b2afd11d78836c41ad333f656d8daba9c18d05708eddb699305f2ec692e0e93fe0c587c4e48f65044de75f72c6c9c5d87d14a27e16eee7bf8f6
7
+ data.tar.gz: e4963b67d861f0ec4dd2771d2229a339d7d4a0dde4d2b37696b483846813aed32816bc691197ce0af2bb60a41db6c354bd52756dcea1368f3e4ec22ccfb1d560
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in jobim.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+ Copyright © 2013 Zachary Elliott <zach@nyu.edu>
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the “Software”), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in
12
+ all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Jobim
2
+
3
+ Jobim is utility for turning a directory into a static HTTP server.
4
+
5
+ ## Installation
6
+
7
+ ``` shell
8
+ gem install jobim
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ``` shell
14
+ jobim
15
+ ```
16
+
17
+ View at `http://localhost:5634`
18
+
19
+ ## Contributing
20
+
21
+ 1. Fork it
22
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
23
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
24
+ 4. Push to the branch (`git push origin my-new-feature`)
25
+ 5. Create new Pull Request
26
+
27
+ ## Copyright
28
+
29
+ Copyright (c) 2013 Zachary Elliott. See LICENSE for further details.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/jobim ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'pathname'
4
+ file = Pathname.new(__FILE__).realpath
5
+
6
+ $:.unshift File.expand_path("../../lib", file)
7
+
8
+ require 'jobim'
9
+
10
+ opts = Jobim::CLI.run!(*ARGV)
11
+
12
+ exit if opts.nil?
13
+
14
+ require 'rack'
15
+ require 'rack-rewrite'
16
+
17
+ app = Rack::Builder.new do
18
+ use Rack::Rewrite do
19
+ rewrite '/', '/index.html'
20
+ end
21
+ use Rack::CommonLogger, STDOUT
22
+ run Rack::Directory.new(opts[:dir])
23
+ end
24
+
25
+ puts ">>> Serving #{opts[:dir]}"
26
+
27
+ Rack::Handler::Thin.run app, :Port => 5634
data/jobim.gemspec ADDED
@@ -0,0 +1,33 @@
1
+ # coding: utf-8
2
+
3
+ $:.unshift File.expand_path("../lib", __FILE__)
4
+ require 'jobim/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "jobim"
8
+ spec.version = Jobim::VERSION
9
+
10
+ spec.authors = ["Zachary Elliott"]
11
+ spec.email = ["zach@nyu.edu"]
12
+
13
+ spec.summary = %q{Popup HTTP Server}
14
+ spec.description = %q{Popup HTTP Server for serving static content.}
15
+
16
+ spec.homepage = "https://github.com/zellio/jobim"
17
+
18
+ spec.license = "MIT"
19
+
20
+ spec.files = `git ls-files`.split($/)
21
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
22
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
23
+
24
+ spec.require_paths = ["lib"]
25
+
26
+ spec.add_development_dependency "bundler", "~> 1.3"
27
+ spec.add_development_dependency "rake", "~> 10.1"
28
+ spec.add_development_dependency 'yard', "~> 0.8"
29
+ spec.add_development_dependency 'redcarpet', "~> 3.0"
30
+ spec.add_development_dependency 'github-markup', "~> 0.7"
31
+
32
+ spec.add_runtime_dependency "thin", "~> 1.5"
33
+ end
data/lib/jobim/cli.rb ADDED
@@ -0,0 +1,51 @@
1
+
2
+ require 'optparse'
3
+
4
+ class Jobim::CLI
5
+
6
+ attr_reader :parser, :options
7
+
8
+ def self.run!(*args, &opts)
9
+ cli = Jobim::CLI.new
10
+ begin
11
+ cli.parse(args)
12
+ cli.options
13
+ rescue
14
+ puts cli.help
15
+ exit
16
+ end
17
+ end
18
+
19
+ def options
20
+ @options ||= { :dir => Dir.pwd }
21
+ end
22
+
23
+ def parser
24
+ @parser ||= OptionParser.new do |o|
25
+ o.banner = "jobim - TODO: FINISH ME"
26
+ o.separator ""
27
+ o.separator "Usage: jobim [OPTION]... [DIRECTORY]"
28
+ o.separator ""
29
+ # o.separator "Specific options:"
30
+ # o.separator ""
31
+ o.separator "General options:"
32
+ o.on "-h", "--help", "Display this help message." do
33
+ puts help
34
+ exit
35
+ end
36
+ o.on "--version", "Display the version number" do
37
+ options[:version] = Jobim::VERSION
38
+ puts options[:version]
39
+ exit
40
+ end
41
+ end
42
+ end
43
+
44
+ def parse(args)
45
+ parser.parse!(args)
46
+ end
47
+
48
+ def help
49
+ parser.to_s
50
+ end
51
+ end
@@ -0,0 +1,3 @@
1
+ module Jobim
2
+ VERSION = "0.1.0"
3
+ end
data/lib/jobim.rb ADDED
@@ -0,0 +1,7 @@
1
+
2
+ module Jobim
3
+
4
+ require "jobim/version"
5
+ require "jobim/cli"
6
+
7
+ end
metadata ADDED
@@ -0,0 +1,140 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jobim
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Zachary Elliott
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-09-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '10.1'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '10.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: yard
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '0.8'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '0.8'
55
+ - !ruby/object:Gem::Dependency
56
+ name: redcarpet
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: github-markup
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: '0.7'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '0.7'
83
+ - !ruby/object:Gem::Dependency
84
+ name: thin
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: '1.5'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: '1.5'
97
+ description: Popup HTTP Server for serving static content.
98
+ email:
99
+ - zach@nyu.edu
100
+ executables:
101
+ - jobim
102
+ extensions: []
103
+ extra_rdoc_files: []
104
+ files:
105
+ - .gitignore
106
+ - Gemfile
107
+ - LICENSE
108
+ - README.md
109
+ - Rakefile
110
+ - bin/jobim
111
+ - jobim.gemspec
112
+ - lib/jobim.rb
113
+ - lib/jobim/cli.rb
114
+ - lib/jobim/version.rb
115
+ homepage: https://github.com/zellio/jobim
116
+ licenses:
117
+ - MIT
118
+ metadata: {}
119
+ post_install_message:
120
+ rdoc_options: []
121
+ require_paths:
122
+ - lib
123
+ required_ruby_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - '>='
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - '>='
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ requirements: []
134
+ rubyforge_project:
135
+ rubygems_version: 2.1.4
136
+ signing_key:
137
+ specification_version: 4
138
+ summary: Popup HTTP Server
139
+ test_files: []
140
+ has_rdoc: