Sha256: 4ff99a51e711b9069a075599996203e5ad2903ddcc8827bbb05a5421d34cba5e

Contents?: true

Size: 780 Bytes

Versions: 2

Compression:

Stored size: 780 Bytes

Contents

require "bundler/gem_tasks"

namespace :bin do
  task :setup do
      binaries_location = "./externals"
      %W(sloccount oclint/bin).each do |executable_dir|
        executable_dir_path = "#{binaries_location}/#{executable_dir}"
        binaries = Dir.entries(executable_dir_path).select {|f| !File.directory? f}
        binaries.each do |binary|
        contents = <<-RUBY
  require 'pathname'
  pn = Pathname.new(__FILE__)
  opts = ARGV.join(" ")
  puts `"\#{pn.dirname}/../#{executable_dir_path}/\#{pn.basename}" \#{opts}`
        RUBY

        gem_binary_path = "./bin/#{binary}"
        File.open(gem_binary_path, 'w') { |file| file.write(contents) }
        FileUtils.chmod('a+x', [gem_binary_path])
        puts "#{gem_binary_path} generated"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
objective-ci-0.0.4 Rakefile
objective-ci-0.0.3 Rakefile