wordnik 4.11 → 4.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- wordnik (4.11)
4
+ wordnik (4.12)
5
5
  activemodel (>= 3.0.3)
6
6
  addressable (>= 2.2.4)
7
7
  htmlentities (>= 4.2.4)
@@ -28,7 +28,7 @@ GEM
28
28
  diff-lcs (1.1.3)
29
29
  htmlentities (4.3.1)
30
30
  i18n (0.6.1)
31
- json (1.7.5)
31
+ json (1.7.6)
32
32
  mime-types (1.19)
33
33
  multi_json (1.3.6)
34
34
  nokogiri (1.5.5)
data/Rakefile CHANGED
@@ -46,4 +46,4 @@ task :swagger do
46
46
  resource.write_convenience_methods
47
47
  end
48
48
 
49
- end
49
+ end
@@ -57,7 +57,7 @@ module Wordnik
57
57
  # Extract the response format from the header hash
58
58
  # e.g. {'Content-Type' => 'application/json'}
59
59
  def format
60
- headers['Content-Type'].split("/").last.to_s
60
+ headers['Content-Type'].split(";").first.strip.split("/").last.to_s
61
61
  end
62
62
 
63
63
  def json?
@@ -91,4 +91,4 @@ module Wordnik
91
91
  end
92
92
 
93
93
  end
94
- end
94
+ end
@@ -1,3 +1,3 @@
1
1
  module Wordnik
2
- VERSION = "4.11"
2
+ VERSION = "4.12"
3
3
  end
@@ -4,9 +4,7 @@ describe Wordnik::Response do
4
4
 
5
5
  before(:each) do
6
6
 
7
- #VCR.use_cassette('word_resource', :record => :new_episodes) do
8
- @raw = Typhoeus::Request.get("http://#{Wordnik.configuration.host}#{Wordnik.configuration.base_path}/word.json")
9
- #end
7
+ @raw = Typhoeus::Request.get("http://#{Wordnik.configuration.host}#{Wordnik.configuration.base_path}/word.json")
10
8
 
11
9
  @response = Wordnik::Response.new(@raw)
12
10
  end
@@ -29,10 +27,8 @@ describe Wordnik::Response do
29
27
 
30
28
  describe "unauthorized" do
31
29
  it "raises an error when initialized" do
32
- #VCR.use_cassette('get_dog_images', :record => :new_episodes) do
33
- @unauthorized_raw = Typhoeus::Request.get("http://#{Wordnik.configuration.host}#{Wordnik.configuration.base_path}/word.json/dog/images/flickr")
34
- expect { Wordnik::Response.new(@unauthorized_raw) }.to raise_error(ClientError)
35
- #end
30
+ @unauthorized_raw = Typhoeus::Request.get("http://#{Wordnik.configuration.host}#{Wordnik.configuration.base_path}/word.json/dog/images/flickr")
31
+ expect { Wordnik::Response.new(@unauthorized_raw) }.to raise_error(ClientError)
36
32
  end
37
33
  end
38
34
 
@@ -44,9 +40,7 @@ describe Wordnik::Response do
44
40
  end
45
41
 
46
42
  it "recognizes xml" do
47
- #VCR.use_cassette('xml_response_request', :record => :new_episodes) do
48
- @raw = Typhoeus::Request.get("http://#{Wordnik.configuration.host}#{Wordnik.configuration.base_path}/word.xml")
49
- #end
43
+ @raw = Typhoeus::Request.get("http://#{Wordnik.configuration.host}#{Wordnik.configuration.base_path}/word.xml")
50
44
  @response = Wordnik::Response.new(@raw)
51
45
  @response.format.should == 'xml'
52
46
  @response.xml?.should == true
@@ -62,17 +56,13 @@ describe Wordnik::Response do
62
56
 
63
57
  it "has a pretty XML body even in the face of adverse characters" do
64
58
  configure_wordnik
65
- #VCR.use_cassette('crazier_json_request', :record => :new_episodes) do
66
- @request = Wordnik::Request.new(:get, "word.xml/hero/pronunciations", :params => {:limit => 1})
67
- @response = @request.response
68
- #end
59
+ @request = Wordnik::Request.new(:get, "word.xml/hero/pronunciations", :params => {:limit => 1})
60
+ @response = @request.response
69
61
  @response.pretty_body.should =~ /\?xml/
70
62
  end
71
63
 
72
64
  it "has a pretty xml body" do
73
- #VCR.use_cassette('xml_response_request', :record => :new_episodes) do
74
- @raw = Typhoeus::Request.get("http://#{Wordnik.configuration.host}#{Wordnik.configuration.base_path}/word.xml")
75
- #end
65
+ @raw = Typhoeus::Request.get("http://#{Wordnik.configuration.host}#{Wordnik.configuration.base_path}/word.xml")
76
66
  @response = Wordnik::Response.new(@raw)
77
67
  @response.pretty_body.should =~ /\?xml/
78
68
  end
@@ -42,7 +42,7 @@ def configure_wordnik
42
42
  config.password = CREDENTIALS[:password]
43
43
  config.logger = CREDENTIALS[:logfile] ? Logger.new(CREDENTIALS[:logfile]) : Logger.new('/dev/null')
44
44
 
45
- config.host = CREDENTIALS[:host] || 'beta.wordnik.com'
45
+ config.host = CREDENTIALS[:host] || 'beta.api.wordnik.com'
46
46
  config.hosts = CREDENTIALS[:hosts] || []
47
47
  config.base_path = CREDENTIALS[:base_path] || '/v4'
48
48
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wordnik
3
3
  version: !ruby/object:Gem::Version
4
- version: '4.11'
4
+ version: '4.12'
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-01 00:00:00.000000000 Z
13
+ date: 2013-03-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: typhoeus
@@ -308,18 +308,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
308
308
  - - ! '>='
309
309
  - !ruby/object:Gem::Version
310
310
  version: '0'
311
- segments:
312
- - 0
313
- hash: 2965605732452902667
314
311
  required_rubygems_version: !ruby/object:Gem::Requirement
315
312
  none: false
316
313
  requirements:
317
314
  - - ! '>='
318
315
  - !ruby/object:Gem::Version
319
316
  version: '0'
320
- segments:
321
- - 0
322
- hash: 2965605732452902667
323
317
  requirements: []
324
318
  rubyforge_project: wordnik
325
319
  rubygems_version: 1.8.24