emotion-picker 0.2.0 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: f9511c0e8684e2db0e24c71d71002471178a3a4bd623a1c13f1ad0a79547cf27
4
- data.tar.gz: d18c601b7fe6a33e433480f05c637d07214c13df1f64b2f9ce931dda33dc2ff6
2
+ SHA1:
3
+ metadata.gz: 6dc1f0f67e1065f9b19ab588414b8dc0fe2a68aa
4
+ data.tar.gz: dd2ba5a43592fc8f02873c36f3febaa521e3d76d
5
5
  SHA512:
6
- metadata.gz: 7b667a46442121b473961b745455057a6dab927cc60ff8a44d4c52179b1d3753a420bb0512893cbd7b5daf2c46b56703a0cfe3debceb3a0a7694bcefe6c55222
7
- data.tar.gz: 5af035d560f0e6af7f6f3f2c7f718e0285ff047de7d7c5e6619e40d6286f89a1094599ec8a32ead2d4d1638a6a8967ee2710208ba71da8bb8f81945cf37464e8
6
+ metadata.gz: c0b0baafc48608f60e5c9154b8febd3ff4d93e335120eadcb982acbd47b55456ae7805b3c560d7b2e203131b4544035a0847b98c611cace7a8bb9adcb7bc1338
7
+ data.tar.gz: 456ec47422a2069b1e5e273b4569a2d774a1932886fc9a3a591ef295487f00e3abebbf082cdcdffc603a1853b7ee1c91752fcdcb4e0fd0a4ebf332600a95c0e4
data/LICENSE CHANGED
File without changes
data/bin/emotion-picker CHANGED
@@ -1,10 +1,11 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'emotion/picker'
4
5
  require 'nice-sigint'
5
6
  require 'optparse'
6
7
 
7
- OptionParser.new do |opts|
8
+ parser = OptionParser.new do |opts|
8
9
  opts.banner = 'Usage: emotion-picker [-hv]'
9
10
 
10
11
  opts.on('-h', '--help', 'Prints this help') do
@@ -16,6 +17,13 @@ OptionParser.new do |opts|
16
17
  puts Emotion::Picker::VERSION
17
18
  exit
18
19
  end
19
- end.parse!
20
+ end
21
+
22
+ begin
23
+ parser.parse!
24
+ rescue OptionParser::ParseError => e
25
+ warn e.message
26
+ abort parser.to_s
27
+ end
20
28
 
21
29
  puts "You are feeling #{Emotion::Picker.pick}"
@@ -1,5 +1,5 @@
1
1
  - name: Abandoned
2
- description: A state in which people feel discarted, undesired, left behind
2
+ description: An emotional state in which people feel discarted, undesired, left behind
3
3
 
4
4
  - name: Fear of Abandonment
5
5
  description: An irrational belief that one is in imminent danger of being personally rejected, discarded or replaced
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'emotion/picker/version'
2
4
  require 'emotion/picker/emotion'
3
5
  require 'yaml'
4
6
 
5
7
  module Emotion
6
8
  module Picker
7
- EMOTIONS_FILE = "#{__dir__}/emotions.yml".freeze
9
+ EMOTIONS_FILE = "#{__dir__}/emotions.yml"
8
10
  private_constant :EMOTIONS_FILE
9
11
 
10
12
  # Class for choosing an emotion
@@ -17,7 +19,7 @@ module Emotion
17
19
  # @return [Emotion]
18
20
  def pick
19
21
  rand = Random.new
20
- index = rand.rand(@emotions.length - 1)
22
+ index = rand.rand(0..@emotions.length)
21
23
  @emotions[index]
22
24
  end
23
25
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Emotion
2
4
  module Picker
3
5
  # DAO class for representing an emotion
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Emotion
2
4
  module Picker
3
- VERSION = '0.2.0'.freeze
5
+ VERSION = '0.3.0'
4
6
  end
5
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emotion-picker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Birmingham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-31 00:00:00.000000000 Z
11
+ date: 2019-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nice-sigint
@@ -99,7 +99,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  - !ruby/object:Gem::Version
100
100
  version: '0'
101
101
  requirements: []
102
- rubygems_version: 3.0.3
102
+ rubyforge_project:
103
+ rubygems_version: 2.2.5
103
104
  signing_key:
104
105
  specification_version: 4
105
106
  summary: Emotion Picker