mendeley 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ #Overview
2
+ This is a simple ruby wrapper for the mendeley api
3
+ You can find details about the mendeley API here:
4
+ (http://apidocs.mendeley.com/home/public-resources)
5
+
6
+ #Installation
7
+ gem install mendeley
8
+ #Usage
9
+ Before you can use the gem you will need to get a consumer key from the
10
+ mendeley website
11
+
12
+ The first step is to define your consumer key:
13
+ Mendeley.consumer_key = "<Your key here>"
14
+
15
+ Now you can make requests to the mendeley api.
16
+
17
+ To do a search simply the use document search class method
18
+ Mendeley::API::Documents.search(term)
19
+
20
+ To get detailed information on a document:
21
+ Mendeley::API.Documents.document_details(< doc_id>)
@@ -47,6 +47,12 @@ module Mendeley
47
47
  end
48
48
  request(File.join("details", URI.escape(doc_id)))
49
49
  end
50
+
51
+ def self.authored_by(name)
52
+ request(File.join("authored", URI.escape(name)))
53
+ end
54
+
50
55
  end
56
+
51
57
  end
52
58
  end
@@ -1,3 +1,3 @@
1
1
  module Mendeley
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -5,7 +5,7 @@ describe "Mendeley" do
5
5
  describe "API" do
6
6
  describe "Documents" do
7
7
  it "should extend all the API module methods" do
8
- Mendeley::API::Documents.singleton_methods.include?("request").should be_true
8
+ Mendeley::API::Documents.singleton_methods.include?(:request).should be_true
9
9
  end
10
10
  it "should have a base_url" do
11
11
  Documents.base_url.should == "http://api.mendeley.com/oapi/documents/"
@@ -27,6 +27,16 @@ describe "Mendeley" do
27
27
  end
28
28
  end
29
29
 
30
+ describe ".authored_by" do
31
+ it "should search for document with a given author" do
32
+ response = JSON.generate({:result => "success"})
33
+ RestClient.expects(:get).with() do |request|
34
+ request.should == "http://api.mendeley.com/oapi/documents/authored/marcio%20von%20muhlen?consumer_key="
35
+ end.returns(response)
36
+ Documents.authored_by("marcio von muhlen")
37
+ end
38
+ end
39
+
30
40
  describe ".document_details" do
31
41
  it "should return the details of a document do" do
32
42
  response = JSON.generate({:result => "success"})
@@ -40,6 +50,7 @@ describe "Mendeley" do
40
50
  lambda{Documents.document_details(15)}.should raise_error
41
51
  end
42
52
  end
53
+
43
54
  end
44
55
  end
45
56
  end
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mendeley
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 0
9
- - 2
10
- version: 0.0.2
4
+ prerelease:
5
+ version: 0.0.3
11
6
  platform: ruby
12
7
  authors:
13
8
  - Ryan Weald
@@ -15,7 +10,7 @@ autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
12
 
18
- date: 2011-04-01 00:00:00 -07:00
13
+ date: 2011-05-03 00:00:00 -07:00
19
14
  default_executable:
20
15
  dependencies:
21
16
  - !ruby/object:Gem::Dependency
@@ -26,9 +21,6 @@ dependencies:
26
21
  requirements:
27
22
  - - ">="
28
23
  - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
24
  version: "0"
33
25
  type: :development
34
26
  version_requirements: *id001
@@ -40,9 +32,6 @@ dependencies:
40
32
  requirements:
41
33
  - - ">="
42
34
  - !ruby/object:Gem::Version
43
- hash: 3
44
- segments:
45
- - 0
46
35
  version: "0"
47
36
  type: :development
48
37
  version_requirements: *id002
@@ -54,9 +43,6 @@ dependencies:
54
43
  requirements:
55
44
  - - ">="
56
45
  - !ruby/object:Gem::Version
57
- hash: 3
58
- segments:
59
- - 0
60
46
  version: "0"
61
47
  type: :runtime
62
48
  version_requirements: *id003
@@ -68,9 +54,6 @@ dependencies:
68
54
  requirements:
69
55
  - - ">="
70
56
  - !ruby/object:Gem::Version
71
- hash: 3
72
- segments:
73
- - 0
74
57
  version: "0"
75
58
  type: :runtime
76
59
  version_requirements: *id004
@@ -86,6 +69,7 @@ extra_rdoc_files: []
86
69
  files:
87
70
  - .gitignore
88
71
  - Gemfile
72
+ - README.markdown
89
73
  - Rakefile
90
74
  - lib/mendeley.rb
91
75
  - lib/mendeley/public_api.rb
@@ -109,23 +93,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
109
93
  requirements:
110
94
  - - ">="
111
95
  - !ruby/object:Gem::Version
112
- hash: 3
113
- segments:
114
- - 0
115
96
  version: "0"
116
97
  required_rubygems_version: !ruby/object:Gem::Requirement
117
98
  none: false
118
99
  requirements:
119
100
  - - ">="
120
101
  - !ruby/object:Gem::Version
121
- hash: 3
122
- segments:
123
- - 0
124
102
  version: "0"
125
103
  requirements: []
126
104
 
127
105
  rubyforge_project: mendeley
128
- rubygems_version: 1.3.7
106
+ rubygems_version: 1.5.0
129
107
  signing_key:
130
108
  specification_version: 3
131
109
  summary: A simple ruby wrapper for the mendeley api