zencoder 2.1.11 → 2.1.12

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.
data/lib/zencoder.rb CHANGED
@@ -7,6 +7,7 @@ require 'timeout'
7
7
  require 'active_support' # JSON and XML parsing/encoding
8
8
 
9
9
  # Zencoder
10
+ require 'zencoder/extensions'
10
11
  require 'zencoder/zencoder'
11
12
  require 'zencoder/http/net_http'
12
13
  require 'zencoder/http/typhoeus'
@@ -0,0 +1,11 @@
1
+ class Hash
2
+ def recursive_with_indifferent_access
3
+ hash = with_indifferent_access
4
+ hash.each do |key, value|
5
+ if value.is_a?(Hash)
6
+ hash[key] = value.recursive_with_indifferent_access
7
+ end
8
+ end
9
+ return hash
10
+ end
11
+ end
data/lib/zencoder/http.rb CHANGED
@@ -10,7 +10,7 @@ class Zencoder
10
10
 
11
11
  self.default_options = {:timeout => 10000,
12
12
  :headers => {'Accept' => 'application/json',
13
- 'Content-Type' => 'application/json'}}
13
+ 'Content-Type' => 'application/json'}}.recursive_with_indifferent_access
14
14
 
15
15
  def initialize(method, url, options={})
16
16
  self.method = method
@@ -43,7 +43,7 @@ class Zencoder
43
43
  end
44
44
 
45
45
  def options=(value)
46
- @options = default_options.merge(value || {})
46
+ @options = default_options.recursive_with_indifferent_access.merge(value || {})
47
47
 
48
48
  options[:headers] ||= {}
49
49
  options[:headers]['Accept'] = "application/#{format}"
@@ -65,7 +65,7 @@ class Zencoder
65
65
  end
66
66
 
67
67
  def default_options
68
- self.class.default_options
68
+ self.class.default_options.recursive_with_indifferent_access
69
69
  end
70
70
 
71
71
 
@@ -1,3 +1,3 @@
1
1
  class Zencoder
2
- VERSION = '2.1.11'
2
+ VERSION = '2.1.12'
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 1
8
- - 11
9
- version: 2.1.11
8
+ - 12
9
+ version: 2.1.12
10
10
  platform: ruby
11
11
  authors:
12
12
  - Nathan Sutton
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-22 00:00:00 -05:00
17
+ date: 2010-07-23 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -76,6 +76,7 @@ extra_rdoc_files: []
76
76
  files:
77
77
  - lib/zencoder/account.rb
78
78
  - lib/zencoder/errors.rb
79
+ - lib/zencoder/extensions.rb
79
80
  - lib/zencoder/http/net_http.rb
80
81
  - lib/zencoder/http/typhoeus.rb
81
82
  - lib/zencoder/http.rb