Class: Easymarklet::SimpleGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/easymarklet/simple/simple_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_js_fileObject



5
6
7
8
# File 'lib/generators/easymarklet/simple/simple_generator.rb', line 5

def copy_js_file
  template "simple_bookmarklet.js", "app/assets/javascripts/#{file_name}_bookmarklet.js"
  template "simple_bookmarklet.css", "app/assets/stylesheets/#{file_name}_bookmarklet.css"
end

#display_msgObject



10
11
12
13
14
15
16
# File 'lib/generators/easymarklet/simple/simple_generator.rb', line 10

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}_bookmarklet.js') %>"
  puts ""
end