]>
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
180 # Example from http://www.ruby-doc.org/docs/ProgrammingRuby/html/language.html
181 d = 4 + 5 + # no '\' needed
184 # Example from http://www.ruby-doc.org/docs/ProgrammingRuby/html/language.html
188 foo = obj.bar { |m| tee(m) } +
189 obj.qux { |m| hum(m) }
198 MSG = 'Separate every 3 digits in the integer portion of a number' \
199 'with underscores(_).'
214 while a < b do # "do" is optional
224 # https://github.com/rails/rails/blob/17f5d8e062909f1fcae25351834d8e89967b645e/activesupport/lib/active_support/time_with_zone.rb#L206
225 foo # comment intended to confuse the tokenizer
245 method arg1, # bug#15594
271 it "is a method call with block" do |asd|
280 and_this_one(has) { |block, parameters|
346 # http://stackoverflow.com/questions/17786563/emacs-ruby-mode-if-expressions-indentation
373 foo = [1, 2, 3].map do |i|
426 a.records().map(&:b).zip(
440 # FIXME: This is not consistent with the example below it, but this
441 # offset only happens if the colon is at eol, which wouldn't be often.
442 # Tokenizing `bar:' as `:bar =>' would be better, but it's hard to
443 # distinguish from a variable reference inside a ternary operator.
451 OpenStruct.new(id: 0, name: "foo") => [
464 return render json: {
465 errors: { base: [message] },