Class: Easymarklet::DluxGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Easymarklet::DluxGenerator
- Defined in:
- lib/generators/easymarklet/dlux/dlux_generator.rb
Instance Method Summary collapse
Instance Method Details
#copy_files ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/generators/easymarklet/dlux/dlux_generator.rb', line 5 def copy_files template "dlux_bookmarklet.js", "app/assets/javascripts/#{file_name}_bookmarklet.js" template "dlux_consumer.js", "app/assets/javascripts/#{file_name}_consumer.js" template "dlux_producer.js", "app/assets/javascripts/#{file_name}_producer.js" template "dlux_producer_controller.rb", "app/controllers/#{file_name}_producer_controller.rb" template "dlux_producer_index.html.erb", "app/views/#{file_name}_producer/index.html.erb" template "views/easymarklet_layout.html.erb", "app/views/layouts/#{file_name}_producer.html.erb" template "views/easymarklet_buffer_frame.html.erb", "app/views/layouts/#{file_name}_producer_buffer.html.erb" end |
#create_routes ⇒ Object
15 16 17 18 |
# File 'lib/generators/easymarklet/dlux/dlux_generator.rb', line 15 def create_routes route("match '#{file_name}_producer' => '#{file_name}_producer#index'") route("match '#{file_name}_producer/buffer' => '#{file_name}_producer#buffer'") end |
#display_msg ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/generators/easymarklet/dlux/dlux_generator.rb', line 20 def display_msg puts "" puts "You can link to your new bookmarklet with this :" puts "" puts "<%= link_to '#{file_name.titleize}', easymarklet_js('#{file_name}_consumer.js') %>" puts "" end |