ghpreview 0.0.6 → 0.0.7

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.
data/Gemfile CHANGED
@@ -1,4 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in github-preview.gemspec
4
+ gem 'rake'
4
5
  gemspec
data/README.md CHANGED
@@ -33,6 +33,12 @@ option:
33
33
  $ ghpreview -w README.md
34
34
  ```
35
35
 
36
+ To use an alternate browser (Mac only), use the `-a` (or `--application`) option:
37
+
38
+ ```bash
39
+ $ ghpreview -a Safari.app README.md
40
+ ```
41
+
36
42
  ## Why is this better than X?
37
43
 
38
44
  There are several tools available for previewing Markdown files, and many that
data/bin/ghpreview CHANGED
@@ -13,6 +13,10 @@ optparse = OptionParser.new do |opts|
13
13
  opts.on("-w", "--watch", "Watch for changes") do |w|
14
14
  options[:watch] = w
15
15
  end
16
+
17
+ opts.on("-a", "--application APP", "Alternate browser") do |a|
18
+ options[:application] = a
19
+ end
16
20
  end
17
21
 
18
22
  def valid_file? filename
@@ -16,6 +16,7 @@ module GHPreview
16
16
  @http = HTTPClient.new
17
17
  generate_template_with_fingerprinted_stylesheet_links
18
18
 
19
+ @application = options[:application]
19
20
  options[:watch] ? listen : open
20
21
  end
21
22
 
@@ -39,7 +40,7 @@ module GHPreview
39
40
  if RUBY_PLATFORM =~ /linux/
40
41
  command = 'xdg-open'
41
42
  else
42
- command = 'open'
43
+ command = @application ? "open -a #{@application}" : 'open'
43
44
  end
44
45
  `#{command} #{HTML_FILEPATH}`
45
46
  end
@@ -1,3 +1,3 @@
1
1
  module GHPreview
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
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.6
4
+ version: 0.0.7
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: 2013-01-04 00:00:00.000000000 Z
12
+ date: 2013-04-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: listen
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  requirements: []
132
132
  rubyforge_project:
133
- rubygems_version: 1.8.24
133
+ rubygems_version: 1.8.23
134
134
  signing_key:
135
135
  specification_version: 3
136
136
  summary: Command line utility for previewing Markdown files with Github styling