Sha256: f691da7636df2862a6b54a4679da30b659b20419941eb13782003a287f86303a

Contents?: true

Size: 690 Bytes

Versions: 27

Compression:

Stored size: 690 Bytes

Contents

# -*- coding: utf-8 -*-
require "magellan/cli"

module Magellan
  module Cli
    class Direct < ::Magellan::Cli::Base

      desc "get PATH", "Send GET request with PATH"
      def get(path)
        r = get_json(path)
        $stdout.puts(JSON.pretty_generate(r))
      end

      desc "post PATH [PARAMS]", "Send POST request with PATH and PARAMS"
      def post(path, params = nil)
        post_json(path)
      end

      desc "put PATH [PARAMS]", "Send PUT request with PATH and PARAMS"
      def put(path, params = nil)
        put_json(path)
      end

      desc "delete PATH", "Send DELETE request with PATH"
      def delete(path)
        delete(path)
      end

    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
magellan-cli-0.11.1 lib/magellan/cli/direct.rb
magellan-cli-0.11.0 lib/magellan/cli/direct.rb
magellan-cli-0.10.0 lib/magellan/cli/direct.rb
magellan-cli-0.9.1 lib/magellan/cli/direct.rb
magellan-cli-0.9.0 lib/magellan/cli/direct.rb
magellan-cli-0.8.3 lib/magellan/cli/direct.rb
magellan-cli-0.8.2 lib/magellan/cli/direct.rb
magellan-cli-0.8.1 lib/magellan/cli/direct.rb
magellan-cli-0.8.0 lib/magellan/cli/direct.rb
magellan-cli-0.7.11 lib/magellan/cli/direct.rb
magellan-cli-0.7.10 lib/magellan/cli/direct.rb
magellan-cli-0.7.9 lib/magellan/cli/direct.rb
magellan-cli-0.7.8 lib/magellan/cli/direct.rb
magellan-cli-0.7.7 lib/magellan/cli/direct.rb
magellan-cli-0.7.6 lib/magellan/cli/direct.rb
magellan-cli-0.7.5 lib/magellan/cli/direct.rb
magellan-cli-0.7.4 lib/magellan/cli/direct.rb
magellan-cli-0.7.3 lib/magellan/cli/direct.rb
magellan-cli-0.7.2 lib/magellan/cli/direct.rb
magellan-cli-0.7.1 lib/magellan/cli/direct.rb