Skip to content

Instantly share code, notes, and snippets.

@nthj
Created October 25, 2013 20:16
Show Gist options
  • Save nthj/7161156 to your computer and use it in GitHub Desktop.
Save nthj/7161156 to your computer and use it in GitHub Desktop.
Add this to `lib/generators/javascript_generator.rb`
class JavascriptGenerator < Rails::Generators::NamedBase
def create_javascript_files
create_file "app/assets/javascripts/#{file_name}.coffee", "# New JavaScript File"
create_file "spec/javascripts/#{file_name}_spec.coffee", <<-SPEC
describe "test for #{file_name}", ->
SPEC
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment