Sha256: 57ae313dc8e0e2d85f3ac8657ca6b61d01ac3ee6af169c885b23d1751ab513de

Contents?: true

Size: 635 Bytes

Versions: 11

Compression:

Stored size: 635 Bytes

Contents

module PushToSns # We need this name to help Rails generators lookup
  module Generators
    # rails generate push_to_sns:notifier new_goal goal
    class NotifierGenerator < Rails::Generators::NamedBase
      desc "Create a new PushToSNS notifier"
      argument :attributes,
        type: :array,
        default: [],
        banner: "attribute attribute ..."

      def self.source_root
        @source_root ||= File.expand_path("../templates", __FILE__)
      end

      def create_notifier
        template "notifier.rb", File.join(
          "app/push_notifiers", "#{file_name}_notifier.rb"
        )
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
push_to_sns-0.6.0 lib/rails/generators/push_to_sns/notifier_generator.rb
push_to_sns-0.5.0 lib/rails/generators/push_to_sns/notifier_generator.rb
push_to_sns-0.4.1 lib/rails/generators/push_to_sns/notifier_generator.rb
push_to_sns-0.4.0 lib/rails/generators/push_to_sns/notifier_generator.rb
push_to_sns-0.3.3 lib/rails/generators/push_to_sns/notifier_generator.rb
push_to_sns-0.3.2 lib/rails/generators/push_to_sns/notifier_generator.rb
push_to_sns-0.3.1 lib/rails/generators/push_to_sns/notifier_generator.rb
push_to_sns-0.3.0 lib/rails/generators/push_to_sns/notifier_generator.rb
push_to_sns-0.2.0 lib/rails/generators/push_to_sns/notifier_generator.rb
push_to_sns-0.1.1 lib/rails/generators/push_to_sns/notifier_generator.rb
push_to_sns-0.1.0 lib/rails/generators/push_to_sns/notifier_generator.rb