serve_dir 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.mkd +1 -0
- data/bin/serve_dir +8 -3
- data/lib/serve_dir/version.rb +1 -1
- data/serve_dir.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f30aabe0fa534b80afb4eb9a6140f03cb40792f0
|
4
|
+
data.tar.gz: 11945a30c504710436d036498c54668fa3542a5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b9f3c1a12ce0768ce132b1f16458d4c2bb2f9b9843e8a9da2eab37326c9c5bc0bcf3a84f6334f26eecbb04bd9c0daf07fb559981420f68eb0bd54423bcf5eb6
|
7
|
+
data.tar.gz: 9f13f4a6c3b75d15ca56fc7ef5b32b2a0ba8eb86c922f77368b4b23a1a586aba0249cce9048a6b49ca892944f47ec02c2bc8cfe3a869c16fe7f69765434e9b1c
|
data/Gemfile.lock
CHANGED
@@ -3,7 +3,7 @@ PATH
|
|
3
3
|
specs:
|
4
4
|
serve_dir (0.2.0)
|
5
5
|
launchy (~> 2.3.0)
|
6
|
-
rack (~> 1.
|
6
|
+
rack (~> 1.5)
|
7
7
|
slop (~> 2)
|
8
8
|
|
9
9
|
GEM
|
@@ -12,7 +12,7 @@ GEM
|
|
12
12
|
addressable (2.3.5)
|
13
13
|
launchy (2.3.0)
|
14
14
|
addressable (~> 2.3)
|
15
|
-
rack (1.
|
15
|
+
rack (1.5.2)
|
16
16
|
slop (2.4.4)
|
17
17
|
|
18
18
|
PLATFORMS
|
data/README.mkd
CHANGED
@@ -25,6 +25,7 @@ Options:
|
|
25
25
|
* -p, --port=PORT : http port (default: 8181)
|
26
26
|
* --path=PATH : http path to open with browser (default: '/')
|
27
27
|
* -O, --no-open : don't open browser (default: open browser automatically)
|
28
|
+
* -I, --rack-index : don't complement 'index.html' on startup
|
28
29
|
* -h, --help : show help
|
29
30
|
|
30
31
|
License
|
data/bin/serve_dir
CHANGED
@@ -9,6 +9,7 @@ opts = Slop.parse!(ARGV){
|
|
9
9
|
on "-p", "--port=", 'http port (default: 8181)', as: :int, default: 8181
|
10
10
|
on "--path=", 'http path to open with browser (default: /)', default: '/'
|
11
11
|
on "-O", "--no-open", "don't open browser"
|
12
|
+
on "-I", "--rack-index", "don't complement `index.html` on startup"
|
12
13
|
on "-h", "--help"
|
13
14
|
}
|
14
15
|
if ARGV.size == 0
|
@@ -26,8 +27,12 @@ app = Rack::Builder.app{
|
|
26
27
|
port = opts[:port] || 8181
|
27
28
|
path = opts[:path]
|
28
29
|
path = "/" + path unless path.start_with?("/")
|
29
|
-
|
30
|
-
|
31
|
-
|
30
|
+
# complement "index.html"
|
31
|
+
if !opts["rack-index"] && File.exist?("#{dir}/index.html")
|
32
|
+
path = File.join(path, "index.html")
|
33
|
+
end
|
34
|
+
open_url = "http://localhost:#{port}#{path}"
|
35
|
+
puts open_url
|
36
|
+
Launchy.open(open_url) unless opts["no-open"]
|
32
37
|
|
33
38
|
Rack::Server.start(:app => app, :Port => port)
|
data/lib/serve_dir/version.rb
CHANGED
data/serve_dir.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serve_dir
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yutaka HARA
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: slop
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: '1.5'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: '1.5'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: launchy
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|