emotion-picker 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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 26e82c760dcfa7c46d4c7ee83b6e11138afa51bf665b6d4ad7a367dff90c358e
4
+ data.tar.gz: bf83cd542ce95fb69a1b85461b3bc6771138d443a4f4559c0ebdcee9228bcfee
5
+ SHA512:
6
+ metadata.gz: 5a3b061e5d7ef5404114e031a1237d090c532200a6a45dd2aa5d3cdccda48c30618e42f73ab9bf742bff0b28c27b538213fed7f07bb4132bd9e211f39f8bb7fa
7
+ data.tar.gz: 4b0f60bd5f289b6c08f7f6667cb19dc6769c97b88cc10d24609177a3cb00cf438fd3c43d094f68650d418cbd09c62427b666d52455036aaaf59ba2888a667f7f
data/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ This is free and unencumbered software released into the public domain.
2
+
3
+ Anyone is free to copy, modify, publish, use, compile, sell, or
4
+ distribute this software, either in source code form or as a compiled
5
+ binary, for any purpose, commercial or non-commercial, and by any
6
+ means.
7
+
8
+ In jurisdictions that recognize copyright laws, the author or authors
9
+ of this software dedicate any and all copyright interest in the
10
+ software to the public domain. We make this dedication for the benefit
11
+ of the public at large and to the detriment of our heirs and
12
+ successors. We intend this dedication to be an overt act of
13
+ relinquishment in perpetuity of all present and future rights to this
14
+ software under copyright law.
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 NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ For more information, please refer to <http://unlicense.org/>
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'emotion/picker'
4
+ require 'nice-sigint'
5
+ require 'optparse'
6
+
7
+ OptionParser.new do |opts|
8
+ opts.banner = 'Usage: emotion-picker [-hv]'
9
+
10
+ opts.on('-h', '--help', 'Prints this help') do
11
+ puts opts
12
+ exit
13
+ end
14
+
15
+ opts.on('-v', '--version', 'Prints program version') do
16
+ puts Emotion::Picker::VERSION
17
+ exit
18
+ end
19
+ end.parse!
20
+
21
+ emotion = Emotion::Picker::EmotionPicker.new
22
+ puts "You are feeling #{emotion.pick}"
@@ -0,0 +1,212 @@
1
+ - name: Abandoned
2
+ description: A state in which people feel discarted, undesired, left behind
3
+
4
+ - name: Fear of Abandonment
5
+ description: An irrational belief that one is in imminent danger of being personally rejected, discarded or replaced
6
+
7
+ - name: Afflicted
8
+ description: To be distress by a physical problem or mental function or even monotony
9
+
10
+ - name: Afraid
11
+ description: Filled with fear, apprehension or regret over an unwanted situation
12
+
13
+ - name: Aggravated
14
+ description: To feel annoyed or bothered
15
+
16
+ - name: Agressive
17
+ description: To feel or show aggression. To use forceful methods to succeed
18
+
19
+ - name: Apprehensive
20
+ description: Anxious or fearful about the future. Uneasy
21
+
22
+ - name: Astonished
23
+ description: To fill with sudden wonder or amazement
24
+
25
+ - name: Angry
26
+ description: Displeasure, hostility. An emotional state that may range in intensity from mild irritation to intense fury and rage
27
+
28
+ - name: Annoyed
29
+ description: To feel disturbed or troubled, evoking moderate anger. Annoy refers to mild disturbance that can be caused by an act that triggers one's patience
30
+
31
+ - name: Anxious
32
+ description: An abnormal and overwhelming sense of apprehension often marked by physiological signs . Sweating, tension, and increased pulse
33
+
34
+ - name: Appreciation
35
+ description: A feeling or expression of admiration, approval, or gratitude
36
+
37
+ - name: Arrogance
38
+ description: The feeling that comes from believing that you are better, smarter, or more important than other people.
39
+
40
+ - name: Betrayed
41
+ description: To feel harmed when you have trusted them
42
+
43
+ - name: Bored
44
+ description: ""
45
+
46
+ - name: Lack of interest.
47
+ description: ""
48
+
49
+ - name: Calm
50
+ description: When not feeling nervousness, anger, or other emotions
51
+
52
+ - name: Cheerful
53
+ description: Being in or characterized by good spirits
54
+
55
+ - name: Certain
56
+ description: Sure to come or happen; inevitable. Established beyond doubt or question; indisputable. Having confidence; assured
57
+
58
+ - name: Comfortable
59
+ description: Free from stress or anxiety; at ease. Ease and security feelings
60
+
61
+ - name: Confused
62
+ description: Being unable to think with clarity or act with understanding
63
+
64
+ - name: Confident
65
+ description: Faith or belief that one will act in a right, proper, or effective way. A state of being certain.
66
+
67
+ - name: Denial
68
+ description: An unconscious defense mechanism characterized by refusal to acknowledge painful realities, thoughts, or feelings.
69
+
70
+ - name: Defensive
71
+ description: Protecting oneself from emotional pain
72
+
73
+ - name: Determined
74
+ description: arked by or showing determination; resolute
75
+
76
+ - name: Depressed
77
+ description: Pessimistic sense of inadequacy, lack of activity
78
+
79
+ - name: Displeased
80
+ description: Dissatisfied or dislike
81
+
82
+ - name: Distracted
83
+ description: Mentally confused
84
+
85
+ - name: Distressed
86
+ description: ""
87
+
88
+ - name: Disturbed
89
+ description: ""
90
+
91
+ - name: Dissatisfied
92
+ description: Exhibiting lack of satisfaction
93
+
94
+ - name: Disgust
95
+ description: ""
96
+
97
+ - name: Disappointed
98
+ description: Thwarted in hope, desire, or expectation
99
+
100
+ - name: Enthusiasm
101
+ description: A strong excitement of feeling. Great excitement for or interest in a subject or cause.
102
+
103
+ - name: Envy
104
+ description: Painful or resentful emotion. Awareness of an advantage enjoyed by another joined with a desire to possess the same advantage.
105
+
106
+ - name: Fascinated
107
+ description: To hold an intense interest or attraction
108
+
109
+ - name: Fear
110
+ description: ""
111
+
112
+ - name: Aversion
113
+ description: ""
114
+
115
+ - name: Frustrated
116
+ description: A deep dissatisfaction arising from unresolved problems or unfulfilled needs
117
+
118
+ - name: Guilt
119
+ description: Culpability especially for imagined offenses or from a sense of inadequacy
120
+
121
+ - name: Grateful
122
+ description: The state of being grateful; thankfulness
123
+
124
+ - name: Grief
125
+ description: Intense sorrow especially caused by someone’s death
126
+
127
+ - name: Happiness
128
+ description: A state of mind or feeling characterized by contentment, love, satisfaction, pleasure, or joy
129
+
130
+ - name: Hope
131
+ description: To cherish a desire with anticipation. To wish for something with expectation of its fulfillment
132
+
133
+ - name: Jealous
134
+ description: Thoughts, feelings, and behaviors that occur when a person believes a valued relationship is being threatened by a rival
135
+
136
+ - name: Joyful
137
+ description: ""
138
+
139
+ - name: Love
140
+ description: A strong feeling of affection and concern toward another person, as that arising from kinship or close friendship
141
+
142
+ - name: Negative
143
+ description: Being pessimistic, expressing disagreement or refusal
144
+
145
+ - name: Offended
146
+ description: To result in displeasure
147
+
148
+ - name: Optimistic
149
+ description: Expecting the best in this best of all possible worlds
150
+
151
+ - name: Overwhelmed
152
+ description: ""
153
+
154
+ - name: Patient
155
+ description: Having or showing patience
156
+
157
+ - name: Pride
158
+ description: A sense of one's own proper dignity or value; self-respect
159
+
160
+ - name: Regret
161
+ description: Sorrow, repentance, disappointment
162
+
163
+ - name: Resentful
164
+ description: A feeling of indignant displeasure or persistent ill will at something regarded as a wrong, insult, or injury
165
+
166
+ - name: Relaxed
167
+ description: Not agitated or disturbed emotionally. Free from worry or anxiety
168
+
169
+ - name: Sad
170
+ description: Unhappy. Feeling sorrow
171
+
172
+ - name: Self-pity
173
+ description: A self-indulgent dwelling on one's own sorrows or misfortunes
174
+
175
+ - name: Shame
176
+ description: A condition of humiliating disgrace or disrepute
177
+
178
+ - name: Stressed
179
+ description: ""
180
+
181
+ - name: Surpriesed
182
+ description: ""
183
+
184
+ - name: Troubled
185
+ description: ""
186
+
187
+ - name: Trust
188
+ description: Firm belief in reliability, truth, ability or strength of someone or something
189
+
190
+ - name: Upset
191
+ description: ""
192
+
193
+ - name: Unconfortable
194
+ description: ""
195
+
196
+ - name: Unconcerned
197
+ description: ""
198
+
199
+ - name: Unhappy
200
+ description: ""
201
+
202
+ - name: Vitality
203
+ description: Physical or mental vigor especially when highly developed. The capacity to live, grow, or develop
204
+
205
+ - name: Victimized
206
+ description: ""
207
+
208
+ - name: Vulnerable
209
+ description: Feeling exposed to being attacked or harmed
210
+
211
+ - name: Worried
212
+ description: Anxious over actual or potential difficulties
@@ -0,0 +1,40 @@
1
+ require 'emotion/picker/version'
2
+ require 'emotion/picker/emotion'
3
+ require 'yaml'
4
+
5
+ EMOTIONS_FILE = "#{__dir__}/emotions.yml".freeze
6
+
7
+ module Emotion
8
+ module Picker
9
+ # Class for choosing an emotion
10
+ class EmotionPicker
11
+ def initialize
12
+ @emotions = load
13
+ end
14
+
15
+ # Picks a random emotion and returns it
16
+ # @return [Emotion]
17
+ def pick
18
+ rand = Random.new
19
+ index = rand.rand(@emotions.length - 1)
20
+ @emotions[index]
21
+ end
22
+
23
+ private
24
+
25
+ # Loads the emotions file into an internal array
26
+ # @return [Array]
27
+ def load
28
+ emotions = []
29
+ parsed = YAML.load_file(EMOTIONS_FILE)
30
+
31
+ parsed.each do |emotion|
32
+ emote = Emotion.new(emotion['name'], emotion['description'])
33
+ emotions.push(emote)
34
+ end
35
+
36
+ emotions
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,24 @@
1
+ module Emotion
2
+ module Picker
3
+ # DAO class for representing an emotion
4
+ class Emotion
5
+ attr_reader :name, :description
6
+
7
+ # Emotion constructor
8
+ # @param name [String]
9
+ # @param description [String]
10
+ def initialize(name, description = '')
11
+ @name = name
12
+ @description = description
13
+ end
14
+
15
+ # Returns a string representation of the class
16
+ # @return [String]
17
+ def to_s
18
+ str = @name
19
+ str << " - #{@description}" unless @description == ''
20
+ str
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,5 @@
1
+ module Emotion
2
+ module Picker
3
+ VERSION = '0.1.0'.freeze
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,106 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: emotion-picker
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Christopher Birmingham
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-08-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: nice-sigint
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.1.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.1.0
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.17'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.17'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '5.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '5.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ description: Program for picking a random emotion
70
+ email:
71
+ - chris.birmingham@hotmail.co.uk
72
+ executables:
73
+ - emotion-picker
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - LICENSE
78
+ - bin/emotion-picker
79
+ - lib/emotion/emotions.yml
80
+ - lib/emotion/picker.rb
81
+ - lib/emotion/picker/emotion.rb
82
+ - lib/emotion/picker/version.rb
83
+ homepage: https://github.com/chrisBirmingham/emotion-picker
84
+ licenses:
85
+ - Unlicense
86
+ metadata: {}
87
+ post_install_message:
88
+ rdoc_options: []
89
+ require_paths:
90
+ - lib
91
+ required_ruby_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ required_rubygems_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ requirements: []
102
+ rubygems_version: 3.0.3
103
+ signing_key:
104
+ specification_version: 4
105
+ summary: Emotion Picker
106
+ test_files: []