ghpreview 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/bin/ghpreview CHANGED
@@ -1,17 +1,31 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ trap("INT") { exit }
3
4
  require 'optparse'
4
5
  require 'ghpreview'
5
6
 
6
7
  options = {}
7
8
 
8
- OptionParser.new do |opts|
9
+ optparse = OptionParser.new do |opts|
9
10
  opts.banner = "Usage: ghpreview [options] FILE"
10
11
  opts.separator ""
11
12
 
12
13
  opts.on("-w", "--watch", "Watch for changes") do |w|
13
14
  options[:watch] = w
14
15
  end
15
- end.parse!
16
+ end
17
+
18
+ def valid_file? filename
19
+ filename and File.exist?(filename) and File.file?(filename)
20
+ end
21
+
22
+ begin
23
+ optparse.parse!
24
+ unless valid_file? ARGV[0]
25
+ puts "Missing markdown file."
26
+ puts optparse
27
+ exit
28
+ end
29
+ end
16
30
 
17
31
  GHPreview::Previewer.new(ARGV[0], options)
data/ghpreview.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |gem|
19
19
 
20
20
  gem.add_dependency 'listen'
21
21
  gem.add_dependency 'rb-fsevent'
22
- gem.add_dependency 'html-pipeline', '0.0.4'
22
+ gem.add_dependency 'html-pipeline', '0.0.6'
23
23
  gem.add_dependency 'httpclient'
24
- gem.add_dependency 'github-linguist', '2.3.4'
24
+ gem.add_dependency 'github-linguist', '2.1'
25
25
  end
@@ -1,3 +1,3 @@
1
1
  module GHPreview
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ghpreview
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-20 00:00:00.000000000 Z
12
+ date: 2013-01-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: listen
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - '='
52
52
  - !ruby/object:Gem::Version
53
- version: 0.0.4
53
+ version: 0.0.6
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 0.0.4
61
+ version: 0.0.6
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: httpclient
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -82,7 +82,7 @@ dependencies:
82
82
  requirements:
83
83
  - - '='
84
84
  - !ruby/object:Gem::Version
85
- version: 2.3.4
85
+ version: '2.1'
86
86
  type: :runtime
87
87
  prerelease: false
88
88
  version_requirements: !ruby/object:Gem::Requirement
@@ -90,7 +90,7 @@ dependencies:
90
90
  requirements:
91
91
  - - '='
92
92
  - !ruby/object:Gem::Version
93
- version: 2.3.4
93
+ version: '2.1'
94
94
  description: Command line utility for previewing Markdown files with Github styling
95
95
  email:
96
96
  - adam@adamlogic.com