-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f5db752
commit 1fd2280
Showing
1 changed file
with
3 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,14 @@ | ||
class JudgeGenerator < Rails::Generators::Base | ||
source_root File.expand_path("../templates", __FILE__) | ||
argument :path, :type => :string, :default => "public/javascripts" | ||
class_option :example, :type => :boolean, :default => true, :description => "Copy example jQuery element bindings" | ||
|
||
desc %Q{ | ||
This copies the judge jQuery plugin to your application. | ||
This copies the judge JavaScript file to your application. | ||
The default path is public/javascripts, but you can set your own as follows: | ||
rails g judge my/super/cool/path | ||
Some example element bindings are also copied into this directory. | ||
If you don't want them, use the --skip-example option. | ||
rails generate judge my/super/cool/path | ||
} | ||
def copy_files | ||
copy_file "jquery.judge.js", "#{path}/jquery.judge.js" | ||
copy_file "example.judge.js", "#{path}/example.judge.js" if options.example? | ||
copy_file "judge.js", "#{path}/judge.js" | ||
end | ||
end |