showdown 0.0.3 → 0.0.4

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: 6f60cf030f44a32c37050c2aa586ada218c46a81
4
- data.tar.gz: d3b23a782759ec64c187b7f02f2f3cb4c5ac990b
3
+ metadata.gz: 17c0bd53511c5e975d0aa24b08d175f4a9ad0f53
4
+ data.tar.gz: 88a173b57cf008e8aa8c5fd34d89187dabd22833
5
5
  SHA512:
6
- metadata.gz: 6eef93f7bde1d6f226e0665a8330d0c088babcd295ffd87e907c22c9b47d50a4e7c2df0ac2d0afb63105282a6b0131a1bf09aa9b1c9a72d42505f7dde2c62ea4
7
- data.tar.gz: bec2daba14813316384092df3259d38673ef6a5d111f1c2b666086e69044887e4a48af038e899cf38b6c2e63e0f21e6df1a7537034c6fb2a72b3e8260f91db41
6
+ metadata.gz: 0f0b71e6a68a756e23fadeceb99b94c76341fb1d0f3a31d6b0fb3e2b8c06dfaf9e9354a3122ce83b6dbc670ba76c1bb1bf019ace7ff5a8951ad7036a3cd7d7b7
7
+ data.tar.gz: ed62cdb226874e6196edb1570846c114d2b11f92dcd8c9c1f572b09a3df64ebb068669b10eacebc3b9ae535a5c5abc4f9b0ff568d02dc89b8436bf5f7d1a7ff7
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # showdown
1
+ # showdown [![Gem Version](https://badge.fury.io/rb/showdown.svg)](http://badge.fury.io/rb/showdown)
2
2
 
3
3
  Near-Real time Markdown viewer.
4
4
 
data/bin/showdown CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- PORT = 3000
2
+ require 'optparse'
3
+
4
+ @port = 3000
3
5
  RACKUP_FILE_PATH = "#{File.expand_path('../../lib', __FILE__)}/config.ru"
4
6
 
5
7
  Signal.trap(:INT) do
@@ -7,8 +9,15 @@ Signal.trap(:INT) do
7
9
  exit(0)
8
10
  end
9
11
 
12
+ def parse_options
13
+ OptionParser.new do |o|
14
+ o.on('-p', '--port=PORT') { |v| @port = v }
15
+ o.parse!(ARGV)
16
+ end
17
+ end
18
+
10
19
  def help
11
- $stdout.puts 'usage: showdown <path>'
20
+ $stdout.puts 'usage: showdown [-p 4567] /path/to/your/markdown/file'
12
21
  end
13
22
 
14
23
  unless ARGV[0]
@@ -16,6 +25,7 @@ unless ARGV[0]
16
25
  exit 1
17
26
  end
18
27
 
19
- TARGET_PATH = File.expand_path(ARGV[0])
28
+ parse_options
29
+ TARGET_PATH = File.expand_path(ARGV.shift)
20
30
 
21
- system "TARGET_PATH=#{TARGET_PATH} thin -R #{RACKUP_FILE_PATH} -p #{PORT} start"
31
+ system "TARGET_PATH=#{TARGET_PATH} thin -R #{RACKUP_FILE_PATH} -p #{@port} start"
@@ -1,3 +1,3 @@
1
1
  module Showdown
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: showdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fumitaka Tokumitsu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-19 00:00:00.000000000 Z
11
+ date: 2014-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: websocket-rack