uifaces 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +69 -0
- data/Rakefile +1 -0
- data/lib/uifaces.rb +132 -0
- data/lib/uifaces/version.rb +3 -0
- data/uifaces.gemspec +23 -0
- metadata +86 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Jake Moffatt
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
# UIFaces
|
2
|
+
|
3
|
+
A simple library to generate a url of photo of a face, for use in development,
|
4
|
+
design, and testing of your local projects.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
gem 'uifaces'
|
11
|
+
|
12
|
+
And then execute:
|
13
|
+
|
14
|
+
$ bundle
|
15
|
+
|
16
|
+
Or install it yourself as:
|
17
|
+
|
18
|
+
$ gem install uifaces
|
19
|
+
|
20
|
+
## Usage
|
21
|
+
|
22
|
+
#### Get a random face:
|
23
|
+
|
24
|
+
If you don't care which face is assigned to a particular user or place in your
|
25
|
+
page, use this:
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
UIFaces::face # => "http://uifaces.com/faces/_twitter/vehbikilic_120.jpg"
|
29
|
+
```
|
30
|
+
|
31
|
+
#### Get a specific face:
|
32
|
+
|
33
|
+
If you are assigning faces to users of your app for development/testing, you may
|
34
|
+
want to avoid having the same faces assigned randomly to different users.
|
35
|
+
|
36
|
+
If so, you can pass an integer index to retrieve the Nth face.
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
UIFaces::face(1) => "http://uifaces.com/faces/_twitter/VinThomas_120.jpg"
|
40
|
+
UIFaces::face(1) => "http://uifaces.com/faces/_twitter/VinThomas_120.jpg"
|
41
|
+
```
|
42
|
+
|
43
|
+
If you pass an index higher than the number of faces, it will recycle the faces
|
44
|
+
starting with the first face, so you can use this to map a face to profile id,
|
45
|
+
for instance:
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
User.each do |user|
|
49
|
+
user.photo = UIFaces::face(u.id)
|
50
|
+
end
|
51
|
+
```
|
52
|
+
|
53
|
+
## Ideas
|
54
|
+
|
55
|
+
* Build some system to locally cache the images
|
56
|
+
* Integrate with twitter to get faces of your followers/followings
|
57
|
+
|
58
|
+
## Contributing
|
59
|
+
|
60
|
+
1. Fork it
|
61
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
62
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
63
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
64
|
+
5. Create new Pull Request
|
65
|
+
|
66
|
+
|
67
|
+
## Credits
|
68
|
+
Big shoutout to @calebogden for building (uiFaces)[http://uifaces.com]
|
69
|
+
Library written by @jakeonrails
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/lib/uifaces.rb
ADDED
@@ -0,0 +1,132 @@
|
|
1
|
+
require "uifaces/version"
|
2
|
+
|
3
|
+
module UIFaces
|
4
|
+
def self.face(index = nil)
|
5
|
+
index ||= rand(0..UIFACES.size - 1)
|
6
|
+
index = index % UIFACES.size
|
7
|
+
"http://uifaces.com/faces/_twitter/#{UIFACES[index]}_120.jpg"
|
8
|
+
end
|
9
|
+
|
10
|
+
UIFACES = %w(
|
11
|
+
jayrobinson
|
12
|
+
VinThomas
|
13
|
+
ShaunMoynihan
|
14
|
+
jayman
|
15
|
+
damenleeturks
|
16
|
+
kolage
|
17
|
+
rogie
|
18
|
+
jacobseethaler
|
19
|
+
calebogden
|
20
|
+
blakesimkins
|
21
|
+
nckjrvs
|
22
|
+
cameronmoll
|
23
|
+
gilbertglee
|
24
|
+
alagoon
|
25
|
+
kirkouimet
|
26
|
+
zulsdesign
|
27
|
+
danielhaim
|
28
|
+
garrettgee
|
29
|
+
ripplemdk
|
30
|
+
timothycd
|
31
|
+
daryl
|
32
|
+
ogvidius
|
33
|
+
motherfuton
|
34
|
+
andrewpautler
|
35
|
+
WhatTheFerguson
|
36
|
+
pizzulata
|
37
|
+
dbox
|
38
|
+
deimler
|
39
|
+
antoniopratas
|
40
|
+
Djeje
|
41
|
+
molovo
|
42
|
+
owlfurty
|
43
|
+
OskarLevinson
|
44
|
+
redkeg
|
45
|
+
russellsmith21
|
46
|
+
benefritz
|
47
|
+
decarola
|
48
|
+
mkalalang
|
49
|
+
kristijantaken
|
50
|
+
iamlouisbullock
|
51
|
+
vctrfrnndz
|
52
|
+
daniel_love
|
53
|
+
jonsuh
|
54
|
+
leevigraham
|
55
|
+
utroda
|
56
|
+
JuliaYunLiu
|
57
|
+
gabediaz
|
58
|
+
Alvaro_Nistal
|
59
|
+
benpeck
|
60
|
+
Anotherdagou
|
61
|
+
ryanleroux
|
62
|
+
haibnu
|
63
|
+
todd_coleman
|
64
|
+
ThisIsJohnBrown
|
65
|
+
axelbouaziz
|
66
|
+
ryanAmurphy
|
67
|
+
AngelZxxWingZ
|
68
|
+
mikebeecham
|
69
|
+
tiagocamargo
|
70
|
+
jsngr
|
71
|
+
benhowdle
|
72
|
+
feliperibeiros
|
73
|
+
jpadilla_
|
74
|
+
_joshnh
|
75
|
+
MarkusOkur
|
76
|
+
imfine_thankyou
|
77
|
+
matejsudar
|
78
|
+
ckor
|
79
|
+
ariona_rian
|
80
|
+
roybarberuk
|
81
|
+
eldelentes
|
82
|
+
nimaa
|
83
|
+
sajtoo
|
84
|
+
bradenhamm
|
85
|
+
PtiteNoli
|
86
|
+
NastyaVZ
|
87
|
+
walterstephanie
|
88
|
+
mds
|
89
|
+
designer_dean
|
90
|
+
itolmach
|
91
|
+
JeffChausse
|
92
|
+
CrafterSama
|
93
|
+
vehbikilic
|
94
|
+
jcarlosweb
|
95
|
+
renbyrd
|
96
|
+
max9xs
|
97
|
+
Fitehal
|
98
|
+
iamlouisbullock
|
99
|
+
gerwitz
|
100
|
+
Fubaruba
|
101
|
+
hvillega
|
102
|
+
waqar_alamgir
|
103
|
+
desaiguddu
|
104
|
+
mambows
|
105
|
+
fabioChannel
|
106
|
+
ryanlfoster
|
107
|
+
macvhustle
|
108
|
+
Rafa3mil
|
109
|
+
toodlenoodle
|
110
|
+
jwphillips
|
111
|
+
alek_djuric
|
112
|
+
calvintennant
|
113
|
+
cibawoman
|
114
|
+
mcmieras
|
115
|
+
jjmpsp
|
116
|
+
rizwaniqbal
|
117
|
+
neweravin
|
118
|
+
temonehm
|
119
|
+
acoops_
|
120
|
+
smharley
|
121
|
+
odaymashalla
|
122
|
+
meddeg
|
123
|
+
FreelanceNathan
|
124
|
+
luhman
|
125
|
+
adn
|
126
|
+
wrightmartin
|
127
|
+
brampitoyo
|
128
|
+
iamjamie
|
129
|
+
dvidsilva
|
130
|
+
arjunchetna
|
131
|
+
)
|
132
|
+
end
|
data/uifaces.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'uifaces/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "uifaces"
|
8
|
+
spec.version = UIFaces::VERSION
|
9
|
+
spec.authors = ["Jake Moffatt"]
|
10
|
+
spec.email = ["jakeonrails@gmail.com"]
|
11
|
+
spec.description = %q{Get profile images from uifaces.com, by @calebogden}
|
12
|
+
spec.summary = %q{Get profile images from uifaces.com, by @calebogden}
|
13
|
+
spec.homepage = "http://github.com/jakeonrails/uifaces"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: uifaces
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jake Moffatt
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-04-15 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '1.3'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.3'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
description: Get profile images from uifaces.com, by @calebogden
|
47
|
+
email:
|
48
|
+
- jakeonrails@gmail.com
|
49
|
+
executables: []
|
50
|
+
extensions: []
|
51
|
+
extra_rdoc_files: []
|
52
|
+
files:
|
53
|
+
- .gitignore
|
54
|
+
- Gemfile
|
55
|
+
- LICENSE.txt
|
56
|
+
- README.md
|
57
|
+
- Rakefile
|
58
|
+
- lib/uifaces.rb
|
59
|
+
- lib/uifaces/version.rb
|
60
|
+
- uifaces.gemspec
|
61
|
+
homepage: http://github.com/jakeonrails/uifaces
|
62
|
+
licenses:
|
63
|
+
- MIT
|
64
|
+
post_install_message:
|
65
|
+
rdoc_options: []
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ! '>='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ! '>='
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
requirements: []
|
81
|
+
rubyforge_project:
|
82
|
+
rubygems_version: 1.8.25
|
83
|
+
signing_key:
|
84
|
+
specification_version: 3
|
85
|
+
summary: Get profile images from uifaces.com, by @calebogden
|
86
|
+
test_files: []
|