Sha256: 69533705a76a952546c96cbdb4be2c5243682588f787d9eb317d51f7314ede1f

Contents?: true

Size: 949 Bytes

Versions: 38

Compression:

Stored size: 949 Bytes

Contents

# Redefined standard Rails tasks only in instance mode
unless Radiant.app?
  require 'rake/testtask'
  
  ENV['RADIANT_ENV_FILE'] = File.join(RAILS_ROOT, 'config', 'environment')
  
  [Dir["#{RADIANT_ROOT}/vendor/rails/railties/lib/tasks/*.rake"], Dir["#{RADIANT_ROOT}/vendor/plugins/rspec_on_rails/tasks/*.rake"]].flatten.each do |rake|
    lines = IO.readlines(rake)
    lines.map! do |line|
      line.gsub!('RAILS_ROOT', 'RADIANT_ROOT') unless rake =~ /(misc|rspec|databases)\.rake$/
      case rake
      when /testing\.rake$/
        line.gsub!(/t.libs << (["'])/, 't.libs << \1#{RADIANT_ROOT}/')
        line.gsub!(/t\.pattern = (["'])/, 't.pattern = \1#{RADIANT_ROOT}/')
      when /databases\.rake$/
        line.gsub!(/(migrate|rollback)\((["'])/, '\1(\2#{RADIANT_ROOT}/')
        line.gsub!(/(run|new)\((:up|:down), (["'])db/, '\1(\2, \3#{RADIANT_ROOT}/db')
      end
      line
    end
    eval(lines.join("\n"), binding, rake)
  end
end

Version data entries

38 entries across 38 versions & 3 rubygems

Version Path
radiant-1.1.4 lib/tasks/instance.rake
radiant-1.1.3 lib/tasks/instance.rake
radiant-1.1.2 lib/tasks/instance.rake
radiant-1.1.1 lib/tasks/instance.rake
radiant-1.1.0 lib/tasks/instance.rake
radiant-1.1.0.rc1 lib/tasks/instance.rake
radiant-1.1.0.beta lib/tasks/instance.rake
radiant-1.0.1 lib/tasks/instance.rake
radiant-1.1.0.alpha lib/tasks/instance.rake
radiant-1.0.0 lib/tasks/instance.rake
radiant-1.0.0.rc5 lib/tasks/instance.rake
radiant-1.0.0.rc4 lib/tasks/instance.rake
radiant-1.0.0.rc3 lib/tasks/instance.rake
radiant-1.0.0.rc2 lib/tasks/instance.rake
radiant-1.0.0.rc1 lib/tasks/instance.rake
radiantcms-couchrest_model-0.2.4 lib/tasks/instance.rake
radiantcms-couchrest_model-0.2.2 lib/tasks/instance.rake
radiantcms-couchrest_model-0.2.1 lib/tasks/instance.rake
radiantcms-couchrest_model-0.2 lib/tasks/instance.rake
radiantcms-couchrest_model-0.1.9 lib/tasks/instance.rake