auto_draft 0.0.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 +7 -0
- data/lib/auto_draft.rb +32 -0
- metadata +45 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 926e76b29cebe10c75d453068c644ce2f5935b14
|
4
|
+
data.tar.gz: 68f24e4293b186c6e67e0a6fbd023f429e9e58d9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: dc27847b605befc8153b2d83ccc25d1973b24f78f45719522a389a558796958eef6450864a2d577ec980f63b026a840a65682fa92e88b0563f24c1ea1233ca4f
|
7
|
+
data.tar.gz: 776c60cde069e1159f537039666f9e1f4439a8b1a21902cfc4e29c159c67c9321fc53b9b39809d593f537adb2a0ab42de25c64c5cc3decc8c6741dd61591ca46
|
data/lib/auto_draft.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
module TeamPairing
|
2
|
+
class GroupCreator
|
3
|
+
|
4
|
+
def openfile (filename)
|
5
|
+
f = File.open(filename,'r:UTF-8')
|
6
|
+
text = f.read
|
7
|
+
f.close
|
8
|
+
return text.tr("'@1234567890","").split("\n")
|
9
|
+
end
|
10
|
+
|
11
|
+
def write_to_file(filename, content)
|
12
|
+
f = File.open(filename, 'w:UTF-8')
|
13
|
+
f.write(content)
|
14
|
+
f.close
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
def form_teams(filename, number)
|
19
|
+
h = []
|
20
|
+
count = 1
|
21
|
+
teams = openfile(filename)
|
22
|
+
teams.sample(teams.length).each_slice(number.to_i) do |group_members|
|
23
|
+
result = ("Group #{count}\n#{group_members.join(", ")}\n")
|
24
|
+
h.push(result)
|
25
|
+
count += 1
|
26
|
+
end
|
27
|
+
return write_to_file("team_of_#{number}_#{filename}", h.join("\n"))
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
|
metadata
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: auto_draft
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Charles Agyemang
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-11-12 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: A gem that created groups out of a list
|
14
|
+
email:
|
15
|
+
- micnkru@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- lib/auto_draft.rb
|
21
|
+
homepage: http://rubygems.org/gems/auto_draft
|
22
|
+
licenses:
|
23
|
+
- MIT
|
24
|
+
metadata: {}
|
25
|
+
post_install_message:
|
26
|
+
rdoc_options: []
|
27
|
+
require_paths:
|
28
|
+
- lib
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
requirements: []
|
40
|
+
rubyforge_project:
|
41
|
+
rubygems_version: 2.6.8
|
42
|
+
signing_key:
|
43
|
+
specification_version: 4
|
44
|
+
summary: Auto Draft Gem
|
45
|
+
test_files: []
|