16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/generators/kiso_themes/customize_generator.rb', line 16
def copy_stylesheet
unless File.directory?(File.expand_path("../../../../lib/generators/kiso_themes/templates/customizations/styles/#{options.theme_name}", __FILE__))
raise Thor::Error, "You asked to customize theme '#{options.theme_name}', but it doesn't exist."
return
end
unless File.exists?(File.expand_path("../../../../lib/generators/kiso_themes/templates/customizations/styles/#{options.theme_name}/#{options.style_name}.css.scss", __FILE__))
raise Thor::Error, "You asked to customize theme #{options.theme_name}'s '#{options.style_name}.css.scss', but it doesn't exist."
return
end
copy_file "lib/generators/kiso_themes/templates/customizations/styles/#{options.theme_name}/#{options.style_name}.css.scss", "app/assets/stylesheets/kiso_themes.css.scss"
copy_file "lib/sass/kiso_themes/#{options.theme_name}/styles/_#{options.style_name}_variables.scss", "app/assets/stylesheets/_#{options.style_name}_variables.scss"
copy_file "app/assets/javascripts/kiso_themes.js", "app/assets/javascripts/kiso_themes.js"
PageRewriter.compile("app/assets/stylesheets/kiso_themes.css.scss", /kiso_themes\/#{options.theme_name}\/styles\//, '')
end
|