Sha256: 8fc337775888078f5ef90d5ac7c40579d5c79fd49f2bfe89aa8bf4d97a33ee6f

Contents?: true

Size: 1.1 KB

Versions: 43

Compression:

Stored size: 1.1 KB

Contents

require 'bundler/gem_tasks'
require 'rake/testtask'

Rake::TestTask.new do |t|
  t.pattern = 'test/**/*_test.rb'
end

task default: [:test]

namespace :binaries do
  def get_binaries(version)
    puts 'Updating python script'
    system("wget -O ./vendor/bin/youtube-dl https://yt-dl.org/downloads/#{version}/youtube-dl")
    puts 'Updating Windows EXE'
    system("wget -O ./vendor/bin/youtube-dl.exe https://yt-dl.org/downloads/#{version}/youtube-dl.exe")
  end

  desc 'Get latest binaries'
  task :latest do
    get_binaries('latest')
  end

  desc 'Get binaries for specific version (run with `rake binaries:version[2015.07.07]`)'
  task :version, [:ver] do |_t, a|
    get_binaries(a[:ver])
  end

  desc 'Auto update binaries and increment version number'
  task :update => :latest do
    File.open('./lib/youtube-dl/version.rb', 'r+') do |f|
      version_file = f.read
      f.rewind
      f.write version_file.gsub(/\d{4}\.\d+\.\d+\.?\d+?/, `./vendor/bin/youtube-dl --version`.strip)
    end
    abort unless system("git commit -a -m 'Updated binaries to #{`./vendor/bin/youtube-dl --version`.strip}'")
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
youtube-dl.rb-0.3.0.2016.04.13 Rakefile
youtube-dl.rb-0.3.0.2016.04.06 Rakefile
youtube-dl.rb-0.3.0.2016.04.01 Rakefile
youtube-dl.rb-0.3.0.2016.03.27 Rakefile
youtube-dl.rb-0.3.0.2016.03.25 Rakefile
youtube-dl.rb-0.3.0.2016.03.14 Rakefile
youtube-dl.rb-0.3.0.2016.03.06 Rakefile
youtube-dl.rb-0.3.0.2016.03.01 Rakefile
youtube-dl.rb-0.3.0.2016.02.22 Rakefile
youtube-dl.rb-0.2.5.2016.02.22 Rakefile
youtube-dl.rb-0.2.5.2016.02.09.1 Rakefile
youtube-dl.rb-0.2.5.2016.02.05.1 Rakefile
youtube-dl.rb-0.2.5.2016.02.01 Rakefile
youtube-dl.rb-0.2.5.2016.01.31 Rakefile
youtube-dl.rb-0.2.5.2016.01.29 Rakefile
youtube-dl.rb-0.2.5.2016.01.23 Rakefile
youtube-dl.rb-0.2.5.2016.01.15 Rakefile
youtube-dl.rb-0.2.5.2016.01.14 Rakefile
youtube-dl.rb-0.2.5.2016.01.09 Rakefile
youtube-dl.rb-0.2.5.2016.01.01 Rakefile