Class: Chatroom::Generators::ChatroomGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
Rails::Generators::ResourceHelpers
Defined in:
lib/generators/chatroom/chatroom_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_chatroom_routesObject

hook_for :helpers



21
22
23
24
25
26
# File 'lib/generators/chatroom/chatroom_generator.rb', line 21

def add_chatroom_routes
	chatroom_route = <<-ROUTE
resources :#{plural_name}, module: 'chatroom'
	ROUTE
	route chatroom_route
end

#setup_private_pubObject



28
29
30
31
32
33
34
35
36
37
# File 'lib/generators/chatroom/chatroom_generator.rb', line 28

def setup_private_pub
	gem 'private_pub', '1.0.3'
	gem 'thin', '1.5.1'
	generate 'private_pub:install'

	inject_into_file 'app/assets/javascripts/application.js', before: '//= require_tree .' do <<-RUBY
//= require private_pub
	RUBY
	end
end