Sha256: 445232be6c6637362bd32d7569b1d5d7d6028d0094c2c097ae66602bf252ca6d

Contents?: true

Size: 536 Bytes

Versions: 6

Compression:

Stored size: 536 Bytes

Contents

namespace :fixtures do
  desc "Refresh spec fixtures with fresh data from gares-en-mouvement.com"
  task :refresh do
    require File.expand_path(File.dirname(__FILE__) + "/../spec/spec_helper")

    ONLY = ENV['ONLY'] ? ENV['ONLY'].split(',') : []
    GARES_SAMPLES.each_pair do |url, fixture|
      next if !ONLY.empty? and !ONLY.include?(fixture)
      page = `curl -is #{url}`

      File.open(File.expand_path(File.dirname(__FILE__) + "/../spec/fixtures/#{fixture}"), 'w') do |f|
        f.write(page)
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gares-1.0.0 tasks/fixtures.rake
gares-0.1.4 tasks/fixtures.rake
gares-0.1.3 tasks/fixtures.rake
gares-0.1.2 tasks/fixtures.rake
gares-0.1.1 tasks/fixtures.rake
gares-0.1.0 tasks/fixtures.rake