trivia_factory 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 061fd3b7cdd3fb4ffd630cd1bd08d5cff5b8b654
4
+ data.tar.gz: 11585669b30b6bef798bc1d34d368935427b9117
5
+ SHA512:
6
+ metadata.gz: 38cb4a15e72f227dfc6315da238e3cce9c2c14e92d32f9ad0ec670795a3fc9bb6f9f26fdf40d26edd5608cc72e29714611c722ba7a0a544d78f304508b178cd3
7
+ data.tar.gz: 69be04c20a13dd803d43d2faf637ff04278d361f8864a743d715d76c896d2b8e34a205960b7d3064238c4815c98a73e439f046e18f400bd441b6e90041b9d559
data/.gitignore ADDED
@@ -0,0 +1,52 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ .DS_store
14
+
15
+ # Used by dotenv library to load environment variables.
16
+ # .env
17
+
18
+ ## Specific to RubyMotion:
19
+ .dat*
20
+ .repl_history
21
+ build/
22
+ *.bridgesupport
23
+ build-iPhoneOS/
24
+ build-iPhoneSimulator/
25
+
26
+ ## Specific to RubyMotion (use of CocoaPods):
27
+ #
28
+ # We recommend against adding the Pods directory to your .gitignore. However
29
+ # you should judge for yourself, the pros and cons are mentioned at:
30
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
31
+ #
32
+ # vendor/Pods/
33
+
34
+ ## Documentation cache and generated files:
35
+ /.yardoc/
36
+ /_yardoc/
37
+ /doc/
38
+ /rdoc/
39
+
40
+ ## Environment normalization:
41
+ /.bundle/
42
+ /vendor/bundle
43
+ /lib/bundler/man/
44
+
45
+ # for a library or gem, you might want to ignore these files since the code is
46
+ # intended to run in multiple environments; otherwise, check them in:
47
+ # Gemfile.lock
48
+ # .ruby-version
49
+ # .ruby-gemset
50
+
51
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
52
+ .rvmrc
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.4
5
+ before_install: gem install bundler -v 1.15.4
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at erik.dungan@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in trivia_factory.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,22 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ trivia_factory (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ minitest (5.10.3)
10
+ rake (10.5.0)
11
+
12
+ PLATFORMS
13
+ ruby
14
+
15
+ DEPENDENCIES
16
+ bundler (~> 1.15)
17
+ minitest (~> 5.0)
18
+ rake (~> 10.0)
19
+ trivia_factory!
20
+
21
+ BUNDLED WITH
22
+ 1.15.4
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 Erik Dungan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Callmeed
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # Trivia Factory
2
+
3
+ Ruby gem for creating sample trivia/test questions. Intended for use in specs (like Faker) or apps that need questions.
4
+
5
+ ## Installation
6
+
7
+ *Coming soon (gem not published yet)*
8
+
9
+ ## Usage
10
+
11
+ Sample question (not random yet):
12
+
13
+ ```
14
+
15
+ > question = TriviaFactory::Question.generate
16
+ >
17
+ > question.to_h
18
+ > {
19
+ > label: "Who won the MLB World Series in 2016?",
20
+ > question_type: :multiple_choice,
21
+ > choices: ["San Francisco Giants", "Chicago Cubs", "Cleveland Indians", "Golden State Warriors"],
22
+ > answer_type: :choice_index,
23
+ > answer: 1
24
+ > }
25
+
26
+ ```
27
+
28
+ Basic math question (addition of random integers):
29
+
30
+ ```
31
+
32
+ > question = TriviaFactory::Question.math(10)
33
+ >
34
+ > question.to_h
35
+ > {
36
+ > label: "5 + 3 = _____?",
37
+ > question_type: :fill_in_the_blank,
38
+ > choices: [],
39
+ > answer_type: :integer,
40
+ > answer: 8
41
+ > }
42
+
43
+ ```
data/Rakefile ADDED
@@ -0,0 +1,14 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
9
+
10
+ task :console do
11
+ exec "irb -r trivia_factory -I ./lib"
12
+ end
13
+
14
+ task :default => :test
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "trivia_factory"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,234 @@
1
+ Abu Dhabi,United Arab Emirates
2
+ Abuja,Nigeria
3
+ Accra,Ghana
4
+ Adamstown,Pitcairn
5
+ Addis Ababa,Ethiopia
6
+ Algiers,Algeria
7
+ Alofi,Niue
8
+ Amman,Jordan
9
+ Amsterdam,Netherlands
10
+ Andorra la Vella,Andorra
11
+ Ankara,Turkey
12
+ Antananarivo,Madagascar
13
+ Apia,Samoa
14
+ Ashgabat,Turkmenistan
15
+ Asmara,Eritrea
16
+ Astana,Kazakhstan
17
+ Asunción,Paraguay
18
+ Athens,Greece
19
+ Avarua,Cook Islands
20
+ Baghdad,Iraq
21
+ Baku,Azerbaijan
22
+ Bamako,Mali
23
+ Bandar Seri Begawan,Brunei
24
+ Bangkok,Thailand
25
+ Bangui,Central African Republic
26
+ Banjul,Gambia
27
+ Basse-Terre,Guadeloupe
28
+ Basseterre,Saint Kitts and Nevis
29
+ Beijing,China
30
+ Beirut,Lebanon
31
+ Belgrade,Serbia
32
+ Belmopan,Belize
33
+ Berlin,Germany
34
+ Bern,Switzerland
35
+ Bishkek,Kyrgyzstan
36
+ Bissau,Guinea-Bissau
37
+ Bogotá,Colombia
38
+ Brasília,Brazil
39
+ Bratislava,Slovakia
40
+ Brazzaville,Republic of the Congo
41
+ Bridgetown,Barbados
42
+ Brussels,Belgium
43
+ Bucharest,Romania
44
+ Budapest,Hungary
45
+ Buenos Aires,Argentina
46
+ Bujumbura,Burundi
47
+ Cairo,Egypt
48
+ Canberra,Australia
49
+ Caracas,Venezuela
50
+ Castries,Saint Lucia
51
+ Cayenne,French Guiana
52
+ Charlotte Amalie,United States Virgin Islands
53
+ Chișinău,Moldova
54
+ Cockburn Town,Turks and Caicos Islands
55
+ Conakry,Guinea
56
+ Copenhagen,Denmark
57
+ Dakar,Senegal
58
+ Damascus,Syria
59
+ Dhaka,Bangladesh
60
+ Dili,East Timor
61
+ Djibouti,Djibouti
62
+ Doha,Qatar
63
+ Douglas,Isle of Man
64
+ Dublin,Ireland
65
+ Dushanbe,Tajikistan
66
+ Edinburgh of the Seven Seas,Tristan da Cunha
67
+ Tifariti,Sahrawi Arab Democratic Republic
68
+ Episkopi Cantonment,Akrotiri and Dhekelia
69
+ Flying Fish Cove,Christmas Island
70
+ Fort-de-France,Martinique
71
+ Freetown,Sierra Leone
72
+ Funafuti,Tuvalu
73
+ Gaborone,Botswana
74
+ George Town,Cayman Islands
75
+ Georgetown,Ascension Island
76
+ Georgetown,Guyana
77
+ Gibraltar,Gibraltar
78
+ Grozny,Chechnya
79
+ Guatemala City,Guatemala
80
+ Gustavia,Saint Barthélemy
81
+ Hagåtña,Guam
82
+ Hamilton,Bermuda
83
+ Hanga Roa,Easter Island
84
+ Hanoi,Vietnam
85
+ Harare,Zimbabwe
86
+ Hargeisa,Somaliland
87
+ Havana,Cuba
88
+ Helsinki,Finland
89
+ Hong Kong,Hong Kong
90
+ Honiara,Solomon Islands
91
+ Islamabad,Pakistan
92
+ Jakarta,Indonesia
93
+ Jamestown,Saint Helena
94
+ Jerusalem,Israel
95
+ Juba,South Sudan
96
+ Kabul,Afghanistan
97
+ Kampala,Uganda
98
+ Kathmandu,Nepal
99
+ Khartoum,Sudan
100
+ Kiev,Ukraine
101
+ Kigali,Rwanda
102
+ King Edward Point,South Georgia and the South Sandwich Islands
103
+ Kingston,Jamaica
104
+ Kingston,Norfolk Island
105
+ Kingstown,Saint Vincent and the Grenadines
106
+ Kinshasa,Democratic Republic of the Congo
107
+ Kuwait City,Kuwait
108
+ Libreville,Gabon
109
+ Lilongwe,Malawi
110
+ Lima,Peru
111
+ Lisbon,Portugal
112
+ Ljubljana,Slovenia
113
+ Lomé,Togo
114
+ London,United Kingdom
115
+ Luanda,Angola
116
+ Lusaka,Zambia
117
+ Luxembourg,Luxembourg
118
+ Madrid,Spain
119
+ Majuro,Marshall Islands
120
+ Malabo,Equatorial Guinea
121
+ Malé,Maldives
122
+ Mamoudzou,Mayotte
123
+ Managua,Nicaragua
124
+ Manama,Bahrain
125
+ Manila,Philippines
126
+ Maputo,Mozambique
127
+ Marigot,Saint Martin
128
+ Maseru,Lesotho
129
+ Mata-Utu,Wallis and Futuna
130
+ Mexico City,Mexico
131
+ Minsk,Belarus
132
+ Mogadishu,Somalia
133
+ Monaco,Monaco
134
+ Monrovia,Liberia
135
+ Montevideo,Uruguay
136
+ Moroni,Comoros
137
+ Moscow,Russia
138
+ Muscat,Oman
139
+ Nairobi,Kenya
140
+ Nassau,Bahamas
141
+ Naypyidaw,Myanmar
142
+ N'Djamena,Chad
143
+ New Delhi,India
144
+ Ngerulmud,Palau
145
+ Niamey,Niger
146
+ Nicosia,Cyprus
147
+ Nicosia,Northern Cyprus
148
+ Nouakchott,Mauritania
149
+ Nouméa,New Caledonia
150
+ Nukuʻalofa,Tonga
151
+ Nuuk,Greenland
152
+ Oranjestad,Aruba
153
+ Oslo,Norway
154
+ Ottawa,Canada
155
+ Ouagadougou,Burkina Faso
156
+ Pago Pago,American Samoa
157
+ Palikir,Federated States of Micronesia
158
+ Panama City,Panama
159
+ Papeete,French Polynesia
160
+ Paramaribo,Suriname
161
+ Paris,France
162
+ Philipsburg,Sint Maarten
163
+ Phnom Penh,Cambodia
164
+ Port Louis,Mauritius
165
+ Port Moresby,Papua New Guinea
166
+ Port Vila,Vanuatu
167
+ Port-au-Prince,Haiti
168
+ Port of Spain,Trinidad and Tobago
169
+ Prague,Czech Republic
170
+ Praia,Cape Verde
171
+ Pristina,Kosovo
172
+ Pyongyang,North Korea
173
+ Quito,Ecuador
174
+ Rabat,Morocco
175
+ Reykjavík,Iceland
176
+ Riga,Latvia
177
+ Riyadh,Saudi Arabia
178
+ Road Town,British Virgin Islands
179
+ Rome,Italy
180
+ Roseau,Dominica
181
+ Saint-Denis,Réunion
182
+ Saipan,Northern Mariana Islands
183
+ San José,Costa Rica
184
+ San Juan,Puerto Rico
185
+ San Marino,San Marino
186
+ San Salvador,El Salvador
187
+ Santiago,Chile
188
+ Santo Domingo,Dominican Republic
189
+ São Tomé,São Tomé and Príncipe
190
+ Sarajevo,Bosnia and Herzegovina
191
+ Seoul,South Korea
192
+ Singapore,Singapore
193
+ Skopje,Republic of Macedonia
194
+ Sofia,Bulgaria
195
+ St. George's,Grenada
196
+ St. Helier,Jersey
197
+ St. John's,Antigua and Barbuda
198
+ St. Peter Port,Guernsey
199
+ St. Pierre,Saint Pierre and Miquelon
200
+ Stanley,Falkland Islands
201
+ Stepanakert,Nagorno-Karabakh Republic
202
+ Stockholm,Sweden
203
+ Sukhumi,Abkhazia
204
+ Suva,Fiji
205
+ Taipei,Taiwan
206
+ Tallinn,Estonia
207
+ Tarawa,Kiribati
208
+ Tashkent,Uzbekistan
209
+ Tegucigalpa,Honduras
210
+ Tehran,Iran
211
+ Thimphu,Bhutan
212
+ Tirana,Albania
213
+ Tiraspol,Transnistria
214
+ Tokyo,Japan
215
+ Tórshavn,Faroe Islands
216
+ Tripoli,Libya
217
+ Tskhinvali,South Ossetia
218
+ Tunis,Tunisia
219
+ Ulaanbaatar,Mongolia
220
+ Vaduz,Liechtenstein
221
+ Valletta,Malta
222
+ The Valley,Anguilla
223
+ Vatican City,Vatican City
224
+ Victoria,Seychelles
225
+ Vienna,Austria
226
+ Vientiane,Laos
227
+ Vilnius,Lithuania
228
+ Warsaw,Poland
229
+ "Washington, D.C.",United States
230
+ Wellington,New Zealand
231
+ Windhoek,Namibia
232
+ Yaoundé,Cameroon
233
+ Yerevan,Armenia
234
+ Zagreb,Croatia