Sha256: 18567c4bbe963b8eaa73e03568a2baf90222b25d4c2395fd443f7673b97b8998

Contents?: true

Size: 450 Bytes

Versions: 38

Compression:

Stored size: 450 Bytes

Contents

#!/usr/bin/env ruby
require 'dagger'

method = ARGV[0] or abort "Usage: dagger [method] [url] [data]"

method = if ARGV[1].nil?
  'get'
else
  ARGV.shift
end

def parse_data(str)
  {} # not ready yet. TODO!
end

url  = ARGV[0]
data = parse_data(ARGV[1])

options = {
  :follow => true
}

# puts "#{method} #{url}"
resp = Dagger.send(method, url, data, options)

if ARGV.include?('-I')
  puts resp.status
  puts resp.headers
else
  puts resp.body
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
dagger-2.3.1 bin/dagger
dagger-2.3.0 bin/dagger
dagger-2.2.0 bin/dagger
dagger-2.1.1 bin/dagger
dagger-2.0.1 bin/dagger
dagger-2.0.0 bin/dagger
dagger-1.9.0 bin/dagger
dagger-1.8.0 bin/dagger
dagger-1.7.1 bin/dagger
dagger-1.7.0 bin/dagger
dagger-1.6.2 bin/dagger
dagger-1.6.1 bin/dagger
dagger-1.5.1 bin/dagger
dagger-1.4.1 bin/dagger
dagger-1.4.0 bin/dagger
dagger-1.3.1 bin/dagger
dagger-1.3.0 bin/dagger
dagger-1.2.0 bin/dagger
dagger-1.1.0 bin/dagger
dagger-1.0.2 bin/dagger