Class: Glossarist::CLI::PackageCommand
- Inherits:
-
Object
- Object
- Glossarist::CLI::PackageCommand
- Defined in:
- lib/glossarist/cli/package_command.rb
Instance Method Summary collapse
-
#initialize(dir, options) ⇒ PackageCommand
constructor
A new instance of PackageCommand.
- #run ⇒ Object
Constructor Details
#initialize(dir, options) ⇒ PackageCommand
Returns a new instance of PackageCommand.
6 7 8 9 |
# File 'lib/glossarist/cli/package_command.rb', line 6 def initialize(dir, ) @dir = dir @options = end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/glossarist/cli/package_command.rb', line 11 def run GcrPackage.create_from_directory( @dir, output: @options[:output], shortname: @options[:shortname], version: @options[:version], title: @options[:title], description: @options[:description], owner: @options[:owner], tags: @options[:tags], register_yaml: @options[:register_yaml], uri_prefix: @options[:uri_prefix], ) puts "Created #{@options[:output]}" rescue ArgumentError => e warn "Error: #{e.}" exit 1 end |