Permalink
Browse files

Add devtools gem dependency

* Update gem to work within devtools framework.
  • Loading branch information...
1 parent 04023ab commit a54395381737726b233c7008270d4c344ac9efa9 @dkubb committed Jan 18, 2013
View
4 .rspec
@@ -0,0 +1,4 @@
+--color
+--format progress
+--profile
+--order random
View
@@ -1,7 +1,7 @@
language: ruby
before_install: gem install bundler
bundler_args: --without yard guard benchmarks
-script: "bundle exec rake spec"
+script: "bundle exec rake ci"
rvm:
- ree
- 1.8.7
View
55 Gemfile
@@ -4,56 +4,5 @@ source 'https://rubygems.org'
gemspec
-group :yard do
- gem 'yard', '~> 0.8.3'
- gem 'redcarpet', '~> 2.2.2', :platforms => [ :mri, :rbx ]
-end
-
-group :guard do
- gem 'guard', '~> 1.5.4'
- gem 'guard-bundler', '~> 1.0.0'
- gem 'guard-rspec', '~> 1.2.1'
-end
-
-group :benchmarks do
- gem 'rbench', '~> 0.2.3'
-end
-
-platform :jruby do
- group :jruby do
- gem 'jruby-openssl', '~> 0.7.4'
- end
-end
-
-group :metrics do
- gem 'flay', '~> 1.4.3'
- gem 'flog', '~> 2.5.3'
- gem 'reek', '~> 1.2.8', :github => 'dkubb/reek'
- gem 'roodi', '~> 2.1.0'
- gem 'yardstick', '~> 0.8.0'
-
- platforms :ruby_18, :ruby_19 do
- # this indirectly depends on ffi which does not build on ruby-head
- gem 'yard-spellcheck', '~> 0.1.5'
- end
-
- platforms :mri_18 do
- gem 'arrayfields', '~> 4.7.4' # for metric_fu
- gem 'fattr', '~> 2.2.0' # for metric_fu
- gem 'heckle', '~> 1.4.3'
- gem 'json', '~> 1.7.3' # for metric_fu rake task
- gem 'map', '~> 6.2.0' # for metric_fu
- gem 'metric_fu', '~> 2.1.1'
- gem 'mspec', '~> 1.5.17'
- gem 'rcov', '~> 1.0.0'
- gem 'ruby2ruby', '= 1.2.2' # for heckle
- end
-
- platforms :ruby_19 do
- gem 'simplecov', '~> 0.7.1'
- end
-
- platforms :rbx do
- gem 'pelusa', '~> 0.2.1'
- end
-end
+gem 'devtools', :git => 'https://github.com/datamapper/devtools.git'
+eval File.read('Gemfile.devtools')
View
@@ -0,0 +1,67 @@
+# encoding: utf-8
+
+group :development do
+ gem 'rake', '~> 10.0.3'
+ gem 'rspec', '~> 2.12.0'
+ gem 'yard', '~> 0.8.3'
+end
+
+group :yard do
+ gem 'redcarpet', '~> 2.2.2', :platforms => [ :mri, :rbx ]
+end
+
+group :guard do
+ gem 'guard', '~> 1.6.1'
+ gem 'guard-bundler', '~> 1.0.0'
+ gem 'guard-rspec', '~> 2.3.3'
+
+ # file system change event handling
+ gem 'rb-fchange', '~> 0.0.6', :require => false
+ gem 'rb-fsevent', '~> 0.9.3', :require => false
+ gem 'rb-inotify', '~> 0.9.0', :require => false
+
+ # Remove this one https://github.com/guard/listen/pull/78 is released
+ gem 'listen', '~> 0.7.2', :git => 'https://github.com/guard/listen'
+
+ # notification handling
+ gem 'libnotify', '~> 0.8.0', :require => false
+ gem 'rb-notifu', '~> 0.0.4', :require => false
+ gem 'terminal-notifier-guard', '~> 1.5.3', :require => false
+end
+
+group :metrics do
+ gem 'backports', '~> 2.6.5'
+ gem 'flay', '~> 1.4.3'
+ gem 'flog', '~> 2.5.3'
+ gem 'mutant', '~> 0.2.15'
+ gem 'reek', '~> 1.2.13', :git => 'https://github.com/troessner/reek.git'
+ gem 'roodi', '~> 2.1.0'
+ gem 'yardstick', '~> 0.8.0'
+
+ platforms :ruby_18, :ruby_19 do
+ # this indirectly depends on ffi which does not build on ruby-head
+ gem 'yard-spellcheck', '~> 0.1.5'
+ end
+
+ platforms :mri_18 do
+ gem 'rcov', '~> 1.0.0'
+ end
+
+ platforms :mri_19 do
+ gem 'simplecov', '~> 0.7.1'
+ end
+
+ platforms :rbx do
+ gem 'pelusa', '~> 0.2.2'
+ end
+end
+
+group :benchmarks do
+ gem 'rbench', '~> 0.2.3'
+end
+
+platform :jruby do
+ group :jruby do
+ gem 'jruby-openssl', '~> 0.8.2'
+ end
+end
View
@@ -1,9 +1,6 @@
# encoding: utf-8
require 'rake'
+require 'devtools'
-require File.expand_path('../lib/abstract_type/version', __FILE__)
-
-FileList['tasks/**/*.rake'].each { |task| import task }
-
-task :default => :spec
+Devtools.init
View
@@ -0,0 +1,3 @@
+---
+name: abstract_type
+namespace: AbstractType
View
@@ -1,7 +0,0 @@
---exclude-only "spec/,^/"
---sort coverage
---callsites
---xrefs
---profile
---text-summary
---failure-threshold 100
View
@@ -1,3 +0,0 @@
---color
---loadby random
---format profile
View
@@ -1,11 +1,24 @@
# encoding: utf-8
+if ENV['COVERAGE'] == 'true'
+ require 'simplecov'
+
+ SimpleCov.start do
+ command_name 'spec:unit'
+ add_filter 'config'
+ add_filter 'spec'
+ minimum_coverage 100
+ end
+end
+
require 'abstract_type'
-require 'spec'
-require 'spec/autorun'
+require 'rspec'
+require 'rspec/autorun' if RUBY_VERSION < '1.9'
# require spec support files and shared behavior
-Dir[File.expand_path('../{support,shared}/**/*.rb', __FILE__)].each { |f| require f }
+Dir[File.expand_path('../{support,shared}/**/*.rb', __FILE__)].each do |file|
+ require file
+end
-Spec::Runner.configure do |config|
+RSpec.configure do |config|
end
View
@@ -1,9 +0,0 @@
-# encoding: utf-8
-
-desc 'Run metrics with Heckle'
-task :ci => %w[ ci:metrics metrics:heckle ]
-
-namespace :ci do
- desc 'Run metrics (except heckle) and spec'
- task :metrics => %w[ spec metrics:verify_measurements metrics:flog metrics:flay metrics:reek metrics:roodi metrics:all ]
-end
View
@@ -1,45 +0,0 @@
-# encoding: utf-8
-
-begin
- require 'flay'
- require 'yaml'
-
- config = YAML.load_file(File.expand_path('../../../config/flay.yml', __FILE__)).freeze
- threshold = config.fetch('threshold').to_i
- total_score = config.fetch('total_score').to_f
- files = Flay.expand_dirs_to_files(config.fetch('path', 'lib')).sort
-
- namespace :metrics do
- # original code by Marty Andrews:
- # http://blog.martyandrews.net/2009/05/enforcing-ruby-code-quality.html
- desc 'Analyze for code duplication'
- task :flay do
- # run flay once without a threshold to ensure the max mass matches the threshold
- flay = Flay.new(:fuzzy => false, :verbose => false, :mass => 0)
- flay.process(*files)
-
- max = (flay.masses.map { |hash, mass| mass.to_f / flay.hashes[hash].size }.max) || 0
- unless max >= threshold
- raise "Adjust flay threshold down to #{max}"
- end
-
- total = flay.masses.reduce(0.0) { |total, (hash, mass)| total + (mass.to_f / flay.hashes[hash].size) }
- unless total == total_score
- raise "Flay total is now #{total}, but expected #{total_score}"
- end
-
- # run flay a second time with the threshold set
- flay = Flay.new(:fuzzy => false, :verbose => false, :mass => threshold.succ)
- flay.process(*files)
-
- if flay.masses.any?
- flay.report
- raise "#{flay.masses.size} chunks of code have a duplicate mass > #{threshold}"
- end
- end
- end
-rescue LoadError
- task :flay do
- $stderr.puts 'Flay is not available. In order to run flay, you must: gem install flay'
- end
-end
View
@@ -1,49 +0,0 @@
-# encoding: utf-8
-
-begin
- require 'flog'
- require 'yaml'
-
- class Float
- def round_to(n)
- (self * 10**n).round.to_f * 10**-n
- end
- end
-
- config = YAML.load_file(File.expand_path('../../../config/flog.yml', __FILE__)).freeze
- threshold = config.fetch('threshold').to_f.round_to(1)
-
- namespace :metrics do
- # original code by Marty Andrews:
- # http://blog.martyandrews.net/2009/05/enforcing-ruby-code-quality.html
- desc 'Analyze for code complexity'
- task :flog do
- flog = Flog.new
- flog.flog Array(config.fetch('path', 'lib'))
-
- totals = flog.totals.select { |name, score| name[-5, 5] != '#none' }.
- map { |name, score| [ name, score.round_to(1) ] }.
- sort_by { |name, score| score }
-
- if totals.any?
- max = totals.last[1]
- unless max >= threshold
- raise "Adjust flog score down to #{max}"
- end
- end
-
- bad_methods = totals.select { |name, score| score > threshold }
- if bad_methods.any?
- bad_methods.reverse_each do |name, score|
- puts '%8.1f: %s' % [ score, name ]
- end
-
- raise "#{bad_methods.size} methods have a flog complexity > #{threshold}"
- end
- end
- end
-rescue LoadError
- task :flog do
- $stderr.puts 'Flog is not available. In order to run flog, you must: gem install flog'
- end
-end
Oops, something went wrong.

0 comments on commit a543953

Please sign in to comment.