instapaper_full 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,7 +19,11 @@ Gem::Specification.new do |s|
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
21
 
22
- s.add_dependency("faraday", ">=0.5.5")
23
- s.add_dependency("simple_oauth", ">=0.1.4")
24
- s.add_dependency("yajl-ruby",">=0.8.1")
22
+ s.add_dependency("faraday", "~> 0.7.5")
23
+ s.add_dependency("faraday_middleware", "~> 0.7.0")
24
+ s.add_dependency("simple_oauth", "~> 0.1")
25
+ s.add_dependency("multi_json", "~> 1.0.4")
26
+ s.add_dependency("yajl-ruby", "~> 1.1.0")
27
+
28
+ s.add_development_dependency("rake")
25
29
  end
@@ -1,3 +1,3 @@
1
1
  module InstapaperFull
2
- VERSION = "0.0.4"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -1,4 +1,6 @@
1
- require 'faraday/oauth'
1
+ require 'json'
2
+ require 'faraday/request/oauth'
3
+ require 'faraday/response/parse_json'
2
4
 
3
5
  module InstapaperFull
4
6
  class API
@@ -17,16 +19,19 @@ module InstapaperFull
17
19
  :consumer_key => @options[:consumer_key],
18
20
  :consumer_secret => @options[:consumer_secret]
19
21
  }
22
+
20
23
  if authenticated?
21
24
  oauth_options[:token] = @options[:oauth_token]
22
25
  oauth_options[:token_secret] = @options[:oauth_token_secret]
23
26
  end
24
27
 
25
- Faraday::Connection.new(options) do |builder|
28
+ Faraday.new(options) do |builder|
26
29
  builder.use Faraday::Request::OAuth, oauth_options
30
+ builder.use Faraday::Request::UrlEncoded
31
+ builder.use Faraday::Response::Logger
27
32
  builder.adapter Faraday.default_adapter
28
33
  if authenticated?
29
- builder.response :yajl
34
+ builder.use Faraday::Response::ParseJson
30
35
  end
31
36
  end
32
37
  end
metadata CHANGED
@@ -1,123 +1,120 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: instapaper_full
3
- version: !ruby/object:Gem::Version
4
- hash: 23
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 4
10
- version: 0.0.4
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Matt Biddulph
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-03-03 00:00:00 +01:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2011-11-30 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: faraday
16
+ requirement: &70355479122060 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 0.7.5
22
+ type: :runtime
23
23
  prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
24
+ version_requirements: *70355479122060
25
+ - !ruby/object:Gem::Dependency
26
+ name: faraday_middleware
27
+ requirement: &70355479121500 !ruby/object:Gem::Requirement
25
28
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 1
30
- segments:
31
- - 0
32
- - 5
33
- - 5
34
- version: 0.5.5
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: 0.7.0
35
33
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
34
+ prerelease: false
35
+ version_requirements: *70355479121500
36
+ - !ruby/object:Gem::Dependency
38
37
  name: simple_oauth
38
+ requirement: &70355479121000 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ version: '0.1'
44
+ type: :runtime
39
45
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
46
+ version_requirements: *70355479121000
47
+ - !ruby/object:Gem::Dependency
48
+ name: multi_json
49
+ requirement: &70355479120540 !ruby/object:Gem::Requirement
41
50
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 19
46
- segments:
47
- - 0
48
- - 1
49
- - 4
50
- version: 0.1.4
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 1.0.4
51
55
  type: :runtime
52
- version_requirements: *id002
53
- - !ruby/object:Gem::Dependency
54
- name: yajl-ruby
55
56
  prerelease: false
56
- requirement: &id003 !ruby/object:Gem::Requirement
57
+ version_requirements: *70355479120540
58
+ - !ruby/object:Gem::Dependency
59
+ name: yajl-ruby
60
+ requirement: &70355479120080 !ruby/object:Gem::Requirement
57
61
  none: false
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- hash: 61
62
- segments:
63
- - 0
64
- - 8
65
- - 1
66
- version: 0.8.1
62
+ requirements:
63
+ - - ~>
64
+ - !ruby/object:Gem::Version
65
+ version: 1.1.0
67
66
  type: :runtime
68
- version_requirements: *id003
67
+ prerelease: false
68
+ version_requirements: *70355479120080
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: &70355479119700 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: *70355479119700
69
80
  description: See http://www.instapaper.com/api/full
70
- email:
81
+ email:
71
82
  - mb@hackdiary.com
72
83
  executables: []
73
-
74
84
  extensions: []
75
-
76
85
  extra_rdoc_files: []
77
-
78
- files:
86
+ files:
79
87
  - .gitignore
80
88
  - Gemfile
81
89
  - LICENSE
82
90
  - README.md
83
91
  - Rakefile
84
92
  - instapaper_full.gemspec
85
- - lib/faraday/oauth.rb
86
93
  - lib/instapaper_full.rb
87
94
  - lib/instapaper_full/version.rb
88
- has_rdoc: true
89
95
  homepage: https://github.com/mattb/instapaper_full
90
96
  licenses: []
91
-
92
97
  post_install_message:
93
98
  rdoc_options: []
94
-
95
- require_paths:
99
+ require_paths:
96
100
  - lib
97
- required_ruby_version: !ruby/object:Gem::Requirement
101
+ required_ruby_version: !ruby/object:Gem::Requirement
98
102
  none: false
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- hash: 3
103
- segments:
104
- - 0
105
- version: "0"
106
- required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ! '>='
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
107
108
  none: false
108
- requirements:
109
- - - ">="
110
- - !ruby/object:Gem::Version
111
- hash: 3
112
- segments:
113
- - 0
114
- version: "0"
109
+ requirements:
110
+ - - ! '>='
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
115
113
  requirements: []
116
-
117
114
  rubyforge_project: instapaper_full
118
- rubygems_version: 1.5.2
115
+ rubygems_version: 1.8.6
119
116
  signing_key:
120
117
  specification_version: 3
121
118
  summary: Wrapper for the Instapaper Full Developer API
122
119
  test_files: []
123
-
120
+ has_rdoc:
data/lib/faraday/oauth.rb DELETED
@@ -1,24 +0,0 @@
1
- # from https://github.com/jnunemaker/twitter/blob/master/lib/faraday/oauth.rb
2
-
3
- require 'faraday'
4
- require 'simple_oauth'
5
-
6
- # @private
7
- module Faraday
8
- # @private
9
- class Request::OAuth < Faraday::Middleware
10
- def call(env)
11
- params = env[:body].is_a?(Hash) ? env[:body] : {}
12
- signature_params = params.reject{|k,v| v.respond_to?(:content_type) }
13
- header = SimpleOAuth::Header.new(env[:method], env[:url], signature_params, @options)
14
-
15
- env[:request_headers]['Authorization'] = header.to_s
16
-
17
- @app.call(env)
18
- end
19
-
20
- def initialize(app, options)
21
- @app, @options = app, options
22
- end
23
- end
24
- end