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.1.2016.07.11 Rakefile
youtube-dl.rb-0.3.1.2016.07.09.1 Rakefile
youtube-dl.rb-0.3.1.2016.07.03 Rakefile
youtube-dl.rb-0.3.1.2016.07.01 Rakefile
youtube-dl.rb-0.3.1.2016.06.27 Rakefile
youtube-dl.rb-0.3.1.2016.06.26 Rakefile
youtube-dl.rb-0.3.1.2016.06.25 Rakefile
youtube-dl.rb-0.3.1.2016.06.23 Rakefile
youtube-dl.rb-0.3.1.2016.06.20 Rakefile
youtube-dl.rb-0.3.1.2016.06.19.1 Rakefile
youtube-dl.rb-0.3.1.2016.06.16 Rakefile
youtube-dl.rb-0.3.0.2016.06.16 Rakefile
youtube-dl.rb-0.3.0.2016.06.14 Rakefile
youtube-dl.rb-0.3.0.2016.06.03 Rakefile
youtube-dl.rb-0.3.0.2016.06.02 Rakefile
youtube-dl.rb-0.3.0.2016.05.21.2 Rakefile
youtube-dl.rb-0.3.0.2016.05.16 Rakefile
youtube-dl.rb-0.3.0.2016.05.01 Rakefile
youtube-dl.rb-0.3.0.2016.04.24 Rakefile
youtube-dl.rb-0.3.0.2016.04.19 Rakefile