-
Notifications
You must be signed in to change notification settings - Fork 12
/
Rakefile
81 lines (75 loc) · 3.33 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
require 'rake'
require 'rake/rdoctask'
require 'spec/rake/spectask'
require 'spec'
desc 'Default: run spec tests.'
task :default => :spec
task :test => :spec
desc "Run all specs"
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_files = FileList['spec/*_spec.rb']
t.spec_opts = ['--options', 'spec/spec.opts']
end
desc "Run all specs with RCov"
Spec::Rake::SpecTask.new(:rcov) do |t|
t.spec_files = FileList['spec/*_spec.rb']
t.rcov = true
t.rcov_opts = ['--exclude', 'spec']
end
desc 'Generate documentation for the acts_as_textcaptcha plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = 'acts_as_textcaptcha'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README.rdoc', 'LICENSE')
rdoc.rdoc_files.include('lib/**/*.rb')
end
begin
require 'jeweler'
Jeweler::Tasks.new do |gemspec|
gemspec.name = "acts_as_textcaptcha"
gemspec.summary = "Spam protection for your models via logic questions and the excellent textcaptcha.com api"
gemspec.description = "Spam protection for your ActiveRecord models using logic questions and the excellent textcaptcha api. See textcaptcha.com for more details and to get your api key.
The logic questions are aimed at a child's age of 7, so can be solved easily by all but the most cognitively impaired users. As they involve human logic, such questions cannot be solved by a robot.
For more reasons on why logic questions are useful, see here; http://textcaptcha.com/why"
gemspec.email = "matt@hiddenloop.com"
gemspec.homepage = "http://github.com/matthutchinson/acts_as_textcaptcha"
gemspec.authors = ["Matthew Hutchinson"]
gemspec.files = [Dir.glob("{lib}/**/*"), Dir.glob("{config}/*")]
gemspec.add_dependency('bcrypt-ruby', '~> 2.1.2')
end
Jeweler::GemcutterTasks.new
rescue LoadError
end
begin
require 'metric_fu'
MetricFu::Configuration.run do |config|
config.metrics = [ :churn, :saikuro, :flog, :flay, :reek, :roodi, :rcov ]
config.graphs = [ :flog, :flay, :reek, :roodi, :rcov ]
config.flay = { :dirs_to_flay => ['lib'],
:minimum_score => 75 }
config.flog = { :dirs_to_flog => ['lib'] }
config.reek = { :dirs_to_reek => ['lib'] }
config.roodi = { :dirs_to_roodi => ['lib'] }
config.saikuro = { :output_directory => 'tmp/metric_fu/scratch/saikuro',
:input_directory => ['lib'],
:cyclo => "",
:filter_cyclo => "0",
:warn_cyclo => "5",
:error_cyclo => "7",
:formater => "text" }
config.churn = { :start_date => "1 year ago", :minimum_churn_count => 10 }
config.rcov = { :environment => 'test',
:test_files => ['spec/*_spec.rb'],
:rcov_opts => ["--sort coverage",
"--no-html",
"--text-coverage",
"--no-color",
"--profile",
"--rails",
"--exclude spec"]}
config.graph_engine = :bluff
end
rescue LoadError
puts "Metric Fu not available. Install it with: sudo gem install metric_fu reek roodi flay googlecharts"
end