instagram 1.1.5 → 1.1.6

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTgwYTQ4MzU4NDI1ZmI4ZTM0MGNmZDIxM2I3ZTI3YWMyMDAyNDFlYg==
4
+ Y2NkZDhhNWZjZjFmYzVkN2YwYWQ2NDg5M2I1YTU0YTgyZGE3NWM4OQ==
5
5
  data.tar.gz: !binary |-
6
- YTdiYWFiNTliYjdlNzAyMjdhMGE1YThmNjFjNmE1YjdkZjgyY2NhZA==
6
+ YzZlNzZiYzViZjU0ZDg0OGZlZTk1NWI3ZjVhZDBlMGQwZjFiZjJkMQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTFjM2ViODI3NGE4ZTk4ZTM3Y2FlOTM3Nzk4MjFlYzgwYjEyMTE2YWUyODIz
10
- MzY2ZmNhMTJlNzdhNWE3ZGY1NDkwMzIxNzJmYjI1ZWEzNWM2ZGIxZmI1ZTJi
11
- MjJhYzVlZGQ4ZDVjYjE0OTQ4ZmMzNWQyOWZiOTQ4M2EyOTQwZDg=
9
+ NjhjZGRhM2IyZDVkOTQwYWUzYTFjNzMwOGY0MDEyMDFmZWRlNmVmZjEzZjcx
10
+ YTRhMzUxNDY0YWExMDE0M2MzMjI5OTY3YjkzMmYyMDFlNzRjZTdkNjQ1NDcw
11
+ MTRhMjAyNTdjNDY0ODExMjEyYWE2ZjJjNmFlMzVmMDc2NzAzYWI=
12
12
  data.tar.gz: !binary |-
13
- MzhlODQzNzE2YjJjZTllMGRkNGIxNTg4NjAyMWFkOTZmYjgyY2U2ZWQzZjY2
14
- ZGNkMGQ1MmQwNmI1NjcxMDY5ODczNjE0YTA1MDJlZGRkYTlmNDZjZWIwODQz
15
- MTBmNjczNjBjOWE4MTBkMGM5ZGIxN2ZkNmYzNzc3YjcyMTJmZDE=
13
+ NDJiODkwN2JhZDQ3ZjQxNWRiZWIzOWVkODUyZWRmMjIyNGVlNTI4NTU5OTFl
14
+ ZmQ3YzQ4NjE2NTk1MWQ5OTdkNTM4OTViYWI2MGZlOWExM2JmNDdiNjg4YjEx
15
+ ZmQ0OGE5NDAwM2M3Nzg0M2NmZjNhNDdmYTI4YTU5YWM2ZWU1MWM=
@@ -1,5 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.2
4
- - 2.0.0
5
- - 1.9.3
3
+ - 2.2
4
+ - 2.1
5
+ - 2.0
6
+ - 1.9
@@ -63,7 +63,7 @@ module Instagram
63
63
  o[:callback_url] = callback_url unless callback_url.nil?
64
64
  o[:aspect] = aspect || o[:aspect] || "media"
65
65
  }
66
- response = post("subscriptions", options.merge(:client_secret => client_secret))
66
+ response = post("subscriptions", options.merge(:client_secret => client_secret), signature=true)
67
67
  response
68
68
  end
69
69
 
@@ -92,7 +92,7 @@ module Instagram
92
92
  options = args.last.is_a?(Hash) ? args.pop : {}
93
93
  subscription_id = args.first
94
94
  options.merge!(:id => subscription_id) if subscription_id
95
- response = delete("subscriptions", options.merge(:client_secret => client_secret))
95
+ response = delete("subscriptions", options.merge(:client_secret => client_secret), signature=true)
96
96
  response
97
97
  end
98
98
 
@@ -20,6 +20,7 @@ module Instagram
20
20
  :user_agent,
21
21
  :no_response_wrapper,
22
22
  :loud_logger,
23
+ :sign_requests,
23
24
  ].freeze
24
25
 
25
26
  # By default, don't set a user access token
@@ -76,6 +77,9 @@ module Instagram
76
77
  # By default, don't turn on loud logging
77
78
  DEFAULT_LOUD_LOGGER = nil
78
79
 
80
+ # By default, requests are not signed
81
+ DEFAULT_SIGN_REQUESTS = false
82
+
79
83
  # @private
80
84
  attr_accessor *VALID_OPTIONS_KEYS
81
85
 
@@ -112,6 +116,7 @@ module Instagram
112
116
  self.user_agent = DEFAULT_USER_AGENT
113
117
  self.no_response_wrapper= DEFAULT_NO_RESPONSE_WRAPPER
114
118
  self.loud_logger = DEFAULT_LOUD_LOGGER
119
+ self.sign_requests = DEFAULT_SIGN_REQUESTS
115
120
  end
116
121
  end
117
122
  end
@@ -5,29 +5,29 @@ module Instagram
5
5
  # Defines HTTP request methods
6
6
  module Request
7
7
  # Perform an HTTP GET request
8
- def get(path, options={}, signature=false, raw=false, unformatted=false, no_response_wrapper=no_response_wrapper(), signed=false)
8
+ def get(path, options={}, signature=false, raw=false, unformatted=false, no_response_wrapper=no_response_wrapper(), signed=sign_requests)
9
9
  request(:get, path, options, signature, raw, unformatted, no_response_wrapper, signed)
10
10
  end
11
11
 
12
12
  # Perform an HTTP POST request
13
- def post(path, options={}, signature=false, raw=false, unformatted=false, no_response_wrapper=no_response_wrapper(), signed=false)
13
+ def post(path, options={}, signature=false, raw=false, unformatted=false, no_response_wrapper=no_response_wrapper(), signed=sign_requests)
14
14
  request(:post, path, options, signature, raw, unformatted, no_response_wrapper, signed)
15
15
  end
16
16
 
17
17
  # Perform an HTTP PUT request
18
- def put(path, options={}, signature=false, raw=false, unformatted=false, no_response_wrapper=no_response_wrapper(), signed=false)
18
+ def put(path, options={}, signature=false, raw=false, unformatted=false, no_response_wrapper=no_response_wrapper(), signed=sign_requests)
19
19
  request(:put, path, options, signature, raw, unformatted, no_response_wrapper, signed)
20
20
  end
21
21
 
22
22
  # Perform an HTTP DELETE request
23
- def delete(path, options={}, signature=false, raw=false, unformatted=false, no_response_wrapper=no_response_wrapper(), signed=false)
23
+ def delete(path, options={}, signature=false, raw=false, unformatted=false, no_response_wrapper=no_response_wrapper(), signed=sign_requests)
24
24
  request(:delete, path, options, signature, raw, unformatted, no_response_wrapper, signed)
25
25
  end
26
26
 
27
27
  private
28
28
 
29
29
  # Perform an HTTP request
30
- def request(method, path, options, signature=false, raw=false, unformatted=false, no_response_wrapper=false, signed=false)
30
+ def request(method, path, options, signature=false, raw=false, unformatted=false, no_response_wrapper=false, signed=sign_requests)
31
31
  response = connection(raw).send(method) do |request|
32
32
  path = formatted_path(path) unless unformatted
33
33
 
@@ -44,9 +44,9 @@ module Instagram
44
44
 
45
45
  case method
46
46
  when :get, :delete
47
- request.url(path, options)
47
+ request.url(URI.encode(path), options)
48
48
  when :post, :put
49
- request.path = path
49
+ request.path = URI.encode(path)
50
50
  request.body = options unless options.empty?
51
51
  end
52
52
  if signature && client_ips != nil
@@ -9,7 +9,7 @@ module Instagram
9
9
  instance_variable_set("@#{k}", v) if v
10
10
  end
11
11
  end
12
- ratelimit = ::Hashie::Mash.new(ratelimit_hash)
12
+ @ratelimit = ::Hashie::Mash.new(ratelimit_hash)
13
13
  end
14
14
  data
15
15
  end
@@ -1,3 +1,3 @@
1
1
  module Instagram
2
- VERSION = '1.1.5'.freeze unless defined?(::Instagram::VERSION)
2
+ VERSION = '1.1.6'.freeze unless defined?(::Instagram::VERSION)
3
3
  end
@@ -44,6 +44,7 @@ describe Instagram::API do
44
44
  :user_agent => 'Custom User Agent',
45
45
  :no_response_wrapper => true,
46
46
  :loud_logger => true,
47
+ :sign_requests => false,
47
48
  }
48
49
  end
49
50
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instagram
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shayne Sweeney
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-15 00:00:00.000000000 Z
11
+ date: 2015-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake