secret_santa_picker 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c28fc8d636bda7e25291799188ccfaa999c1e5bcd3d44c99b291dc5f1954d1c
4
- data.tar.gz: 5c878d5b45e1ef65e29cd73d848ffbba8f89f58b7ea193f639b55a40e81d68db
3
+ metadata.gz: f1166abb2c1e41a0ac85405871c4617504fe3fe18a45be7625a1eac1c0cfe808
4
+ data.tar.gz: bb4bfa1639d118f138d478ebd87a434cea8169e8dfdef2c8a238ef8e6b4658af
5
5
  SHA512:
6
- metadata.gz: e35764c00e62ec072805525852661651fb8b818c4b1ed8c9a4a8f68ac0f08e6914bfb679ef9cb5cab98d39a0b6a0173c94ac70fb4e666fe9ae963e52b1031c70
7
- data.tar.gz: 567b6d884b623409cc2142adec904a2f6229fd96dca37573f7bd349cb8e459e33fb2d0bf2ccdc248836be0f7b0e04bcad476e44adb2d24ad1612e84619831aa2
6
+ metadata.gz: 683484fe29f24977fb2991f90eefa3cb610649d1d49ce22dac54df64e7fd952e52580ac000ee029eb050a345e104af162da6479b809a813adb8327e253a4665c
7
+ data.tar.gz: c0af7ab08faf4db846cacc342baf5fefa8353875cdde6da8fe04c1a3737d60e10d21734814896af7a933f3a8a1d4312fce45ed114968ab9b8cf8af408135e6b6
@@ -50,6 +50,10 @@ module SecretSantaPicker
50
50
  exit 0
51
51
  end
52
52
 
53
+ o.on "-x", "--subject-prefix", "Prepend to the Subject line a little additional message" do |arg|
54
+ config.subject_prefix = arg
55
+ end
56
+
53
57
  o.banner = "secret_santa_picker <options>"
54
58
 
55
59
  o.on_tail "-h", "--help", "Show help" do
@@ -6,13 +6,14 @@ module SecretSantaPicker
6
6
  class Configuration
7
7
  include ConfigDefault
8
8
 
9
- attr_accessor :csv_file_path, :sender_email, :sender_password, :debug
9
+ attr_accessor :csv_file_path, :sender_email, :sender_password, :debug, :subject_prefix
10
10
 
11
11
  def initialize(&block)
12
12
  @csv_file_path = DefaultCSVFilePath
13
13
  @sender_email = ENV['SENDER_EMAIL']
14
14
  @sender_password = ENV['SENDER_PASSWORD']
15
15
  @debug = false
16
+ @subject_prefix = nil
16
17
 
17
18
  configure(&block) if block
18
19
  end
@@ -18,10 +18,12 @@ module SecretSantaPicker
18
18
 
19
19
  def send_mail(pair:)
20
20
  sender_email = @conf.sender_email
21
+
22
+ subject = [@conf.subject_prefix, "Secret Santa #{Date.today.strftime('%Y')}"].compact.join(" ")
21
23
  mail = Mail.new do
22
24
  from sender_email
23
25
  to pair.from.email
24
- subject "Cashin Family Secret Santa #{Date.today.strftime('%Y')}"
26
+ subject subject
25
27
  body "Hey #{pair.from.name},\n\nYou are the secret Santa for #{pair.to.name}.\n\nGood Luck!"
26
28
  end
27
29
 
@@ -1,3 +1,3 @@
1
1
  module SecretSantaPicker
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: secret_santa_picker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean