Skip to content

Commit

Permalink
Remove Rake task generation
Browse files Browse the repository at this point in the history
  • Loading branch information
presidentbeef committed Apr 21, 2017
1 parent 03fe729 commit 5333a6c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 96 deletions.
3 changes: 0 additions & 3 deletions bin/brakeman
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ elsif options[:show_help]
elsif options[:show_version]
puts "brakeman #{Brakeman::Version}"
exit
elsif options[:install_rake_task]
Brakeman.install_rake_task
exit
end

#Set application path according to the commandline arguments
Expand Down
38 changes: 0 additions & 38 deletions lib/brakeman.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,43 +269,6 @@ def self.list_checks options
end
end

#Installs Rake task for running Brakeman,
#which basically means copying `lib/brakeman/brakeman.rake` to
#`lib/tasks/brakeman.rake` in the current Rails application.
def self.install_rake_task install_path = nil
if install_path
rake_path = File.join(install_path, "Rakefile")
task_path = File.join(install_path, "lib", "tasks", "brakeman.rake")
else
rake_path = "Rakefile"
task_path = File.join("lib", "tasks", "brakeman.rake")
end

if not File.exist? rake_path
raise RakeInstallError, "No Rakefile detected"
elsif File.exist? task_path
raise RakeInstallError, "Task already exists"
end

require 'fileutils'

if not File.exist? "lib/tasks"
notify "Creating lib/tasks"
FileUtils.mkdir_p "lib/tasks"
end

path = File.expand_path(File.dirname(__FILE__))

FileUtils.cp "#{path}/brakeman/brakeman.rake", task_path

if File.exist? task_path
notify "Task created in #{task_path}"
notify "Usage: rake brakeman:run[output_file]"
else
raise RakeInstallError, "Could not create task"
end
end

#Output configuration to YAML
def self.dump_config options
require 'yaml'
Expand Down Expand Up @@ -534,7 +497,6 @@ def self.check_for_missing_checks included_checks, excluded_checks
end

class DependencyError < RuntimeError; end
class RakeInstallError < RuntimeError; end
class NoBrakemanError < RuntimeError; end
class NoApplication < RuntimeError; end
class MissingChecksError < RuntimeError; end
Expand Down
55 changes: 0 additions & 55 deletions test/tests/rake_task.rb

This file was deleted.

0 comments on commit 5333a6c

Please sign in to comment.