programmer_joke 0.0.3

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: b54edb8297bba72738b85ed3ea503fe2b3452a6e
4
+ data.tar.gz: 575f5bd13c7a58dea39bc12bb54079b1793b99cc
5
+ SHA512:
6
+ metadata.gz: 04f242a179a7e3e3b349cf999a2671be476ded62bace6bfd07b5f4b6fecdc23aa83e34364467cbd2033c11635786d05edce2b577f48ad849878cf9bd6bf8610e
7
+ data.tar.gz: 5dda25ecd3127a3540649a97b3db065ab805b84068299bf27152db0cdf9c0d424cc1615be0f778527e327ddfdc0f4b14cb5c05ca4a9caa9131be4a63743c8fc7
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'programmer_joke'
4
+ puts ProgrammerJoke.joke(ARGV[0])
@@ -0,0 +1,20 @@
1
+ class ProgrammerJoke
2
+
3
+ AVAILABLE_LANGUAGES = %w[English Espaniol]
4
+
5
+ def self.languages
6
+ puts "\n"
7
+ AVAILABLE_LANGUAGES.each { |language| puts "--> #{language}" }
8
+ puts "\n"
9
+ end
10
+
11
+ def self.joke(language = 'English')
12
+ puts "\n"
13
+ jokes = Joke.new(language)
14
+ puts jokes.joke
15
+ puts "\n"
16
+ end
17
+
18
+ end
19
+
20
+ require 'programmer_joke/joke'
@@ -0,0 +1,40 @@
1
+ class ProgrammerJoke::Joke
2
+
3
+ def initialize(language)
4
+ @language = language.strip
5
+ end
6
+
7
+ def joke
8
+ case @language
9
+ when 'English'
10
+ [
11
+ "Why do programmers always mix up Halloween and Christmas?\nBecause Oct 31 == Dec 25",
12
+ "How do you tell an introverted computer scientist from an extroverted computer scientist?\nAn extroverted computer scientist looks at your shoes when he talks to you",
13
+ "A SQL query goes into a bar, walks up to two tables and asks, can I join you?",
14
+ "How many programmers does it take to change a light bulb?\nNone, that's a hardware problem",
15
+ "['hip','hip']\n(hip hip array!)",
16
+ "Why was the function sad after a successful first call?\nIt didn't get a callback",
17
+ "What's the second movie about a database engineer called?\nThe SQL",
18
+ "Why did the computer keep sneezing?\nIt had a virus!",
19
+ "Where does the pirate stash all of their digital treasures?\nRAR",
20
+ "What did the process say after working in an infinite loop all day?\nI need a break",
21
+ "Why don't parents teach their kids about regular expressions?\nBecause they don't want them playing with matches",
22
+ "A SQL developer walked into a NoSQL bar\nThey left because they couldn't find a table",
23
+ "Why don't bachelors like Git?\nBecause they are afraid to commit"
24
+ ].sample
25
+ when 'Espaniol'
26
+ [
27
+ "¿Que es un terapeuta?\n1024 gigapeutas",
28
+ "¿Que le dice una IP a otra?\n- ¿Que tramas?",
29
+ "¿Que le dice un bit al otro?\nNos vemos en el bus",
30
+ "¿Cuántos programadores hacen falta para cambiar una bombilla?\nNinguno, es un problema de hardware",
31
+ "¿Qué es una mujer objeto?\nUna instancia de una mujer con clase",
32
+ "¿Que le dice un informatico a su novia?\nEres mas bonita que compilar un programa a la primera",
33
+ "Para entender qué es la recursividad, antes hay que entender qué es la recursividad"
34
+ ].sample
35
+ else
36
+ "Oops! No jokes in this language yet :("
37
+ end
38
+ end
39
+
40
+ end
metadata ADDED
@@ -0,0 +1,49 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: programmer_joke
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Micaela Wolman
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-01-24 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: If you are a programmer and also like bad jokes this is the gem you were
14
+ looking for
15
+ email:
16
+ executables:
17
+ - programmer_joke
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - bin/programmer_joke
22
+ - lib/programmer_joke.rb
23
+ - lib/programmer_joke/joke.rb
24
+ homepage: http://rubygems.org/gems/programmer_joke
25
+ licenses:
26
+ - MIT
27
+ metadata:
28
+ source_code_uri: https://github.com/micawolman/programmer-joke
29
+ post_install_message:
30
+ rdoc_options: []
31
+ require_paths:
32
+ - lib
33
+ required_ruby_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ required_rubygems_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ requirements: []
44
+ rubyforge_project:
45
+ rubygems_version: 2.6.14
46
+ signing_key:
47
+ specification_version: 4
48
+ summary: Programmer Jokes!
49
+ test_files: []