6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/generators/umlaut/asset_hooks_generator.rb', line 6
def add_to_stylesheet_manifest
existing = IO.read("app/assets/stylesheets/application.css")
unless existing.include?('Umlaut')
after =
if existing.include?("require_self")
"require_self"
else
"/*"
end
insert_into_file "app/assets/stylesheets/application.css", :after => after do
%q{
*
* The base Umlaut styles:
*= require 'umlaut'
*}
end
append_to_file("app/assets/stylesheets/application.css") do
%q{
/* Umlaut needs a jquery-ui theme CSS. Here's an easy way to get one,
* you can replace with another theme.
*
* Note, CSS @import needs to be the first line in a CSS file. This will
* become so if 'require_self' is included above, as the FIRST sprockets
* require, and this @import line is the first non-comment line in this
* file.
*/
@import url(//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-lightness/jquery-ui.css);
}
end
else
say_status("skipped", "Your application.css already references Umlaut", :yellow)
end
end
|