Sha256: 7a0b509093fb3c22c827e9c96a577382d607b3820727ef5e215fa9f43f2008cf

Contents?: true

Size: 825 Bytes

Versions: 10

Compression:

Stored size: 825 Bytes

Contents

require "pry"

module Guard
  module Commands
    class Scope
      def self.import
        Pry::Commands.create_command "scope" do
          group "Guard"
          description "Scope Guard actions to groups and plugins."

          banner <<-BANNER
          Usage: scope <scope>

          Set the global Guard scope.
          BANNER

          def process(*entries)
            scope, unknown = ::Guard::Interactor.convert_scope(entries)

            unless unknown.empty?
              output.puts "Unknown scopes: #{unknown.join(",") }"
              return
            end

            if scope[:plugins].empty? && scope[:groups].empty?
              output.puts "Usage: scope <scope>"
              return
            end

            ::Guard.setup_scope(scope)
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 6 versions & 1 rubygems

Version Path
guard-2.8.2 lib/guard/commands/scope.rb.orig
guard-2.8.2 lib/guard/commands/scope.rb
guard-2.8.1 lib/guard/commands/scope.rb
guard-2.8.1 lib/guard/commands/scope.rb.orig
guard-2.8.0 lib/guard/commands/scope.rb.orig
guard-2.8.0 lib/guard/commands/scope.rb
guard-2.7.3 lib/guard/commands/scope.rb.orig
guard-2.7.3 lib/guard/commands/scope.rb
guard-2.7.2 lib/guard/commands/scope.rb
guard-2.7.1 lib/guard/commands/scope.rb