gitlab-linguist 2.9.6 → 3.0.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2dfefc24eab51f9d712be2477550334f40fc037c
4
- data.tar.gz: 8a67a4a9564c47284dd6681d5f2a69e533363b25
3
+ metadata.gz: 66c5524accd351ef2c788f11c5d94853f25213ed
4
+ data.tar.gz: 22c247710d8d6e82187722a62349a38409c73388
5
5
  SHA512:
6
- metadata.gz: 6b1d0abc0368c13395f58f15d58c87f2f208c728235c3912fa752beda3a713f2018a57b14ecf228371b6317dc5d05b9e0c8943f5c836f96a1097efb1a861b824
7
- data.tar.gz: 0c12bf527db63ad373be2fdbad3279fff283a23d4212236580c7d92b15638b908ddc3d34b29f18c64a9bc048051786846394ae8e89290f3a4eb31f60fc653c1e
6
+ metadata.gz: f5b5178cdf166ba262b08b695fd63ba6980c12d813e29b09e76e14219e414e1ea406f49990fed41b7ae0b0a84d4861689f741808e158a88fd6b06bc31efe5346
7
+ data.tar.gz: 8b66d4e0a2d7ca84862e7db9928b69b3d3398e2271ef3885e1e338b808949c35b75f61ba750640c3a3eb475f87f7a4585e5c223de99e64b2e44675359edf3ba3
@@ -4,7 +4,6 @@ require 'linguist/language'
4
4
  require 'charlock_holmes'
5
5
  require 'escape_utils'
6
6
  require 'mime/types'
7
- require 'pygments'
8
7
  require 'yaml'
9
8
 
10
9
  module Linguist
@@ -189,10 +188,6 @@ module Linguist
189
188
 
190
189
  # Public: Is the blob safe to colorize?
191
190
  #
192
- # We use Pygments for syntax highlighting blobs. Pygments
193
- # can be too slow for very large blobs or for certain
194
- # corner-case blobs.
195
- #
196
191
  # Return true or false
197
192
  def safe_to_colorize?
198
193
  !large? && text? && !high_ratio_of_long_lines?
@@ -200,9 +195,6 @@ module Linguist
200
195
 
201
196
  # Internal: Does the blob have a ratio of long lines?
202
197
  #
203
- # These types of files are usually going to make Pygments.rb
204
- # angry if we try to colorize them.
205
- #
206
198
  # Return true or false
207
199
  def high_ratio_of_long_lines?
208
200
  return false if loc == 0
@@ -298,7 +290,7 @@ module Linguist
298
290
  #
299
291
  # Returns a Lexer.
300
292
  def lexer
301
- language ? language.lexer : Pygments::Lexer.find_by_name('Text only')
293
+ language ? language.lexer : nil
302
294
  end
303
295
 
304
296
  # Public: Highlight syntax of blob
@@ -1,5 +1,4 @@
1
1
  require 'escape_utils'
2
- require 'pygments'
3
2
  require 'yaml'
4
3
 
5
4
  require 'linguist/classifier'
@@ -235,10 +234,6 @@ module Linguist
235
234
  # Set aliases
236
235
  @aliases = [default_alias_name] + (attributes[:aliases] || [])
237
236
 
238
- # Lookup Lexer object
239
- @lexer = Pygments::Lexer.find_by_name(attributes[:lexer] || name) ||
240
- raise(ArgumentError, "#{@name} is missing lexer")
241
-
242
237
  @ace_mode = attributes[:ace_mode]
243
238
  @wrap = attributes[:wrap] || false
244
239
 
@@ -426,7 +421,7 @@ module Linguist
426
421
  #
427
422
  # Returns html String
428
423
  def colorize(text, options = {})
429
- lexer.highlight(text, options = {})
424
+ text
430
425
  end
431
426
 
432
427
  # Public: Return name as String representation
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-linguist
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.6
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-25 00:00:00.000000000 Z
11
+ date: 2014-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: charlock_holmes
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.19'
55
- - !ruby/object:Gem::Dependency
56
- name: gitlab-pygments.rb
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ~>
60
- - !ruby/object:Gem::Version
61
- version: 0.5.4
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ~>
67
- - !ruby/object:Gem::Version
68
- version: 0.5.4
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: mocha
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -129,19 +115,19 @@ executables:
129
115
  extensions: []
130
116
  extra_rdoc_files: []
131
117
  files:
132
- - lib/linguist/language.rb
133
- - lib/linguist/vendor.yml
134
- - lib/linguist/repository.rb
135
- - lib/linguist/samples.rb
136
- - lib/linguist/samples.json
118
+ - lib/linguist/blob_helper.rb
119
+ - lib/linguist/classifier.rb
120
+ - lib/linguist/file_blob.rb
137
121
  - lib/linguist/generated.rb
122
+ - lib/linguist/language.rb
123
+ - lib/linguist/languages.yml
138
124
  - lib/linguist/md5.rb
139
125
  - lib/linguist/popular.yml
140
- - lib/linguist/classifier.rb
126
+ - lib/linguist/repository.rb
127
+ - lib/linguist/samples.json
128
+ - lib/linguist/samples.rb
141
129
  - lib/linguist/tokenizer.rb
142
- - lib/linguist/blob_helper.rb
143
- - lib/linguist/languages.yml
144
- - lib/linguist/file_blob.rb
130
+ - lib/linguist/vendor.yml
145
131
  - lib/linguist.rb
146
132
  - bin/linguist
147
133
  homepage: https://github.com/github/linguist