Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Trying to solve RCov incompatibility issues, refs #12

  • Loading branch information...
commit 0e9bf53a2831ff7f3e248ac3886dbdcbc8881089 1 parent abec1a4
@iain authored
View
2  .rspec
@@ -0,0 +1,2 @@
+--color
+--format documentation
View
10 .travis.yml
@@ -0,0 +1,10 @@
+language: ruby
+script: rspec
+rvm:
+ - 1.9.2
+ - 1.9.3
+ - ruby-head
+ - rbx-2.0
+ - 1.8.7
+ - ree
+ - 1.8.6
View
73 Gemfile.lock
@@ -1,45 +1,57 @@
PATH
remote: .
specs:
- metrical (0.0.7)
- main (~> 4.6.0)
+ metrical (0.1.0.alpha)
metric_fu (~> 2.1.1)
- rake
+ rcov (~> 0.9)
GEM
remote: http://rubygems.org/
specs:
Saikuro (1.1.0)
- activesupport (3.1.0)
+ activesupport (3.2.1)
+ i18n (~> 0.6)
multi_json (~> 1.0)
arrayfields (4.7.4)
chronic (0.3.0)
- churn (0.0.13)
+ churn (0.0.15)
+ arrayfields (= 4.7.4)
+ chronic (>= 0.2.3)
chronic (>= 0.2.3)
+ fattr (= 2.2.0)
+ hirb (= 0.5.0)
hirb
+ jeweler (= 1.6.4)
+ json (= 1.6.1)
json_pure
main
- ruby_parser (~> 2.0.4)
+ main (>= 4.6.0)
+ map (= 4.3.0)
+ ruby_parser (= 2.3.1)
+ ruby_parser (~> 2.3)
+ sexp_processor (= 3.0.7)
sexp_processor (~> 3.0.3)
colored (1.2)
+ diff-lcs (1.1.3)
erubis (2.7.0)
fattr (2.2.0)
flay (1.4.3)
ruby_parser (~> 2.0)
sexp_processor (~> 3.0)
- flog (2.5.2)
+ flog (2.5.3)
ruby_parser (~> 2.0)
sexp_processor (~> 3.0)
- haml (3.1.3)
+ git (1.2.5)
hirb (0.5.0)
i18n (0.6.0)
- json_pure (1.5.4)
- spruz (~> 0.2.8)
- main (4.6.0)
- arrayfields (>= 4.7.4)
- fattr (>= 2.1.0)
- map (>= 2.0.0)
- map (4.5.0)
+ jeweler (1.6.4)
+ bundler (~> 1.0)
+ git (>= 1.2.5)
+ rake
+ json (1.6.1)
+ json_pure (1.6.5)
+ main (4.7.1)
+ map (4.3.0)
metric_fu (2.1.1)
Saikuro (>= 1.1.0)
activesupport (>= 2.0.0)
@@ -52,31 +64,37 @@ GEM
reek (>= 1.2.6)
roodi (>= 2.1.0)
syntax
- multi_json (1.0.3)
- rails_best_practices (0.10.1)
+ multi_json (1.0.4)
+ progressbar (0.10.0)
+ rails_best_practices (1.7.2)
activesupport
colored
erubis
- haml
i18n
- ruby-progressbar
- ruby_parser
- rake (0.9.2)
- rcov (0.9.10)
+ progressbar
+ sexp_processor
+ rake (0.9.2.2)
+ rcov (0.9.11)
reek (1.2.8)
ruby2ruby (~> 1.2)
ruby_parser (~> 2.0)
sexp_processor (~> 3.0)
roodi (2.1.0)
ruby_parser
- ruby-progressbar (0.0.10)
- ruby2ruby (1.3.0)
+ rspec (2.8.0)
+ rspec-core (~> 2.8.0)
+ rspec-expectations (~> 2.8.0)
+ rspec-mocks (~> 2.8.0)
+ rspec-core (2.8.0)
+ rspec-expectations (2.8.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.8.0)
+ ruby2ruby (1.3.1)
ruby_parser (~> 2.0)
sexp_processor (~> 3.0)
- ruby_parser (2.0.6)
+ ruby_parser (2.3.1)
sexp_processor (~> 3.0)
- sexp_processor (3.0.6)
- spruz (0.2.13)
+ sexp_processor (3.0.7)
syntax (1.0.0)
PLATFORMS
@@ -84,3 +102,4 @@ PLATFORMS
DEPENDENCIES
metrical!
+ rspec (~> 2.8)
View
17 lib/metrical.rb
@@ -12,15 +12,28 @@ module Metrical
extend self
def run(*)
- load_defaults
- set_new_rcov_defaults
+ load_settings
load_user_configuration
run_metric_fu
open_in_browser
end
+ def load_settings(ruby_version = RUBY_VERSION)
+ load_defaults
+ if ruby_version =~ /^1\.9/
+ disable_rcov
+ else
+ set_new_rcov_defaults
+ end
+ end
+
private
+ def disable_rcov
+ MetricFu.configuration.metrics -= [ :rcov ]
+ MetricFu.configuration.graphs -= [ :rcov ]
+ end
+
def load_defaults
MetricFu::Configuration.run {}
end
View
2  lib/metrical/version.rb
@@ -1,3 +1,3 @@
module Metrical
- VERSION = "0.0.7"
+ VERSION = "0.1.0.alpha"
end
View
4 metrical.gemspec
@@ -19,6 +19,6 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]
s.add_runtime_dependency "metric_fu", "~> 2.1.1"
- s.add_runtime_dependency "main", "~> 4.6.0"
- s.add_runtime_dependency "rake"
+ s.add_runtime_dependency "rcov", "~> 0.9"
+ s.add_development_dependency "rspec", "~> 2.8"
end
View
22 spec/metrical_spec.rb
@@ -0,0 +1,22 @@
+require 'bundler/setup'
+require 'metrical'
+
+describe Metrical do
+
+ it "won't use rcov under ruby 1.9" do
+ Metrical.load_settings("1.9.3")
+ MetricFu.configuration.metrics.should_not include(:rcov)
+ MetricFu.configuration.graphs.should_not include(:rcov)
+ end
+
+ it "will use rcov under ruby 1.8" do
+ Metrical.load_settings("1.8.7")
+ MetricFu.configuration.metrics.should include(:rcov)
+ MetricFu.configuration.graphs.should include(:rcov)
+ end
+
+ after do
+ MetricFu.configuration.reset
+ end
+
+end
Please sign in to comment.
Something went wrong with that request. Please try again.