Skip to content

Commit

Permalink
Merge pull request #317 from samoli/improve-company-logos
Browse files Browse the repository at this point in the history
Use more realistic logos
  • Loading branch information
stympy committed Feb 4, 2015
2 parents aba6c16 + e3516ee commit 3ad557c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -134,8 +134,8 @@ Faker::Company.ein #=> "34-8488813"

Faker::Company.duns_number #=> "08-341-3736"

# Get a random company logo url in GIF format.
Faker::Company.logo #=> "http://www.biz-logo.com/examples/007.gif"
# Get a random company logo url in PNG format.
Faker::Company.logo #=> "http://pigment.github.com/fake-logos/logos/medium/color/5.png"

```

Expand Down
6 changes: 3 additions & 3 deletions lib/faker/company.rb
Expand Up @@ -29,10 +29,10 @@ def duns_number
('%09d' % rand(10 ** 9)).gsub(/(\d\d)(\d\d\d)(\d\d\d\d)/, '\\1-\\2-\\3')
end

# Get a random company logo url in GIF format.
# Get a random company logo url in PNG format.
def logo
rand_num = Random.rand(76) + 1
"http://www.biz-logo.com/examples/#{ rand_num < 10 ? "00" : "0" }#{rand_num}.gif"
rand_num = Random.rand(13) + 1
"http://pigment.github.io/fake-logos/logos/medium/color/#{rand_num}.png"
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/test_faker_company.rb
Expand Up @@ -14,6 +14,6 @@ def test_duns_number
end

def test_logo
assert @tester.logo.match(%r{http://www.biz-logo.com/examples/\d+\.gif})
assert @tester.logo.match(%r{http://pigment.github.io/fake-logos/logos/medium/color/\d+\.png})
end
end

0 comments on commit 3ad557c

Please sign in to comment.