mocker 0.0.1.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.rspec +2 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +7 -0
- data/LICENSE.txt +22 -0
- data/README.md +31 -0
- data/Rakefile +2 -0
- data/lib/locales/en.yml +38 -0
- data/lib/mocker.rb +12 -0
- data/lib/mocker/place.rb +24 -0
- data/lib/mocker/version.rb +3 -0
- data/mocker.gemspec +27 -0
- data/spec/mocker_spec.rb +48 -0
- data/spec/spec_helper.rb +1 -0
- metadata +132 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 99851d75425b9b85f87f359230e7b8dc259a4d69
|
4
|
+
data.tar.gz: 8ed12cb5aef5c4f6a9e877184ce1b5c05a1167a2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 507c27c9c346516fe78fe0e7f6ea42ec3257a2a00229c82e862c846af49d50c87b700a6020560266effac92ff4c0f5b4a72bcebe33b0e6e88897a9b95c067c1f
|
7
|
+
data.tar.gz: 292bb4d9d80cd9ef2ae8cc2205aea4ead983518410d16908535f19bb2f0163b6fa348e5f896e6c909fb8401ebe33dff0dfeee8e2f05d184c1074879977209b01
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
mocker-gem
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.1.5
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Rui Baltazar
|
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,31 @@
|
|
1
|
+
# Mocker
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'mocker'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install mocker
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
TODO: Write usage instructions here
|
24
|
+
|
25
|
+
## Contributing
|
26
|
+
|
27
|
+
1. Fork it ( https://github.com/[my-github-username]/mocker/fork )
|
28
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
31
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/lib/locales/en.yml
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
en:
|
2
|
+
places:
|
3
|
+
us: [Accident, Beaverlick, Big Beaver, Bird-in-Hand, Blue Bell, Boring, California, Caleb Pusey House, Chicken, Chinatown, Circle, Climax, Cut off, Deadhorse, Dead Women Crossing, Dickshooter, Dicktown, New Jersey, DISH, Dull, Eek, Embarrass, Faggot Hill, Fishkill, Flushing, Gay, George, Grand Teton National Park, Great Kills, Half.com, Hackensack, Hell, Hell Gate, Hell's Kitchen, House, Ho-Ho-Kus, Hooker, Hop Bottom, Humptulips, Intercourse, Jim Thorpe, Kanakanak, Kilmore, King of Prussia, Knob Lick, Lick Fork, Lizard Lick, Mars, Mexican Hat, Mianus, Moon, Mount Despair, Mount Terror, Nameless, Normal, North Pole, Nothing, No Name, Onancock, Paint Lick, Pardeeville, Piscataway, Popcorn, Satan's Kingdom, Shades Of Death Road, Shag Rocks, Slaughter, Slippery Rock, Spuyten Duyvil, Surprise, Toad Suck, Triangle, Truth or Consequences, Tuba City, Unalaska, Unalakleet, Blue Ball, Virginville, Virgin Islands, Virginia, Walla Walla, Wankers Corner, Waterloo, Wawa, Why, What Cheer, Whiskeytown, Yreka, Zigzag, Zzyzx]
|
4
|
+
en: [Bell End, Bitchfield, Boring, Brown Willy, Bulls, Butt Hole Road, Butthole Lane, Catbrain, Christmas Pie, Clitheroe, Cockburnspath, Cocking, Cocks, Gropecunt Lane, Hole of Horcum, Kilmore, Lost, Lower Dicker, Muck, Mudchute, Nasty, Nether Wallop, Nob End, Nork, North Piddle, No Place, Odd Down, Once Brewed, Twice Brewed, Penistone, Pill, Pity Me, Pratt's Bottom, Rape, Ruyton-XI-Towns, Sandy Balls, Scratchy Bottom, Shingay cum Wendy, Shortlands, Six Mile Bottom, Upper Slaughter, Lower Slaughter, Three Cocks, Torpenhow Hill, Twatt, Uck, Ugley, Upper Dicker, Upperthong, Netherthong, Wallyford, Waterloo, Westward Ho!, Wetwang, Wide Open]
|
5
|
+
ie: [Bastardstown, Blue Ball, Cock Hill, Devil's Bit, Devilsmother, Dolphin's Barn, Downhill, Emo, Eye, Feltwell, Fingringhoe, Hospital, Ireland's Eye, Kill, Kilkenny, Killmacow, Kilmore, Muff, Nobber, Tubbercurry]
|
6
|
+
ca: [Berry Head, Big Beaver, Blow Me Down, Come By Chance, Climax, Dildo, Hare Bay, Happy Adventure, Joe Batt's Arm, Kilbride, Medicine Hat, Moose Factory, Moose Jaw, Punkeydoodles Corners, Red Deer, Saint-Louis-du-Ha! Ha!, Slave Lake, Swastika, Vulcan, Waterloo, Wonowon]
|
7
|
+
aq: [Apocalypse Peaks, Dick Peaks, Executive Committee Range, Football Mountain, Inexpressible Island, Knobhead, Mistake Peak, Mount Cocks, Mount Slaughter, Mount Terror, Mount Toogood, Nipple Peak, Queer Mountain, Shagnasty Island, Sofia University Mountains, Supporting Party Mountain, The Office Girls, Waterloo]
|
8
|
+
au: [Bowna, Humpty Doo, Innaloo, Kilmore, Lake Disappointment, Mooball, Mooloolah, Mount Despair, Nowhere Else, Useless Loop, Wagga Wagga, Waterloo, Wee Waa, Woolloomooloo]
|
9
|
+
mg: [Gogogogo]
|
10
|
+
at: [Fucking, Rottenegg]
|
11
|
+
az: [Ganja]
|
12
|
+
pf: [Disappointment Islands]
|
13
|
+
gs: [Coffin Top]
|
14
|
+
ro: [Cărpeniş River]
|
15
|
+
sp: [Castrillo Matajudíos]
|
16
|
+
fi: [Ala-Lemu, Hevonkak, Lemu, Paskalomatunturi]
|
17
|
+
no: [Å, Hell, Slemmestad]
|
18
|
+
se: [Båstad]
|
19
|
+
tr: [Batman]
|
20
|
+
il: [Bat Yam, Kfar Pines, Ofakim]
|
21
|
+
fr: [Bitche, Condom, Pussy]
|
22
|
+
lr: [Bong County]
|
23
|
+
pa: [Boquete]
|
24
|
+
tc: [Cockburn Town]
|
25
|
+
nz: [Gore, Moneymore, Mount Dick, Taylors Mistake, Te Urewera, Waterloo, Whakatane & Whakapapa]
|
26
|
+
gh: [Ho]
|
27
|
+
nl: [Hongerige Wolf, Rectum, Sexbierum]
|
28
|
+
ru: [Miass]
|
29
|
+
dk: [Middelfart]
|
30
|
+
bz: [More Tomorrow]
|
31
|
+
lv: [Ogre]
|
32
|
+
de: [Petting, Wank, Wankum, Wedding, Worms]
|
33
|
+
pl: [Police]
|
34
|
+
br: [Presidente Prudente]
|
35
|
+
bf: [Silly Department]
|
36
|
+
rs: [Varvarin]
|
37
|
+
be: [Waterloo]
|
38
|
+
sl: [Waterloo]
|
data/lib/mocker.rb
ADDED
data/lib/mocker/place.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
module Mocker
|
2
|
+
class Place
|
3
|
+
class CountryNotFoundError < StandardError
|
4
|
+
end
|
5
|
+
|
6
|
+
class << self
|
7
|
+
def name
|
8
|
+
all_places = I18n.t("places")
|
9
|
+
all_places.values.flatten.sample
|
10
|
+
end
|
11
|
+
|
12
|
+
def name_in country_code=nil
|
13
|
+
return self.name if country_code.nil?
|
14
|
+
|
15
|
+
country_places = I18n.t("places.#{country_code}")
|
16
|
+
if country_places.is_a?(Array) && country_places.length > 0
|
17
|
+
country_places.sample
|
18
|
+
else
|
19
|
+
raise Mocker::Place::CountryNotFoundError
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/mocker.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'mocker/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "mocker"
|
8
|
+
spec.version = Mocker::VERSION
|
9
|
+
spec.authors = ["Rui Baltazar"]
|
10
|
+
spec.email = ["rui.p.baltazar@gmail.com"]
|
11
|
+
spec.summary = %q{Simple content generator based on real info}
|
12
|
+
spec.description = %q{Get a random existing place name, based on a list of weird name places around the world}
|
13
|
+
spec.homepage = "https://github.com/rpbaltazar/mocker"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
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_dependency "i18n", "~> 0.7"
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
24
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
+
spec.add_development_dependency "rspec", "~> 3.2"
|
26
|
+
spec.add_development_dependency "fuubar", "~> 2.0"
|
27
|
+
end
|
data/spec/mocker_spec.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "byebug"
|
3
|
+
|
4
|
+
describe Mocker do
|
5
|
+
let(:available_names){
|
6
|
+
I18n.t 'intialize'
|
7
|
+
translations = I18n.backend.send(:translations)
|
8
|
+
all_countries_places = translations[:en][:places]
|
9
|
+
all_countries_places.values.flatten
|
10
|
+
}
|
11
|
+
|
12
|
+
let(:available_names_in_us){
|
13
|
+
I18n.t 'intialize'
|
14
|
+
translations = I18n.backend.send(:translations)
|
15
|
+
translations[:en][:places][:us]
|
16
|
+
}
|
17
|
+
|
18
|
+
describe "Mocker::Place.name" do
|
19
|
+
it "returns a name of an existing location, from the list" do
|
20
|
+
random_place = Mocker::Place.name
|
21
|
+
expect(available_names).to include random_place
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe "Mocker::Place.name_in" do
|
26
|
+
describe "when country argument is valid" do
|
27
|
+
describe "when Mocker has a place in that country" do
|
28
|
+
it "returns a name of a place in the argument country" do
|
29
|
+
random_us_place = Mocker::Place.name_in "us"
|
30
|
+
expect(available_names_in_us).to include random_us_place
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe "when Mocker does not have a place in that country" do
|
35
|
+
it "throws an inexisting places for country error" do
|
36
|
+
expect {Mocker::Place.name_in "pt"}.to raise_error Mocker::Place::CountryNotFoundError
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe "when country argument is empty" do
|
42
|
+
it "defaults to Mocker::Place.name" do
|
43
|
+
random_conchichine_place = Mocker::Place.name_in
|
44
|
+
expect(available_names).to include random_conchichine_place
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "mocker"
|
metadata
ADDED
@@ -0,0 +1,132 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mocker
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1.pre
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Rui Baltazar
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-03-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: i18n
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.7'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.7'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.7'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.2'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.2'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: fuubar
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2.0'
|
83
|
+
description: Get a random existing place name, based on a list of weird name places
|
84
|
+
around the world
|
85
|
+
email:
|
86
|
+
- rui.p.baltazar@gmail.com
|
87
|
+
executables: []
|
88
|
+
extensions: []
|
89
|
+
extra_rdoc_files: []
|
90
|
+
files:
|
91
|
+
- ".gitignore"
|
92
|
+
- ".rspec"
|
93
|
+
- ".ruby-gemset"
|
94
|
+
- ".ruby-version"
|
95
|
+
- Gemfile
|
96
|
+
- LICENSE.txt
|
97
|
+
- README.md
|
98
|
+
- Rakefile
|
99
|
+
- lib/locales/en.yml
|
100
|
+
- lib/mocker.rb
|
101
|
+
- lib/mocker/place.rb
|
102
|
+
- lib/mocker/version.rb
|
103
|
+
- mocker.gemspec
|
104
|
+
- spec/mocker_spec.rb
|
105
|
+
- spec/spec_helper.rb
|
106
|
+
homepage: https://github.com/rpbaltazar/mocker
|
107
|
+
licenses:
|
108
|
+
- MIT
|
109
|
+
metadata: {}
|
110
|
+
post_install_message:
|
111
|
+
rdoc_options: []
|
112
|
+
require_paths:
|
113
|
+
- lib
|
114
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: 1.3.1
|
124
|
+
requirements: []
|
125
|
+
rubyforge_project:
|
126
|
+
rubygems_version: 2.4.5
|
127
|
+
signing_key:
|
128
|
+
specification_version: 4
|
129
|
+
summary: Simple content generator based on real info
|
130
|
+
test_files:
|
131
|
+
- spec/mocker_spec.rb
|
132
|
+
- spec/spec_helper.rb
|