]>
code.delx.au - gnu-emacs/blob - test/manual/indent/ruby.rb
1 if something_wrong
? # ruby-move-to-block-skips-heredoc
2 ActiveSupport
::Deprecation.warn(<<-eowarn)
18 b
= %Q{This is a "string"}
22 d = %(hello (nested) world)
24 # Don't propertize percent literals inside strings.
25 "(%s, %s)" % [123, 456]
34 # Regexp after whitelisted method.
37 # Don't mis-match "sub" at the end of words.
38 a = asub / aslb + bsub / bslb;
40 # Highlight the regexp after "if".
41 x = toto / foo if /do bar/ =~ "dobar"
43 # Regexp options are highlighted.
45 /foo/xi != %r{bar}mo.tee
48 bar { |qux| /'fee"/ } # bug#20026
51 bar(class: XXX) do # ruby-indent-keyword-label
56 foo = [1, # ruby-deep-indent
59 foo = { # ruby-deep-indent-disabled
100 foo = [ # ruby-deep-indent-disabled
104 foo( # ruby-deep-indent-disabled
139 # Support for this syntax was removed in Ruby 1.9, so we
140 # probably don't need to handle it either.
149 # Some Cucumber code:
158 return false unless method == :+
159 x = y + z # Bug#16609
171 # Example from http://www.ruby-doc.org/docs/ProgrammingRuby/html/language.html
172 d = 4 + 5 + # no '\' needed
175 # Example from http://www.ruby-doc.org/docs/ProgrammingRuby/html/language.html
179 foo = obj.bar { |m| tee(m) } +
180 obj.qux { |m| hum(m) }
189 MSG = 'Separate every 3 digits in the integer portion of a number' \
190 'with underscores(_).'
202 while a < b do # "do" is optional
212 # https://github.com/rails/rails/blob/17f5d8e062909f1fcae25351834d8e89967b645e/activesupport/lib/active_support/time_with_zone.rb#L206
230 method arg1, # bug#15594
256 it "is a method call with block" do |asd|
265 and_this_one(has) { |block, parameters|
304 # http://stackoverflow.com/questions/17786563/emacs-ruby-mode-if-expressions-indentation
331 foo = [1, 2, 3].map do |i|
384 a.records().map(&:b).zip(
387 # FIXME: This is not consistent with the example below it, but this
388 # offset only happens if the colon is at eol, which wouldn't be often.
389 # Tokenizing `bar:' as `:bar =>' would be better, but it's hard to
390 # distinguish from a variable reference inside a ternary operator.
405 return render json: {
406 errors: { base: [message] },