coderay 1.1.2 → 1.1.3.rc1

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
- ---
2
- SHA512:
3
- metadata.gz: ee0871415d85030050fc0e1f6c87294618b1b187cd88b8a3742729d81de21deb360eafd0dbe17f5cce7fa038f2a9a4800e36f67f5454792c96738c262a355e95
4
- data.tar.gz: c795a801222d0e0b8602d2585958ce909628d2864fae5c19e5dfe7a0503fdf15cad4e784b47430e1ced879c27ac703472afc240a40477221d8dff954c8438701
5
- SHA1:
6
- metadata.gz: b802ccaafa2572e07f1102d0ddf3f4c385bc4b37
7
- data.tar.gz: 19b8a2745ba53ff3c84ebe243cb2bdc84055fc76
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 38dbc03e09d4f2097b25606eb9dd76d53b8034f00d0b6f11ac08cec89fba7cb7
4
+ data.tar.gz: 91ce1794b172df488c0f53c33496b13f9c71d0a062487676ea5d2b7f6e538510
5
+ SHA512:
6
+ metadata.gz: 68d7d887ef40a9e1f9c237b975e8eb8e87490ed955695377727d92c4ca101b85b0d3e5dd30ff7e6d4409c54042b7d5cd6b06286855a2f462f26f0c52d5f9e618
7
+ data.tar.gz: b94ad7656cc49215461a9806dadb15eb59ce1ce5d8c5d67e6c2147668517ce3c480fff3990f1d81faf251ded1cdb9f06ef6a03253472668ce86f1fbb40b611fc
@@ -76,8 +76,6 @@ module Encoders
76
76
  apply_title! title
77
77
  end
78
78
  self
79
- when nil
80
- return self
81
79
  else
82
80
  raise "Unknown value %p for :wrap" % element
83
81
  end
@@ -37,7 +37,7 @@ module Scanners
37
37
  add(PREDEFINED_CONSTANTS, :predefined_constant) # :nodoc:
38
38
 
39
39
  ESCAPE = / [rbfntv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x # :nodoc:
40
- UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x # :nodoc:
40
+ UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x # :nodoc:
41
41
 
42
42
  protected
43
43
 
@@ -49,7 +49,7 @@ module Scanners
49
49
  add(PREDEFINED_CONSTANTS, :predefined_constant) # :nodoc:
50
50
 
51
51
  ESCAPE = / [rbfntv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x # :nodoc:
52
- UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x # :nodoc:
52
+ UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x # :nodoc:
53
53
 
54
54
  protected
55
55
 
@@ -109,7 +109,7 @@ module Scanners
109
109
  for deleted_line, inserted_line in deleted_lines.zip(inserted_lines)
110
110
  pre, deleted_part, inserted_part, post = diff deleted_line, inserted_line
111
111
  content_scanner_entry_state = content_scanner.state
112
- deleted_lines_tokenized << content_scanner.tokenize([pre, deleted_part, post], :tokens => Tokens.new)
112
+ deleted_lines_tokenized << content_scanner.tokenize([pre, deleted_part, post], :tokens => Tokens.new)
113
113
  content_scanner.state = content_scanner_entry_state || :initial
114
114
  inserted_lines_tokenized << content_scanner.tokenize([pre, inserted_part, post], :tokens => Tokens.new)
115
115
  end
@@ -212,7 +212,7 @@ module Scanners
212
212
  # does not precede the leftmost one from the left.
213
213
  j = -1
214
214
  j -= 1 while j >= j_min && a[j] == b[j]
215
- return a[0...i], a[i..j], b[i..j], (j < -1) ? a[j+1..-1] : ''
215
+ return a[0...i], a[i..j], b[i..j], (j < -1) ? a[j + 1..-1] : ''
216
216
  end
217
217
 
218
218
  end
@@ -22,8 +22,8 @@ module Scanners
22
22
  add(GROOVY_MAGIC_VARIABLES, :local_variable) # :nodoc:
23
23
 
24
24
  ESCAPE = / [bfnrtv$\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x # :nodoc:
25
- UNICODE_ESCAPE = / u[a-fA-F0-9]{4} /x # :nodoc: no 4-byte unicode chars? U[a-fA-F0-9]{8}
26
- REGEXP_ESCAPE = / [bfnrtv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} | \d | [bBdDsSwW\/] /x # :nodoc:
25
+ UNICODE_ESCAPE = / u[a-fA-F0-9]{4} /x # :nodoc: no 4-byte unicode chars? U[a-fA-F0-9]{8}
26
+ REGEXP_ESCAPE = / [bfnrtv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} | \d | [bBdDsSwW\/] /x # :nodoc:
27
27
 
28
28
  # TODO: interpretation inside ', ", /
29
29
  STRING_CONTENT_PATTERN = {
@@ -20,7 +20,7 @@ module Scanners
20
20
  MAGIC_VARIABLES = %w[ this super ] # :nodoc:
21
21
  TYPES = %w[
22
22
  boolean byte char class double enum float int interface long
23
- short void
23
+ short void var
24
24
  ] << '[]' # :nodoc: because int[] should be highlighted as a type
25
25
  DIRECTIVES = %w[
26
26
  abstract extends final implements native private protected public
@@ -38,7 +38,7 @@ module Scanners
38
38
  add(DIRECTIVES, :directive) # :nodoc:
39
39
 
40
40
  ESCAPE = / [bfnrtv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x # :nodoc:
41
- UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x # :nodoc:
41
+ UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x # :nodoc:
42
42
  STRING_CONTENT_PATTERN = {
43
43
  "'" => /[^\\']+/,
44
44
  '"' => /[^\\"]+/,
@@ -40,8 +40,8 @@ module Scanners
40
40
  add(KEYWORDS, :keyword) # :nodoc:
41
41
 
42
42
  ESCAPE = / [bfnrtv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x # :nodoc:
43
- UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x # :nodoc:
44
- REGEXP_ESCAPE = / [bBdDsSwW] /x # :nodoc:
43
+ UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x # :nodoc:
44
+ REGEXP_ESCAPE = / [bBdDsSwW] /x # :nodoc:
45
45
  STRING_CONTENT_PATTERN = {
46
46
  "'" => /[^\\']+/,
47
47
  '"' => /[^\\"]+/,
@@ -100,7 +100,6 @@ module Scanners
100
100
  # TODO: scan over nested tags
101
101
  xml_scanner.tokenize match, :tokens => encoder
102
102
  value_expected = false
103
- next
104
103
 
105
104
  elsif match = scan(/ [-+*=<>?:;,!&^|(\[{~%]+ | \.(?!\d) /x)
106
105
  value_expected = true
@@ -76,7 +76,7 @@ module Scanners
76
76
  encoder.text_token(match, :comment)
77
77
 
78
78
  elsif match = scan(/\[=*\[/) # [[ long (possibly multiline) string ]]
79
- num_equals = match.count("=") # Number must match for comment end
79
+ num_equals = match.count("=") # Number must match for string end
80
80
  encoder.begin_group(:string)
81
81
  encoder.text_token(match, :delimiter)
82
82
  state = :long_string
@@ -63,7 +63,7 @@ module Scanners
63
63
 
64
64
  NAME = / [[:alpha:]_] \w* /x # :nodoc:
65
65
  ESCAPE = / [abfnrtv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x # :nodoc:
66
- UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} | N\{[-\w ]+\} /x # :nodoc:
66
+ UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} | N\{[-\w ]+\} /x # :nodoc:
67
67
 
68
68
  OPERATOR = /
69
69
  \.\.\. | # ellipsis
@@ -60,7 +60,7 @@ module Scanners
60
60
 
61
61
  QUOTE_TO_TYPE = {
62
62
  '`' => :shell,
63
- '/'=> :regexp,
63
+ '/' => :regexp,
64
64
  }
65
65
  QUOTE_TO_TYPE.default = :string
66
66
 
@@ -29,7 +29,7 @@ module Scanners
29
29
  char varchar varchar2 enum binary text tinytext mediumtext
30
30
  longtext blob tinyblob mediumblob longblob timestamp
31
31
  date time datetime year double decimal float int
32
- integer tinyint mediumint bigint smallint unsigned bit
32
+ integer tinyint mediumint bigint smallint unsigned bit numeric
33
33
  bool boolean hex bin oct
34
34
  )
35
35
 
@@ -39,6 +39,9 @@ module CodeRay
39
39
  # You can serialize it to a JSON string and store it in a database, pass it
40
40
  # around to encode it more than once, send it to other algorithms...
41
41
  class Tokens < Array
42
+ # Remove Array#filter that is a new alias for Array#select on Ruby 2.6,
43
+ # for method_missing called with filter method.
44
+ undef_method :filter if instance_methods.include?(:filter)
42
45
 
43
46
  # The Scanner instance that created the tokens.
44
47
  attr_accessor :scanner
@@ -1,3 +1,3 @@
1
1
  module CodeRay
2
- VERSION = '1.1.2'
2
+ VERSION = '1.1.3'
3
3
  end
metadata CHANGED
@@ -1,27 +1,25 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: coderay
3
- version: !ruby/object:Gem::Version
4
- version: 1.1.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.3.rc1
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Kornelius Kalnbach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
-
12
- date: 2017-09-03 00:00:00 Z
11
+ date: 2020-05-30 00:00:00.000000000 Z
13
12
  dependencies: []
14
-
15
- description: Fast and easy syntax highlighting for selected languages, written in Ruby. Comes with RedCloth integration and LOC counter.
16
- email:
13
+ description: Fast and easy syntax highlighting for selected languages, written in
14
+ Ruby. Comes with RedCloth integration and LOC counter.
15
+ email:
17
16
  - murphy@rubychan.de
18
- executables:
17
+ executables:
19
18
  - coderay
20
19
  extensions: []
21
-
22
- extra_rdoc_files:
20
+ extra_rdoc_files:
23
21
  - README_INDEX.rdoc
24
- files:
22
+ files:
25
23
  - MIT-LICENSE
26
24
  - README_INDEX.rdoc
27
25
  - bin/coderay
@@ -98,33 +96,29 @@ files:
98
96
  - lib/coderay/tokens_proxy.rb
99
97
  - lib/coderay/version.rb
100
98
  homepage: http://coderay.rubychan.de
101
- licenses:
99
+ licenses:
102
100
  - MIT
103
101
  metadata: {}
104
-
105
102
  post_install_message:
106
- rdoc_options:
107
- - -SNw2
108
- - -mREADME_INDEX.rdoc
109
- - -t CodeRay Documentation
110
- require_paths:
103
+ rdoc_options:
104
+ - "-SNw2"
105
+ - "-mREADME_INDEX.rdoc"
106
+ - "-t CodeRay Documentation"
107
+ require_paths:
111
108
  - lib
112
- required_ruby_version: !ruby/object:Gem::Requirement
113
- requirements:
109
+ required_ruby_version: !ruby/object:Gem::Requirement
110
+ requirements:
114
111
  - - ">="
115
- - !ruby/object:Gem::Version
112
+ - !ruby/object:Gem::Version
116
113
  version: 1.8.6
117
- required_rubygems_version: !ruby/object:Gem::Requirement
118
- requirements:
119
- - - ">="
120
- - !ruby/object:Gem::Version
121
- version: "0"
114
+ required_rubygems_version: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">"
117
+ - !ruby/object:Gem::Version
118
+ version: 1.3.1
122
119
  requirements: []
123
-
124
- rubyforge_project: coderay
125
- rubygems_version: 2.6.13
120
+ rubygems_version: 3.0.6
126
121
  signing_key:
127
122
  specification_version: 4
128
123
  summary: Fast syntax highlighting for selected languages.
129
124
  test_files: []
130
-