Sha256: 5c658facf453914225269ce1d64ba6516ce59c1d840379f2d6dffe1de958974c

Contents?: true

Size: 718 Bytes

Versions: 2

Compression:

Stored size: 718 Bytes

Contents

module Streamit
  module Generators
    class StreamitGenerator < Rails::Generators::NamedBase
      namespace "streamit"
      source_root File.expand_path("../../templates", __FILE__)

      desc "Generates a model with the given NAME with streamit configuration"

      def copy_model
        template "stream.rb", "app/models/#{file_name}.rb"
      end

      def copy_initializer
        template "streamit.rb", "config/initializers/streamit.rb"
      end

      def copy_locale
        copy_file "../../streamit/locales/en.yml", "config/locales/streamit.en.yml"
      end

      def copy_stream_view
        copy_file "_stream.html.erb", "app/views/streamit/streams/_stream.html.erb"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
streamit-0.0.8 lib/generators/streamit/streamit_generator.rb
streamit-0.0.7 lib/generators/streamit/streamit_generator.rb