lib/sinatra/commands/model_destroyer_command.rb in sinatra-template-1.2.0 vs lib/sinatra/commands/model_destroyer_command.rb in sinatra-template-1.3.0

- old
+ new

@@ -6,26 +6,13 @@ end def self.help "model_name" end - - def initialize(*args) - super - @app_dir = File.expand_path(pwd) - end def call - path = File.expand_path(File.join(@app_dir, "models", "#{self.underscored}.rb")) - begin - rm path, verbose: true - rescue Errno::ENOENT => e - end - path = File.expand_path(File.join(@app_dir, "spec", "models", "#{self.underscored}_spec.rb")) - begin - rm path, verbose: true - rescue Errno::ENOENT => e - end + rm app_path("models", "#{self.underscored}.rb") + rm app_path("spec", "models", "#{self.underscored}_spec.rb") end end end \ No newline at end of file