-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Rake Tasks | ||
========== | ||
|
||
A collection of rake tasks for use with [Trema][trema] and Trema apps. | ||
|
||
[trema]: https://github.com/trema/trema_ruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
begin | ||
require 'cucumber/rake/task' | ||
Cucumber::Rake::Task.new | ||
rescue LoadError | ||
task :cucumber do | ||
$stderr.puts 'Cucumber is disabled' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
begin | ||
require 'flog' | ||
|
||
desc 'Analyze for code complexity' | ||
task :flog do | ||
flog = Flog.new(continue: true) | ||
flog.flog(*FileList['*.rb']) | ||
threshold = 0 | ||
|
||
bad_methods = flog.totals.select do |name, score| | ||
!(/##{flog.no_method}$/ =~ name) && score > threshold | ||
end | ||
bad_methods.sort { |a, b| a[1] <=> b[1] }.reverse.each do |name, score| | ||
printf "%8.1f: %s\n", score, name | ||
end | ||
unless bad_methods.empty? | ||
$stderr.puts "#{bad_methods.size} methods "\ | ||
"have a complexity > #{threshold}" | ||
end | ||
end | ||
rescue LoadError | ||
task :flog do | ||
$stderr.puts 'Flog is disabled' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
begin | ||
require 'reek/rake/task' | ||
Reek::Rake::Task.new do |t| | ||
t.fail_on_error = false | ||
t.verbose = false | ||
end | ||
rescue LoadError | ||
task :reek do | ||
$stderr.puts 'Reek is disabled' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
require 'rspec/core/rake_task' | ||
|
||
RSpec::Core::RakeTask.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
begin | ||
require 'rubocop/rake_task' | ||
RuboCop::RakeTask.new | ||
rescue LoadError | ||
task :rubocop do | ||
$stderr.puts 'RuboCop is disabled' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
begin | ||
require 'yard' | ||
YARD::Rake::YardocTask.new do |t| | ||
t.files = ['lib/**/*.rb'] | ||
t.options = ['--no-private'] | ||
t.options << '--debug' << '--verbose' if verbose == true | ||
end | ||
rescue LoadError | ||
task :yard do | ||
$stderr.puts 'YARD is disabled' | ||
end | ||
end |