fangorn 0.0.17 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fangorn/app.rb +8 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43afb82b253ffb44a314b54c54f548b847972d8f
4
- data.tar.gz: 07f91c4c74453acc7260746029623fb55e6e8d1c
3
+ metadata.gz: 570b6cf4b9a3c5eae2d54fcccf625aa4840777c8
4
+ data.tar.gz: d48dd65e7236cf7d57474799eceeec2ea265c08c
5
5
  SHA512:
6
- metadata.gz: ca9768f7c00728d58bf669ca0388a4ca45c4fdbe081c965945bb0646aaaa0fbba278db22106a109dfbfbd810c9972edf8bc917187bd0c85243a51d943a794f09
7
- data.tar.gz: 4884201e0ad6ba48901fadd47f6406cd1c1b389cc7cf93e36769bc53973d16e07c76cedd46f182e5d3337e1c97995497a307ef7de1316c148eb43a6c0989aa2a
6
+ metadata.gz: d367f77540225e8b6f74ee42566292d764c85ef786252a2b31c7d6fc6c496b5c68664f03936a2005ea09e4512e42f06a495c4e8fdd4bc770052fa7e5ce5d5243
7
+ data.tar.gz: a40d68d3b8f2a2fe7d4b6a96d3e78670203bdefb80fd23fc4fcc9cfa19c50a39a9276a507a3f27ea5cf39e003b598f2e7899fee288ef39a724ed025bc8ae2c46
data/lib/fangorn/app.rb CHANGED
@@ -6,6 +6,9 @@ require_relative 'output'
6
6
 
7
7
  module Fangorn
8
8
  class App
9
+ def initialize
10
+ @port = 8080
11
+ end
9
12
  def run
10
13
  options = OptionParser.new do |opts|
11
14
  opts.on('-s', '--serve', 'Watch source files for change, and serve compiled results') do
@@ -25,6 +28,9 @@ module Fangorn
25
28
  opts.on('-e', '--env=ENV', 'Use environment name with fangorn.yml settings') do |env|
26
29
  Output::env = env
27
30
  end
31
+ opts.on('-p', '--port=PORT', /^\d+$/, 'Serve on port [8080]') do |port|
32
+ @port = port.to_i
33
+ end
28
34
  end
29
35
 
30
36
  begin
@@ -40,8 +46,8 @@ module Fangorn
40
46
  listener = Listen.to(Output::source, :filter => /\.(haml|sass|js|ico|jpg|png|ttf)$/, &update)
41
47
  listener.start
42
48
 
43
- puts 'Starting server on port 8080'
44
- server = WEBrick::HTTPServer.new Port: 8080
49
+ puts "Starting server on port #{@port}"
50
+ server = WEBrick::HTTPServer.new Port: @port
45
51
  server.mount '/', NoCacheFileHandler, Output::dest
46
52
  trap('INT') { server.stop }
47
53
  server.start
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fangorn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Calhoun
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-13 00:00:00.000000000 Z
11
+ date: 2017-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: listen