Skip to content
Browse files

must not expose extension files via public directory

Revert "fix generator"

This reverts commit 5a73b92.
  • Loading branch information...
1 parent 7206bd6 commit 672707fcbd9d436ab7b64264c90e0527cf0537c7 @eudoxa eudoxa committed Apr 23, 2012
Showing with 4 additions and 11 deletions.
  1. +4 −1 lib/generators/chanko/chanko_generator.rb
  2. +0 −10 lib/generators/chanko/install/install_generator.rb
View
5 lib/generators/chanko/chanko_generator.rb
@@ -32,18 +32,21 @@ def create_scss_files
def create_js_files
if options.js? && !options.coffee?
template 'chanko.js', File.join("app", base_directory, file_name, "javascripts", "#{file_name}.js")
+ create_symlink('javascripts')
end
end
def create_coffee_files
if options.coffee?
template 'chanko.coffee', File.join("app", base_directory, file_name, "javascripts", "#{file_name}.js.coffee")
+ create_symlink('javascripts', {:asset => true})
end
end
def create_logo_file
if options.image?
template 'chanko_blank.png', File.join("app", base_directory, file_name, "images", "logo.png")
+ create_symlink('images')
end
end
@@ -69,7 +72,7 @@ def create_symlink(path, option = {})
private
def base_directory
- name = options[:directory] || Chanko.config.directory_name
+ name = options[:directory] || Chanko.config.directory_name
name.pluralize
end
View
10 lib/generators/chanko/install/install_generator.rb
@@ -24,16 +24,6 @@ def create_symbolic_link
inside(Rails.root) do
run("ln -ns ../app/#{base_directory} spec/#{base_directory}") if File.exists?(Rails.root.join("spec"))
run("ln -ns ../app/#{base_directory} test/#{base_directory}") if File.exists?(Rails.root.join("test"))
- run("ln -ns ../app/#{base_directory} test/#{base_directory}") if File.exists?(Rails.root.join("test"))
- if (defined? Sprockets)
- run("ln -ns ../../../app/#{base_directory} app/assets/images/#{base_directory}")
- run("ln -ns ../../../app/#{base_directory} app/assets/javascripts/#{base_directory}")
- run("ln -ns ../../../app/#{base_directory} app/assets/stylesheets/#{base_directory}")
- else
- run("ln -ns ../../app/#{base_directory} public/images/#{base_directory}")
- run("ln -ns ../../app/#{base_directory} public/javascripts/#{base_directory}")
- run("ln -ns ../../app/#{base_directory} public/stylesheets/#{base_directory}")
- end
end
end

0 comments on commit 672707f

Please sign in to comment.
Something went wrong with that request. Please try again.