errplane 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -2
- data/README.md +21 -0
- data/errplane.gemspec +2 -2
- data/lib/errplane.rb +3 -1
- data/lib/errplane/rails.rb +0 -2
- data/lib/errplane/sinatra.rb +1 -1
- data/lib/errplane/version.rb +1 -1
- data/spec/spec_helper.rb +7 -9
- data/spec/support/rails2/app/controllers/application_controller.rb +4 -0
- data/spec/{rails2 → support/rails2}/app/controllers/widgets_controller.rb +0 -1
- data/spec/support/rails2/app/helpers/application_helper.rb +2 -0
- data/spec/support/rails2/app/helpers/widgets_helper.rb +2 -0
- data/spec/support/rails2/config/environment.rb +4 -0
- data/spec/{rails2 → support/rails2}/config/environments/test.rb +0 -0
- data/spec/support/rails2/config/initializers/cookie_verification_secret.rb +1 -0
- data/spec/{rails2 → support/rails2}/config/initializers/errplane.rb +0 -0
- data/spec/support/rails2/config/initializers/new_rails_defaults.rb +8 -0
- data/spec/support/rails2/config/initializers/session_store.rb +4 -0
- data/spec/{rails2 → support/rails2}/config/routes.rb +0 -0
- data/spec/{app/rails3.rb → support/rails3/app.rb} +0 -0
- metadata +29 -109
- data/gemfiles/Gemfile.rails-2.3.x.lock +0 -76
- data/gemfiles/Gemfile.rails-3.0.x.lock +0 -93
- data/gemfiles/Gemfile.rails-3.1.x.lock +0 -105
- data/gemfiles/Gemfile.rails-3.2.x.lock +0 -103
- data/spec/app/rails2.rb +0 -38
- data/spec/rails2/README +0 -243
- data/spec/rails2/Rakefile +0 -10
- data/spec/rails2/app/controllers/application_controller.rb +0 -10
- data/spec/rails2/app/helpers/application_helper.rb +0 -3
- data/spec/rails2/app/helpers/widgets_helper.rb +0 -1
- data/spec/rails2/config/boot.rb +0 -114
- data/spec/rails2/config/database.yml +0 -3
- data/spec/rails2/config/environment.rb +0 -33
- data/spec/rails2/config/environments/development.rb +0 -17
- data/spec/rails2/config/environments/production.rb +0 -28
- data/spec/rails2/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/rails2/config/initializers/cookie_verification_secret.rb +0 -7
- data/spec/rails2/config/initializers/inflections.rb +0 -10
- data/spec/rails2/config/initializers/mime_types.rb +0 -5
- data/spec/rails2/config/initializers/new_rails_defaults.rb +0 -21
- data/spec/rails2/config/initializers/session_store.rb +0 -15
- data/spec/rails2/config/locales/en.yml +0 -5
- data/spec/rails2/lib/tasks/rspec.rake +0 -144
- data/spec/rails2/public/404.html +0 -30
- data/spec/rails2/public/422.html +0 -30
- data/spec/rails2/public/500.html +0 -30
- data/spec/rails2/public/favicon.ico +0 -0
- data/spec/rails2/public/images/rails.png +0 -0
- data/spec/rails2/public/index.html +0 -275
- data/spec/rails2/public/javascripts/application.js +0 -2
- data/spec/rails2/public/javascripts/controls.js +0 -963
- data/spec/rails2/public/javascripts/dragdrop.js +0 -973
- data/spec/rails2/public/javascripts/effects.js +0 -1128
- data/spec/rails2/public/javascripts/prototype.js +0 -4320
- data/spec/rails2/public/robots.txt +0 -5
- data/spec/rails2/script/about +0 -4
- data/spec/rails2/script/autospec +0 -6
- data/spec/rails2/script/console +0 -3
- data/spec/rails2/script/dbconsole +0 -3
- data/spec/rails2/script/destroy +0 -3
- data/spec/rails2/script/generate +0 -3
- data/spec/rails2/script/performance/benchmarker +0 -3
- data/spec/rails2/script/performance/profiler +0 -3
- data/spec/rails2/script/plugin +0 -3
- data/spec/rails2/script/runner +0 -3
- data/spec/rails2/script/server +0 -3
- data/spec/rails2/script/spec +0 -10
- data/spec/rails2/test/performance/browsing_test.rb +0 -9
- data/spec/rails2/test/test_helper.rb +0 -38
data/spec/rails2/Rakefile
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
|
-
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
|
-
|
4
|
-
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
|
5
|
-
|
6
|
-
require 'rake'
|
7
|
-
require 'rake/testtask'
|
8
|
-
require 'rake/rdoctask'
|
9
|
-
|
10
|
-
require 'tasks/rails'
|
@@ -1,10 +0,0 @@
|
|
1
|
-
# Filters added to this controller apply to all controllers in the application.
|
2
|
-
# Likewise, all the methods added will be available for all controllers.
|
3
|
-
|
4
|
-
class ApplicationController < ActionController::Base
|
5
|
-
helper :all # include all helpers, all the time
|
6
|
-
protect_from_forgery # See ActionController::RequestForgeryProtection for details
|
7
|
-
|
8
|
-
# Scrub sensitive parameters from your log
|
9
|
-
# filter_parameter_logging :password
|
10
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
module WidgetsHelper; end
|
data/spec/rails2/config/boot.rb
DELETED
@@ -1,114 +0,0 @@
|
|
1
|
-
# Don't change this file!
|
2
|
-
# Configure your app in config/environment.rb and config/environments/*.rb
|
3
|
-
|
4
|
-
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
|
5
|
-
|
6
|
-
module Rails
|
7
|
-
class << self
|
8
|
-
def boot!
|
9
|
-
unless booted?
|
10
|
-
preinitialize
|
11
|
-
pick_boot.run
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def booted?
|
16
|
-
defined? Rails::Initializer
|
17
|
-
end
|
18
|
-
|
19
|
-
def pick_boot
|
20
|
-
(vendor_rails? ? VendorBoot : GemBoot).new
|
21
|
-
end
|
22
|
-
|
23
|
-
def vendor_rails?
|
24
|
-
File.exist?("#{RAILS_ROOT}/vendor/rails")
|
25
|
-
end
|
26
|
-
|
27
|
-
def preinitialize
|
28
|
-
load(preinitializer_path) if File.exist?(preinitializer_path)
|
29
|
-
end
|
30
|
-
|
31
|
-
def preinitializer_path
|
32
|
-
"#{RAILS_ROOT}/config/preinitializer.rb"
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
class Boot
|
37
|
-
def run
|
38
|
-
load_initializer
|
39
|
-
Rails::Initializer.run(:set_load_path)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
class VendorBoot < Boot
|
44
|
-
def load_initializer
|
45
|
-
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
46
|
-
Rails::Initializer.run(:install_gem_spec_stubs)
|
47
|
-
Rails::GemDependency.add_frozen_gem_path
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
class GemBoot < Boot
|
52
|
-
def load_initializer
|
53
|
-
self.class.load_rubygems
|
54
|
-
load_rails_gem
|
55
|
-
require 'initializer'
|
56
|
-
end
|
57
|
-
|
58
|
-
def load_rails_gem
|
59
|
-
if version = self.class.gem_version
|
60
|
-
gem 'rails', version
|
61
|
-
else
|
62
|
-
gem 'rails'
|
63
|
-
end
|
64
|
-
rescue Gem::LoadError => load_error
|
65
|
-
if load_error.message =~ /Could not find RubyGem rails/
|
66
|
-
STDERR.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
|
67
|
-
exit 1
|
68
|
-
else
|
69
|
-
raise
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
class << self
|
74
|
-
def rubygems_version
|
75
|
-
Gem::RubyGemsVersion rescue nil
|
76
|
-
end
|
77
|
-
|
78
|
-
def gem_version
|
79
|
-
if defined? RAILS_GEM_VERSION
|
80
|
-
RAILS_GEM_VERSION
|
81
|
-
elsif ENV.include?('RAILS_GEM_VERSION')
|
82
|
-
ENV['RAILS_GEM_VERSION']
|
83
|
-
else
|
84
|
-
parse_gem_version(read_environment_rb)
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
def load_rubygems
|
89
|
-
min_version = '1.3.2'
|
90
|
-
require 'rubygems'
|
91
|
-
unless rubygems_version >= min_version
|
92
|
-
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
93
|
-
exit 1
|
94
|
-
end
|
95
|
-
|
96
|
-
rescue LoadError
|
97
|
-
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
98
|
-
exit 1
|
99
|
-
end
|
100
|
-
|
101
|
-
def parse_gem_version(text)
|
102
|
-
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
|
103
|
-
end
|
104
|
-
|
105
|
-
private
|
106
|
-
def read_environment_rb
|
107
|
-
File.read("#{RAILS_ROOT}/config/environment.rb")
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
# All that for this:
|
114
|
-
Rails.boot!
|
@@ -1,33 +0,0 @@
|
|
1
|
-
Rails::Initializer.run do |config|
|
2
|
-
# Settings in config/environments/* take precedence over those specified here.
|
3
|
-
# Application configuration should go into files in config/initializers
|
4
|
-
# -- all .rb files in that directory are automatically loaded.
|
5
|
-
|
6
|
-
# Add additional load paths for your own custom dirs
|
7
|
-
# config.autoload_paths += %W( #{RAILS_ROOT}/extras )
|
8
|
-
|
9
|
-
# Specify gems that this application depends on and have them installed with rake gems:install
|
10
|
-
# config.gem "bj"
|
11
|
-
# config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
|
12
|
-
# config.gem "sqlite3-ruby", :lib => "sqlite3"
|
13
|
-
# config.gem "aws-s3", :lib => "aws/s3"
|
14
|
-
|
15
|
-
# Only load the plugins named here, in the order given (default is alphabetical).
|
16
|
-
# :all can be used as a placeholder for all plugins not explicitly named
|
17
|
-
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
18
|
-
|
19
|
-
# Skip frameworks you're not going to use. To use Rails without a database,
|
20
|
-
# you must remove the Active Record framework.
|
21
|
-
config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
|
22
|
-
|
23
|
-
# Activate observers that should always be running
|
24
|
-
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
25
|
-
|
26
|
-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
27
|
-
# Run "rake -D time" for a list of tasks for finding time zone names.
|
28
|
-
config.time_zone = 'UTC'
|
29
|
-
|
30
|
-
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
31
|
-
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
|
32
|
-
# config.i18n.default_locale = :de
|
33
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
-
|
3
|
-
# In the development environment your application's code is reloaded on
|
4
|
-
# every request. This slows down response time but is perfect for development
|
5
|
-
# since you don't have to restart the webserver when you make code changes.
|
6
|
-
config.cache_classes = false
|
7
|
-
|
8
|
-
# Log error messages when you accidentally call methods on nil.
|
9
|
-
config.whiny_nils = true
|
10
|
-
|
11
|
-
# Show full error reports and disable caching
|
12
|
-
config.action_controller.consider_all_requests_local = true
|
13
|
-
config.action_view.debug_rjs = true
|
14
|
-
config.action_controller.perform_caching = false
|
15
|
-
|
16
|
-
# Don't care if the mailer can't send
|
17
|
-
config.action_mailer.raise_delivery_errors = false
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
-
|
3
|
-
# The production environment is meant for finished, "live" apps.
|
4
|
-
# Code is not reloaded between requests
|
5
|
-
config.cache_classes = true
|
6
|
-
|
7
|
-
# Full error reports are disabled and caching is turned on
|
8
|
-
config.action_controller.consider_all_requests_local = false
|
9
|
-
config.action_controller.perform_caching = true
|
10
|
-
config.action_view.cache_template_loading = true
|
11
|
-
|
12
|
-
# See everything in the log (default is :info)
|
13
|
-
# config.log_level = :debug
|
14
|
-
|
15
|
-
# Use a different logger for distributed setups
|
16
|
-
# config.logger = SyslogLogger.new
|
17
|
-
|
18
|
-
# Use a different cache store in production
|
19
|
-
# config.cache_store = :mem_cache_store
|
20
|
-
|
21
|
-
# Enable serving of images, stylesheets, and javascripts from an asset server
|
22
|
-
# config.action_controller.asset_host = "http://assets.example.com"
|
23
|
-
|
24
|
-
# Disable delivery errors, bad email addresses will be ignored
|
25
|
-
# config.action_mailer.raise_delivery_errors = false
|
26
|
-
|
27
|
-
# Enable threaded mode
|
28
|
-
# config.threadsafe!
|
@@ -1,7 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
-
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
-
|
6
|
-
# You can also remove all the silencers if you're trying do debug a problem that might steem from framework code.
|
7
|
-
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -1,7 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Your secret key for verifying the integrity of signed cookies.
|
4
|
-
# If you change this key, all old signed cookies will become invalid!
|
5
|
-
# Make sure the secret is at least 30 characters and all random,
|
6
|
-
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
-
ActionController::Base.cookie_verifier_secret = '171a91942320ec70c77a53d50cf62835b06a9e9e3ee8e9f045d4fe195965b9d5b30ceed7570ac6d77c20ca561229625be0cf987e8342b14f499033a271480970';
|
@@ -1,10 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Add new inflection rules using the following format
|
4
|
-
# (all these examples are active by default):
|
5
|
-
# ActiveSupport::Inflector.inflections do |inflect|
|
6
|
-
# inflect.plural /^(ox)$/i, '\1en'
|
7
|
-
# inflect.singular /^(ox)en/i, '\1'
|
8
|
-
# inflect.irregular 'person', 'people'
|
9
|
-
# inflect.uncountable %w( fish sheep )
|
10
|
-
# end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# These settings change the behavior of Rails 2 apps and will be defaults
|
4
|
-
# for Rails 3. You can remove this initializer when Rails 3 is released.
|
5
|
-
|
6
|
-
if defined?(ActiveRecord)
|
7
|
-
# Include Active Record class name as root for JSON serialized output.
|
8
|
-
ActiveRecord::Base.include_root_in_json = true
|
9
|
-
|
10
|
-
# Store the full class name (including module namespace) in STI type column.
|
11
|
-
ActiveRecord::Base.store_full_sti_class = true
|
12
|
-
end
|
13
|
-
|
14
|
-
ActionController::Routing.generate_best_match = false
|
15
|
-
|
16
|
-
# Use ISO 8601 format for JSON serialized times and dates.
|
17
|
-
ActiveSupport.use_standard_json_time_format = true
|
18
|
-
|
19
|
-
# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
|
20
|
-
# if you're including raw json in an HTML page.
|
21
|
-
ActiveSupport.escape_html_entities_in_json = false
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Your secret key for verifying cookie session data integrity.
|
4
|
-
# If you change this key, all old sessions will become invalid!
|
5
|
-
# Make sure the secret is at least 30 characters and all random,
|
6
|
-
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
-
ActionController::Base.session = {
|
8
|
-
:key => '_rails-2.3_session',
|
9
|
-
:secret => '76cc9f32d38e9b6227bd663076edcf28cc915dc3021da204763a73dbd0d2741f6f7074af21400d4f8f9ef6c4db72487c467edf4a1dfec732835c5674a9846dd7'
|
10
|
-
}
|
11
|
-
|
12
|
-
# Use the database for sessions instead of the cookie-based default,
|
13
|
-
# which shouldn't be used to store highly confidential information
|
14
|
-
# (create the session table with "rake db:sessions:create")
|
15
|
-
# ActionController::Base.session_store = :active_record_store
|
@@ -1,144 +0,0 @@
|
|
1
|
-
gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f >= 1.9
|
2
|
-
rspec_gem_dir = nil
|
3
|
-
Dir["#{RAILS_ROOT}/vendor/gems/*"].each do |subdir|
|
4
|
-
rspec_gem_dir = subdir if subdir.gsub("#{RAILS_ROOT}/vendor/gems/","") =~ /^(\w+-)?rspec-(\d+)/ && File.exist?("#{subdir}/lib/spec/rake/spectask.rb")
|
5
|
-
end
|
6
|
-
rspec_plugin_dir = File.expand_path(File.dirname(__FILE__) + '/../../vendor/plugins/rspec')
|
7
|
-
|
8
|
-
if rspec_gem_dir && (test ?d, rspec_plugin_dir)
|
9
|
-
raise "\n#{'*'*50}\nYou have rspec installed in both vendor/gems and vendor/plugins\nPlease pick one and dispose of the other.\n#{'*'*50}\n\n"
|
10
|
-
end
|
11
|
-
|
12
|
-
if rspec_gem_dir
|
13
|
-
$LOAD_PATH.unshift("#{rspec_gem_dir}/lib")
|
14
|
-
elsif File.exist?(rspec_plugin_dir)
|
15
|
-
$LOAD_PATH.unshift("#{rspec_plugin_dir}/lib")
|
16
|
-
end
|
17
|
-
|
18
|
-
# Don't load rspec if running "rake gems:*"
|
19
|
-
unless ARGV.any? {|a| a =~ /^gems/}
|
20
|
-
|
21
|
-
begin
|
22
|
-
require 'spec/rake/spectask'
|
23
|
-
rescue MissingSourceFile
|
24
|
-
module Spec
|
25
|
-
module Rake
|
26
|
-
class SpecTask
|
27
|
-
def initialize(name)
|
28
|
-
task name do
|
29
|
-
# if rspec-rails is a configured gem, this will output helpful material and exit ...
|
30
|
-
require File.expand_path(File.join(File.dirname(__FILE__),"..","..","config","environment"))
|
31
|
-
|
32
|
-
# ... otherwise, do this:
|
33
|
-
raise <<-MSG
|
34
|
-
|
35
|
-
#{"*" * 80}
|
36
|
-
* You are trying to run an rspec rake task defined in
|
37
|
-
* #{__FILE__},
|
38
|
-
* but rspec can not be found in vendor/gems, vendor/plugins or system gems.
|
39
|
-
#{"*" * 80}
|
40
|
-
MSG
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
Rake.application.instance_variable_get('@tasks').delete('default')
|
49
|
-
|
50
|
-
spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? "db:test:prepare" : :noop
|
51
|
-
task :noop do
|
52
|
-
end
|
53
|
-
|
54
|
-
task :default => :spec
|
55
|
-
task :stats => "spec:statsetup"
|
56
|
-
|
57
|
-
desc "Run all specs in spec directory (excluding plugin specs)"
|
58
|
-
Spec::Rake::SpecTask.new(:spec => spec_prereq) do |t|
|
59
|
-
t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
|
60
|
-
t.spec_files = FileList['spec/**/*_spec.rb']
|
61
|
-
end
|
62
|
-
|
63
|
-
namespace :spec do
|
64
|
-
desc "Run all specs in spec directory with RCov (excluding plugin specs)"
|
65
|
-
Spec::Rake::SpecTask.new(:rcov) do |t|
|
66
|
-
t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
|
67
|
-
t.spec_files = FileList['spec/**/*_spec.rb']
|
68
|
-
t.rcov = true
|
69
|
-
t.rcov_opts = lambda do
|
70
|
-
IO.readlines("#{RAILS_ROOT}/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
desc "Print Specdoc for all specs (excluding plugin specs)"
|
75
|
-
Spec::Rake::SpecTask.new(:doc) do |t|
|
76
|
-
t.spec_opts = ["--format", "specdoc", "--dry-run"]
|
77
|
-
t.spec_files = FileList['spec/**/*_spec.rb']
|
78
|
-
end
|
79
|
-
|
80
|
-
desc "Print Specdoc for all plugin examples"
|
81
|
-
Spec::Rake::SpecTask.new(:plugin_doc) do |t|
|
82
|
-
t.spec_opts = ["--format", "specdoc", "--dry-run"]
|
83
|
-
t.spec_files = FileList['vendor/plugins/**/spec/**/*_spec.rb'].exclude('vendor/plugins/rspec/*')
|
84
|
-
end
|
85
|
-
|
86
|
-
[:models, :controllers, :views, :helpers, :lib, :integration].each do |sub|
|
87
|
-
desc "Run the code examples in spec/#{sub}"
|
88
|
-
Spec::Rake::SpecTask.new(sub => spec_prereq) do |t|
|
89
|
-
t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
|
90
|
-
t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
desc "Run the code examples in vendor/plugins (except RSpec's own)"
|
95
|
-
Spec::Rake::SpecTask.new(:plugins => spec_prereq) do |t|
|
96
|
-
t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
|
97
|
-
t.spec_files = FileList['vendor/plugins/**/spec/**/*_spec.rb'].exclude('vendor/plugins/rspec/*').exclude("vendor/plugins/rspec-rails/*")
|
98
|
-
end
|
99
|
-
|
100
|
-
namespace :plugins do
|
101
|
-
desc "Runs the examples for rspec_on_rails"
|
102
|
-
Spec::Rake::SpecTask.new(:rspec_on_rails) do |t|
|
103
|
-
t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
|
104
|
-
t.spec_files = FileList['vendor/plugins/rspec-rails/spec/**/*_spec.rb']
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
# Setup specs for stats
|
109
|
-
task :statsetup do
|
110
|
-
require 'code_statistics'
|
111
|
-
::STATS_DIRECTORIES << %w(Model\ specs spec/models) if File.exist?('spec/models')
|
112
|
-
::STATS_DIRECTORIES << %w(View\ specs spec/views) if File.exist?('spec/views')
|
113
|
-
::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers) if File.exist?('spec/controllers')
|
114
|
-
::STATS_DIRECTORIES << %w(Helper\ specs spec/helpers) if File.exist?('spec/helpers')
|
115
|
-
::STATS_DIRECTORIES << %w(Library\ specs spec/lib) if File.exist?('spec/lib')
|
116
|
-
::STATS_DIRECTORIES << %w(Routing\ specs spec/routing) if File.exist?('spec/routing')
|
117
|
-
::STATS_DIRECTORIES << %w(Integration\ specs spec/integration) if File.exist?('spec/integration')
|
118
|
-
::CodeStatistics::TEST_TYPES << "Model specs" if File.exist?('spec/models')
|
119
|
-
::CodeStatistics::TEST_TYPES << "View specs" if File.exist?('spec/views')
|
120
|
-
::CodeStatistics::TEST_TYPES << "Controller specs" if File.exist?('spec/controllers')
|
121
|
-
::CodeStatistics::TEST_TYPES << "Helper specs" if File.exist?('spec/helpers')
|
122
|
-
::CodeStatistics::TEST_TYPES << "Library specs" if File.exist?('spec/lib')
|
123
|
-
::CodeStatistics::TEST_TYPES << "Routing specs" if File.exist?('spec/routing')
|
124
|
-
::CodeStatistics::TEST_TYPES << "Integration specs" if File.exist?('spec/integration')
|
125
|
-
end
|
126
|
-
|
127
|
-
namespace :db do
|
128
|
-
namespace :fixtures do
|
129
|
-
desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y. Load from subdirectory in test/fixtures using FIXTURES_DIR=z."
|
130
|
-
task :load => :environment do
|
131
|
-
ActiveRecord::Base.establish_connection(Rails.env)
|
132
|
-
base_dir = File.join(Rails.root, 'spec', 'fixtures')
|
133
|
-
fixtures_dir = ENV['FIXTURES_DIR'] ? File.join(base_dir, ENV['FIXTURES_DIR']) : base_dir
|
134
|
-
|
135
|
-
require 'active_record/fixtures'
|
136
|
-
(ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/).map {|f| File.join(fixtures_dir, f) } : Dir.glob(File.join(fixtures_dir, '*.{yml,csv}'))).each do |fixture_file|
|
137
|
-
Fixtures.create_fixtures(File.dirname(fixture_file), File.basename(fixture_file, '.*'))
|
138
|
-
end
|
139
|
-
end
|
140
|
-
end
|
141
|
-
end
|
142
|
-
end
|
143
|
-
|
144
|
-
end
|