class Deano::AppDestroyer

Public Class Methods

command() click to toggle source
# File lib/deano/commands/app_destroyer_command.rb, line 4
def self.command
  "destroy:app"
end
help() click to toggle source
# File lib/deano/commands/app_destroyer_command.rb, line 8
def self.help
  "app_name"
end

Public Instance Methods

call() click to toggle source
# File lib/deano/commands/app_destroyer_command.rb, line 16
    def call
      path = app_path("apps", "#{self.underscored}.rb")
      rm path

      path = app_path("apps", "views", self.underscored)
      rm_r path

      path = app_path("spec", "apps", "#{self.underscored}_spec.rb")
      rm path

      path = app_path("assets", "javascripts", "#{self.underscored}.js.coffee")
      rm path

      path = app_path("assets", "stylesheets", "#{self.underscored}.css.scss")
      rm path

      path = app_path("config.ru")
      old = File.read(path)
      File.open(path, "w") do |file|
        map = <<-EOF
  map "/#{self.underscored}" do
    run #{self.classified}
  end
        EOF
        file.puts old.gsub(map, "")
      end
    end
classified() click to toggle source
# File lib/deano/commands/app_destroyer_command.rb, line 12
def classified
  "#{self.name.classify}App"
end