Class: Ixcb::Util

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/ixCB/util.rb

Instance Method Summary collapse

Instance Method Details

#add_requirement(name, extension) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/ixCB/util.rb', line 7

def add_requirement(name, extension)
  if name
    if extension == "css"
      inject_into_file "app/assets/stylesheets/application.css", " *= require #{name}\n", :after => " *= require_self\n"
    elsif extension == "js"
      inject_into_file "app/assets/javascripts/application.js", "//= require #{name}\n", :after => "//= require jquery\n"
    end
  end
end