From c834b7d4dd29f9556f7d012587fc467b93c51029 Mon Sep 17 00:00:00 2001 From: Yuki Date: Tue, 1 Sep 2015 19:00:05 +0530 Subject: [PATCH] Brakeman + Guard --- Gemfile | 4 +++- Gemfile.lock | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++ Guardfile | 23 +++++++++++++++++++++ Rakefile | 4 ++++ 4 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 Guardfile diff --git a/Gemfile b/Gemfile index e19e6187..6dec9e9a 100644 --- a/Gemfile +++ b/Gemfile @@ -98,5 +98,7 @@ group :development, :test do gem 'simplecov-rcov', require: false gem 'database_cleaner' gem 'better_errors' - gem "letter_opener" # Use this just in local test environments + gem 'letter_opener' # Use this just in local test environments + gem 'brakeman' + gem 'guard-brakeman' end diff --git a/Gemfile.lock b/Gemfile.lock index b1a43dd8..1cb68be5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -60,6 +60,17 @@ GEM bootstrap_form (2.3.0) bootswatch-rails (3.2.4) railties (>= 3.1) + brakeman (3.1.0) + erubis (~> 2.6) + fastercsv (~> 1.5) + haml (>= 3.0, < 5.0) + highline (~> 1.6) + multi_json (~> 1.2) + ruby2ruby (>= 2.1.1, < 2.3.0) + ruby_parser (~> 3.7.0) + sass (~> 3.0) + slim (>= 1.3.6, < 4.0) + terminal-table (~> 1.4.5) buftok (0.2.0) builder (3.2.2) byebug (4.0.5) @@ -124,6 +135,8 @@ GEM multipart-post (>= 1.2, < 3) faraday_middleware (0.9.1) faraday (>= 0.7.4, < 0.10) + fastercsv (1.5.5) + ffi (1.9.10) fission (0.5.0) CFPropertyList (~> 2.2) fog (1.28.0) @@ -215,9 +228,22 @@ GEM formatador (0.2.5) globalid (0.3.6) activesupport (>= 4.1.0) + guard (2.13.0) + formatador (>= 0.2.4) + listen (>= 2.7, <= 4.0) + lumberjack (~> 1.0) + nenv (~> 0.1) + notiffany (~> 0.0) + pry (>= 0.9.12) + shellany (~> 0.0) + thor (>= 0.18.1) + guard-brakeman (0.8.3) + brakeman (>= 2.1.1) + guard (>= 2.0.0) haml (4.0.6) tilt hashie (3.4.1) + highline (1.7.3) hike (1.2.3) hitimes (1.2.2) http (0.6.4) @@ -252,12 +278,17 @@ GEM addressable (~> 2.3) letter_opener (1.4.1) launchy (~> 2.2) + listen (3.0.3) + rb-fsevent (>= 0.9.3) + rb-inotify (>= 0.9) loofah (2.0.3) nokogiri (>= 1.5.9) + lumberjack (1.0.9) mail (2.6.3) mime-types (>= 1.16, < 3) memoizable (0.4.2) thread_safe (~> 0.3, >= 0.3.1) + method_source (0.8.2) mime-types (2.6.1) mini_portile (0.6.2) minitest (5.8.0) @@ -267,6 +298,7 @@ GEM multipart-post (2.0.0) mysql2 (0.3.18) naught (1.0.0) + nenv (0.2.0) nested_form (0.3.2) net-scp (1.2.1) net-ssh (>= 2.6.5) @@ -275,6 +307,9 @@ GEM mini_portile (~> 0.6.0) nokogumbo (1.2.0) nokogiri + notiffany (0.0.7) + nenv (~> 0.1) + shellany (~> 0.0) nprogress-rails (0.1.6.6) oauth (0.4.7) omniauth (1.2.2) @@ -302,6 +337,10 @@ GEM cliver (~> 0.3.1) multi_json (~> 1.0) websocket-driver (>= 0.2.0) + pry (0.10.1) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) rack (1.6.4) rack-pjax (0.8.0) nokogiri (~> 1.5) @@ -356,6 +395,9 @@ GEM thor (>= 0.18.1, < 2.0) raindrops (0.13.0) rake (10.4.2) + rb-fsevent (0.9.5) + rb-inotify (0.9.5) + ffi (>= 0.5.0) rdoc (4.2.0) json (~> 1.4) redcarpet (3.2.3) @@ -384,6 +426,11 @@ GEM rspec-support (~> 3.0.0) rspec-support (3.0.4) ruby-progressbar (1.7.5) + ruby2ruby (2.2.0) + ruby_parser (~> 3.1) + sexp_processor (~> 4.0) + ruby_parser (3.7.1) + sexp_processor (~> 4.1) safe_yaml (1.0.4) sanitize (3.1.2) crass (~> 1.0.1) @@ -398,6 +445,8 @@ GEM sdoc (0.4.1) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) + sexp_processor (4.6.0) + shellany (0.0.1) sidekiq (3.3.3) celluloid (>= 0.16.0) connection_pool (>= 2.1.1) @@ -419,6 +468,10 @@ GEM rack (~> 1.4) rack-protection (~> 1.4) tilt (>= 1.3, < 3) + slim (3.0.6) + temple (~> 0.7.3) + tilt (>= 1.3.3, < 2.1) + slop (3.6.0) spring (1.3.5) sprockets (2.12.4) hike (~> 1.2) @@ -431,6 +484,8 @@ GEM sprockets (>= 2.8, < 4.0) sweetalert-rails (0.5.0) railties (>= 3.1.0) + temple (0.7.6) + terminal-table (1.4.5) thin (1.6.3) daemons (~> 1.0, >= 1.0.9) eventmachine (~> 1.0) @@ -499,6 +554,7 @@ DEPENDENCIES bootstrap3-datetimepicker-rails (~> 4.7.14) bootstrap_form bootswatch-rails + brakeman byebug capybara coffee-rails (~> 4.1.0) @@ -515,6 +571,7 @@ DEPENDENCIES font-awesome-rails (~> 4.3.0.0) font-kit-rails foreman + guard-brakeman haml i18n-js jbuilder (~> 2.2.4) diff --git a/Guardfile b/Guardfile new file mode 100644 index 00000000..84ce27ce --- /dev/null +++ b/Guardfile @@ -0,0 +1,23 @@ +# A sample Guardfile +# More info at https://github.com/guard/guard#readme + +## Uncomment and set this to only include directories you want to watch +# directories %w(app lib config test spec features) \ +# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")} + +## Note: if you are using the `directories` clause above and you are not +## watching the project directory ('.'), then you will want to move +## the Guardfile to a watched dir and symlink it back, e.g. +# +# $ mkdir config +# $ mv Guardfile config/ +# $ ln -s config/Guardfile . +# +# and, you'll have to watch "config/Guardfile" instead of "Guardfile" + +guard 'brakeman', :run_on_start => true do + watch(%r{^app/.+\.(erb|haml|rhtml|rb)$}) + watch(%r{^config/.+\.rb$}) + watch(%r{^lib/.+\.rb$}) + watch('Gemfile') +end diff --git a/Rakefile b/Rakefile index ab8c526d..6ce0e0dc 100644 --- a/Rakefile +++ b/Rakefile @@ -5,6 +5,10 @@ require File.expand_path('../config/application', __FILE__) Rails.application.load_tasks +task :default do + Brakeman.run :app_path => ".", :print_report => true +end + namespace :justask do desc "Regenerate themes" task themes: :environment do