github-markup 1.6.2 → 1.7.0

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
- SHA1:
3
- metadata.gz: 9cdb298d9ec9756e7fab1f948d1025957a5059c8
4
- data.tar.gz: 2ca9f9e7c1c07111d389c242f1bbf7a8d163b051
2
+ SHA256:
3
+ metadata.gz: 75e98a420bcda4902275853fc8190048077725dc7950ad685b2061a031e9b2d0
4
+ data.tar.gz: 2bdba5ce8edbd5887fa262c48e1adf41c54dc4695886daf303fcf6fa103d3c81
5
5
  SHA512:
6
- metadata.gz: 8f9556d901900d9a930879aa1722af0465130797d7e80461ddf7af5618988b560c445f6a7db90f2aeaa5f28d7334b55255c1e8ad3dbca9577ba9770382263596
7
- data.tar.gz: 6657b245fd58d141fef0a72b6e88dc46a9943cf19d676cb1a367dcb38bc1c225a30956897da7e5e3ed0928b7a8b10f99ffe29c4e08bbccabb006475d28c9bc08
6
+ metadata.gz: f70a33ad3658dc853c688f99dc75eaf7f643a6c43480a255b7fa8a00a9fa464d252867016a59e1c9281292390ed48ccc9baf86608f9bb24d681126bff7de10f0
7
+ data.tar.gz: 84c0610b905918cb1ea480b281a664fc6e50da90c1fb6753c9070b03fe2e4bd8afa44a3cfd4a2bd356ea87a8141e33873526db08ea60ca793bd08d598668af1f
data/.travis.yml CHANGED
@@ -2,7 +2,6 @@ dist: trusty
2
2
  sudo: required
3
3
  language: ruby
4
4
  rvm:
5
- - 2.0.0
6
5
  - 2.1.10
7
6
  - 2.2.7
8
7
  - 2.3.4
data/CONTRIBUTING.md CHANGED
@@ -23,6 +23,10 @@ Anything else - [search open issues](https://github.com/github/markup/issues) or
23
23
  5. Open a [Pull Request][1]
24
24
  6. Enjoy a refreshing Diet Coke and wait
25
25
 
26
+ **dependencies**
27
+
28
+ You can run `script/bootstrap.contrib` to fetch them all.
29
+
26
30
  ## Testing
27
31
 
28
32
  To run the tests:
data/Gemfile CHANGED
@@ -10,5 +10,6 @@ gem "rdoc", "~>3.6"
10
10
  gem "org-ruby", "= 0.9.9"
11
11
  gem "creole", "~>0.3.6"
12
12
  gem "wikicloth", "=0.8.3"
13
+ gem "twitter-text", "~> 1.14"
13
14
  gem "asciidoctor", "= 1.5.6.1"
14
15
  gem "rake"
data/HISTORY.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 1.7.0 - 2018-01-30
2
+
3
+ ### Changed
4
+
5
+ * Updates for Linguist v6 [#1139](https://github.com/github/markup/pull/1139)
6
+ * Update to Nokogiri ~> 1.8; drop support for Ruby 2.0 [#1156](https://github.com/github/markup/pull/1156)
7
+
1
8
  ## 1.6.2 - 2017-11-27
2
9
 
3
10
  ### Changed
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.add_development_dependency 'minitest', '~> 5.4', '>= 5.4.3'
22
22
  s.add_development_dependency 'html-pipeline', '~> 1.0'
23
23
  s.add_development_dependency 'sanitize', '~> 2.1', '>= 2.1.0'
24
- s.add_development_dependency 'nokogiri', '1.6.8.1'
24
+ s.add_development_dependency 'nokogiri', '~> 1.8.1'
25
25
  s.add_development_dependency 'nokogiri-diff', '~> 0.2.0'
26
- s.add_development_dependency "github-linguist", "~> 5.0", ">= 5.0.8"
26
+ s.add_development_dependency "github-linguist", "~> 6.0"
27
27
  end
data/lib/github-markup.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module GitHub
2
2
  module Markup
3
- VERSION = '1.6.2'
3
+ VERSION = '1.7.0'
4
4
  Version = VERSION
5
5
  end
6
6
  end
data/lib/github/markup.rb CHANGED
@@ -40,10 +40,11 @@ module GitHub
40
40
  end
41
41
  end
42
42
 
43
- def render(filename, content = nil)
43
+ def render(filename, content = nil, symlink = nil)
44
44
  content ||= File.read(filename)
45
+ symlink = (File.symlink?(filename) rescue false) if symlink.nil?
45
46
 
46
- if impl = renderer(filename, content)
47
+ if impl = renderer(filename, content, symlink)
47
48
  impl.render(filename, content)
48
49
  else
49
50
  content
@@ -79,20 +80,20 @@ module GitHub
79
80
  markup_impl(symbol, CommandImplementation.new(regexp, languages, command, name, &block))
80
81
  end
81
82
 
82
- def can_render?(filename, content)
83
- !!renderer(filename, content)
83
+ def can_render?(filename, content, symlink = false)
84
+ !!renderer(filename, content, symlink)
84
85
  end
85
86
 
86
- def renderer(filename, content)
87
- language = language(filename, content)
87
+ def renderer(filename, content, symlink = false)
88
+ language = language(filename, content, symlink)
88
89
  markup_impls.find { |impl|
89
90
  impl.match?(filename, language)
90
91
  }
91
92
  end
92
93
 
93
- def language(filename, content)
94
+ def language(filename, content, symlink = false)
94
95
  if defined?(::Linguist)
95
- blob = Linguist::Blob.new(filename, content)
96
+ blob = Linguist::Blob.new(filename, content, symlink: symlink)
96
97
  return Linguist.detect(blob, allow_empty: true)
97
98
  end
98
99
  end
@@ -0,0 +1,15 @@
1
+ #!/bin/bash
2
+
3
+ set -e
4
+
5
+ cd $(dirname "$0")/..
6
+
7
+ bundle install --path vendor/bundle
8
+ virtualenv vendor/python && source vendor/python/bin/activate
9
+ pip install docutils
10
+
11
+ echo ""
12
+ echo "*** DONE ***"
13
+ echo ""
14
+ echo "activate python environment with 'source vendor/python/bin/activate'"
15
+ echo "run tests with 'bundle exec rake'"
data/test/markup_test.rb CHANGED
@@ -104,7 +104,7 @@ message
104
104
  GitHub::Markup.command(:doesntmatter, 'test/fixtures/fail.sh', /fail/, ['Java'], 'fail')
105
105
  assert GitHub::Markup.can_render?('README.java', 'stop swallowing errors')
106
106
  begin
107
- GitHub::Markup.render('README.java', "stop swallowing errors")
107
+ GitHub::Markup.render('README.java', "stop swallowing errors", false)
108
108
  rescue GitHub::Markup::CommandError => e
109
109
  assert_equal "failure message", e.message
110
110
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-markup
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wanstrath
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-27 00:00:00.000000000 Z
11
+ date: 2018-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -96,16 +96,16 @@ dependencies:
96
96
  name: nokogiri
97
97
  requirement: !ruby/object:Gem::Requirement
98
98
  requirements:
99
- - - '='
99
+ - - "~>"
100
100
  - !ruby/object:Gem::Version
101
- version: 1.6.8.1
101
+ version: 1.8.1
102
102
  type: :development
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
- - - '='
106
+ - - "~>"
107
107
  - !ruby/object:Gem::Version
108
- version: 1.6.8.1
108
+ version: 1.8.1
109
109
  - !ruby/object:Gem::Dependency
110
110
  name: nokogiri-diff
111
111
  requirement: !ruby/object:Gem::Requirement
@@ -126,20 +126,14 @@ dependencies:
126
126
  requirements:
127
127
  - - "~>"
128
128
  - !ruby/object:Gem::Version
129
- version: '5.0'
130
- - - ">="
131
- - !ruby/object:Gem::Version
132
- version: 5.0.8
129
+ version: '6.0'
133
130
  type: :development
134
131
  prerelease: false
135
132
  version_requirements: !ruby/object:Gem::Requirement
136
133
  requirements:
137
134
  - - "~>"
138
135
  - !ruby/object:Gem::Version
139
- version: '5.0'
140
- - - ">="
141
- - !ruby/object:Gem::Version
142
- version: 5.0.8
136
+ version: '6.0'
143
137
  description: This gem is used by GitHub to render any fancy markup such as Markdown,
144
138
  Textile, Org-Mode, etc. Fork it and add your own!
145
139
  email: chris@ozmm.org
@@ -170,6 +164,7 @@ files:
170
164
  - lib/github/markup/rdoc.rb
171
165
  - lib/github/markups.rb
172
166
  - script/bootstrap
167
+ - script/bootstrap.contrib
173
168
  - script/cibuild
174
169
  - test/fixtures/fail.sh
175
170
  - test/markup_test.rb
@@ -225,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
225
220
  version: '0'
226
221
  requirements: []
227
222
  rubyforge_project:
228
- rubygems_version: 2.5.1
223
+ rubygems_version: 2.7.3
229
224
  signing_key:
230
225
  specification_version: 4
231
226
  summary: The code GitHub uses to render README.markup