quotify 0.1.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 54b8fa36bdbf2498482bc462018f7581fd636b118d48afa8e3eb4f17f22ca4b4
4
+ data.tar.gz: e5e86fb909e7b66d992f6b980cec416288698cf2f71e76adcfb8484d25c56fd9
5
+ SHA512:
6
+ metadata.gz: ed4a6618f5b10a864373c8ee4db29d6f97843f36e18950280ad01ed19b30085d83224f63c2627c41472d25a27cd89882c46dba950bb80e58dfd747526a973f27
7
+ data.tar.gz: 4b45f4e4880439a9976bf5524f7dd50c2c282b84563c560e9969e60c39560fbc9e857c71055ec380db095f06cb74b1dd740a0c997989e8ac2360e80eca773968
@@ -0,0 +1 @@
1
+ ok
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 Justin Léger
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.
@@ -0,0 +1,18 @@
1
+ require 'quotify/quote'
2
+
3
+ ##
4
+ # This module generates quotes on demand. Welcome to the future.
5
+ module Quotify
6
+
7
+ # Generates a quote
8
+ # @param quote [#to_s] A specified quote
9
+ # @param author [#to_s] A specified author
10
+ # @return [Quotify::Quote] quote with author
11
+ # <br>
12
+ # Example:
13
+ # >> Quotify.generate
14
+ # => #<Quotify::Quote:0x00007f8a44053978 @quote="You must be the change you wish to see in the world.", @author="Logan Paul">
15
+ def self.generate(quote: nil, author: nil)
16
+ Quote.new(quote: quote, author: author)
17
+ end
18
+ end
@@ -0,0 +1,67 @@
1
+ require 'yaml'
2
+ require 'json'
3
+
4
+ module Quotify
5
+
6
+ ##
7
+ # This class represents a quote object
8
+ class Quote
9
+
10
+ # Generates a quote
11
+ # @param quote [#to_s] A specified quote
12
+ # @param author [#to_s] A specified author
13
+ # @return [Quote] quote with author
14
+ def initialize(quote: nil, author: nil)
15
+ quote_list = YAML.load_file(File.join(__dir__, 'quotes.yml')) unless quote && author
16
+ @quote = quote || quote_list['quotes'].sample
17
+ @author = author || quote_list['authors'].sample
18
+ end
19
+
20
+ # Returns the quote and author in a string format
21
+ # @option spacer [#to_s] Characters between quote and author
22
+ # <br>
23
+ # Example:
24
+ # >> Quote.new.to_s(spacer: " 🔥 ")
25
+ # => You must be the change you wish to see in the world. 🔥 Logan Paul
26
+ def to_s(spacer: " - ")
27
+ "#{@quote}#{spacer}#{@author}"
28
+ end
29
+
30
+
31
+ # Returns the quote and author in a string format
32
+ # @option spacer [#to_s] Characters between quote and author
33
+ # <br>
34
+ # Example:
35
+ # >> Quote.new.to_s(spacer: " 🔥 ")
36
+ # => You must be the change you wish to see in the world. 🔥 Logan Paul
37
+ def to_str(spacer: " - ")
38
+ to_s(spacer: spacer)
39
+ end
40
+
41
+ # Returns the quote and author in a hash
42
+ # @return [Hash]
43
+ def to_hash
44
+ { quote: @quote, author: @author }
45
+ end
46
+
47
+ # Returns the quote and author in a JSON structured String
48
+ # @return [String]
49
+ def to_json
50
+ to_hash.to_json
51
+ end
52
+
53
+ # Returns the author
54
+ # @return [#to_s]
55
+ def author
56
+ @author
57
+ end
58
+
59
+ # Returns the quote
60
+ # @return [#to_s]
61
+ def quote
62
+ @quote
63
+ end
64
+
65
+ alias_method :to_h, :to_hash
66
+ end
67
+ end
@@ -0,0 +1,94 @@
1
+ authors:
2
+ - Ivanka Trump
3
+ - Dog The Bounty Hunter
4
+ - Master Yoda
5
+ - Abe Lincoln
6
+ - Stev-o
7
+ - Wee-man
8
+ - Albus Dumbledore
9
+ - Satan
10
+ - Momo Taleb
11
+ - Undertaker
12
+ - John Cena
13
+ - Triple H
14
+ - Kane
15
+ - Big Show
16
+ - The Rock
17
+ - Bing Han
18
+ - Sarah Palin
19
+ - Dj Khaled
20
+ - 21 Savage
21
+ - Sugar Ray Robinson
22
+ - Soulja Boy
23
+ - Betsy DeVos
24
+ - The Red Power Ranger
25
+ - Oprah Winfrey
26
+ - Snoop Dogg
27
+ - Olga
28
+ - Logan Paul
29
+
30
+ quotes:
31
+ - The ode lives upon the ideal, the epic upon the grandiose, the drama upon the real.
32
+ - If we don't study the mistakes of the future we're doomed to repeat them for the
33
+ first time.
34
+ - I love hookers and blow.
35
+ - C++ supports OOP
36
+ - You can do anything, but not everything.
37
+ - Perfection is achieved, not when there is nothing more to add, but when there is
38
+ nothing left to take away.
39
+ - The richest man is not he who has the most, but he who needs the least.
40
+ - You miss 100 percent of the shots you never take.
41
+ - Courage is not the absence of fear, but rather the judgement that something else
42
+ is more important than fear.
43
+ - You must be the change you wish to see in the world.
44
+ - When hungry, eat your rice; when tired, close your eyes. Fools may laugh at me,
45
+ but wise men will know what I mean.
46
+ - To the man who only has a hammer, everything he encounters begins to look like a
47
+ nail.
48
+ - We are what we repeatedly do; excellence, then, is not an act but a habit.
49
+ - You must be the change you wish to see in the world.
50
+ - The weak can never forgive. Forgiveness is the attribute of the strong.
51
+ - Happiness is when what you think, what you say, and what you do are in harmony.
52
+ - An eye for eye only ends up making the whole world blind.
53
+ - Live as if you were to die tomorrow; learn as if you were to live forever.
54
+ - First they ignore you, then they laugh at you, then they fight you, then you win.
55
+ - You must not lose faith in humanity. Humanity is an ocean; if a few drops of the
56
+ ocean are dirty, the ocean does not become dirty.
57
+ - The best way to find yourself is to lose yourself in the service of others.
58
+ - Strength does not come from physical capacity. It comes from an indomitable will.
59
+ - A man is but the product of his thoughts; what he thinks, he becomes.
60
+ - YES we can
61
+ - No we can't
62
+ - Those were alternative facts
63
+ - Don't force me to give you the D
64
+ - You can't see me
65
+ - I have a dream
66
+ - In god we trust
67
+ - Thou shall not pass
68
+ - What is a private email server?
69
+ - It's local on the the remote server
70
+ - It's not a muslim ban
71
+ - Snow mexicans, you're getting a wall too!
72
+ - Don't ever play yourself
73
+ - Just play. Have fun. Enjoy the game.
74
+ - "'Sexy' is being independent, being confident and having fun."
75
+ - It's kind of fun to do the impossible.
76
+ - We gucci Fam - Ghandi
77
+ - I want my world to be fun.
78
+ - Everyone gets a car
79
+ - One more thing
80
+ - Wrong
81
+ - Such a nasty woman
82
+ - Bazinga!
83
+ - You shall not pass!
84
+ - Wingardium leviosa
85
+ - Grab them by the pussy!
86
+ - Go bing or go home !
87
+ - Chronological awareness.
88
+ - This is a problem right here.
89
+ - Oh god..
90
+ - www.loganpaul.com/shop
91
+ - Get your merch on
92
+ - Best merch in the game
93
+ - Link in Bio
94
+ - Be a maverick
metadata ADDED
@@ -0,0 +1,134 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: quotify
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Justin Leger
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-12-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: json
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: mocha
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: simplecov
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: codecov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: Generates random quotes. Perfect placeholder text.
98
+ email: hey@justinleger.ca
99
+ executables: []
100
+ extensions: []
101
+ extra_rdoc_files: []
102
+ files:
103
+ - CHANGELOG.md
104
+ - LICENSE
105
+ - lib/quotify.rb
106
+ - lib/quotify/quote.rb
107
+ - lib/quotify/quotes.yml
108
+ homepage: https://github.com/jusleg/quotify-ruby
109
+ licenses:
110
+ - MIT
111
+ metadata:
112
+ source_code_uri: https://github.com/jusleg/quotify-ruby
113
+ changelog_uri: https://github.com/jusleg/quotify-ruby/blob/master/CHANGELOG.md
114
+ post_install_message:
115
+ rdoc_options: []
116
+ require_paths:
117
+ - lib
118
+ required_ruby_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ required_rubygems_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ requirements: []
129
+ rubyforge_project:
130
+ rubygems_version: 2.7.3
131
+ signing_key:
132
+ specification_version: 4
133
+ summary: Generates random quotes
134
+ test_files: []