Sha256: f3d92a1d344a72ddee7290d398a87766e18e4a8feb344486dc306a6cf130cfcc

Contents?: true

Size: 987 Bytes

Versions: 2

Compression:

Stored size: 987 Bytes

Contents

$:.push File.expand_path(File.dirname(__FILE__))

require 'rainbow'
require 'gli'
require 'gli_version'
require 'iisconfig/version'
require 'iisconfig/configuration'

include GLI

program_desc 'Configures IIS on Windows'

version IISConfig::VERSION

desc 'executes the configuration file'
command :execute, :e do |c|
  c.desc 'Only recycle the application pools'
  c.switch :'recycle-apppools'

  c.desc 'Dry run'
  c.switch :'dry-run'

  c.desc 'Verbose'
  c.switch :'verbose'

  c.action do |global_options, options, args|
    opts = {}
    opts[:recycle_apppools] = true if options[:'recycle-apppools']

    IISConfig::IISConfiguration.dry_run = true if options[:'dry-run']
    IISConfig::IISConfiguration.verbose = true if options[:'verbose']

    config = IISConfig::IISConfiguration.new opts

    file = args[0]
    if file.nil?
      puts 'No file specified to execute'
    else
      config.load file
      config.run
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
iisconfig-0.6.0 lib/iisconfig.rb
iisconfig-0.5.0 lib/iisconfig.rb