movieDB 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 74b279fd8176148e500f57dec1d3624ab7b659f3
4
- data.tar.gz: 1af73f92f30564941cd59276135a8e1120835c3a
3
+ metadata.gz: 7522418d9aeaec5ff6eb52d3cfe694f617162546
4
+ data.tar.gz: f3ae4a57ba1804cb38521ccb96edb6cd7739e36d
5
5
  SHA512:
6
- metadata.gz: 1c47e7bde46058da742bbbe039de10819d7d8f4827f42182363edcbe51347947180905f731e28bbb7a78b1d192708df85f068ba2bc004c1ec650dafbffc3097a
7
- data.tar.gz: 65959df798bd181df872ad64c1f66bb5eb1934c83cbe4d8249f7cde8d1240cbbcfe59983d59fe969a6be3588f1dae546f71c66766a4fe267fdf37e109ffa7889
6
+ metadata.gz: 6dcca13a7c59c4b4c90b3fc9f13a217137d8186d994a1fb849e506ae14bd79a5f0acd880dd3120d9e59cb6dbe47335c0439e08256eea660e571e917d0b3f5daf
7
+ data.tar.gz: 6867b912311c3d337a500df2b97caf3fe296bf458a3b3fd13043d90e26ee43b8fcfc6f4a0c5033e3e79be3e9ed7cee424c20cf6e2658db9442d27b8e94f606e3
data/lib/movieDB.rb CHANGED
@@ -14,7 +14,7 @@ require "movieDB/version"
14
14
  # Example
15
15
  # movie = Movie.new()
16
16
  # movie.title = "When Sally Met Harry"
17
- unless defined? MovieDB
17
+ unless defined? MovieDB::Movie
18
18
  module MovieDB
19
19
  class Movie < MovieDB::Base
20
20
 
@@ -135,3 +135,4 @@ unless defined? MovieDB
135
135
  end
136
136
  end
137
137
  end
138
+
@@ -9,10 +9,10 @@ require 'time'
9
9
  # # actor_name = actor.map(&:name) #=> ["Brittany Murphy"]
10
10
  #
11
11
  # # Alive?
12
- # # actor_name = actor.map(&:alive?) #=> [false, true]
12
+ # # actor_name = actor.map(&:alive?) #=> [false, true]
13
13
  #
14
14
  # # Age
15
- # # actor_name = actor.map(&:age) #=> [32, 52]
15
+ # # actor_name = actor.map(&:age) #=> [32, 52]
16
16
  #
17
17
 
18
18
  module MovieDB
@@ -57,6 +57,17 @@ module MovieDB
57
57
  raise ArgumentError, "#{attr} can only be name or age" if !attr == :age && :name
58
58
  return @person_DS.select{|s| s.alive?}.map(&attr)
59
59
  end
60
+
61
+ ##
62
+ # Returns a random parameter integer between min to max,
63
+ # rather than a float between min to max.(Ruby 2.0.0)
64
+ #
65
+
66
+ def sample_attr(attr)
67
+ randgen = Object.new
68
+ attr_array = self.instance_eval{filter_person(attr)}
69
+ attr_array.sample(random: randgen)
70
+ end
60
71
  end
61
72
  private_class_method :create_with_info, :filter_person
62
73
  end
@@ -1,3 +1,3 @@
1
1
  module MovieDB
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/spec/movieDB_spec.rb CHANGED
@@ -55,10 +55,10 @@ describe MovieDB do
55
55
 
56
56
  context "#capture" do
57
57
  let!(:newCap){ MovieDB::Movie.new()}
58
-
58
+
59
59
  it "should accept new synopsis argument" do
60
60
  newCap.capture( synopsis: "Last Vegas - Four geriatric friends vow to set Las Vegas Ablaze.").should === {:synopsis=>"Last Vegas - Four geriatric friends vow to set Las Vegas Ablaze."}
61
-
61
+
62
62
  end
63
63
  end
64
64
  end
data/spec/person_spec.rb CHANGED
@@ -5,10 +5,18 @@ describe MovieDB::Person do
5
5
  context "#filter_person" do
6
6
  it "should return attributes" do
7
7
  MovieDB::Person.instance_eval{create_with_info("Brittany Murphy", "F", "1977-11-10", "2009-12-20")}
8
- MovieDB::Person.instance_eval{create_with_info("George Clooney", "M", "1961-05-06", nil)}
8
+ MovieDB::Person.instance_eval{create_with_info("George Clooney", "M", "1961-05-06", "")}
9
+
10
+ MovieDB::Person.instance_eval{filter_person('name')}.should == ['Brittany Murphy', 'George Clooney']
11
+ end
12
+ end
9
13
 
14
+ context "" do
15
+ it "should return a random integer bewreen min to max" do
16
+ age = MovieDB::Person.instance_eval{filter_person('age')}
17
+ moviePerson = MovieDB::Person.instance_eval{sample_attr('age')}
10
18
 
11
- MovieDB::Person.instance_eval{filter_person('name')}.should == ['Brittany Murphy', 'George Clooney']
19
+ moviePerson.should be_in(age)
12
20
  end
13
21
  end
14
22
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: movieDB
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Albert_McKeever
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-23 00:00:00.000000000 Z
11
+ date: 2013-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler