lib/generators/voltron/notify/install_generator.rb in voltron-notify-0.1.9 vs lib/generators/voltron/notify/install_generator.rb in voltron-notify-0.2.0

- old
+ new

@@ -12,11 +12,11 @@ def inject_initializer voltron_initialzer_path = Rails.root.join('config', 'initializers', 'voltron.rb') unless File.exist? voltron_initialzer_path - unless system("cd #{Rails.root.to_s} && rails generate voltron:install") + unless system("cd #{Rails.root} && rails generate voltron:install") puts 'Voltron initializer does not exist. Please ensure you have the \'voltron\' gem installed and run `rails g voltron:install` to create it' return false end end @@ -30,13 +30,10 @@ # Whether or not to use the ActiveJob queue to handle sending email/sms messages # A queue is still only used if configured via config.active_job.queue_adapter # config.notify.use_queue = false - # How long to delay sending email/sms messages. Use this in conjunction with config.notify.use_queue - # config.notify.delay = 0.seconds - # Twilio account id number # config.notify.sms_account_sid = '' # Twilio authentication token # config.notify.sms_auth_token = '' @@ -72,16 +69,17 @@ copy_migration 'create_voltron_notification_sms_notification_attachments' end def copy_views copy_file '../../../app/views/voltron/notification_mailer/notify.html.erb', Rails.root.join('app', 'views', 'voltron', 'notification_mailer', 'notify.html.erb') + copy_file '../../../app/views/voltron/notification_mailer/notify.text.erb', Rails.root.join('app', 'views', 'voltron', 'notification_mailer', 'notify.text.erb') end def copy_locales locale_path = Rails.root.join('config', 'locales', 'voltron.yml') locale = YAML.load_file(locale_path).symbolize_keys rescue {} - compact_nested = Proc.new do |k, v| + compact_nested = Proc.new do |_, v| v.respond_to?(:delete_if) ? (v.delete_if(&compact_nested); nil) : v.blank? end notification_path = File.expand_path('../../../templates/config/locales/voltron-notification.yml', __FILE__) notification_locale = YAML.load_file(notification_path).symbolize_keys \ No newline at end of file