deadlinez 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/{CHANGELOG → CHANGELOG.markdown} +4 -0
- data/VERSION +1 -1
- data/deadlinez.gemspec +2 -2
- data/lib/deadlinez/api.rb +9 -6
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/deadlinez.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{deadlinez}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["David Balatero"]
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.files = [
|
20
20
|
".document",
|
21
21
|
".gitignore",
|
22
|
-
"CHANGELOG",
|
22
|
+
"CHANGELOG.markdown",
|
23
23
|
"LICENSE",
|
24
24
|
"README.rdoc",
|
25
25
|
"Rakefile",
|
data/lib/deadlinez/api.rb
CHANGED
@@ -4,6 +4,12 @@ module Deadlinez
|
|
4
4
|
format :xml
|
5
5
|
base_uri 'service.afterthedeadline.com'
|
6
6
|
|
7
|
+
REQUIRED_HEADERS = {
|
8
|
+
'Host' => 'service.afterthedeadline.com',
|
9
|
+
'Content-Type' => 'application/x-www-form-urlencoded',
|
10
|
+
'User-Agent' => 'AtD/0.1'
|
11
|
+
}
|
12
|
+
|
7
13
|
# Proxies any URL through to AtD. Useful for the TinyMCE
|
8
14
|
# plugin.
|
9
15
|
def self.proxy(path, params)
|
@@ -11,11 +17,7 @@ module Deadlinez
|
|
11
17
|
response = post(path,
|
12
18
|
:body => proxy_params,
|
13
19
|
:format => nil,
|
14
|
-
:headers =>
|
15
|
-
'Host' => 'service.afterthedeadline.com',
|
16
|
-
'Content-Type' => 'application/x-www-form-urlencoded',
|
17
|
-
'User-Agent' => 'AtD/0.1'
|
18
|
-
})
|
20
|
+
:headers => REQUIRED_HEADERS)
|
19
21
|
response.body
|
20
22
|
end
|
21
23
|
|
@@ -23,7 +25,8 @@ module Deadlinez
|
|
23
25
|
response = post('/stats',
|
24
26
|
:body => {
|
25
27
|
:data => data
|
26
|
-
}
|
28
|
+
},
|
29
|
+
:headers => REQUIRED_HEADERS)
|
27
30
|
response['scores']['metric']
|
28
31
|
end
|
29
32
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- David Balatero
|
@@ -67,7 +67,7 @@ extra_rdoc_files:
|
|
67
67
|
files:
|
68
68
|
- .document
|
69
69
|
- .gitignore
|
70
|
-
- CHANGELOG
|
70
|
+
- CHANGELOG.markdown
|
71
71
|
- LICENSE
|
72
72
|
- README.rdoc
|
73
73
|
- Rakefile
|