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 +1 -0
- data/README.md +6 -0
- data/bin/ghpreview +4 -0
- data/lib/ghpreview/previewer.rb +2 -1
- data/lib/ghpreview/version.rb +1 -1
- metadata +3 -3
data/Gemfile
CHANGED
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
|
data/lib/ghpreview/previewer.rb
CHANGED
@@ -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
|
data/lib/ghpreview/version.rb
CHANGED
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.
|
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-
|
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.
|
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
|