rouge 0.3.9 → 0.3.10

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,186 @@
1
+ # MIT license. See http://www.opensource.org/licenses/mit-license.php
2
+
3
+ Copyright (c) 2012 Jay Adkisson.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
22
+
23
+ # SPECIAL NOTE:
24
+ Many of the lexers in this project are adaptations of those in Pygments
25
+ (pygments.org). The license for Pygments is as follows:
26
+
27
+ # BEGIN pygments/LICENSE #
28
+
29
+ Copyright (c) 2006-2012 by the respective authors (see AUTHORS file).
30
+ All rights reserved.
31
+
32
+ Redistribution and use in source and binary forms, with or without
33
+ modification, are permitted provided that the following conditions are
34
+ met:
35
+
36
+ * Redistributions of source code must retain the above copyright
37
+ notice, this list of conditions and the following disclaimer.
38
+
39
+ * Redistributions in binary form must reproduce the above copyright
40
+ notice, this list of conditions and the following disclaimer in the
41
+ documentation and/or other materials provided with the distribution.
42
+
43
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
44
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
45
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
46
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
47
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
48
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
49
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
50
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
51
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
52
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
53
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54
+
55
+ # END pygments/LICENSE #
56
+
57
+ The contents of the AUTHORS file at the time of porting was:
58
+
59
+ # BEGIN pygments/AUTHORS #
60
+
61
+ Pygments is written and maintained by Georg Brandl <georg@python.org>.
62
+
63
+ Major developers are Tim Hatch <tim@timhatch.com> and Armin Ronacher
64
+ <armin.ronacher@active-4.com>.
65
+
66
+ Other contributors, listed alphabetically, are:
67
+
68
+ * Sam Aaron -- Ioke lexer
69
+ * Kumar Appaiah -- Debian control lexer
70
+ * Ali Afshar -- image formatter
71
+ * Andreas Amann -- AppleScript lexer
72
+ * Jeffrey Arnold -- R/S lexer, BUGS lexers
73
+ * Jeremy Ashkenas -- CoffeeScript lexer
74
+ * Stefan Matthias Aust -- Smalltalk lexer
75
+ * Ben Bangert -- Mako lexers
76
+ * Max Battcher -- Darcs patch lexer
77
+ * Paul Baumgart, 280 North, Inc. -- Objective-J lexer
78
+ * Michael Bayer -- Myghty lexers
79
+ * John Benediktsson -- Factor lexer
80
+ * Christopher Bertels -- Fancy lexer
81
+ * Jarrett Billingsley -- MiniD lexer
82
+ * Adam Blinkinsop -- Haskell, Redcode lexers
83
+ * Frits van Bommel -- assembler lexers
84
+ * Pierre Bourdon -- bugfixes
85
+ * Hiram Chirino -- Scaml and Jade lexers
86
+ * Leaf Corcoran -- MoonScript lexer
87
+ * Christopher Creutzig -- MuPAD lexer
88
+ * Pete Curry -- bugfixes
89
+ * Owen Durni -- haXe lexer
90
+ * Nick Efford -- Python 3 lexer
91
+ * Sven Efftinge -- Xtend lexer
92
+ * Artem Egorkine -- terminal256 formatter
93
+ * James H. Fisher -- PostScript lexer
94
+ * Carlos Galdino -- Elixir and Elixir Console lexers
95
+ * Naveen Garg -- Autohotkey lexer
96
+ * Laurent Gautier -- R/S lexer
97
+ * Alex Gaynor -- PyPy log lexer
98
+ * Bertrand Goetzmann -- Groovy lexer
99
+ * Krzysiek Goj -- Scala lexer
100
+ * Matt Good -- Genshi, Cheetah lexers
101
+ * Patrick Gotthardt -- PHP namespaces support
102
+ * Olivier Guibe -- Asymptote lexer
103
+ * Martin Harriman -- SNOBOL lexer
104
+ * Matthew Harrison -- SVG formatter
105
+ * Steven Hazel -- Tcl lexer
106
+ * Aslak Hellesøy -- Gherkin lexer
107
+ * Greg Hendershott -- Racket lexer
108
+ * Jordi Gutiérrez Hermoso -- Octave lexer
109
+ * David Hess, Fish Software, Inc. -- Objective-J lexer
110
+ * Varun Hiremath -- Debian control lexer
111
+ * Doug Hogan -- Mscgen lexer
112
+ * Ben Hollis -- Mason lexer
113
+ * Tim Howard -- BlitzMax lexer
114
+ * Ivan Inozemtsev -- Fantom lexer
115
+ * Brian R. Jackson -- Tea lexer
116
+ * Dennis Kaarsemaker -- sources.list lexer
117
+ * Igor Kalnitsky -- vhdl lexer
118
+ * Eric Knibbe -- Lasso lexer
119
+ * Adam Koprowski -- Opa lexer
120
+ * Benjamin Kowarsch -- Modula-2 lexer
121
+ * Alexander Kriegisch -- Kconfig and AspectJ lexers
122
+ * Marek Kubica -- Scheme lexer
123
+ * Jochen Kupperschmidt -- Markdown processor
124
+ * Gerd Kurzbach -- Modelica lexer
125
+ * Olov Lassus -- Dart lexer
126
+ * Sylvestre Ledru -- Scilab lexer
127
+ * Mark Lee -- Vala lexer
128
+ * Ben Mabey -- Gherkin lexer
129
+ * Simone Margaritelli -- Hybris lexer
130
+ * Kirk McDonald -- D lexer
131
+ * Gordon McGregor -- SystemVerilog lexer
132
+ * Stephen McKamey -- Duel/JBST lexer
133
+ * Brian McKenna -- F# lexer
134
+ * Lukas Meuser -- BBCode formatter, Lua lexer
135
+ * Paul Miller -- LiveScript lexer
136
+ * Hong Minhee -- HTTP lexer
137
+ * Michael Mior -- Awk lexer
138
+ * Jon Morton -- Rust lexer
139
+ * Paulo Moura -- Logtalk lexer
140
+ * Mher Movsisyan -- DTD lexer
141
+ * Ana Nelson -- Ragel, ANTLR, R console lexers
142
+ * Nam T. Nguyen -- Monokai style
143
+ * Jesper Noehr -- HTML formatter "anchorlinenos"
144
+ * Mike Nolta -- Julia lexer
145
+ * Jonas Obrist -- BBCode lexer
146
+ * David Oliva -- Rebol lexer
147
+ * Jon Parise -- Protocol buffers lexer
148
+ * Ronny Pfannschmidt -- BBCode lexer
149
+ * Benjamin Peterson -- Test suite refactoring
150
+ * Dominik Picheta -- Nimrod lexer
151
+ * Clément Prévost -- UrbiScript lexer
152
+ * Kashif Rasul -- CUDA lexer
153
+ * Justin Reidy -- MXML lexer
154
+ * Norman Richards -- JSON lexer
155
+ * Lubomir Rintel -- GoodData MAQL and CL lexers
156
+ * Andre Roberge -- Tango style
157
+ * Konrad Rudolph -- LaTeX formatter enhancements
158
+ * Mario Ruggier -- Evoque lexers
159
+ * Stou Sandalski -- NumPy, FORTRAN, tcsh and XSLT lexers
160
+ * Matteo Sasso -- Common Lisp lexer
161
+ * Joe Schafer -- Ada lexer
162
+ * Ken Schutte -- Matlab lexers
163
+ * Tassilo Schweyer -- Io, MOOCode lexers
164
+ * Joerg Sieker -- ABAP lexer
165
+ * Robert Simmons -- Standard ML lexer
166
+ * Kirill Simonov -- YAML lexer
167
+ * Steve Spigarelli -- XQuery lexer
168
+ * Jerome St-Louis -- eC lexer
169
+ * James Strachan -- Kotlin lexer
170
+ * Tiberius Teng -- default style overhaul
171
+ * Jeremy Thurgood -- Erlang, Squid config lexers
172
+ * Erick Tryzelaar -- Felix lexer
173
+ * Daniele Varrazzo -- PostgreSQL lexers
174
+ * Abe Voelker -- OpenEdge ABL lexer
175
+ * Whitney Young -- ObjectiveC lexer
176
+ * Matthias Vallentin -- Bro lexer
177
+ * Nathan Weizenbaum -- Haml and Sass lexers
178
+ * Dietmar Winkler -- Modelica lexer
179
+ * Nils Winter -- Smalltalk lexer
180
+ * Davy Wybiral -- Clojure lexer
181
+ * Diego Zamboni -- CFengine3 lexer
182
+ * Alex Zimin -- Nemerle lexer
183
+
184
+ Many thanks for all contributions!
185
+
186
+ # END pygments/AUTHORS #
@@ -0,0 +1,8 @@
1
+ dbenford <- function(x){
2
+ log10(1 + 1/x)
3
+ }
4
+
5
+ pbenford <- function(q){
6
+ cumprobs <- cumsum(dbenford(1:9))
7
+ return(cumprobs[q])
8
+ }
@@ -0,0 +1,54 @@
1
+ module Rouge
2
+ module Lexers
3
+ class R < RegexLexer
4
+ desc 'The R statistics language (r-project.org)'
5
+ tag 'r'
6
+ aliases 'r', 'R', 's', 'S'
7
+ filenames '*.R', '*.S', '.Rhistory', '.Rprofile'
8
+ mimetypes 'text/x-r-source', 'text/x-r', 'text/x-R'
9
+
10
+ mimetypes 'text/x-r', 'application/x-r'
11
+
12
+ def self.keywords
13
+ @keywords ||= %w(
14
+ if else for while repeat in next break return switch function
15
+ )
16
+ end
17
+
18
+ def self.analyze_text(text)
19
+ return 1 if text.shebang? 'Rscript'
20
+ return 0.1 if text.include? '->'
21
+ end
22
+
23
+ state :root do
24
+ rule /#.*?\n/, 'Comment.Single'
25
+ rule /\s+/m, 'Text'
26
+ rule /[.]?[a-zA-Z_][\w.]*/ do |m|
27
+ if self.class.keywords.include? m[0]
28
+ token 'Keyword'
29
+ else
30
+ token 'Name'
31
+ end
32
+ end
33
+
34
+ rule /`.*?`/, 'Literal.String.Backtick'
35
+ rule /'(\\.|.)*?'/m, 'Literal.String.Single'
36
+ rule /"(\\.|.)*?"/m, 'Literal.String.Double'
37
+
38
+ rule /\b(NULL|Inf|TRUE|FALSE|NaN)\b/, 'Keyword.Constant'
39
+ rule /\bNA(_(integer|real|complex|character)_)?\b/,
40
+ 'Keyword.Constant'
41
+ rule /\b[TF]\b/, 'Keyword.Variable'
42
+
43
+ rule /0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?/, 'Literal.Number.Hex'
44
+ rule /[+-]?(\d+([.]\d+)?|[.]\d+)([eE][+-]?\d+)?[Li]?/,
45
+ 'Literal.Number'
46
+
47
+ rule /[\[\]{}();,]/, 'Punctuation'
48
+
49
+ rule %r([-<>?*+^/!=~$@:%&|]), 'Operator'
50
+ rule /[.][.][.]/, 'Keyword'
51
+ end
52
+ end
53
+ end
54
+ end
@@ -1,5 +1,5 @@
1
1
  module Rouge
2
2
  def self.version
3
- "0.3.9"
3
+ "0.3.10"
4
4
  end
5
5
  end
@@ -12,8 +12,9 @@ Gem::Specification.new do |s|
12
12
  desc
13
13
  s.homepage = "http://github.com/jayferd/rouge"
14
14
  s.rubyforge_project = "rouge"
15
- s.files = Dir['Gemfile', 'rouge.gemspec', 'lib/**/*.rb', 'bin/rougify', 'lib/rouge/demos/*']
15
+ s.files = Dir['Gemfile', 'LICENSE', 'rouge.gemspec', 'lib/**/*.rb', 'bin/rougify', 'lib/rouge/demos/*']
16
16
  s.executables = %w(rougify)
17
+ s.license = 'MIT (see LICENSE file)'
17
18
 
18
19
  s.add_dependency 'thor'
19
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rouge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.3.10
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-07-19 00:00:00.000000000 Z
12
+ date: 2013-08-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  type: :runtime
@@ -36,6 +36,7 @@ extensions: []
36
36
  extra_rdoc_files: []
37
37
  files:
38
38
  - Gemfile
39
+ - LICENSE
39
40
  - rouge.gemspec
40
41
  - lib/rouge/token.rb
41
42
  - lib/rouge/version.rb
@@ -110,6 +111,7 @@ files:
110
111
  - lib/rouge/lexers/cpp.rb
111
112
  - lib/rouge/lexers/sql.rb
112
113
  - lib/rouge/lexers/haskell.rb
114
+ - lib/rouge/lexers/r.rb
113
115
  - lib/rouge/lexers/markdown.rb
114
116
  - lib/rouge/lexers/prolog.rb
115
117
  - lib/rouge/lexers/conf.rb
@@ -132,6 +134,7 @@ files:
132
134
  - lib/rouge/demos/perl
133
135
  - lib/rouge/demos/text
134
136
  - lib/rouge/demos/prolog
137
+ - lib/rouge/demos/r
135
138
  - lib/rouge/demos/viml
136
139
  - lib/rouge/demos/haskell
137
140
  - lib/rouge/demos/css
@@ -171,7 +174,8 @@ files:
171
174
  - lib/rouge/demos/scheme
172
175
  - lib/rouge/demos/diff
173
176
  homepage: http://github.com/jayferd/rouge
174
- licenses: []
177
+ licenses:
178
+ - MIT (see LICENSE file)
175
179
  post_install_message:
176
180
  rdoc_options: []
177
181
  require_paths: