pocket-ruby 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,13 +1,18 @@
1
1
  *.gem
2
2
  *.rbc
3
- .DS_Store
4
3
  .bundle
5
- .rvmrc
4
+ .config
5
+ coverage
6
+ InstalledFiles
7
+ lib/bundler/man
8
+ pkg
9
+ rdoc
10
+ spec/reports
11
+ test/tmp
12
+ test/version_tmp
13
+ tmp
14
+
15
+ # YARD artifacts
6
16
  .yardoc
7
- .rake_tasks~
8
- Gemfile.lock
9
- coverage/*
10
- doc/*
11
- log/*
12
- pkg/*
13
- .idea/*
17
+ _yardoc
18
+ doc/
data/Gemfile.lock ADDED
@@ -0,0 +1,62 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ pocket-ruby (0.0.3)
5
+ faraday (>= 0.7, < 0.9)
6
+ faraday_middleware (~> 0.8)
7
+ hashie (>= 0.4.0)
8
+ multi_json (~> 1.0, >= 1.0.3)
9
+
10
+ GEM
11
+ remote: http://rubygems.org/
12
+ specs:
13
+ addressable (2.3.2)
14
+ bluecloth (2.0.11)
15
+ coderay (1.0.8)
16
+ crack (0.3.1)
17
+ diff-lcs (1.1.3)
18
+ faraday (0.8.4)
19
+ multipart-post (~> 1.1)
20
+ faraday_middleware (0.9.0)
21
+ faraday (>= 0.7.4, < 0.9)
22
+ hashie (1.2.0)
23
+ method_source (0.8.1)
24
+ multi_json (1.3.7)
25
+ multi_xml (0.5.1)
26
+ multipart-post (1.1.5)
27
+ pry (0.9.10)
28
+ coderay (~> 1.0.5)
29
+ method_source (~> 0.8)
30
+ slop (~> 3.3.1)
31
+ rack (1.4.1)
32
+ rack-protection (1.2.0)
33
+ rack
34
+ rspec (2.12.0)
35
+ rspec-core (~> 2.12.0)
36
+ rspec-expectations (~> 2.12.0)
37
+ rspec-mocks (~> 2.12.0)
38
+ rspec-core (2.12.0)
39
+ rspec-expectations (2.12.0)
40
+ diff-lcs (~> 1.1.3)
41
+ rspec-mocks (2.12.0)
42
+ sinatra (1.3.3)
43
+ rack (~> 1.3, >= 1.3.6)
44
+ rack-protection (~> 1.2)
45
+ tilt (~> 1.3, >= 1.3.3)
46
+ slop (3.3.3)
47
+ tilt (1.3.3)
48
+ webmock (1.9.0)
49
+ addressable (>= 2.2.7)
50
+ crack (>= 0.1.7)
51
+
52
+ PLATFORMS
53
+ ruby
54
+
55
+ DEPENDENCIES
56
+ bluecloth (~> 2.0.11)
57
+ multi_xml
58
+ pocket-ruby!
59
+ pry (~> 0.9.10)
60
+ rspec (~> 2.4)
61
+ sinatra (~> 1.3.3)
62
+ webmock (~> 1.6)
data/README.md ADDED
@@ -0,0 +1,2 @@
1
+ pocket-ruby
2
+ ===========
data/demo-server.rb CHANGED
@@ -7,7 +7,7 @@ enable :sessions
7
7
  CALLBACK_URL = "http://localhost:4567/oauth/callback"
8
8
 
9
9
  Pocket.configure do |config|
10
- config.consumer_key = <http://getpocket.com/developer/apps/>
10
+ config.consumer_key = '10188-3565cd04d1464e6d0e64b67f'
11
11
  end
12
12
 
13
13
  get '/reset' do
@@ -31,24 +31,20 @@ end
31
31
 
32
32
  get "/oauth/connect" do
33
33
  puts "OAUTH CONNECT"
34
- puts "session: #{session}"
35
34
  session[:code] = Pocket.get_code(:redirect_uri => CALLBACK_URL)
36
- puts "code in connect session: #{session[:code]}"
37
35
  new_url = Pocket.authorize_url(:code => session[:code], :redirect_uri => CALLBACK_URL)
38
36
  puts "new_url: #{new_url}"
37
+ puts "session: #{session}"
39
38
  redirect new_url
40
39
  end
41
40
 
42
41
  get "/oauth/callback" do
43
42
  puts "OAUTH CALLBACK"
44
- puts "session: #{session}"
45
43
  puts "request.url: #{request.url}"
46
44
  puts "request.body: #{request.body.read}"
47
- puts "code in callback session: #{session[:code]}"
48
- puts "code in callback session: #{session[:code]}"
49
- session[:code] = session[:code] if session[:code] == "ef0a7115-e3f2-a253-1147-a16a32"
50
45
  access_token = Pocket.get_access_token(session[:code], :redirect_uri => CALLBACK_URL)
51
46
  session[:access_token] = access_token
47
+ puts "session: #{session}"
52
48
  redirect "/"
53
49
  end
54
50
 
@@ -3,8 +3,8 @@ module Pocket
3
3
  # http://getpocket.com/developer/docs/v3/modify
4
4
  module Modify
5
5
  # required params: actions, consumer_key, access_token
6
- def modify params
7
- response = connection.post("/v3/send", params)
6
+ def modify actions
7
+ response = connection.post("/v3/send", {actions: actions})
8
8
  response.body
9
9
  end
10
10
  end
@@ -1,3 +1,3 @@
1
1
  module Pocket
2
- VERSION = '0.0.3'.freeze unless defined?(::Pocket::VERSION)
2
+ VERSION = '0.0.4'
3
3
  end
data/pocket-ruby.gemspec CHANGED
@@ -2,18 +2,14 @@
2
2
  require File.expand_path('../lib/pocket/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
- s.add_development_dependency('rspec', '~> 2.4')
6
- s.add_development_dependency('webmock', '~> 1.6')
7
- s.add_development_dependency('bluecloth', '~> 2.0.11')
8
5
  s.add_development_dependency('sinatra', '~> 1.3.3')
9
- s.add_development_dependency('pry', '~> 0.9.10')
10
6
  s.add_development_dependency('multi_xml')
11
7
  s.add_runtime_dependency('faraday', ['>= 0.7', '< 0.9'])
12
8
  s.add_runtime_dependency('faraday_middleware', '~> 0.8')
13
9
  s.add_runtime_dependency('multi_json', '>= 1.0.3', '~> 1.0')
14
10
  s.add_runtime_dependency('hashie', '>= 0.4.0')
15
11
  s.authors = ["Turadg Aleahmad"]
16
- s.description = %q{A Ruby wrapper for the Pocket REST and Search APIs}
12
+ s.description = %q{A Ruby wrapper for the Pocket API v3 (Add, Modify and Retrieve)}
17
13
  s.email = ['turadg@aleahmad.net']
18
14
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
15
  s.files = `git ls-files`.split("\n")
@@ -23,7 +19,7 @@ Gem::Specification.new do |s|
23
19
  s.require_paths = ['lib']
24
20
  s.required_rubygems_version = Gem::Requirement.new('>= 1.3.6') if s.respond_to? :required_rubygems_version=
25
21
  s.rubyforge_project = s.name
26
- s.summary = %q{Ruby wrapper for the Pocket API}
22
+ s.summary = %q{Ruby wrapper for the Pocket API v3}
27
23
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
28
- s.version = Pocket::VERSION.dup
24
+ s.version = Pocket::VERSION
29
25
  end
metadata CHANGED
@@ -1,116 +1,50 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pocket-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
5
4
  prerelease:
5
+ version: 0.0.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Turadg Aleahmad
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-10 00:00:00.000000000 Z
12
+ date: 2013-01-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: rspec
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ~>
20
- - !ruby/object:Gem::Version
21
- version: '2.4'
22
- type: :development
23
- prerelease: false
24
15
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ~>
28
- - !ruby/object:Gem::Version
29
- version: '2.4'
30
- - !ruby/object:Gem::Dependency
31
- name: webmock
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
16
  requirements:
35
17
  - - ~>
36
18
  - !ruby/object:Gem::Version
37
- version: '1.6'
38
- type: :development
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- version: '1.6'
46
- - !ruby/object:Gem::Dependency
47
- name: bluecloth
48
- requirement: !ruby/object:Gem::Requirement
19
+ version: 1.3.3
49
20
  none: false
50
- requirements:
51
- - - ~>
52
- - !ruby/object:Gem::Version
53
- version: 2.0.11
21
+ name: sinatra
54
22
  type: :development
55
23
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ~>
60
- - !ruby/object:Gem::Version
61
- version: 2.0.11
62
- - !ruby/object:Gem::Dependency
63
- name: sinatra
64
24
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
25
  requirements:
67
26
  - - ~>
68
27
  - !ruby/object:Gem::Version
69
28
  version: 1.3.3
70
- type: :development
71
- prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
29
  none: false
74
- requirements:
75
- - - ~>
76
- - !ruby/object:Gem::Version
77
- version: 1.3.3
78
30
  - !ruby/object:Gem::Dependency
79
- name: pry
80
- requirement: !ruby/object:Gem::Requirement
81
- none: false
82
- requirements:
83
- - - ~>
84
- - !ruby/object:Gem::Version
85
- version: 0.9.10
86
- type: :development
87
- prerelease: false
88
31
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ~>
92
- - !ruby/object:Gem::Version
93
- version: 0.9.10
94
- - !ruby/object:Gem::Dependency
95
- name: multi_xml
96
- requirement: !ruby/object:Gem::Requirement
97
- none: false
98
32
  requirements:
99
33
  - - ! '>='
100
34
  - !ruby/object:Gem::Version
101
35
  version: '0'
36
+ none: false
37
+ name: multi_xml
102
38
  type: :development
103
39
  prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- none: false
40
+ requirement: !ruby/object:Gem::Requirement
106
41
  requirements:
107
42
  - - ! '>='
108
43
  - !ruby/object:Gem::Version
109
44
  version: '0'
110
- - !ruby/object:Gem::Dependency
111
- name: faraday
112
- requirement: !ruby/object:Gem::Requirement
113
45
  none: false
46
+ - !ruby/object:Gem::Dependency
47
+ version_requirements: !ruby/object:Gem::Requirement
114
48
  requirements:
115
49
  - - ! '>='
116
50
  - !ruby/object:Gem::Version
@@ -118,10 +52,11 @@ dependencies:
118
52
  - - <
119
53
  - !ruby/object:Gem::Version
120
54
  version: '0.9'
55
+ none: false
56
+ name: faraday
121
57
  type: :runtime
122
58
  prerelease: false
123
- version_requirements: !ruby/object:Gem::Requirement
124
- none: false
59
+ requirement: !ruby/object:Gem::Requirement
125
60
  requirements:
126
61
  - - ! '>='
127
62
  - !ruby/object:Gem::Version
@@ -129,26 +64,25 @@ dependencies:
129
64
  - - <
130
65
  - !ruby/object:Gem::Version
131
66
  version: '0.9'
132
- - !ruby/object:Gem::Dependency
133
- name: faraday_middleware
134
- requirement: !ruby/object:Gem::Requirement
135
67
  none: false
68
+ - !ruby/object:Gem::Dependency
69
+ version_requirements: !ruby/object:Gem::Requirement
136
70
  requirements:
137
71
  - - ~>
138
72
  - !ruby/object:Gem::Version
139
73
  version: '0.8'
74
+ none: false
75
+ name: faraday_middleware
140
76
  type: :runtime
141
77
  prerelease: false
142
- version_requirements: !ruby/object:Gem::Requirement
143
- none: false
78
+ requirement: !ruby/object:Gem::Requirement
144
79
  requirements:
145
80
  - - ~>
146
81
  - !ruby/object:Gem::Version
147
82
  version: '0.8'
148
- - !ruby/object:Gem::Dependency
149
- name: multi_json
150
- requirement: !ruby/object:Gem::Requirement
151
83
  none: false
84
+ - !ruby/object:Gem::Dependency
85
+ version_requirements: !ruby/object:Gem::Requirement
152
86
  requirements:
153
87
  - - ! '>='
154
88
  - !ruby/object:Gem::Version
@@ -156,10 +90,11 @@ dependencies:
156
90
  - - ~>
157
91
  - !ruby/object:Gem::Version
158
92
  version: '1.0'
93
+ none: false
94
+ name: multi_json
159
95
  type: :runtime
160
96
  prerelease: false
161
- version_requirements: !ruby/object:Gem::Requirement
162
- none: false
97
+ requirement: !ruby/object:Gem::Requirement
163
98
  requirements:
164
99
  - - ! '>='
165
100
  - !ruby/object:Gem::Version
@@ -167,23 +102,24 @@ dependencies:
167
102
  - - ~>
168
103
  - !ruby/object:Gem::Version
169
104
  version: '1.0'
170
- - !ruby/object:Gem::Dependency
171
- name: hashie
172
- requirement: !ruby/object:Gem::Requirement
173
105
  none: false
106
+ - !ruby/object:Gem::Dependency
107
+ version_requirements: !ruby/object:Gem::Requirement
174
108
  requirements:
175
109
  - - ! '>='
176
110
  - !ruby/object:Gem::Version
177
111
  version: 0.4.0
112
+ none: false
113
+ name: hashie
178
114
  type: :runtime
179
115
  prerelease: false
180
- version_requirements: !ruby/object:Gem::Requirement
181
- none: false
116
+ requirement: !ruby/object:Gem::Requirement
182
117
  requirements:
183
118
  - - ! '>='
184
119
  - !ruby/object:Gem::Version
185
120
  version: 0.4.0
186
- description: A Ruby wrapper for the Pocket REST and Search APIs
121
+ none: false
122
+ description: A Ruby wrapper for the Pocket API v3 (Add, Modify and Retrieve)
187
123
  email:
188
124
  - turadg@aleahmad.net
189
125
  executables: []
@@ -191,10 +127,11 @@ extensions: []
191
127
  extra_rdoc_files: []
192
128
  files:
193
129
  - .gitignore
194
- - .rspec
195
130
  - .yardopts
196
131
  - Gemfile
132
+ - Gemfile.lock
197
133
  - LICENSE.md
134
+ - README.md
198
135
  - Rakefile
199
136
  - demo-server.rb
200
137
  - lib/faraday/pocket_oauth.rb
@@ -218,21 +155,22 @@ rdoc_options: []
218
155
  require_paths:
219
156
  - lib
220
157
  required_ruby_version: !ruby/object:Gem::Requirement
221
- none: false
222
158
  requirements:
223
159
  - - ! '>='
224
160
  - !ruby/object:Gem::Version
225
161
  version: '0'
226
- required_rubygems_version: !ruby/object:Gem::Requirement
227
162
  none: false
163
+ required_rubygems_version: !ruby/object:Gem::Requirement
228
164
  requirements:
229
165
  - - ! '>='
230
166
  - !ruby/object:Gem::Version
231
167
  version: 1.3.6
168
+ none: false
232
169
  requirements: []
233
170
  rubyforge_project: pocket-ruby
234
- rubygems_version: 1.8.24
171
+ rubygems_version: 1.8.23
235
172
  signing_key:
236
173
  specification_version: 3
237
- summary: Ruby wrapper for the Pocket API
174
+ summary: Ruby wrapper for the Pocket API v3
238
175
  test_files: []
176
+ has_rdoc:
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --color
2
- --format=nested
3
- --backtrace