mic_monitor_gem 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82c62004a3e4a3427728853c5821ceaab152b23cf64ea4e0ab20ce6f9d3d9c33
4
- data.tar.gz: 4fd74408972b5e1551768bec655d723a4b3042fafe35db9d37b1b627435d4de7
3
+ metadata.gz: 11a25f5f2dbe7a6556914666bf9f9edbac1d76da4b12d259f2612aa0e68a0961
4
+ data.tar.gz: fa3fbae548734598b7c446184e311457a2c6c568ade45543d7511b30ec658cb8
5
5
  SHA512:
6
- metadata.gz: 8c2220a37bd7cfd6aeadd251739c882ae7084e6aa8206833245f9e93d9ab57598e343e88643eef0c1acad55e14ae8958607c357526a7437714c5542aafc3e335
7
- data.tar.gz: f2699d1df07b8e7e5d3d48beae0e56e50070d1d33415658d408a33f2796730cc4c188372357a5a5e25a4da89b9f6e0b912493365a9516c9e8cdca03ff7f3a007
6
+ metadata.gz: b4287e81bd8b02ad3c23cea4b5e2ba66cd554b5aa5438fa975015a8e40991b84e9c62bc553cc83693edbc3b1ce2d4f1fcdec5aac56d9aacbdeae5e4100673a91
7
+ data.tar.gz: 51f68a53bffc2ed787764eca8d1cb1cde59e727d9e9579c452dd59509a261115f527f965fcea6a880515df33b2a0e94eabf31d113eaef528a4cb8cf56c9d195b
@@ -3,19 +3,24 @@ module MicMonitorGem
3
3
  class InstallGenerator < Rails::Generators::Base
4
4
  source_root File.expand_path('templates', __dir__)
5
5
 
6
- ENV_PATH = "#{Rails.root}/config/environments/production.rb"
6
+ GEM_PATH = "#{Rails.root}/config/initializers/mic_monitor_gem.rb"
7
7
 
8
- def add_config_email_to_env_produciton
9
- append_to_file ENV_PATH do
10
- <<-'RUBY'
8
+ def create_file_mic_monitor_gem
9
+ template 'mic_monitor_gem.rb', GEM_PATH
10
+ end
11
11
 
12
- Rails.application.config.middleware.use ExceptionNotification::Rack,
13
- email: {
14
- deliver_with: :deliver, # Rails >= 4.2.1 do not need this option since it defaults to :deliver_now
15
- email_prefix: ENV['EMAIL_PREFIX'],
16
- sender_address: ENV['SENDER_ADDRESS'],
17
- exception_recipients: ENV['EXCEPTION_RECINPIENTS']
18
- }
12
+ def add_config_email
13
+ append_to_file GEM_PATH do
14
+ <<-'RUBY'
15
+ if Rails.env.production?
16
+ Rails.application.config.middleware.use ExceptionNotification::Rack,
17
+ email: {
18
+ deliver_with: :deliver, # Rails >= 4.2.1 do not need this option since it defaults to :deliver_now
19
+ email_prefix: ENV['EMAIL_PREFIX'],
20
+ sender_address: ENV['SENDER_ADDRESS'],
21
+ exception_recipients: ENV['EXCEPTION_RECINPIENTS']
22
+ }
23
+ end
19
24
  RUBY
20
25
  end
21
26
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MicMonitorGem
4
- VERSION = "0.3.4"
4
+ VERSION = "0.3.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mic_monitor_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - mic-locnv
@@ -19,7 +19,6 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - Rakefile
21
21
  - app/controller/mic_monitor_gem/ping_controller.rb
22
- - config/environments/production.rb
23
22
  - config/routes.rb
24
23
  - lib/generators/mic_monitor_gem/install_generator.rb
25
24
  - lib/mic_monitor_gem.rb
@@ -1,6 +0,0 @@
1
- Rails.application.config.middleware.use ExceptionNotification::Rack,
2
- email: {
3
- email_prefix: '[PREFIX] ',
4
- sender_address: %{"notifier" <loc@miclabs.co>},
5
- exception_recipients: %w{loc@miclabs.co}
6
- }