pairing_shuffler 0.0.3 → 0.0.4

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.
@@ -1,3 +1,3 @@
1
1
  module PairingShuffler
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -8,6 +8,8 @@ module PairingShuffler
8
8
  end
9
9
 
10
10
  class Shuffler
11
+ DAY = 24 * 60 * 60
12
+
11
13
  def initialize(config)
12
14
  @config = config
13
15
  end
@@ -36,9 +38,16 @@ module PairingShuffler
36
38
  end
37
39
 
38
40
  def list
39
- emails = content[2..-1].map(&:first)
41
+ emails = content.select { |row| row.first.include?("@") && present?(row) }.map(&:first)
40
42
  emails.sort_by{ rand }.each_slice(2).to_a.reject { |group| group.size == 1 }
41
43
  end
44
+
45
+ def present?(row)
46
+ away_until = content.map { |row| row.index("Away until") }.compact.first
47
+ !away_until ||
48
+ row[away_until].to_s.strip.empty? ||
49
+ Time.parse(row[away_until]) + DAY < Time.now
50
+ end
42
51
  end
43
52
 
44
53
  class Mailer
@@ -70,6 +79,7 @@ module PairingShuffler
70
79
  - Talk out loud & explain: what are you thinking / what are you going to do
71
80
  - Avoid keyboard fights: use 2 keyboards + 2 mice
72
81
  - Ping pong with tests: A writes tests, B writes implementation
82
+ - Invite others to sign up for pairing
73
83
 
74
84
  Greetings,
75
85
  PairingShuffler
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pairing_shuffler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -36,7 +36,7 @@ cert_chain:
36
36
  VHNmKzZNYWVud0FNa0FnSGRzd0dzSnp0T25ObkJhM0YKeTBrQ1NXbUs2RCt4
37
37
  L1NiZlM2cjdLZTA3TVJxemlKZEI5R3VFMSswY0lSdUZoOEVRK0xONkhYQ0tN
38
38
  NXBvbi9HVQp5Y3dNWGZsMAotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
39
- date: 2013-05-25 00:00:00.000000000 Z
39
+ date: 2013-06-04 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: google_drive
@@ -77,7 +77,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
77
77
  version: '0'
78
78
  segments:
79
79
  - 0
80
- hash: -2199579545543132747
80
+ hash: 1899055636196311541
81
81
  required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  none: false
83
83
  requirements:
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  version: '0'
87
87
  segments:
88
88
  - 0
89
- hash: -2199579545543132747
89
+ hash: 1899055636196311541
90
90
  requirements: []
91
91
  rubyforge_project:
92
92
  rubygems_version: 1.8.25
metadata.gz.sig CHANGED
Binary file