github-markdown-preview 3.1.2 → 3.1.3

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: 378ce73894688cc81f8aa0d0eb62d1a5d5a988f8
4
- data.tar.gz: f361e29fdddfdc8bf1b34118315d1525916b142c
3
+ metadata.gz: 25fb9084150907bcf20c323b08fd0b1a062e96b6
4
+ data.tar.gz: 91908da689d9d34061fa2ac054b8dfe352ef5eed
5
5
  SHA512:
6
- metadata.gz: 584b24b77abe743721af0cbb8cbf1d2a56a82561ea95a9d648098ab8f7e87368926c66c4082e913bf1b550596ae6e86536edecfd9cfed4a604bf3484e8730ce2
7
- data.tar.gz: e178fe65c119787d1dd6c4815b23d4695b0709117784babb8b01eb1e393cb35ec349519ea5dad06108d83402cedf08de30ecb308f3e086029a06af5193d47d07
6
+ metadata.gz: 03d309a5bec7b32a89c917930d1f22436c0008b24d1cca4f547cff0d0436ba7a22942c687bcae03f346e62086af954aeb1f95caed6fcfe7630b3614217d354f9
7
+ data.tar.gz: 6422a31c144de029af467b6be8cfde1622529e8ed887885439065fa3a49e11ff7c1fab010fc36d711d238d740df6606dc36c7ab31bb398853425d676dbd3d700
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## v3.1.3
4
+ * Only initialize a listener if we're doing some listening [#34](https://github.com/dmarcotte/github-markdown-preview/pull/34)
5
+
3
6
  ## v3.1.2
4
7
  * Update Github css
5
8
 
data/Gemfile.optional CHANGED
@@ -9,4 +9,4 @@ if RUBY_VERSION =~ /1.8/
9
9
  gem 'escape_utils', '~> 0.3'
10
10
  end
11
11
 
12
- gem 'github-linguist'
12
+ gem 'github-linguist', '3.3.1'
@@ -13,14 +13,14 @@ Gem::Specification.new do |s|
13
13
  s.description = %q{Local previews for Github markdown}
14
14
  s.license = 'MIT'
15
15
 
16
- s.add_dependency 'listen', '2.7'
17
- s.add_dependency 'html-pipeline', '~> 1.8'
18
- s.add_dependency 'sanitize', '~> 2.1'
16
+ s.add_dependency 'listen', '2.8'
17
+ s.add_dependency 'html-pipeline', '~> 1.11'
18
+ s.add_dependency 'sanitize', '~> 3.0'
19
19
  s.add_dependency 'github-markdown', '~> 0.6'
20
- s.add_dependency 'gemoji', '~> 1.5'
20
+ s.add_dependency 'gemoji', '~> 2.1'
21
21
 
22
- s.add_development_dependency 'minitest', '~> 5.3'
23
- s.add_development_dependency 'bundler', '~> 1.6'
22
+ s.add_development_dependency 'minitest', '~> 5.4'
23
+ s.add_development_dependency 'bundler', '~> 1.7'
24
24
  s.add_development_dependency 'rake', '~> 10.3'
25
25
 
26
26
  s.files = `git ls-files`.split("\n")
@@ -11,6 +11,7 @@ module GithubMarkdownPreview
11
11
  attr_reader :source_file, :preview_file
12
12
 
13
13
  begin
14
+ gem 'github-linguist', '=3.3.1'
14
15
  require 'linguist'
15
16
  SYNTAX_HIGHLIGHTS = true
16
17
  rescue LoadError => _
@@ -47,16 +48,6 @@ module GithubMarkdownPreview
47
48
  delete
48
49
  end
49
50
  end
50
-
51
- # set up a listener which ca be asked to watch for updates
52
- source_file_dir = File.dirname(@source_file)
53
-
54
- @listener = Listen.to(source_file_dir) { update }
55
-
56
- # only look at files who's basename matches the file we care about
57
- # we could probably be more aggressive and make sure it's the *exact* file,
58
- # but this is simpler, should be cross platform and at worst means a few no-op updates
59
- @listener.only(%r{.*#{File.basename(@source_file)}$})
60
51
  end
61
52
 
62
53
  ##
@@ -137,6 +128,17 @@ module GithubMarkdownPreview
137
128
  end
138
129
 
139
130
  def start_watch(blocking = false)
131
+ unless @listener
132
+ # set up a listener which ca be asked to watch for updates
133
+ source_file_dir = File.dirname(@source_file)
134
+
135
+ @listener = Listen.to(source_file_dir) { update }
136
+
137
+ # only look at files who's basename matches the file we care about
138
+ # we could probably be more aggressive and make sure it's the *exact* file,
139
+ # but this is simpler, should be cross platform and at worst means a few no-op updates
140
+ @listener.only(%r{.*#{File.basename(@source_file)}$})
141
+ end
140
142
  @listener.start
141
143
  sleep if blocking
142
144
  end
@@ -145,7 +147,9 @@ module GithubMarkdownPreview
145
147
  ##
146
148
  # Stop watching source file (only applies to previews using the non-blocking #watch)
147
149
  def end_watch
148
- @listener.stop
150
+ if @listener
151
+ @listener.stop
152
+ end
149
153
  end
150
154
 
151
155
  ##
@@ -1,3 +1,3 @@
1
1
  module GithubMarkdownPreview
2
- VERSION = '3.1.2'
2
+ VERSION = '3.1.3'
3
3
  end
data/readme.md CHANGED
@@ -27,7 +27,7 @@ $ github-markdown-preview <path/to/markdown/file.md> # writes <path/to/markdown/
27
27
  Use the `-c` switch to generate a preview of how Github renders comments/issues, which differs from repository markdown files in a few ways:
28
28
  * [newlines](https://help.github.com/articles/github-flavored-markdown#newlines) are rendered as hard breaks
29
29
  * `@mentions` are linked to the user's home page
30
- * [TODO](https://github.com/dmarcotte/github-markdown-preview/issues/17): auto-linked [references](https://help.github.com/articles/github-flavored-markdown#references)
30
+ * Note: auto-linked [references](https://help.github.com/articles/writing-on-github#references) are not rendered as links. See [#17](https://github.com/dmarcotte/github-markdown-preview/issues/17)
31
31
 
32
32
  ```bash
33
33
  $ github-markdown-preview -c <path/to/comment/draft.md> # writes <path/to/comment/draft.md.html>
@@ -36,9 +36,11 @@ $ github-markdown-preview -c <path/to/comment/draft.md> # writes <path/to/commen
36
36
  ### Enable syntax highlighting for code blocks
37
37
  To enable syntax highlighting for code blocks, you will need to install [`github-linguist`](https://github.com/github/linguist):
38
38
  ```
39
- gem install github-linguist
39
+ gem install github-linguist -v 3.3.1
40
40
  ```
41
41
 
42
+ (Note that version 3.3.1 is required)
43
+
42
44
  Note that this install will fail unless your system meets the requirements needed to build its native extensions:
43
45
  * You will to either `brew install icu4c` or `apt-get install libicu-dev`
44
46
  * On Mac, you will need to have XCode installed (seems like a full install is required, not just the Command Line Tools)
@@ -72,7 +72,7 @@ class TestHtmlPreview < Minitest::Test
72
72
  def test_default_mode_anchors
73
73
  write(@source_file_path, "# foo\n## bar")
74
74
  markdown_preview = @ghp.new( @source_file_path )
75
- assert_equal markdown_preview.wrap_preview("<h1>\n<a name=\"foo\" class=\"anchor\" href=\"#foo\"><span class=\"octicon octicon-link\"></span></a>foo</h1>\n\n<h2>\n<a name=\"bar\" class=\"anchor\" href=\"#bar\"><span class=\"octicon octicon-link\"></span></a>bar</h2>"),
75
+ assert_equal markdown_preview.wrap_preview("<h1>\n<a id=\"foo\" class=\"anchor\" href=\"#foo\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"></span></a>foo</h1>\n\n<h2>\n<a id=\"bar\" class=\"anchor\" href=\"#bar\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"></span></a>bar</h2>"),
76
76
  read(markdown_preview.preview_file),
77
77
  'Should contain anchor link markup in default mode'
78
78
  end
data/test/test_helper.rb CHANGED
@@ -1,4 +1,3 @@
1
- # celluloid (used by guard/listen) needs to be told we're testing so that one test's teardown
2
- # doesn't accidentally shut down the next test's celluloid setup.
3
- # See https://github.com/celluloid/celluloid/blob/87592f9fbba99c7228a22618c33e88265c8a0516/lib/celluloid.rb#L513
4
- $CELLULOID_TEST = true
1
+ # ensure celluloid plays nice with minitest. See https://github.com/celluloid/celluloid/pull/162
2
+ require 'celluloid/test.rb'
3
+ Celluloid.boot
metadata CHANGED
@@ -1,127 +1,127 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-markdown-preview
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Marcotte
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-08 00:00:00.000000000 Z
11
+ date: 2014-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: listen
15
- version_requirements: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - '='
18
- - !ruby/object:Gem::Version
19
- version: '2.7'
20
15
  requirement: !ruby/object:Gem::Requirement
21
16
  requirements:
22
17
  - - '='
23
18
  - !ruby/object:Gem::Version
24
- version: '2.7'
25
- prerelease: false
19
+ version: '2.8'
26
20
  type: :runtime
27
- - !ruby/object:Gem::Dependency
28
- name: html-pipeline
21
+ prerelease: false
29
22
  version_requirements: !ruby/object:Gem::Requirement
30
23
  requirements:
31
- - - ~>
24
+ - - '='
32
25
  - !ruby/object:Gem::Version
33
- version: '1.8'
26
+ version: '2.8'
27
+ - !ruby/object:Gem::Dependency
28
+ name: html-pipeline
34
29
  requirement: !ruby/object:Gem::Requirement
35
30
  requirements:
36
- - - ~>
31
+ - - "~>"
37
32
  - !ruby/object:Gem::Version
38
- version: '1.8'
39
- prerelease: false
33
+ version: '1.11'
40
34
  type: :runtime
41
- - !ruby/object:Gem::Dependency
42
- name: sanitize
35
+ prerelease: false
43
36
  version_requirements: !ruby/object:Gem::Requirement
44
37
  requirements:
45
- - - ~>
38
+ - - "~>"
46
39
  - !ruby/object:Gem::Version
47
- version: '2.1'
40
+ version: '1.11'
41
+ - !ruby/object:Gem::Dependency
42
+ name: sanitize
48
43
  requirement: !ruby/object:Gem::Requirement
49
44
  requirements:
50
- - - ~>
45
+ - - "~>"
51
46
  - !ruby/object:Gem::Version
52
- version: '2.1'
53
- prerelease: false
47
+ version: '3.0'
54
48
  type: :runtime
55
- - !ruby/object:Gem::Dependency
56
- name: github-markdown
49
+ prerelease: false
57
50
  version_requirements: !ruby/object:Gem::Requirement
58
51
  requirements:
59
- - - ~>
52
+ - - "~>"
60
53
  - !ruby/object:Gem::Version
61
- version: '0.6'
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: github-markdown
62
57
  requirement: !ruby/object:Gem::Requirement
63
58
  requirements:
64
- - - ~>
59
+ - - "~>"
65
60
  - !ruby/object:Gem::Version
66
61
  version: '0.6'
67
- prerelease: false
68
62
  type: :runtime
69
- - !ruby/object:Gem::Dependency
70
- name: gemoji
63
+ prerelease: false
71
64
  version_requirements: !ruby/object:Gem::Requirement
72
65
  requirements:
73
- - - ~>
66
+ - - "~>"
74
67
  - !ruby/object:Gem::Version
75
- version: '1.5'
68
+ version: '0.6'
69
+ - !ruby/object:Gem::Dependency
70
+ name: gemoji
76
71
  requirement: !ruby/object:Gem::Requirement
77
72
  requirements:
78
- - - ~>
73
+ - - "~>"
79
74
  - !ruby/object:Gem::Version
80
- version: '1.5'
81
- prerelease: false
75
+ version: '2.1'
82
76
  type: :runtime
83
- - !ruby/object:Gem::Dependency
84
- name: minitest
77
+ prerelease: false
85
78
  version_requirements: !ruby/object:Gem::Requirement
86
79
  requirements:
87
- - - ~>
80
+ - - "~>"
88
81
  - !ruby/object:Gem::Version
89
- version: '5.3'
82
+ version: '2.1'
83
+ - !ruby/object:Gem::Dependency
84
+ name: minitest
90
85
  requirement: !ruby/object:Gem::Requirement
91
86
  requirements:
92
- - - ~>
87
+ - - "~>"
93
88
  - !ruby/object:Gem::Version
94
- version: '5.3'
95
- prerelease: false
89
+ version: '5.4'
96
90
  type: :development
97
- - !ruby/object:Gem::Dependency
98
- name: bundler
91
+ prerelease: false
99
92
  version_requirements: !ruby/object:Gem::Requirement
100
93
  requirements:
101
- - - ~>
94
+ - - "~>"
102
95
  - !ruby/object:Gem::Version
103
- version: '1.6'
96
+ version: '5.4'
97
+ - !ruby/object:Gem::Dependency
98
+ name: bundler
104
99
  requirement: !ruby/object:Gem::Requirement
105
100
  requirements:
106
- - - ~>
101
+ - - "~>"
107
102
  - !ruby/object:Gem::Version
108
- version: '1.6'
109
- prerelease: false
103
+ version: '1.7'
110
104
  type: :development
111
- - !ruby/object:Gem::Dependency
112
- name: rake
105
+ prerelease: false
113
106
  version_requirements: !ruby/object:Gem::Requirement
114
107
  requirements:
115
- - - ~>
108
+ - - "~>"
116
109
  - !ruby/object:Gem::Version
117
- version: '10.3'
110
+ version: '1.7'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rake
118
113
  requirement: !ruby/object:Gem::Requirement
119
114
  requirements:
120
- - - ~>
115
+ - - "~>"
121
116
  - !ruby/object:Gem::Version
122
117
  version: '10.3'
123
- prerelease: false
124
118
  type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '10.3'
125
125
  description: Local previews for Github markdown
126
126
  email: dmarcotte@gmail.com
127
127
  executables:
@@ -129,8 +129,8 @@ executables:
129
129
  extensions: []
130
130
  extra_rdoc_files: []
131
131
  files:
132
- - .gitignore
133
- - .travis.yml
132
+ - ".gitignore"
133
+ - ".travis.yml"
134
134
  - CHANGELOG.md
135
135
  - Gemfile
136
136
  - Gemfile.optional
@@ -157,29 +157,29 @@ homepage: https://github.com/dmarcotte/github-markdown-preview
157
157
  licenses:
158
158
  - MIT
159
159
  metadata: {}
160
- post_install_message:
160
+ post_install_message:
161
161
  rdoc_options: []
162
162
  require_paths:
163
163
  - lib
164
164
  required_ruby_version: !ruby/object:Gem::Requirement
165
165
  requirements:
166
- - - '>='
166
+ - - ">="
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0'
169
169
  required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - '>='
171
+ - - ">="
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  requirements: []
175
- rubyforge_project:
175
+ rubyforge_project:
176
176
  rubygems_version: 2.2.2
177
- signing_key:
177
+ signing_key:
178
178
  specification_version: 4
179
- summary: Use your favorite editor plus the usual edit/refresh cycle to quickly write and polish your Github markdown
179
+ summary: Use your favorite editor plus the usual edit/refresh cycle to quickly write
180
+ and polish your Github markdown
180
181
  test_files:
181
182
  - test/filter/task_list_filter_test.rb
182
183
  - test/github-markdown-preview_test.rb
183
184
  - test/html_preview_test.rb
184
185
  - test/test_helper.rb
185
- has_rdoc: