Class: Pah::Templates::Rollbar
- Inherits:
-
Pah::Template
- Object
- Rails::Generators::Base
- Pah::Template
- Pah::Templates::Rollbar
- Defined in:
- lib/pah/templates/rollbar.rb
Instance Method Summary collapse
Methods inherited from Pah::Template
#ask_unless_test, #copy_static_file, #git_commit, #static_files, #will_you_like_to?
Instance Method Details
#call ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/pah/templates/rollbar.rb', line 4 def call system 'bundle exec rails generate rollbar -q' search = <<HEREDOC # Here we'll disable in 'test': if Rails.env.test? config.enabled = false end HEREDOC replace = ' config.enabled = Rails.env.production? || Rails.env.staging?' gsub_file 'config/initializers/rollbar.rb', search, replace git add: 'config/initializers/rollbar.rb' git_commit 'Add rollbar initialize file.' end |