Sha256: a587827b34cbfbf3361aad0320225c29d82348e6abc8985a6214eb397a396672

Contents?: true

Size: 562 Bytes

Versions: 3

Compression:

Stored size: 562 Bytes

Contents

gem 'slop', '~> 4'
require 'slop'

module Slop
	class SymbolOption < Option
		def call(value)
			value.to_sym
		end
	end

	class PathOption < Option
		def call(value)
			ShellHelpers::Pathname.new(value)
		end
		def finish(opts)
			if opts[:verbose] and opts[:test]
				pathname=ShellHelpers::Pathname::DryRun
			elsif opts[:verbose] and !opts[:test]
				pathname=ShellHelpers::Pathname::Verbose
			elsif opts[:test]
				pathname=ShellHelpers::Pathname::NoWrite
			else
				pathname=ShellHelpers::Pathname
			end
			self.value=pathname.new(value)
		end
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shell_helpers-0.7.1 lib/shell_helpers/options.rb
shell_helpers-0.7.0 lib/shell_helpers/options.rb
shell_helpers-0.6.0 lib/shell_helpers/options.rb