ruser 1.0.0 → 1.1.0

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: 43a09f150d33f23b3afc41a2d279ce186bc9e99e
4
- data.tar.gz: da507723153984d0981079707c2ae46fd49fb449
3
+ metadata.gz: 728c53c5c3f4d2d9ca7afe7c0082329522b3c08f
4
+ data.tar.gz: d6bc2c4f4e669d5dde199ca54857d512351e7c61
5
5
  SHA512:
6
- metadata.gz: eb8ae5407bc1a926feebcaab64968d92c7e8bbe618c34a1586afec84596ec3e418261da8f61970fa492afd1ba5b86f38215eda6022d8a92526e66663757563eb
7
- data.tar.gz: acacf827c86755890d62e4fc0005e6b455df1735121cdd88fbc79db4ee71fc9ca3d9682338b834c59380168eebf22cfd4baccea2e21209cf1bc4fcc413eab74d
6
+ metadata.gz: 5234a998f7753d9139bb6086ebdab3c2c9ca9d1dc824bc6531c68580e5e5bb00b834172cf48025c6ea7771ec6ebbc4cdb36c7256e9f3d19c597b3f6b4aed6df9
7
+ data.tar.gz: 006ac47a3115ed6c62f1677a4a0103253ff809227de8b9ce19e699e485ccc79a08b9fe621022d1a8045d8934928244f5824d23c3d1bcdda15c8eb74754aad2ac
data/README.md CHANGED
@@ -39,7 +39,7 @@ Then you can access any of the following user attributes:
39
39
  - street
40
40
  - city
41
41
  - state
42
- - zip
42
+ - zipcode
43
43
  - email
44
44
  - username
45
45
  - password
data/lib/ruser/api.rb CHANGED
@@ -6,6 +6,6 @@ module RUser
6
6
  Url = 'http://api.randomuser.me'
7
7
 
8
8
  # The version of the API that is used.
9
- Version = '0.3.2'
9
+ Version = '0.4'
10
10
  end
11
11
  end
data/lib/ruser/person.rb CHANGED
@@ -10,7 +10,9 @@ module RUser
10
10
  # @return [String] the user's gender, either male or female.
11
11
  attr_reader :gender
12
12
 
13
- # @return [Hash] the user's location including containing the :street, :city, :state, and :zip.
13
+ # As of version 1.1.0 the location hash now uses the key :zipcode instead of :zip, so that dot
14
+ # notation users don't end up using the Ruby Array zip method by calling user.location.zip.
15
+ # @return [Hash] the user's location including containing the :street, :city, :state, and :zipcode.
14
16
  attr_reader :location
15
17
 
16
18
  # @return [Hash] the user's name including :title (Mr, Mrs, etc.), :first_name, and :last_name.
@@ -83,7 +85,12 @@ module RUser
83
85
  ].join('/'))['results'][0])
84
86
 
85
87
  @gender = data.user.gender
86
- @location = data.user.location
88
+ @location = Hashie::Mash.new({
89
+ "street" => data.user.location.street,
90
+ "city" => data.user.location.city,
91
+ "state" => data.user.location.state,
92
+ "zipcode" => data.user.location['zip']
93
+ })
87
94
  @name = Hashie::Mash.new({
88
95
  "title" => data.user.name.title,
89
96
  "first_name" => data.user.name['first'],
data/lib/ruser/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RUser
2
- Version = '1.0.0'
2
+ Version = '1.1.0'
3
3
  end
@@ -0,0 +1,127 @@
1
+ require 'ruser'
2
+ require 'spec_helper'
3
+
4
+ # API Health Test
5
+ # Verifies that the API has not changed.
6
+ describe 'API' do
7
+
8
+ describe '.health' do
9
+ before do
10
+ @user = RUser::Person.new()
11
+ end
12
+
13
+ # Gender
14
+ it 'should have a gender string' do
15
+ expect(@user.gender).to be_instance_of(String)
16
+ end
17
+
18
+ # Location Hash
19
+ it 'should have a location hash' do
20
+ expect(@user.location).to be_instance_of(Hashie::Mash)
21
+ end
22
+
23
+ it 'should have a street address in the location hash' do
24
+ expect(@user.location.street).to be_instance_of(String)
25
+ end
26
+
27
+ it 'should have a city in the location hash' do
28
+ expect(@user.location.city).to be_instance_of(String)
29
+ end
30
+
31
+ it 'should have a state in the location hash' do
32
+ expect(@user.location.state).to be_instance_of(String)
33
+ end
34
+
35
+ it 'should have a zipcode in the location hash' do
36
+ expect(@user.location.zipcode).to be_instance_of(String)
37
+ end
38
+
39
+ # Name Hash
40
+ it 'should have a name hash' do
41
+ expect(@user.name).to be_instance_of(Hashie::Mash)
42
+ end
43
+
44
+ it 'should have a title in the name hash' do
45
+ expect(@user.name.title).to be_instance_of(String)
46
+ end
47
+
48
+ it 'should have a first name in the name hash' do
49
+ expect(@user.name.first_name).to be_instance_of(String)
50
+ end
51
+
52
+ it 'should have a last name in the name hash' do
53
+ expect(@user.name.last_name).to be_instance_of(String)
54
+ end
55
+
56
+ # Email Address
57
+ it 'should have a email address string' do
58
+ expect(@user.email).to be_instance_of(String)
59
+ end
60
+
61
+ # Username
62
+ it 'should have a username string' do
63
+ expect(@user.username).to be_instance_of(String)
64
+ end
65
+
66
+ # Password
67
+ it 'should have a password string' do
68
+ expect(@user.password).to be_instance_of(String)
69
+ end
70
+
71
+ # Salt
72
+ it 'should have a salt string' do
73
+ expect(@user.salt).to be_instance_of(String)
74
+ end
75
+
76
+ # MD5
77
+ it 'should have a md5 string' do
78
+ expect(@user.sha1).to be_instance_of(String)
79
+ end
80
+
81
+ # SHA1
82
+ it 'should have a sha1 string' do
83
+ expect(@user.sha1).to be_instance_of(String)
84
+ end
85
+
86
+ # SHA256
87
+ it 'should have a sha56 string' do
88
+ expect(@user.sha256).to be_instance_of(String)
89
+ end
90
+
91
+ # Registered
92
+ it 'should have a registered string' do
93
+ expect(@user.registered).to be_instance_of(String)
94
+ end
95
+
96
+ # DOB
97
+ it 'should have a date of birth string' do
98
+ expect(@user.dob).to be_instance_of(String)
99
+ end
100
+
101
+ # Phone
102
+ it 'should have a phone string' do
103
+ expect(@user.phone).to be_instance_of(String)
104
+ end
105
+
106
+ # Cell
107
+ it 'should have a cell phone string' do
108
+ expect(@user.cell).to be_instance_of(String)
109
+ end
110
+
111
+ # SSN
112
+ it 'should have a ssn string' do
113
+ expect(@user.ssn).to be_instance_of(String)
114
+ end
115
+
116
+ # Picture
117
+ it 'should have a picture string' do
118
+ expect(@user.picture).to be_instance_of(String)
119
+ end
120
+
121
+ # Seed
122
+ it 'should have a seed string' do
123
+ expect(@user.seed).to be_instance_of(String)
124
+ end
125
+ end
126
+
127
+ end
@@ -33,7 +33,7 @@ describe 'Person' do
33
33
  end
34
34
  end
35
35
 
36
- describe '.lookup' do
36
+ describe '.seed' do
37
37
  before do
38
38
  @user = RUser::Person.new(seed: 'lazyWolf')
39
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Kendall
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-01 00:00:00.000000000 Z
11
+ date: 2014-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -82,6 +82,7 @@ files:
82
82
  - lib/ruser/api.rb
83
83
  - lib/ruser/person.rb
84
84
  - lib/ruser/version.rb
85
+ - spec/functional/api_spec.rb
85
86
  - spec/functional/person_spec.rb
86
87
  - spec/spec_helper.rb
87
88
  homepage: http://github.com/simpleappgroup/ruser