rails_generators/walruz_generator.rb in walruz-rails-0.0.8 vs rails_generators/walruz_generator.rb in walruz-rails-0.0.9

- old
+ new

@@ -1,22 +1,27 @@ class WalruzGenerator < Rails::Generator::Base def manifest record do |m| - m.directory 'config/initializers' m.file('walruz_initializer.rb', 'config/initializers/walruz_initializer.rb') m.directory 'lib/walruz' m.directory 'lib/walruz/policies' m.file('policies.rb', 'lib/walruz/policies.rb') m.file('actor_is_subject_example.rb', 'lib/walruz/policies/actor_is_subject.rb') - m.directory 'public' + task_template_name = if File.exists?(File.join(Rails.root, "spec")) + 'spec_task.rake' + else + 'test_task.rake' + end + m.file(task_template_name, 'lib/tasks/walruz.rake') + m.file('unauthorized.html', 'public/unauthorized.html') end end def banner "Usage: #{$0} walruz" end -end \ No newline at end of file +end