Sha256: 91f71bb819b7d2498fc87f093ec79b0d644f332842ac2b97a25ab2f49561a3f8

Contents?: true

Size: 596 Bytes

Versions: 1

Compression:

Stored size: 596 Bytes

Contents

require 'rails'
require 'spine/generators'

module Spine
  module Generators
    class ViewGenerator < Base
      source_root File.expand_path("../templates", __FILE__)
      desc "Generate a Spine view, eg: posts/index"

      # rails g spine:view Users index edit show
      def create_views
        view_format = if defined?(::Eco)
          'eco'
        elsif defined?(::RubyHamlJs)
          'hamljs'
        else
          'ejs'
        end

        template "view.#{view_format}.erb", "app/assets/javascripts/#{app_name}/views/#{file_name}.jst.#{view_format}"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spine-rails-0.0.5 lib/generators/spine/view/view_generator.rb