Sha256: 461769d3cab4e420badacc98817e7a23c79960c5e5838ee6e61878b295043536

Contents?: true

Size: 691 Bytes

Versions: 21

Compression:

Stored size: 691 Bytes

Contents

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

module Magellan
  module Cli
    class Direct < ::Magellan::Cli::Http

      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

21 entries across 21 versions & 1 rubygems

Version Path
magellan-cli-0.5.9 lib/magellan/cli/direct.rb
magellan-cli-0.5.8 lib/magellan/cli/direct.rb
magellan-cli-0.5.7 lib/magellan/cli/direct.rb
magellan-cli-0.5.6 lib/magellan/cli/direct.rb
magellan-cli-0.5.5 lib/magellan/cli/direct.rb
magellan-cli-0.5.4 lib/magellan/cli/direct.rb
magellan-cli-0.5.3 lib/magellan/cli/direct.rb
magellan-cli-0.5.2 lib/magellan/cli/direct.rb
magellan-cli-0.5.1 lib/magellan/cli/direct.rb
magellan-cli-0.5.0 lib/magellan/cli/direct.rb
magellan-cli-0.4.4 lib/magellan/cli/direct.rb
magellan-cli-0.4.3 lib/magellan/cli/direct.rb
magellan-cli-0.4.2 lib/magellan/cli/direct.rb
magellan-cli-0.4.1 lib/magellan/cli/direct.rb
magellan-cli-0.4.0 lib/magellan/cli/direct.rb
magellan-cli-0.3.4 lib/magellan/cli/direct.rb
magellan-cli-0.3.3 lib/magellan/cli/direct.rb
magellan-cli-0.3.2 lib/magellan/cli/direct.rb
magellan-cli-0.3.1 lib/magellan/cli/direct.rb
magellan-cli-0.3.0 lib/magellan/cli/direct.rb