jobim 0.1.1 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75ebff56329423e815ad268488f64e7eb0233b95
4
- data.tar.gz: 3cab722f7cca971a1608cc9539e68e9415add27e
3
+ metadata.gz: 0e86219d170d04f5ef5fe065016436c23b6aa92d
4
+ data.tar.gz: 64aae4a07b61d44e91fc9c4fc873fc4fe4680067
5
5
  SHA512:
6
- metadata.gz: a8501afda6620c2b026dece7953f6e58257a304c1608e73e15a3f4ea9c4b25625ea9bc89195b5cdf635bc55b500565322d86d4d5745ac2f10f11d8a30f1eac60
7
- data.tar.gz: d993f9b0f75ed445d66dd5ca8e1d32b4aec3dbc0bce51f4c0471de1492a1d888c580161feb736deffdab3dd2c809e4ebb0fea4ce8f4ec670edad42b9e0e9b900
6
+ metadata.gz: a33953d920f95c489aa862a0b1fd999fa73f5b7dd2cf299af9ad4dd87b3ee4570296d4557c8b9b68cd9a2cc7dee0dec81cb71f7ac5e1eab6cf4502e9d5b45a91
7
+ data.tar.gz: b7e47af14d953da698560d8de12d03427017f0cccebc7f08a93a205d8335cac8abe53068f3d66b415ac381147963cd6e63f571d41e2a8cd212ef2a07ee645038
data/bin/jobim CHANGED
@@ -24,4 +24,4 @@ end
24
24
 
25
25
  puts ">>> Serving #{opts[:dir]}"
26
26
 
27
- Rack::Handler::Thin.run app, :Port => 5634
27
+ Rack::Handler::Thin.run app, :Host => opts[:host], :Port => opts[:port]
data/lib/jobim/cli.rb CHANGED
@@ -17,7 +17,11 @@ class Jobim::CLI
17
17
  end
18
18
 
19
19
  def options
20
- @options ||= { :dir => Dir.pwd }
20
+ @options ||= {
21
+ :dir => Dir.pwd,
22
+ :host => '0.0.0.0',
23
+ :port => 5634
24
+ }
21
25
  end
22
26
 
23
27
  def parser
@@ -25,10 +29,22 @@ class Jobim::CLI
25
29
  o.banner = "jobim - TODO: FINISH ME"
26
30
  o.separator ""
27
31
  o.separator "Usage: jobim [OPTION]... [DIRECTORY]"
32
+
33
+ o.separator ""
34
+ o.separator "Specific options:"
35
+
36
+ o.on("-a", "--address HOST",
37
+ "bind to HOST address (default: 0.0.0.0)") do |host|
38
+ options[:host] = host
39
+ end
40
+
41
+ o.on "-p", "--port PORT", "use PORT (default: 5634)" do |port|
42
+ options[:port] = port
43
+ end
44
+
28
45
  o.separator ""
29
- # o.separator "Specific options:"
30
- # o.separator ""
31
46
  o.separator "General options:"
47
+
32
48
  o.on "-h", "--help", "Display this help message." do
33
49
  puts help
34
50
  exit
@@ -43,9 +59,11 @@ class Jobim::CLI
43
59
 
44
60
  def parse(args)
45
61
  parser.parse!(args)
62
+ options[:dir] = File.expand_path(args[0]) if args.length == 1
46
63
  end
47
64
 
48
65
  def help
49
66
  parser.to_s
50
67
  end
68
+
51
69
  end
data/lib/jobim/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jobim
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jobim
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zachary Elliott
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-19 00:00:00.000000000 Z
11
+ date: 2013-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler