Class: Kryptonite::UpdateGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/kryptonite/update/update_generator.rb

Instance Method Summary collapse

Instance Method Details

#generate_filesObject



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
41
# File 'lib/generators/kryptonite/update/update_generator.rb', line 6

def generate_files
    puts "*** Updating Kryptonite public assets. These should not be modified as they may be overwritten in future updates. ***"

    #stylesheets
	copy_file "public/kryptonite/stylesheets/screen.css", "app/assets/kryptonite/stylesheets/screen.css"
	copy_file "public/kryptonite/stylesheets/elements.css", "app/assets/kryptonite/stylesheets/elements.css"
	copy_file "public/kryptonite/stylesheets/login.css", "app/assets/kryptonite/stylesheets/login.css"
	copy_file "public/kryptonite/stylesheets/fileuploader.css", "app/assets/kryptonite/stylesheets/fileuploader.css"

	#javascripts
	copy_file "public/kryptonite/javascripts/kryptonite.js", "app/assets/kryptonite/javascripts/kryptonite.js"
	copy_file "public/kryptonite/javascripts/login.js", "app/assets/kryptonite/javascripts/login.js"
	copy_file "public/kryptonite/javascripts/jquery.js", "app/assets/kryptonite/javascripts/jquery.js"
	copy_file "public/kryptonite/javascripts/rails.js", "app/assets/kryptonite/javascripts/rails.js"
	copy_file "public/kryptonite/javascripts/fileuploader.js", "app/assets/kryptonite/javascripts/fileuploader.js"

    #images
    copy_file "public/kryptonite/images/header.png", "app/assets/kryptonite/images/header.png"
    copy_file "public/kryptonite/images/nav.png", "app/assets/kryptonite/images/nav.png"
    copy_file "public/kryptonite/images/rightNav.png", "app/assets/kryptonite/images/rightNav.png"
    copy_file "public/kryptonite/images/rightNavButton.png", "app/assets/kryptonite/images/rightNavButton.png"
    copy_file "public/kryptonite/images/kryptonite.png", "app/assets/kryptonite/images/kryptonite.png"
    copy_file "public/kryptonite/images/visitSiteNav.png", "app/assets/kryptonite/images/visitSiteNav.png"
	copy_file "public/kryptonite/images/login/top.png", "app/assets/kryptonite/images/login/top.png"
  copy_file "public/kryptonite/images/login/bottom.png", "app/assets/kryptonite/images/login/bottom.png"
  copy_file "public/kryptonite/images/loading.gif", "app/assets/kryptonite/images/loading.gif"

	#icons
	all_icons = Dir.new(File.expand_path('../templates/public/kryptonite/images/icons/', __FILE__)).entries

	for icon in all_icons
		if File.extname(icon) == ".png"
			copy_file "public/kryptonite/images/icons/#{icon}", "app/assets/kryptonite/images/icons/#{icon}"
		end
	end
end