Sha256: a5a3a5768a13d8a6dc5a0ee7967519d5966e217388833528b85e47ec2b3fc56b

Contents?: true

Size: 870 Bytes

Versions: 1

Compression:

Stored size: 870 Bytes

Contents

module DemoInstaller
  def proceed(target,source,banner)
    options = { }
    options[:target]="#{target}"
    OptionParser.new do |opts|
      opts.banner =banner +<<END

Command syntax:
----------
END
      opts.on("-t","--target DIRECTORY","","target directory where demo project will be installed","default: --target #{options[:target]}" ) do |v|
        options[:target] = v
      end


      # No argument, shows at tail.  This will print an options summary.
      # Try it and see!
      opts.on_tail("-h", "--help", "Show this message") do
        puts opts
        exit
      end
    end.parse!

    if File.exist?(options[:target])
      puts "WARNING: File already exists (#{options[:target]})"
      puts "WARNING: Copy aborted"
    else
      cp_r("#{source}", options[:target] )
      puts "INFO: Project created in #{options[:target]}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ontomde-core-1.0.4 lib/ontomde-core/demoInstaller.rb