Sha256: 8a87f3d1c9ecc401d97eb06ed1b3bfc4f6751f175f005b67d837dce65666e94d

Contents?: true

Size: 926 Bytes

Versions: 4

Compression:

Stored size: 926 Bytes

Contents

module Chatroom
	module Generators
		class AssetsGenerator < Rails::Generators::Base
			source_root File.expand_path('../../../../app/assets', __FILE__)

			desc "Generators the assets including coffee and sass"

			def generate_stylesheets
				directory "stylesheets/chatroom", "#{stylesheets_target_path}" do |content|
					content
				end
			end

			def generate_coffees
				directory "javascripts/chatroom", "#{javascripts_target_path}" do |content|
					content
				end
			end

			def generate_images
				directory "images", "#{images_target_path}" do |content|
					content
				end
			end

			private
			  def stylesheets_target_path
					@stylesheets_target_path ||= "app/assets/stylesheets/chatroom" 
				end

				def javascripts_target_path
					@javascripts_target_path ||= "app/assets/javascripts/chatroom"
				end

				def images_target_path
					@images_target_path ||= "app/assets/images"
				end
		end
	end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
chatroom-0.1.1 lib/generators/chatroom/assets_generator.rb
chatroom-0.1.0 lib/generators/chatroom/assets_generator.rb
chatroom-0.0.9 lib/generators/chatroom/assets_generator.rb
chatroom-0.0.8 lib/generators/chatroom/assets_generator.rb