brakeman 3.5.0 → 3.6.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 +4 -4
- data/CHANGES +15 -4
- data/bin/brakeman +6 -1
- data/bundle/load.rb +2 -2
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/Manifest.txt +5 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/README.rdoc +12 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/Rakefile +127 -70
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/compare/normalize.rb +146 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/rp_extensions.rb +77 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/rp_stringscanner.rb +64 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/ruby18_parser.rb +1637 -1646
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/ruby18_parser.y +11 -11
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/ruby19_parser.rb +1602 -1603
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/ruby19_parser.y +12 -12
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/ruby20_parser.rb +2507 -2524
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/ruby20_parser.y +12 -26
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/ruby21_parser.rb +1872 -1868
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/ruby21_parser.y +12 -21
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/ruby22_parser.rb +1758 -1754
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/ruby22_parser.y +12 -21
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/ruby23_parser.rb +1844 -1847
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/ruby23_parser.y +12 -21
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/ruby24_parser.rb +6790 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/ruby24_parser.y +2364 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/ruby_lexer.rb +12 -16
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/ruby_lexer.rex.rb +6 -12
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/ruby_parser.rb +86 -7
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/ruby_parser.yy +51 -50
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/lib/ruby_parser_extras.rb +30 -237
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/test/test_ruby_lexer.rb +54 -41
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/test/test_ruby_parser.rb +775 -700
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.4/test/test_ruby_parser_extras.rb +4 -6
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.7.0 → sexp_processor-4.8.0}/History.txt +7 -0
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.7.0 → sexp_processor-4.8.0}/Manifest.txt +0 -0
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.7.0 → sexp_processor-4.8.0}/README.txt +0 -0
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.7.0 → sexp_processor-4.8.0}/Rakefile +0 -0
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.7.0 → sexp_processor-4.8.0}/lib/composite_sexp_processor.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.7.0 → sexp_processor-4.8.0}/lib/pt_testcase.rb +3 -1
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.7.0 → sexp_processor-4.8.0}/lib/sexp.rb +7 -0
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.7.0 → sexp_processor-4.8.0}/lib/sexp_processor.rb +7 -5
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.7.0 → sexp_processor-4.8.0}/lib/unique.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.7.0 → sexp_processor-4.8.0}/test/test_composite_sexp_processor.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.7.0 → sexp_processor-4.8.0}/test/test_environment.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.7.0 → sexp_processor-4.8.0}/test/test_sexp.rb +21 -2
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.7.0 → sexp_processor-4.8.0}/test/test_sexp_processor.rb +13 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/CHANGELOG.md +4 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/COPYING +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/Gemfile +1 -1
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/HACKING +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/README.md +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/Rakefile +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/bin/tilt +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/docs/TEMPLATES.md +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/docs/common.css +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/asciidoc.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/babel.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/bluecloth.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/builder.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/coffee.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/commonmarker.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/creole.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/csv.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/dummy.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/erb.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/erubi.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/erubis.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/etanni.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/haml.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/kramdown.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/less.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/liquid.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/livescript.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/mapping.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/markaby.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/maruku.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/nokogiri.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/pandoc.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/plain.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/prawn.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/radius.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/rdiscount.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/rdoc.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/redcarpet.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/redcloth.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/rst-pandoc.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/sass.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/sigil.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/string.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/template.rb +10 -1
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/typescript.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/wikicloth.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/lib/tilt/yajl.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/man/index.txt +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/man/tilt.1.ronn +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/markaby/locals.mab +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/markaby/markaby.mab +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/markaby/markaby_other_static.mab +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/markaby/render_twice.mab +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/markaby/scope.mab +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/markaby/yielding.mab +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/mytemplate.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/test_helper.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_asciidoctor_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_babeltemplate.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_blueclothtemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_buildertemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_cache_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_coffeescripttemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_commonmarkertemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_compilesite_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_creoletemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_csv_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_erbtemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_erubistemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_erubitemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_etannitemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_hamltemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_kramdown_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_lesstemplate_test.less +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_lesstemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_liquidtemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_livescripttemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_mapping_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_markaby_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_markdown_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_marukutemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_metadata_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_nokogiritemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_pandoctemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_prawntemplate.prawn +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_prawntemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_radiustemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_rdiscounttemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_rdoctemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_redcarpettemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_redclothtemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_rstpandoctemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_sasstemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_sigil_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_stringtemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_template_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_typescript_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_wikiclothtemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_yajltemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/tilt.gemspec +2 -2
- data/lib/brakeman.rb +4 -0
- data/lib/brakeman/checks/check_sql.rb +2 -2
- data/lib/brakeman/checks/check_xml_dos.rb +0 -6
- data/lib/brakeman/options.rb +4 -0
- data/lib/brakeman/parsers/rails3_erubis.rb +7 -0
- data/lib/brakeman/processors/alias_processor.rb +101 -0
- data/lib/brakeman/processors/controller_processor.rb +3 -1
- data/lib/brakeman/version.rb +1 -1
- metadata +125 -118
@@ -1,10 +1,8 @@
|
|
1
1
|
# encoding: US-ASCII
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
|
7
|
-
require 'minitest/test'
|
3
|
+
require "minitest/autorun"
|
4
|
+
require "ruby_parser_extras"
|
5
|
+
require "ruby_parser"
|
8
6
|
|
9
7
|
class TestStackState < Minitest::Test
|
10
8
|
attr_reader :s
|
@@ -15,7 +13,7 @@ class TestStackState < Minitest::Test
|
|
15
13
|
|
16
14
|
def assert_encoding str, default = false
|
17
15
|
orig_str = str.dup
|
18
|
-
p =
|
16
|
+
p = RubyParser.latest
|
19
17
|
s = nil
|
20
18
|
|
21
19
|
out, err = capture_io do
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/bundle/ruby/2.3.0/gems/{sexp_processor-4.7.0 → sexp_processor-4.8.0}/lib/pt_testcase.rb
RENAMED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
$TESTING = true
|
4
4
|
|
5
|
-
require 'minitest/
|
5
|
+
require 'minitest/test'
|
6
6
|
require 'sexp_processor' # for deep_clone
|
7
7
|
|
8
8
|
# key:
|
@@ -111,6 +111,8 @@ class ParseTreeTestCase < Minitest::Test
|
|
111
111
|
if tversions then
|
112
112
|
cversion = self.class.name[/#{VER_RE}/]
|
113
113
|
|
114
|
+
assert true # shut up prove_it!
|
115
|
+
|
114
116
|
# can't push this up because it may be generating into an
|
115
117
|
# abstract test class and the actual subclass is versioned.
|
116
118
|
return "version specific test" unless tversions.include? cversion if cversion
|
@@ -199,6 +199,13 @@ class Sexp < Array # ZenTest FULL
|
|
199
199
|
end
|
200
200
|
end
|
201
201
|
|
202
|
+
##
|
203
|
+
# Returns the maximum line number of the children of self.
|
204
|
+
|
205
|
+
def line_max
|
206
|
+
self.deep_each.map(&:line).max
|
207
|
+
end
|
208
|
+
|
202
209
|
##
|
203
210
|
# Returns the size of the sexp, flattened.
|
204
211
|
|
data/bundle/ruby/2.3.0/gems/{sexp_processor-4.7.0 → sexp_processor-4.8.0}/lib/sexp_processor.rb
RENAMED
@@ -33,7 +33,7 @@ require 'sexp'
|
|
33
33
|
|
34
34
|
class SexpProcessor
|
35
35
|
|
36
|
-
VERSION = "4.
|
36
|
+
VERSION = "4.8.0"
|
37
37
|
|
38
38
|
##
|
39
39
|
# Automatically shifts off the Sexp type before handing the
|
@@ -488,10 +488,11 @@ class MethodBasedSexpProcessor < SexpProcessor
|
|
488
488
|
##
|
489
489
|
# Adds name to the method stack, for the duration of the block
|
490
490
|
|
491
|
-
def in_method
|
491
|
+
def in_method name, file, line, line_max=nil
|
492
492
|
method_name = Regexp === name ? name.inspect : name.to_s
|
493
493
|
@method_stack.unshift method_name
|
494
|
-
|
494
|
+
line_max = "-#{line_max}" if line_max
|
495
|
+
@method_locations[signature] = "#{file}:#{line}#{line_max}"
|
495
496
|
yield
|
496
497
|
ensure
|
497
498
|
@method_stack.shift
|
@@ -562,7 +563,8 @@ class MethodBasedSexpProcessor < SexpProcessor
|
|
562
563
|
def process_defn(exp)
|
563
564
|
exp.shift unless auto_shift_type # node type
|
564
565
|
name = @sclass.empty? ? exp.shift : "::#{exp.shift}"
|
565
|
-
|
566
|
+
|
567
|
+
in_method name, exp.file, exp.line, exp.line_max do
|
566
568
|
if block_given? then
|
567
569
|
yield
|
568
570
|
else
|
@@ -580,7 +582,7 @@ class MethodBasedSexpProcessor < SexpProcessor
|
|
580
582
|
def process_defs(exp)
|
581
583
|
exp.shift unless auto_shift_type # node type
|
582
584
|
process exp.shift # recv
|
583
|
-
in_method "::#{exp.shift}", exp.file, exp.line do
|
585
|
+
in_method "::#{exp.shift}", exp.file, exp.line, exp.line_max do
|
584
586
|
if block_given? then
|
585
587
|
yield
|
586
588
|
else
|
File without changes
|
File without changes
|
data/bundle/ruby/2.3.0/gems/{sexp_processor-4.7.0 → sexp_processor-4.8.0}/test/test_environment.rb
RENAMED
File without changes
|
@@ -48,8 +48,15 @@ class TestSexp < SexpTestCase # ZenTest FULL
|
|
48
48
|
@sexp_class = Object.const_get(self.class.name[4..-1])
|
49
49
|
@processor = SexpProcessor.new
|
50
50
|
@sexp = @sexp_class.new(1, 2, 3)
|
51
|
-
@basic_sexp = s(:lasgn, :var, s(:lit, 42))
|
52
|
-
@complex_sexp = s(:block,
|
51
|
+
@basic_sexp = s(:lasgn, :var, s(:lit, 42).line(1)).line(1)
|
52
|
+
@complex_sexp = s(:block,
|
53
|
+
s(:lasgn, :foo, s(:str, "foo").line(1)).line(1),
|
54
|
+
s(:if, s(:and, s(:true).line(2), s(:lit, 1).line(2)).line(2),
|
55
|
+
s(:if, s(:lvar, :foo).line(3),
|
56
|
+
s(:str, "bar").line(3),
|
57
|
+
nil).line(3),
|
58
|
+
s(:true).line(5)).line(2)).line(1)
|
59
|
+
|
53
60
|
@re = s(:lit, 42)
|
54
61
|
@bad1 = s(:lit, 24)
|
55
62
|
@bad1 = s(:blah, 42)
|
@@ -193,6 +200,18 @@ class TestSexp < SexpTestCase # ZenTest FULL
|
|
193
200
|
k.new(:a, k.new(:b)).inspect)
|
194
201
|
end
|
195
202
|
|
203
|
+
def test_line
|
204
|
+
assert_nil @sexp.line
|
205
|
+
assert_equal 1, @basic_sexp.line
|
206
|
+
assert_equal 1, @complex_sexp.line
|
207
|
+
end
|
208
|
+
|
209
|
+
def test_line_max
|
210
|
+
assert_nil @sexp.line_max
|
211
|
+
assert_equal 1, @basic_sexp.line_max
|
212
|
+
assert_equal 5, @complex_sexp.line_max
|
213
|
+
end
|
214
|
+
|
196
215
|
def test_mass
|
197
216
|
assert_equal 1, s(:a).mass
|
198
217
|
assert_equal 3, s(:a, s(:b), s(:c)).mass
|
@@ -327,6 +327,19 @@ class TestMethodBasedSexpProcessor < Minitest::Test
|
|
327
327
|
assert_equal expected, processor.method_locations
|
328
328
|
end
|
329
329
|
|
330
|
+
def test_in_method_line_max
|
331
|
+
assert_empty processor.method_stack
|
332
|
+
|
333
|
+
processor.in_method "xxx", "file.rb", 42, 44 do
|
334
|
+
assert_equal ["xxx"], processor.method_stack
|
335
|
+
end
|
336
|
+
|
337
|
+
assert_empty processor.method_stack
|
338
|
+
|
339
|
+
expected = {"main#xxx" => "file.rb:42-44"}
|
340
|
+
assert_equal expected, processor.method_locations
|
341
|
+
end
|
342
|
+
|
330
343
|
def test_klass_name
|
331
344
|
assert_equal :main, processor.klass_name
|
332
345
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -2,7 +2,16 @@ require 'thread'
|
|
2
2
|
|
3
3
|
module Tilt
|
4
4
|
# @private
|
5
|
-
TOPOBJECT =
|
5
|
+
TOPOBJECT = if RUBY_VERSION >= '2.0'
|
6
|
+
# @private
|
7
|
+
module CompiledTemplates
|
8
|
+
self
|
9
|
+
end
|
10
|
+
elsif RUBY_VERSION >= '1.9'
|
11
|
+
BasicObject
|
12
|
+
else
|
13
|
+
Object
|
14
|
+
end
|
6
15
|
# @private
|
7
16
|
LOCK = Mutex.new
|
8
17
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_coffeescripttemplate_test.rb
RENAMED
File without changes
|
data/bundle/ruby/2.3.0/gems/{tilt-2.0.6 → tilt-2.0.7}/test/tilt_commonmarkertemplate_test.rb
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -3,8 +3,8 @@ Gem::Specification.new do |s|
|
|
3
3
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
4
4
|
|
5
5
|
s.name = 'tilt'
|
6
|
-
s.version = '2.0.
|
7
|
-
s.date = '2017-
|
6
|
+
s.version = '2.0.7'
|
7
|
+
s.date = '2017-03-19'
|
8
8
|
|
9
9
|
s.description = "Generic interface to multiple Ruby template engines"
|
10
10
|
s.summary = s.description
|