work_together 0.9.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/work_together.rb +10 -0
- data/lib/work_together/pair_maker.rb +14 -0
- data/lib/work_together/table.rb +6 -0
- data/lib/work_together/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71e855c6dadb23628458dac49ec95f41803a640e
|
4
|
+
data.tar.gz: a4b1f6b52c818a301d26468ddd85d72e39da28bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46c836e0bbdfb0bd608c4e77b5abaad33d18152a7c9e885188a24d54a9d256a9b21b47aa5413873e3a92478250ee0a4396781e1be21800c78b605a2f24794991
|
7
|
+
data.tar.gz: 1f4396c294818b31c3e6da4da3f9bc44514b50cb0d165e08f87e98f428c94baf081be771df9c37471a1d8d21ab6a5e65e1ccb38d8f02e59d52235e3532f82891
|
data/lib/work_together.rb
CHANGED
@@ -40,6 +40,8 @@ module WorkTogether
|
|
40
40
|
pair_maker.public_send("make_pairs_#{flag}", students)
|
41
41
|
elsif options.include?("tables")
|
42
42
|
pair_maker.public_send("make_tables_#{flag}", students)
|
43
|
+
elsif options.include?("groups")
|
44
|
+
pair_maker.public_send("make_groups", flag, students)
|
43
45
|
elsif options.include?("--help")
|
44
46
|
help
|
45
47
|
else
|
@@ -96,6 +98,14 @@ module WorkTogether
|
|
96
98
|
Table.all
|
97
99
|
end
|
98
100
|
|
101
|
+
def self.all_students
|
102
|
+
self.all.map do |group|
|
103
|
+
group.students.map do |student|
|
104
|
+
student
|
105
|
+
end
|
106
|
+
end.flatten
|
107
|
+
end
|
108
|
+
|
99
109
|
def self.display_groups
|
100
110
|
Table.all.each_with_index do |table, i|
|
101
111
|
puts "Group #{i + 1}:".colorize(:blue)
|
@@ -48,6 +48,20 @@ class PairMaker
|
|
48
48
|
mindful_batch_of_four(two_groups_of_four)
|
49
49
|
end
|
50
50
|
|
51
|
+
def make_groups(num_of_groups, students)
|
52
|
+
num_of_groups = students.length/num_of_groups.to_i
|
53
|
+
# binding.pry
|
54
|
+
students.each_slice(num_of_groups).each do |slice|
|
55
|
+
# binding.pry
|
56
|
+
if slice.length == 1
|
57
|
+
Table.all.last.students << slice.first
|
58
|
+
else
|
59
|
+
Table.new(slice)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
# binding.pry
|
63
|
+
end
|
64
|
+
|
51
65
|
private
|
52
66
|
|
53
67
|
def randomize_students(students)
|
data/lib/work_together/table.rb
CHANGED