Class: RailsUpgrade::Upgraders::RouteObject

Inherits:
Object
  • Object
show all
Defined in:
lib/rails-upgrade/upgraders/routes.rb

Direct Known Subclasses

FakeNamespace, FakeResourceRoute, FakeRoute

Instance Method Summary collapse

Instance Method Details

#indent_lines(code_lines) ⇒ Object



140
141
142
143
144
145
146
# File 'lib/rails-upgrade/upgraders/routes.rb', line 140

def indent_lines(code_lines)
  if code_lines.length > 1
    code_lines.flatten.map {|l| "#{@indent}#{l.chomp}"}.join("\n") + "\n"
  else
    "#{@indent}#{code_lines.shift}"
  end
end

#opts_to_string(opts) ⇒ Object



148
149
150
151
# File 'lib/rails-upgrade/upgraders/routes.rb', line 148

def opts_to_string(opts)
  # omg hax.  again.
  opts.is_a?(Hash) ? opts.inspect.match(/^\{(.*)\}$/)[1] : nil
end