Sha256: 99d76ad4380ae59fc8a682b9ed31c75468f88e7fe871a1921fb59b3a4459add6

Contents?: true

Size: 733 Bytes

Versions: 1

Compression:

Stored size: 733 Bytes

Contents

module MagicReveal
  class Cli
    # Command line options
    class Options
      attr_accessor(
        :command,
        :project
      )

      def program_name
        @program_name ||= File.basename($PROGRAM_NAME)
      end

      def parse(args) # rubocop:disable MethodLength
        case args.first
        when 'new'
          if args.length != 2
            @command = :help
          else
            @command = :new
            @project = args[1]
          end
        when 'force-reload'
          @command = :force_reload
        when 'start'
          @command = :start
        when 'static'
          @command = :static
        else # including help
          @command = :help
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
magic_reveal-2.6.1.4 lib/magic_reveal/cli/options.rb