rotten-party 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -25,15 +25,15 @@ module RottenParty
25
25
 
26
26
  # Find a specific film by it's identifier
27
27
  def find_film_by_id(id, options={})
28
- options.merge!(@global_options)
28
+ options = options.recurse_merge(@global_options)
29
29
  response = self.class.get("/movies/#{id}.json", options).parsed_response
30
30
  Hashie::Mash.new(response)
31
31
  end
32
32
 
33
33
  # Find a film by it's title
34
34
  def find_film_by_title(title, options={})
35
- options.merge!(@global_options)
36
- options.merge!({:query => {:q => u(title)}})
35
+ options = options.recurse_merge(@global_options)
36
+ options = options.recurse_merge({:query => {:q => u(title)}})
37
37
  response = self.class.get("/movies.json", options).parsed_response
38
38
  Hashie::Mash.new(response["movies"].first)
39
39
  end
@@ -48,9 +48,15 @@ module RottenParty
48
48
  # => 'dvds'
49
49
  # => 'movies'
50
50
  def find_movies_in_list(list, directory, options={})
51
- options.merge!(@global_options)
51
+ options = options.recurse_merge(@global_options)
52
52
  response = self.class.get("/lists/#{directory}/#{list}.json", options).parsed_response
53
53
  response["movies"].collect{ |movie| Hashie::Mash.new(movie) }
54
54
  end
55
55
  end
56
+
57
+ def recurse_merge(a,b)
58
+ a.merge(b) do |_,x,y|
59
+ (x.is_a?(Hash) && y.is_a?(Hash)) ? recurse_merge(x,y) : [*x,*y]
60
+ end
61
+ end
56
62
  end
data/rotten-party.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rotten-party}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nick Pellant"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rotten-party
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.1
5
+ version: 0.1.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Nick Pellant
@@ -116,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - ">="
118
118
  - !ruby/object:Gem::Version
119
- hash: 1354565757689011251
119
+ hash: -1643533933040285390
120
120
  segments:
121
121
  - 0
122
122
  version: "0"