Sha256: 893e04769364ebc049c45b7ada9939ce4c01ad8f6173e67d65efad3138c5d4a6

Contents?: true

Size: 799 Bytes

Versions: 15

Compression:

Stored size: 799 Bytes

Contents

require 'dply/pkgs'
require 'dply/helper'

module Dply
  module Cli
    class InstallPkgs

      include Helper

      def initialize(argv)
        @argv = argv
        @options = {}
      end

      def run
        opts.parse!(@argv)
        error "pkgs.yml cannot be a symlink" if File.symlink? "pkgs.yml"
        pkgs = Pkgs.new
        pkgs.install(build_mode: @options[:build_mode])
        puts "installed"
      end

      def opts
        OptionParser.new do |opts|

          opts.banner = "Usage: drake install-pkgs [options] [target]"
          
          opts.on("-b" , "Build mode") do |b|
            @options[:build_mode] = true
          end

          opts.on("-h", "--help", "Help") do
            puts opts
            exit
          end
        end
      end


    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
dply-0.2.19 lib/dply/cli/install_pkgs.rb
dply-0.2.18 lib/dply/cli/install_pkgs.rb
dply-0.2.17 lib/dply/cli/install_pkgs.rb
dply-0.2.16 lib/dply/cli/install_pkgs.rb
dply-0.2.15 lib/dply/cli/install_pkgs.rb
dply-0.2.14 lib/dply/cli/install_pkgs.rb
dply-0.2.13 lib/dply/cli/install_pkgs.rb
dply-0.2.11 lib/dply/cli/install_pkgs.rb
dply-0.2.10 lib/dply/cli/install_pkgs.rb
dply-0.2.9 lib/dply/cli/install_pkgs.rb
dply-0.2.8 lib/dply/cli/install_pkgs.rb
dply-0.2.7 lib/dply/cli/install_pkgs.rb
dply-0.2.6 lib/dply/cli/install_pkgs.rb
dply-0.2.5 lib/dply/cli/install_pkgs.rb
dply-0.2.4 lib/dply/cli/install_pkgs.rb