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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3facd4ccca23b4b266de702ea5e3d258d2aea33f
4
- data.tar.gz: 7d9cbcdbcac118ced348da9717138077de33c1cc
3
+ metadata.gz: f30aabe0fa534b80afb4eb9a6140f03cb40792f0
4
+ data.tar.gz: 11945a30c504710436d036498c54668fa3542a5f
5
5
  SHA512:
6
- metadata.gz: 91723fc191fe83c042ab295cf527890521c317706b639393cf7cd03cd284ab232d21f2bce28d15734284077ffba57b5778270fcb67211b65ce7d7a424a229d08
7
- data.tar.gz: 2907cc0aec328744e208288284dc89621945b4696b8ddbc98b325441b0af3238977d26aba3ec599528704de1696974347d29076ce76db67b4ec4c1b2b0724998
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.4.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.4.5)
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
- url = "http://localhost:#{port}#{path}"
30
- puts url
31
- Launchy.open(url) unless opts["no-open"]
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)
@@ -1,3 +1,3 @@
1
1
  module ServeDir
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
data/serve_dir.gemspec CHANGED
@@ -15,6 +15,6 @@ Gem::Specification.new do |gem|
15
15
  gem.version = ServeDir::VERSION
16
16
 
17
17
  gem.add_dependency("slop", "~> 2")
18
- gem.add_dependency("rack", "~> 1.4.1")
18
+ gem.add_dependency("rack", "~> 1.5")
19
19
  gem.add_dependency("launchy", "~> 2.3.0")
20
20
  end
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.2.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-09 00:00:00.000000000 Z
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.4.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.4.1
40
+ version: '1.5'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: launchy
43
43
  requirement: !ruby/object:Gem::Requirement