Sha256: 601b451ece290c58974e7dd1a0c7cb080f7c8f19fc9db2f9c85469ba5d458d25

Contents?: true

Size: 820 Bytes

Versions: 19

Compression:

Stored size: 820 Bytes

Contents

require 'dply/pkgs_config'
require 'dply/yum'
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 = PkgsConfig.new(build_mode: @options[:build_mode]).pkgs
        Yum.new(pkgs).install
      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

19 entries across 19 versions & 1 rubygems

Version Path
dply-0.2.3 lib/dply/cli/install_pkgs.rb
dply-0.2.2 lib/dply/cli/install_pkgs.rb
dply-0.2.0 lib/dply/cli/install_pkgs.rb
dply-0.1.19 lib/dply/cli/install_pkgs.rb
dply-0.1.18 lib/dply/cli/install_pkgs.rb
dply-0.1.17 lib/dply/cli/install_pkgs.rb
dply-0.1.13 lib/dply/cli/install_pkgs.rb
dply-0.1.12 lib/dply/cli/install_pkgs.rb
dply-0.1.11 lib/dply/cli/install_pkgs.rb
dply-0.1.10 lib/dply/cli/install_pkgs.rb
dply-0.1.9 lib/dply/cli/install_pkgs.rb
dply-0.1.8 lib/dply/cli/install_pkgs.rb
dply-0.1.7 lib/dply/cli/install_pkgs.rb
dply-0.1.6 lib/dply/cli/install_pkgs.rb
dply-0.1.5 lib/dply/cli/install_pkgs.rb
dply-0.1.4 lib/dply/cli/install_pkgs.rb
dply-0.1.2 lib/dply/cli/install_pkgs.rb
dply-0.1.1 lib/dply/cli/install_pkgs.rb
dply-0.1.0 lib/dply/cli/install_pkgs.rb