Browse files

Setup dev environment.

  • Loading branch information...
1 parent 72f221a commit f84369044d3521b539adb1f721247c6ba833936b @myronmarston myronmarston committed Apr 2, 2012
Showing with 52 additions and 0 deletions.
  1. +3 −0 .rspec
  2. +1 −0 .rvmrc
  3. +17 −0 Rakefile
  4. +8 −0 interpol.gemspec
  5. +10 −0 spec/fast_spec_helper.rb
  6. +13 −0 spec/simplecov_setup.rb
View
3 .rspec
@@ -0,0 +1,3 @@
+--color
+--format documentation
+--order random
View
1 .rvmrc
@@ -0,0 +1 @@
+rvm use 1.9.3@interpol --create
View
17 Rakefile
@@ -1,2 +1,19 @@
#!/usr/bin/env rake
require "bundler/gem_tasks"
+
+require 'rspec/core/rake_task'
+RSpec::Core::RakeTask.new(:spec) do |t|
+ t.rspec_opts = %w[--profile --format progress]
+ t.ruby_opts = "-Ispec -rsimplecov_setup"
+end
+
+require 'cane/rake_task'
+
+desc "Run cane to check quality metrics"
+Cane::RakeTask.new(:quality) do |cane|
+ cane.abc_max = 10
+ cane.add_threshold 'coverage/coverage_percent.txt', :==, 100
+ cane.style_measure = 100
+end
+
+task default: [:spec, :quality]
View
8 interpol.gemspec
@@ -14,4 +14,12 @@ Gem::Specification.new do |gem|
gem.name = "interpol"
gem.require_paths = ["lib"]
gem.version = Interpol::VERSION
+
+ gem.add_dependency 'sinatra', '>= 1.3.2', '< 2.0.0'
+ gem.add_dependency 'json-schema', '~> 1.0.5'
+
+ gem.add_development_dependency 'rspec', '~> 2.9'
+ gem.add_development_dependency 'rspec-fire', '~> 0.4'
+ gem.add_development_dependency 'simplecov', '~> 0.6'
+ gem.add_development_dependency 'cane', '~> 1.2'
end
View
10 spec/fast_spec_helper.rb
@@ -0,0 +1,10 @@
+# Note: this file is purposefully minimal. Load as little as possible here.
+require 'rspec/fire'
+
+RSpec.configure do |c|
+ c.include RSpec::Fire
+ c.treat_symbols_as_metadata_keys_with_true_values = true
+ c.filter_run :f
+ c.run_all_when_everything_filtered = true
+end
+
View
13 spec/simplecov_setup.rb
@@ -0,0 +1,13 @@
+require 'simplecov'
+
+SimpleCov.start do
+ add_filter "/spec"
+end
+
+SimpleCov.at_exit do
+ File.open(File.join(SimpleCov.coverage_path, 'coverage_percent.txt'), 'w') do |f|
+ f.write SimpleCov.result.covered_percent
+ end
+ SimpleCov.result.format!
+end
+

0 comments on commit f843690

Please sign in to comment.