brakeman 3.4.0 → 3.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +10 -0
  3. data/bundle/load.rb +3 -3
  4. data/bundle/ruby/2.3.0/gems/{ruby2ruby-2.3.0 → ruby2ruby-2.3.1}/History.txt +10 -0
  5. data/bundle/ruby/2.3.0/gems/{ruby2ruby-2.3.0 → ruby2ruby-2.3.1}/Manifest.txt +0 -0
  6. data/bundle/ruby/2.3.0/gems/{ruby2ruby-2.3.0 → ruby2ruby-2.3.1}/README.txt +0 -0
  7. data/bundle/ruby/2.3.0/gems/{ruby2ruby-2.3.0 → ruby2ruby-2.3.1}/Rakefile +0 -0
  8. data/bundle/ruby/2.3.0/gems/{ruby2ruby-2.3.0 → ruby2ruby-2.3.1}/bin/r2r_show +0 -0
  9. data/bundle/ruby/2.3.0/gems/{ruby2ruby-2.3.0 → ruby2ruby-2.3.1}/lib/ruby2ruby.rb +34 -1
  10. data/bundle/ruby/2.3.0/gems/{ruby2ruby-2.3.0 → ruby2ruby-2.3.1}/test/test_ruby2ruby.rb +41 -0
  11. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/History.txt +12 -0
  12. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/Manifest.txt +0 -0
  13. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/README.txt +0 -0
  14. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/Rakefile +0 -0
  15. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/bin/ruby_parse +0 -0
  16. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/bin/ruby_parse_extract_error +0 -0
  17. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/lib/ruby18_parser.rb +7 -8
  18. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/lib/ruby18_parser.y +7 -8
  19. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/lib/ruby19_parser.rb +8 -9
  20. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/lib/ruby19_parser.y +10 -11
  21. data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.3/lib/ruby20_parser.rb +6690 -0
  22. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/lib/ruby20_parser.y +14 -50
  23. data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.3/lib/ruby21_parser.rb +6738 -0
  24. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/lib/ruby21_parser.y +14 -48
  25. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/lib/ruby22_parser.rb +263 -286
  26. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/lib/ruby22_parser.y +14 -45
  27. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/lib/ruby23_parser.rb +269 -292
  28. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/lib/ruby23_parser.y +14 -45
  29. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/lib/ruby_lexer.rb +41 -8
  30. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/lib/ruby_lexer.rex +6 -6
  31. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/lib/ruby_lexer.rex.rb +17 -11
  32. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/lib/ruby_parser.rb +0 -0
  33. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/lib/ruby_parser.yy +20 -33
  34. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/lib/ruby_parser_extras.rb +65 -3
  35. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/test/test_ruby_lexer.rb +88 -14
  36. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/test/test_ruby_parser.rb +102 -9
  37. data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.2 → ruby_parser-3.8.3}/test/test_ruby_parser_extras.rb +1 -1
  38. data/bundle/ruby/2.3.0/gems/{terminal-table-1.7.1 → terminal-table-1.7.3}/Gemfile +2 -0
  39. data/bundle/ruby/2.3.0/gems/{terminal-table-1.7.1 → terminal-table-1.7.3}/History.rdoc +10 -0
  40. data/bundle/ruby/2.3.0/gems/{terminal-table-1.7.1 → terminal-table-1.7.3}/Manifest +0 -0
  41. data/bundle/ruby/2.3.0/gems/{terminal-table-1.7.1 → terminal-table-1.7.3}/README.rdoc +0 -0
  42. data/bundle/ruby/2.3.0/gems/terminal-table-1.7.3/Rakefile +15 -0
  43. data/bundle/ruby/2.3.0/gems/{terminal-table-1.7.1 → terminal-table-1.7.3}/Todo.rdoc +0 -0
  44. data/bundle/ruby/2.3.0/gems/{terminal-table-1.7.1 → terminal-table-1.7.3}/examples/examples.rb +0 -0
  45. data/bundle/ruby/2.3.0/gems/{terminal-table-1.7.1 → terminal-table-1.7.3}/lib/terminal-table.rb +0 -0
  46. data/bundle/ruby/2.3.0/gems/{terminal-table-1.7.1 → terminal-table-1.7.3}/lib/terminal-table/cell.rb +0 -0
  47. data/bundle/ruby/2.3.0/gems/{terminal-table-1.7.1 → terminal-table-1.7.3}/lib/terminal-table/import.rb +0 -0
  48. data/bundle/ruby/2.3.0/gems/{terminal-table-1.7.1 → terminal-table-1.7.3}/lib/terminal-table/row.rb +4 -0
  49. data/bundle/ruby/2.3.0/gems/{terminal-table-1.7.1 → terminal-table-1.7.3}/lib/terminal-table/separator.rb +0 -0
  50. data/bundle/ruby/2.3.0/gems/{terminal-table-1.7.1 → terminal-table-1.7.3}/lib/terminal-table/style.rb +9 -0
  51. data/bundle/ruby/2.3.0/gems/terminal-table-1.7.3/lib/terminal-table/table.rb +343 -0
  52. data/bundle/ruby/2.3.0/gems/{terminal-table-1.7.1 → terminal-table-1.7.3}/lib/terminal-table/table_helper.rb +0 -0
  53. data/bundle/ruby/2.3.0/gems/{terminal-table-1.7.1 → terminal-table-1.7.3}/lib/terminal-table/version.rb +1 -1
  54. data/bundle/ruby/2.3.0/gems/{terminal-table-1.7.1 → terminal-table-1.7.3}/terminal-table.gemspec +0 -0
  55. data/lib/brakeman.rb +2 -1
  56. data/lib/brakeman/app_tree.rb +22 -5
  57. data/lib/brakeman/checks/check_forgery_setting.rb +43 -31
  58. data/lib/brakeman/checks/check_link_to_href.rb +33 -19
  59. data/lib/brakeman/checks/check_sql.rb +3 -1
  60. data/lib/brakeman/checks/check_symbol_dos.rb +1 -0
  61. data/lib/brakeman/checks/check_unsafe_reflection.rb +1 -1
  62. data/lib/brakeman/options.rb +5 -0
  63. data/lib/brakeman/processors/gem_processor.rb +17 -10
  64. data/lib/brakeman/report/ignore/interactive.rb +17 -6
  65. data/lib/brakeman/scanner.rb +4 -0
  66. data/lib/brakeman/tracker/config.rb +10 -1
  67. data/lib/brakeman/version.rb +1 -1
  68. metadata +53 -53
  69. data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.2/lib/ruby20_parser.rb +0 -6728
  70. data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.2/lib/ruby21_parser.rb +0 -6766
  71. data/bundle/ruby/2.3.0/gems/terminal-table-1.7.1/Rakefile +0 -9
  72. data/bundle/ruby/2.3.0/gems/terminal-table-1.7.1/lib/terminal-table/table.rb +0 -239
@@ -1,9 +0,0 @@
1
- require "bundler/gem_tasks"
2
-
3
- desc "Run specs"
4
- task :spec do
5
- sh "bundle exec rspec -f progress"
6
- end
7
-
8
- desc "Default: Run specs"
9
- task :default => [:spec]
@@ -1,239 +0,0 @@
1
- require 'unicode/display_width'
2
-
3
- module Terminal
4
- class Table
5
-
6
- attr_reader :title
7
- attr_reader :headings
8
-
9
- ##
10
- # Generates a ASCII table with the given _options_.
11
-
12
- def initialize options = {}, &block
13
- @column_widths = []
14
- self.style = options.fetch :style, {}
15
- self.headings = options.fetch :headings, []
16
- self.rows = options.fetch :rows, []
17
- self.title = options.fetch :title, nil
18
- yield_or_eval(&block) if block
19
- end
20
-
21
- ##
22
- # Align column _n_ to the given _alignment_ of :center, :left, or :right.
23
-
24
- def align_column n, alignment
25
- r = rows
26
- column(n).each_with_index do |col, i|
27
- cell = r[i][n]
28
- cell.alignment = alignment unless cell.alignment?
29
- end
30
- end
31
-
32
- ##
33
- # Add a row.
34
-
35
- def add_row array
36
- row = array == :separator ? Separator.new(self) : Row.new(self, array)
37
- @rows << row
38
- recalc_column_widths row
39
- end
40
- alias :<< :add_row
41
-
42
- ##
43
- # Add a separator.
44
-
45
- def add_separator
46
- self << :separator
47
- end
48
-
49
- def cell_spacing
50
- cell_padding + style.border_y.length
51
- end
52
-
53
- def cell_padding
54
- style.padding_left + style.padding_right
55
- end
56
-
57
- ##
58
- # Return column _n_.
59
-
60
- def column n, method = :value, array = rows
61
- array.map { |row|
62
- # for each cells in a row, find the column with index
63
- # just greater than the required one, and go back one.
64
- index = col = 0
65
- row.cells.each do |cell|
66
- break if index > n
67
- index += cell.colspan
68
- col += 1
69
- end
70
- cell = row[col - 1]
71
- cell && method ? cell.__send__(method) : cell
72
- }.compact
73
- end
74
-
75
- ##
76
- # Return _n_ column including headings.
77
-
78
- def column_with_headings n, method = :value
79
- column n, method, headings_with_rows
80
- end
81
-
82
- ##
83
- # Return columns.
84
-
85
- def columns
86
- (0...number_of_columns).map { |n| column n }
87
- end
88
-
89
- ##
90
- # Return length of column _n_.
91
-
92
- def column_width n
93
- width = @column_widths[n] || 0
94
- width + additional_column_widths[n].to_i
95
- end
96
- alias length_of_column column_width # for legacy support
97
-
98
- ##
99
- # Return total number of columns available.
100
-
101
- def number_of_columns
102
- headings_with_rows.map { |r| r.cells.size }.max
103
- end
104
-
105
- ##
106
- # Set the headings
107
-
108
- def headings= arrays
109
- arrays = [arrays] unless arrays.first.is_a?(Array)
110
- @headings = arrays.map do |array|
111
- row = Row.new(self, array)
112
- recalc_column_widths row
113
- row
114
- end
115
- end
116
-
117
- ##
118
- # Render the table.
119
-
120
- def render
121
- separator = Separator.new(self)
122
- buffer = [separator]
123
- unless @title.nil?
124
- buffer << Row.new(self, [title_cell_options])
125
- buffer << separator
126
- end
127
- @headings.each do |row|
128
- unless row.cells.empty?
129
- buffer << row
130
- buffer << separator
131
- end
132
- end
133
- if style.all_separators
134
- buffer += @rows.product([separator]).flatten
135
- else
136
- buffer += @rows
137
- buffer << separator
138
- end
139
- buffer.map { |r| style.margin_left + r.render.rstrip }.join("\n")
140
- end
141
- alias :to_s :render
142
-
143
- ##
144
- # Return rows without separator rows.
145
-
146
- def rows
147
- @rows.reject { |row| row.is_a? Separator }
148
- end
149
-
150
- def rows= array
151
- @rows = []
152
- array.each { |arr| self << arr }
153
- end
154
-
155
- def style=(options)
156
- style.apply options
157
- end
158
-
159
- def style
160
- @style ||= Style.new
161
- end
162
-
163
- def title=(title)
164
- @title = title
165
- recalc_column_widths Row.new(self, [title_cell_options])
166
- end
167
-
168
- ##
169
- # Check if _other_ is equal to self. _other_ is considered equal
170
- # if it contains the same headings and rows.
171
-
172
- def == other
173
- if other.respond_to? :render and other.respond_to? :rows
174
- self.headings == other.headings and self.rows == other.rows
175
- end
176
- end
177
-
178
- private
179
-
180
- def columns_width
181
- @column_widths.inject(0) { |s, i| s + i + cell_spacing } + style.border_y.length
182
- end
183
-
184
- def additional_column_widths
185
- return [] if style.width.nil?
186
- spacing = style.width - columns_width
187
- if spacing < 0
188
- raise "Table width exceeds wanted width of #{style.width} characters."
189
- else
190
- per_col = spacing / number_of_columns
191
- arr = (1...number_of_columns).to_a.map { |i| per_col }
192
- other_cols = arr.inject(0) { |s, i| s + i }
193
- arr << spacing - other_cols
194
- arr
195
- end
196
- end
197
-
198
- def recalc_column_widths row
199
- return if row.is_a? Separator
200
- i = 0
201
- row.cells.each do |cell|
202
- colspan = cell.colspan
203
- cell_value = cell.value_for_column_width_recalc
204
- colspan.downto(1) do |j|
205
- cell_length = Unicode::DisplayWidth.of(cell_value.to_s)
206
- if colspan > 1
207
- spacing_length = cell_spacing * (colspan - 1)
208
- length_in_columns = (cell_length - spacing_length)
209
- cell_length = (length_in_columns.to_f / colspan).ceil
210
- end
211
- if @column_widths[i].to_i < cell_length
212
- @column_widths[i] = cell_length
213
- end
214
- i = i + 1
215
- end
216
- end
217
- end
218
-
219
- ##
220
- # Return headings combined with rows.
221
-
222
- def headings_with_rows
223
- @headings + rows
224
- end
225
-
226
- def yield_or_eval &block
227
- return unless block
228
- if block.arity > 0
229
- yield self
230
- else
231
- self.instance_eval(&block)
232
- end
233
- end
234
-
235
- def title_cell_options
236
- {:value => @title, :alignment => :center, :colspan => number_of_columns}
237
- end
238
- end
239
- end