Sha256: acd07b4924a22358c50869eb99210b2b25edc530127c23f924d70d6c111ea1ae

Contents?: true

Size: 858 Bytes

Versions: 1

Compression:

Stored size: 858 Bytes

Contents

require 'bundler'
Bundler::GemHelper.install_tasks

require 'rake'
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
  test.libs << 'lib' << 'test'
  test.pattern = 'test/**/test_*.rb'
  test.verbose = true
end

task :default => :test

task :fallbacks do
  require_relative 'lib/brighter_planet_metadata'
  fallbacks = BrighterPlanet::Metadata::LIVE_URL.inject({}) do |memo, (k, _)|
    if BrighterPlanet.metadata.respond_to?(k)
      memo[k] = BrighterPlanet.metadata.send k
    else
      parts = k.split('_') # rail_trips_options => rail, trips, options
      method_id = parts.pop
      arg = parts.join('_')
      memo[k] = BrighterPlanet.metadata.send method_id, arg
    end
    memo
  end
  File.open(File.expand_path('../lib/brighter_planet_metadata/fallbacks.json', __FILE__), 'w') do |f|
    f.write MultiJson.encode(fallbacks)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
brighter_planet_metadata-0.2.1 Rakefile