auger 1.4.3 → 1.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/auger/plugin/http.rb +17 -1
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.3
1
+ 1.4.4
@@ -44,6 +44,10 @@ module Auger
44
44
  @requests << Auger::HttpPost.load(url, &block)
45
45
  end
46
46
 
47
+ def propfind(url, &block)
48
+ @requests << Auger::HttpPropfind.load(url, &block)
49
+ end
50
+
47
51
  def open(host, options)
48
52
  http = Net::HTTP.new(host, options[:port])
49
53
  http.use_ssl = options[:ssl]
@@ -61,7 +65,7 @@ module Auger
61
65
  end
62
66
 
63
67
  class HttpRequest < Auger::Request
64
- attr_accessor :method, :headers, :user, :password, :data
68
+ attr_accessor :method, :headers, :user, :password, :data, :body
65
69
  alias_method :url, :arg
66
70
 
67
71
  def initialize(url)
@@ -75,6 +79,10 @@ module Auger
75
79
  @data = hash
76
80
  end
77
81
 
82
+ def body(string)
83
+ @body = string
84
+ end
85
+
78
86
  def header(h)
79
87
  key, value = h.split /\s*:\s*/
80
88
  @headers[key] = value
@@ -93,6 +101,7 @@ module Auger
93
101
  request.basic_auth(@user, @password || '') if @user
94
102
  @headers.each { |k,v| request[k] = v }
95
103
  request.set_form_data(@data)
104
+ request.body = @body
96
105
  http.request(request)
97
106
  end
98
107
 
@@ -112,4 +121,11 @@ module Auger
112
121
  end
113
122
  end
114
123
 
124
+ class HttpPropfind < Auger::HttpRequest
125
+ def initialize(url)
126
+ @method = :propfind
127
+ super
128
+ end
129
+ end
130
+
115
131
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3
4
+ version: 1.4.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-11-28 00:00:00.000000000 Z
13
+ date: 2013-01-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json