Sha256: 67a55ad1db49817f2c6bc451dd6d05902ea413d0187871c224ecc97c455fbfe9
Contents?: true
Size: 1.02 KB
Versions: 1
Compression:
Stored size: 1.02 KB
Contents
# frozen_string_literal: true require 'fileutils' require 'shoes/samples' class Shoes module UI class CLI class SamplesCommand < BaseCommand attr_accessor :destination_dir def run if parse!(args) source = Shoes::Samples.path destination = File.join((destination_dir || Dir.pwd), "shoes_samples") if File.exist?(destination) puts "Oops, #{destination} already exists! Try somewhere else, maybe with -d." else FileUtils.cp_r source, destination end end end def options OptionParser.new do |opts| opts.on('-dDEST', '--destination=DEST', 'Destination directory') do |destination| self.destination_dir = destination end end end def help help_from_options("shoes samples [options]", options) + <<-EOS Installs samples to try out. EOS end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
shoes-core-4.0.0.rc1 | lib/shoes/ui/cli/samples_command.rb |