Module: RailsAssist::File::Environment
Instance Method Summary collapse
- #insert_after_application_init(content = nil, &block) ⇒ Object
- #insert_application_init(place, statement = nil, &block) ⇒ Object
- #insert_before_application_init(content = nil, &block) ⇒ Object
Instance Method Details
#insert_after_application_init(content = nil, &block) ⇒ Object
7 8 9 |
# File 'lib/rails_assist/file/environment.rb', line 7 def insert_after_application_init content=nil, &block insert_application_init :after, content, &block end |
#insert_application_init(place, statement = nil, &block) ⇒ Object
11 12 13 14 |
# File 'lib/rails_assist/file/environment.rb', line 11 def insert_application_init place, statement=nil, &block statement = block ? yield : statement environment_file.insert statement, place => /\w+#{Regexp.escape('::Application.initialize!')}/ end |
#insert_before_application_init(content = nil, &block) ⇒ Object
3 4 5 |
# File 'lib/rails_assist/file/environment.rb', line 3 def insert_before_application_init content=nil, &block insert_application_init :before, content, &block end |