muzang-plugins 1.0.0
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/Rakefile +11 -0
- data/lib/muzang-plugins.rb +11 -0
- data/lib/muzang-plugins/helpers.rb +39 -0
- data/lib/muzang-plugins/muzang-eval.rb +51 -0
- data/lib/muzang-plugins/muzang-livereload.rb +19 -0
- data/lib/muzang-plugins/muzang-meme.rb +51 -0
- data/lib/muzang-plugins/muzang-motd.rb +21 -0
- data/lib/muzang-plugins/muzang-nerdpursuit.rb +95 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/algorithms/fastes_sorting_algorithm.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/algorithms/run_time_of_bst.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/bash/last_cmd_sub.json +13 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/bash/last_directory.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/bash/prefix_last_command.json +13 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/couchdb/new_database.json +10 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/css/attribute_selectors.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/css/background_image.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/css/float_left.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/css/hexadecimal_code.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/css/how_do_you_use_multiple_box_sha.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/css/media.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/css/position_fixed_support.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/css/position_property.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/css/release_date.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/css/roses.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/css/z-index_property.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/culture/all_ur_base.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/culture/answer_to_everything.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/culture/club_mate_caffeine.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/culture/ook_ook.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/culture/prediction_gates.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/culture/the_cake.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/culture/to_which_year_marty_mcfly_wants.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/culture/what_is_a_traditional_vulcan_sa.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/culture/what_is_the_c_base.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/culture/when_life_gives_you_lemons.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/culture/where_are_the_characters_of_daw.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/culture/which_character_in_star_trek_se.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/culture/who_is_the_first_character_to_b.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/culture/yo_dawg.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/data/half_a_byte.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/flash/fps.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/flash/trace_something_in_as3.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/grafix/png.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/grafix/ps_save_for_web.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/grafix/screen_image_resolution.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/html/how_do_you_specify_html5_doctyp.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/html/img_tag.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/html/optional_html_tags.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/html/strict_doctype.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/http/HTCPCP.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/javascript/chrome_v8.json +10 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/javascript/fun_with_brackets.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/javascript/how_can_you_access_the_data_pas.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/javascript/jquery_sizzle.json +10 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/javascript/json.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/javascript/jsonp.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/javascript/nodetype_of_text_node.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/javascript/same_origin_policy.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/javascript/string_object_coercion_internals.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/javascript/typeof_arguments.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/javascript/valid_function_expression.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/javascript/what_s_4_2.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/javascript/what_s_typeof_null.json +12 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/javascript/who_created_jquery.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/php/invited-php.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/python/square_numbers_in_list.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/rails/controller_action.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/rails/folders.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/rails/pluralize_person.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/rails/rails_first_shown.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/rails/rails_inventor.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/rails/rake_about.json +11 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/rails/simple_format.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/regex/emails.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/regex/lazy.json +13 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/regex/min_max_quantifier.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/regex/negative_look_ahead.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/regex/prime.json +10 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/2_seconds.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/about_ruby.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/absolute_superclass_1.8.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/absolute_superclass_1.9.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/active_record_base.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/array_all_but_the_first.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/array_all_but_the_first_and_last .json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/array_all_but_the_last.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/array_ampersand.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/array_get_and remove_first_element.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/array_get_and remove_last_element.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/array_pipe.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/array_splat.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/array_to_csv_string.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/backticks_in_ruby.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/base_object.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/best_language.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/bitwise_and.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/bitwise_or.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/class_inheritance.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/collect_alternative.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/comparsion.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/constants.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/date_format_month.json +10 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/divmod.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/enumerable.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/equality.json +13 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/falsy.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/fizzbuzz.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/garbarge_collector_in_19.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/global_variable_character.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/hash_with_indifferent_access.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/how_is_ruby_licensed.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/how_many_gems.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/instance_exec.json +10 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/kanji_converter.json +10 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/kernel-sprintf-2.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/kernel-sprintf.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/kernel.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/matz.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/method_used_for_comparisions.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/mixins_are_what.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/new_lambda_calling_syntax.json +13 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/new_lambda_constructing_syntax.json +10 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/nil.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/nil_id.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/nilclass.json +10 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/numeric_types.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/private_method_in_ruby.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/protected_method_in_ruby.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/quo.json +10 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/ranges_three_dots.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/return_value_or.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/rspec_controller_render_views.json +10 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/spaceship_operator.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/string_clean_whitespace.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/sum_things_up.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/symbol_identity_01.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/symbol_identity_02.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/symbol_identity_03.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/symbol_string_ids.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/symbols.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/the_difference_between_and_operators.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/unless_wtf.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/weakref.json +10 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/what_did_matz_say_about_ruby.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/what_do_array.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/what_do_string.json +14 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/what_does_gil_stands_for.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/what_does_negate_regexp_operator_do.json +15 -0
- data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/what_is_a_mixin.json +14 -0
- data/lib/muzang-plugins/muzang-plusone.rb +49 -0
- data/lib/muzang-plugins/muzang-reddit.rb +42 -0
- data/lib/muzang-plugins/muzang-rubygems.rb +43 -0
- data/lib/muzang-plugins/version.rb +5 -0
- data/muzang-plugins.gemspec +23 -0
- data/spec/livereload_spec.rb +23 -0
- data/spec/meme_spec.rb +43 -0
- data/spec/motd_spec.rb +18 -0
- data/spec/muzang-eval_spec.rb +43 -0
- data/spec/nerdpursuit_spec.rb +76 -0
- data/spec/plusone_spec.rb +67 -0
- data/spec/reddit_spec.rb +45 -0
- data/spec/rubygems_spec.rb +37 -0
- data/spec/spec_helper.rb +11 -0
- data/spec/support/connection_mock.rb +15 -0
- data/spec/support/responses/meme.response +4 -0
- data/spec/support/responses/reddit.response +3 -0
- data/spec/support/responses/rubygems.response +3 -0
- metadata +259 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
{ "question" : {
|
2
|
+
"id": "",
|
3
|
+
"category": "regex",
|
4
|
+
"nerd_level": 5,
|
5
|
+
"text": "Which one works as email validator?",
|
6
|
+
"a1": "/[\w.!\$%+-].@[\w-]+(?\.[\w-]+)+/",
|
7
|
+
"a2": "/[\w.!#\$%+-]+@[\w-]+(?:\.[\w-]+)+/",
|
8
|
+
"a3": "/[\w.+!#\$%+]+@[\w-]+(?\.[\w-]+)+/",
|
9
|
+
"a4": "/[\w.!\$%+-]+@[\w-].(?:\.[\w-]+)-/",
|
10
|
+
"right_answer": "a2",
|
11
|
+
"created_at": "2011-06-07",
|
12
|
+
"created_by": "tmschndr"
|
13
|
+
}
|
14
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{ "question" : {
|
2
|
+
"id": "",
|
3
|
+
"category": "regex",
|
4
|
+
"nerd_level": 3,
|
5
|
+
"text": "Which regex will capture everything between the first pair of square brackets: '[a,b,c][1]'",
|
6
|
+
"a1": "/\[(.*)\]/",
|
7
|
+
"a2": "/\[(.+)\]/",
|
8
|
+
"a3": "/\[(.*?)\]/",
|
9
|
+
"right_answer": "a3",
|
10
|
+
"created_at": "2011-06-07",
|
11
|
+
"created_by": "mkorfmann"
|
12
|
+
}
|
13
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{ "question" : {
|
2
|
+
"id": "",
|
3
|
+
"category": "regex",
|
4
|
+
"nerd_level": 2,
|
5
|
+
"text": "Which regex will match 'blaaa' with the number of 'a' ' s at the end ranging from 2 to 5",
|
6
|
+
"a1": "bla{2..5}",
|
7
|
+
"a2": "bla{2-5}",
|
8
|
+
"a3": "bla{2,5}",
|
9
|
+
"a4": "bla[2-5]",
|
10
|
+
"right_answer": "a3",
|
11
|
+
"created_at": "2011-06-07",
|
12
|
+
"created_by": "mkorfmann"
|
13
|
+
}
|
14
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{ "question" : {
|
2
|
+
"id": "",
|
3
|
+
"category": "regex",
|
4
|
+
"nerd_level": 3,
|
5
|
+
"text": "Which regex will match 'foobaz' and 'fooboz' but not 'foobar'",
|
6
|
+
"a1": "/foo[^bar]/",
|
7
|
+
"a2": "/foo(?!bar)/",
|
8
|
+
"a3": "/foo(?:bar)/",
|
9
|
+
"a4": "/foo(?!=bar)/",
|
10
|
+
"right_answer": "a2",
|
11
|
+
"created_at": "2011-06-07",
|
12
|
+
"created_by": "mkorfmann"
|
13
|
+
}
|
14
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
{ "question" : {
|
2
|
+
"id": "",
|
3
|
+
"category": "regex",
|
4
|
+
"nerd_level": 5,
|
5
|
+
"text": "This regex is normally used to determine if a number is not prime: /^1?$|^(1+?)\1+$/, but it is broken, how to fix it? The number has the format /1{number}/.",
|
6
|
+
"a1": "/^1?$|^(11+?)\1+$/",
|
7
|
+
"created_at": "2011-06-07",
|
8
|
+
"created_by": "mkorfmann"
|
9
|
+
}
|
10
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"question": {
|
3
|
+
"nerd_level": 1,
|
4
|
+
"text": "In Rails, what is the class of an object created with this statement: 2.seconds",
|
5
|
+
"a1": "Duration",
|
6
|
+
"created_by": "Mike Poltyn",
|
7
|
+
"a2": "DateTime",
|
8
|
+
"a3": "Fixnum",
|
9
|
+
"created_at": "2011-06-15",
|
10
|
+
"a4": "Time",
|
11
|
+
"category": "ruby",
|
12
|
+
"right_answer": "a3",
|
13
|
+
"id": ""
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{ "question" : {
|
2
|
+
"id": "",
|
3
|
+
"category": "ruby",
|
4
|
+
"nerd_level": 1,
|
5
|
+
"text":"Who invented Ruby?",
|
6
|
+
"a1": "Yukihiro Matsumoto",
|
7
|
+
"a2": "David Heinemeier Hansson",
|
8
|
+
"a3": "Rasmus Lerdorf",
|
9
|
+
"a4": "Ransom E. Olds",
|
10
|
+
"right_answer":"a1",
|
11
|
+
"created_at": "2011-05-09",
|
12
|
+
"created_by": "Koos"
|
13
|
+
}
|
14
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{ "question" : {
|
2
|
+
"id": "",
|
3
|
+
"category": "ruby",
|
4
|
+
"nerd_level": 1,
|
5
|
+
"text": "What is the absolute superclass, the mother of all classes, in Ruby 1.8?",
|
6
|
+
"a1": "MotherClass",
|
7
|
+
"a2": "Object",
|
8
|
+
"a3": "Lilith",
|
9
|
+
"a4": "Base-Object",
|
10
|
+
"right_answer": "a2",
|
11
|
+
"created_at": "2011-06-07",
|
12
|
+
"created_by": "Paul"
|
13
|
+
}
|
14
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{ "question" : {
|
2
|
+
"id": "",
|
3
|
+
"category": "ruby",
|
4
|
+
"nerd_level": 1,
|
5
|
+
"text": "What is the return value of nil || 'a'?",
|
6
|
+
"a1": "true",
|
7
|
+
"a2": "nil",
|
8
|
+
"a3": "'a'",
|
9
|
+
"a4": "false",
|
10
|
+
"right_answer": "a3",
|
11
|
+
"created_at": "2011-06-07",
|
12
|
+
"created_by": "Paul"
|
13
|
+
}
|
14
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{ "question" : {
|
2
|
+
"id": "",
|
3
|
+
"category": "ruby",
|
4
|
+
"nerd_level": 1,
|
5
|
+
"text": "From which class do all active record objects descend?",
|
6
|
+
"a1": "MySql",
|
7
|
+
"a2": "Object",
|
8
|
+
"a3": "SuperClass",
|
9
|
+
"a4": "Base",
|
10
|
+
"right_answer": "a4",
|
11
|
+
"created_at": "2011-05-24",
|
12
|
+
"created_by": "Schorsch"
|
13
|
+
}
|
14
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"question": {
|
3
|
+
"nerd_level": 2,
|
4
|
+
"text": "How to get all but the first element of an array.",
|
5
|
+
"a1": "ary.first",
|
6
|
+
"a2": "ary[1..-1]",
|
7
|
+
"a3": "ary.size-1",
|
8
|
+
"a4": "ary[1...-1]",
|
9
|
+
"category": "ruby",
|
10
|
+
"right_answer": "a2",
|
11
|
+
"created_by": "Georg Leciejewski",
|
12
|
+
"created_at": "2011-06-23",
|
13
|
+
"id": ""
|
14
|
+
}
|
15
|
+
}
|
data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/array_all_but_the_first_and_last .json
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"question": {
|
3
|
+
"nerd_level": 3,
|
4
|
+
"text": "How to get all but the first and last elements of an array.",
|
5
|
+
"a1": "ary[1..-1]",
|
6
|
+
"a2": "ary.pop",
|
7
|
+
"a3": "ary[1...-1]",
|
8
|
+
"a4": "ary.size-2",
|
9
|
+
"category": "ruby",
|
10
|
+
"right_answer": "a1",
|
11
|
+
"created_by": "Georg Leciejewski",
|
12
|
+
"created_at": "2011-06-23",
|
13
|
+
"id": ""
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"question": {
|
3
|
+
"nerd_level": 2,
|
4
|
+
"text": "How to get all but the last element of an array.",
|
5
|
+
"a1": "ary[0..-1]",
|
6
|
+
"a2": "ary.pop",
|
7
|
+
"a3": "ary.size-1",
|
8
|
+
"a4": "ary[0...-1]",
|
9
|
+
"category": "ruby",
|
10
|
+
"right_answer": "a4",
|
11
|
+
"created_by": "Georg Leciejewski",
|
12
|
+
"created_at": "2011-06-20",
|
13
|
+
"id": ""
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{ "question" : {
|
2
|
+
"id": "",
|
3
|
+
"category": "ruby",
|
4
|
+
"nerd_level": 1,
|
5
|
+
"text": "What's the output of [1, 2, 3] & [3, 4, 5]?",
|
6
|
+
"a1": "[1, 2, 4, 5]",
|
7
|
+
"a2": "[1, 2, 3, 3, 4, 5]",
|
8
|
+
"a3": "[3]",
|
9
|
+
"a4": "[1, 2, 3, 4, 5]",
|
10
|
+
"right_answer": "a3",
|
11
|
+
"created_at": "2011-06-07",
|
12
|
+
"created_by": "Paul"
|
13
|
+
}
|
14
|
+
}
|
data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/array_get_and remove_first_element.json
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"question": {
|
3
|
+
"nerd_level": 1,
|
4
|
+
"text": "How to get and remove the first element of an array.",
|
5
|
+
"a1": "[1,2,3].pop",
|
6
|
+
"a2": "[1,2,3].shift",
|
7
|
+
"a3": "[1,2,3].first",
|
8
|
+
"a4": "[1,2,3].index(1)",
|
9
|
+
"category": "ruby",
|
10
|
+
"right_answer": "a2",
|
11
|
+
"created_by": "Georg Leciejewski",
|
12
|
+
"created_at": "2011-06-23",
|
13
|
+
"id": ""
|
14
|
+
}
|
15
|
+
}
|
data/lib/muzang-plugins/muzang-nerdpursuit/questions/ruby/array_get_and remove_last_element.json
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"question": {
|
3
|
+
"nerd_level": 1,
|
4
|
+
"text": "How to get and remove the first element of an array.",
|
5
|
+
"a1": "[1,2,3].pop",
|
6
|
+
"a2": "[1,2,3].last",
|
7
|
+
"a3": "[1,2,3].shift",
|
8
|
+
"a4": "[1,2,3].index(3)",
|
9
|
+
"category": "ruby",
|
10
|
+
"right_answer": "a1",
|
11
|
+
"created_by": "Georg Leciejewski",
|
12
|
+
"created_at": "2011-06-23",
|
13
|
+
"id": ""
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{ "question" : {
|
2
|
+
"id": "",
|
3
|
+
"category": "ruby",
|
4
|
+
"nerd_level": 1,
|
5
|
+
"text": "What's the output of [1, 2, 3] | [3, 4, 5]?",
|
6
|
+
"a1": "[1, 2, 4, 5]",
|
7
|
+
"a2": "[1, 2, 3, 3, 4, 5]",
|
8
|
+
"a3": "[3]",
|
9
|
+
"a4": "[1, 2, 3, 4, 5]",
|
10
|
+
"right_answer": "a4",
|
11
|
+
"created_at": "2011-06-07",
|
12
|
+
"created_by": "Paul"
|
13
|
+
}
|
14
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{ "question" : {
|
2
|
+
"id": "",
|
3
|
+
"category": "ruby",
|
4
|
+
"nerd_level": 1,
|
5
|
+
"text": "What is the correct way to pass [arg1, arg2] as an argument to User.send(:my_method)?",
|
6
|
+
"a1": "User.send(:my_method, a)",
|
7
|
+
"a2": "User.send(:my_method, &a)",
|
8
|
+
"a3": "User.send(:my_method, @a)",
|
9
|
+
"a4": "User.send(:my_method, *a)",
|
10
|
+
"right_answer": "a4",
|
11
|
+
"created_at": "2011-06-07",
|
12
|
+
"created_by": "Paul"
|
13
|
+
}
|
14
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"question": {
|
3
|
+
"nerd_level": 1,
|
4
|
+
"text": "How to convert an array into a comma seperated string.",
|
5
|
+
"a1": "[1,2,3].csv_merge",
|
6
|
+
"a2": "[1,2,3].collapse(',')",
|
7
|
+
"a3": "[1,2,3].join(',')",
|
8
|
+
"a4": "[1,2,3].glue.with(',')",
|
9
|
+
"category": "ruby",
|
10
|
+
"right_answer": "a3",
|
11
|
+
"created_by": "Georg Leciejewski",
|
12
|
+
"created_at": "2011-06-20",
|
13
|
+
"id": ""
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"question": {
|
3
|
+
"category": "ruby",
|
4
|
+
"right_answer": "a3",
|
5
|
+
"nerd_level": 4,
|
6
|
+
"text": "Backticks ` in ruby",
|
7
|
+
"a1": "are a shortcut to send method",
|
8
|
+
"a2": "do nothing",
|
9
|
+
"a3": "allow to execute a system command",
|
10
|
+
"a4": "raise SyntaxError",
|
11
|
+
"created_by": "nbartlomiej",
|
12
|
+
"id": "",
|
13
|
+
"created_at": "2011-06-14"
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{ "question" : {
|
2
|
+
"id": "",
|
3
|
+
"category": "ruby",
|
4
|
+
"nerd_level": 1,
|
5
|
+
"text": "What is the absolute superclass in Ruby 1.9?",
|
6
|
+
"a1": "Super",
|
7
|
+
"a2": "Object",
|
8
|
+
"a3": "Mother",
|
9
|
+
"a4": "Base-Object",
|
10
|
+
"right_answer": "a4",
|
11
|
+
"created_at": "2011-06-07",
|
12
|
+
"created_by": "Paul"
|
13
|
+
}
|
14
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{ "question" : {
|
2
|
+
"id": "",
|
3
|
+
"category": "ruby",
|
4
|
+
"nerd_level": 1,
|
5
|
+
"text":"What is the best programing language ever?",
|
6
|
+
"a1": "C#",
|
7
|
+
"a2": "Ruby",
|
8
|
+
"a3": "Java",
|
9
|
+
"a4": "LOLCODE",
|
10
|
+
"right_answer":"a2",
|
11
|
+
"created_at": "2011-06-06",
|
12
|
+
"created_by": "juliancheal"
|
13
|
+
}
|
14
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{ "question" : {
|
2
|
+
"id": "",
|
3
|
+
"category": "ruby",
|
4
|
+
"nerd_level": 1,
|
5
|
+
"text": "From how many classes can a ruby class directly descend/inherit.",
|
6
|
+
"a1": "three",
|
7
|
+
"a2": "none",
|
8
|
+
"a3": "two",
|
9
|
+
"a4": "one",
|
10
|
+
"right_answer": "a4",
|
11
|
+
"created_at": "2011-05-24",
|
12
|
+
"created_by": "Schorsch"
|
13
|
+
}
|
14
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{ "question" : {
|
2
|
+
"id": "",
|
3
|
+
"category": "ruby",
|
4
|
+
"nerd_level": 1,
|
5
|
+
"text":"Which method can be used instead of 'collect' ",
|
6
|
+
"a1": "scan",
|
7
|
+
"a2": "chomp",
|
8
|
+
"a3": "map",
|
9
|
+
"a4": "select",
|
10
|
+
"right_answer":"a3",
|
11
|
+
"created_at": "2011-06-07",
|
12
|
+
"created_by": "kangguru"
|
13
|
+
}
|
14
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{ "question" : {
|
2
|
+
"id": "",
|
3
|
+
"category": "ruby",
|
4
|
+
"nerd_level": 2,
|
5
|
+
"text": "What is the result of 'a' == ('b' || 'a')",
|
6
|
+
"a1": "a",
|
7
|
+
"a2": "b",
|
8
|
+
"a3": "true",
|
9
|
+
"a4": "false",
|
10
|
+
"right_answer": "a4",
|
11
|
+
"created_at": "2011-06-08",
|
12
|
+
"created_by": "koos"
|
13
|
+
}
|
14
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{ "question" : {
|
2
|
+
"id": "",
|
3
|
+
"category": "ruby",
|
4
|
+
"nerd_level": 2,
|
5
|
+
"text":"Which of the following will call the constant Bar from class Foo ?",
|
6
|
+
"a1": "Foo.Bar()",
|
7
|
+
"a2": "Foo.Bar",
|
8
|
+
"a3": "Foo::Bar()",
|
9
|
+
"a4": "Foo::Bar",
|
10
|
+
"right_answer":"a4",
|
11
|
+
"created_at": "2011-06-06",
|
12
|
+
"created_by": "juliancheal"
|
13
|
+
}
|
14
|
+
}
|