Sha256: cc63ae1749b1d8b449be2e1be45ddcbfb1a5196b3429b1e3994a1e47d3dba9ba

Contents?: true

Size: 475 Bytes

Versions: 5

Compression:

Stored size: 475 Bytes

Contents

module Rpub
  module Commands
    class Base
      extend SubclassTracker

      attr_reader :options

      def initialize(options = [], stdout = $stdout)
        @options, @stdout = options, stdout
      end

      def invoke
        parser.parse!(options)
      end

      def help
        puts parser
      end

    protected

      def parser
        OptionParser.new
      end

    private

      def puts(*args)
        @stdout.puts(*args)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rpub-0.4.0 lib/rpub/commands/base.rb
rpub-0.3.0 lib/rpub/commands/base.rb
rpub-0.2.1 lib/rpub/commands/base.rb
rpub-0.2.0 lib/rpub/commands/base.rb
rpub-0.1.0 lib/rpub/commands/base.rb