lib/generators/effective/ability_generator.rb in effective_developer-0.2.1 vs lib/generators/effective/ability_generator.rb in effective_developer-0.2.2
- old
+ new
@@ -18,9 +18,14 @@
def invoke_ability
say_status :invoke, :ability, :white
end
def create_ability
+ unless File.exists?('app/models/ability.rb')
+ say_status :skipped, :ability, :yellow
+ return
+ end
+
Effective::CodeWriter.new('app/models/ability.rb') do |w|
if resource.namespaces.blank?
if w.find { |line, depth| depth == 2 && line == ability }
say_status :identical, ability, :blue
else