Class: PagePilingRails::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/page_piling_rails/install/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_javascriptsObject



4
5
6
7
8
9
# File 'lib/generators/page_piling_rails/install/install_generator.rb', line 4

def add_javascripts
  file_path = 'app/assets/javascripts/application.js'
  if File.exists?(file_path)
    append_file file_path, "//= require jquery.pagepiling.min.js\n"
  end
end

#add_stylesheetsObject



11
12
13
14
15
16
# File 'lib/generators/page_piling_rails/install/install_generator.rb', line 11

def add_stylesheets
  file_path = 'app/assets/stylesheets/application.css'
  if File.exists?(file_path)
    inject_into_file file_path, "*= require jquery.pagepiling.css\n", before: /\*\//, verbose: true
  end
end

#whats_nextObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/generators/page_piling_rails/install/install_generator.rb', line 18

def whats_next
  puts "    \\n\n    #################################################################\\n\n    We've set up the basics of page piling for you, but you'll still\n    need to check:\n      1. app/assets/javascripts/application.js has '//= require jquery.pagepiling.min.js', and\n      2. app/assets/stylesheets/application.css has '*= require jquery.pagepiling.css'\\n\n    See the README.md for this gem at\n    https://github.com/abhaynikam/page_piling_rails/blob/master/README.md\n    for more info.\n    Thanks for using page_piling_rails!\\n\n    #################################################################\n  EOF\nend\n".strip_heredoc