Sha256: 2489629e1f278478ebabdd28a62edbfb3195706b443ed234109aaa00836366f8

Contents?: true

Size: 648 Bytes

Versions: 2

Compression:

Stored size: 648 Bytes

Contents

require 'miu'

module Miu
  class Command
    def self.new(name, plugin, options = {}, &block)
      require 'thor'
      Class.new ::Thor do
        include ::Thor::Actions
        add_runtime_options!

        class << self
          def source_root
            Miu.find_root('Gemfile', plugin.called_from)
          end

          def destination_root
            Miu.root
          end

          def banner(task, namespace = nil, subcommand = nil)
            super task, namespace, subcommand || options.fetch(:subcommand, true)
          end
        end

        namespace name
        class_eval &block if block
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
miu-0.0.6 lib/miu/command.rb
miu-0.0.5 lib/miu/command.rb