viking-pairity 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.byebug_history +179 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +4 -0
- data/Guardfile +70 -0
- data/LICENSE.txt +21 -0
- data/README.md +52 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/pairity +11 -0
- data/lib/pairity.rb +15 -0
- data/lib/pairity/adjacency_matrix.rb +142 -0
- data/lib/pairity/cli.rb +336 -0
- data/lib/pairity/config.rb +69 -0
- data/lib/pairity/edge.rb +17 -0
- data/lib/pairity/google_sync.rb +174 -0
- data/lib/pairity/pair_generator.rb +79 -0
- data/lib/pairity/pair_saver.rb +20 -0
- data/lib/pairity/pair_stats.rb +12 -0
- data/lib/pairity/person.rb +22 -0
- data/lib/pairity/slackbot.rb +28 -0
- data/lib/pairity/version.rb +3 -0
- data/pairity.gemspec +45 -0
- data/tags +121 -0
- data/test.rb +11 -0
- data/todays_pairs.txt +7 -0
- metadata +271 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6add9806fa86f468a9dc0d5e46458bee9d610b2b
|
4
|
+
data.tar.gz: 634ec149a79a9736a7375bf01cb53242df6d3abb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 17933debe3a1fea48656ffadab68619f2d76b850fd8906271c54e5762fe8814e1c19d88da3705c20127ec0a13249c455b5821cf7853c8db2a00963bdf44d7e64
|
7
|
+
data.tar.gz: cdc1b5c33bbeba38722cac8092a4eca5c11ad0b9ae1222035c9df3f19c79ea7b9851d08112104c3a50ab209bddc4c9f156a5ec2df75ec8ed4b29707c136a3588
|
data/.byebug_history
ADDED
@@ -0,0 +1,179 @@
|
|
1
|
+
continue
|
2
|
+
pair
|
3
|
+
continue
|
4
|
+
next
|
5
|
+
remaining_people - pair
|
6
|
+
remaining_people
|
7
|
+
pair
|
8
|
+
continue
|
9
|
+
exit
|
10
|
+
pair
|
11
|
+
exit
|
12
|
+
pair
|
13
|
+
remaining_people
|
14
|
+
set
|
15
|
+
exit
|
16
|
+
others
|
17
|
+
person
|
18
|
+
others
|
19
|
+
person
|
20
|
+
people
|
21
|
+
others
|
22
|
+
exit
|
23
|
+
set
|
24
|
+
self.set
|
25
|
+
set
|
26
|
+
person
|
27
|
+
other
|
28
|
+
person
|
29
|
+
scores
|
30
|
+
exit
|
31
|
+
next
|
32
|
+
answer
|
33
|
+
next
|
34
|
+
answer
|
35
|
+
remaining_people
|
36
|
+
next
|
37
|
+
min[:person]
|
38
|
+
person
|
39
|
+
remaining_people
|
40
|
+
people
|
41
|
+
next
|
42
|
+
peers - pair
|
43
|
+
peers
|
44
|
+
pair
|
45
|
+
next
|
46
|
+
exit
|
47
|
+
continue
|
48
|
+
next
|
49
|
+
pair
|
50
|
+
next
|
51
|
+
pair
|
52
|
+
next
|
53
|
+
pair
|
54
|
+
next
|
55
|
+
pair
|
56
|
+
next
|
57
|
+
pair
|
58
|
+
next
|
59
|
+
netx
|
60
|
+
next
|
61
|
+
pair
|
62
|
+
next
|
63
|
+
peers
|
64
|
+
pair
|
65
|
+
continue
|
66
|
+
next
|
67
|
+
first
|
68
|
+
pairs
|
69
|
+
next
|
70
|
+
pairs
|
71
|
+
first
|
72
|
+
pair
|
73
|
+
pairs
|
74
|
+
next
|
75
|
+
nxt
|
76
|
+
next
|
77
|
+
pairs
|
78
|
+
next
|
79
|
+
pairs
|
80
|
+
pair
|
81
|
+
next
|
82
|
+
pairs
|
83
|
+
pair
|
84
|
+
next
|
85
|
+
pairs
|
86
|
+
pair
|
87
|
+
exit
|
88
|
+
continue
|
89
|
+
pair.sort
|
90
|
+
pair
|
91
|
+
continue
|
92
|
+
@matrix[pair.reverse]
|
93
|
+
pair
|
94
|
+
@matrix[pair.sort]
|
95
|
+
@matrix[pair]
|
96
|
+
pair
|
97
|
+
next
|
98
|
+
continue
|
99
|
+
next
|
100
|
+
continue
|
101
|
+
next
|
102
|
+
args
|
103
|
+
continue
|
104
|
+
args.sort
|
105
|
+
args
|
106
|
+
*args
|
107
|
+
continue
|
108
|
+
pair.sort
|
109
|
+
pair
|
110
|
+
pair.sort
|
111
|
+
@matrix
|
112
|
+
pair
|
113
|
+
exit
|
114
|
+
continue
|
115
|
+
ws.max_rows
|
116
|
+
ws
|
117
|
+
continue
|
118
|
+
@pairs
|
119
|
+
continue
|
120
|
+
pairs
|
121
|
+
next
|
122
|
+
exit
|
123
|
+
continue
|
124
|
+
pairs
|
125
|
+
next
|
126
|
+
pairs
|
127
|
+
continue
|
128
|
+
pair
|
129
|
+
pairs
|
130
|
+
next
|
131
|
+
pairs
|
132
|
+
pair[1]
|
133
|
+
pair[0]
|
134
|
+
pairs
|
135
|
+
pair
|
136
|
+
continue
|
137
|
+
pairs
|
138
|
+
pair
|
139
|
+
unpaired.combination(2).to_a
|
140
|
+
unpaired.combination(2)
|
141
|
+
pairs
|
142
|
+
unpaired
|
143
|
+
pair
|
144
|
+
next
|
145
|
+
@pairs
|
146
|
+
1
|
147
|
+
continue
|
148
|
+
@pairs
|
149
|
+
1
|
150
|
+
continue
|
151
|
+
next
|
152
|
+
continue
|
153
|
+
@pairs
|
154
|
+
@pairs[1], @pairs[-1] = @pairs[-1], @pairs[1]
|
155
|
+
@pairs.index(pair)
|
156
|
+
pair = @pairs.find { |pair| pair.any? { |person| person.name == "Han Solo" } }
|
157
|
+
@pairs
|
158
|
+
continue
|
159
|
+
p2
|
160
|
+
p1
|
161
|
+
p2
|
162
|
+
p1
|
163
|
+
@matrix
|
164
|
+
continue
|
165
|
+
help
|
166
|
+
back
|
167
|
+
p
|
168
|
+
n
|
169
|
+
next
|
170
|
+
@people
|
171
|
+
matrix
|
172
|
+
step
|
173
|
+
help
|
174
|
+
continue
|
175
|
+
next
|
176
|
+
person
|
177
|
+
matrix
|
178
|
+
pry
|
179
|
+
help
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at kitlangton@gmail.com. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
## Uncomment and set this to only include directories you want to watch
|
5
|
+
# directories %w(app lib config test spec features) \
|
6
|
+
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
7
|
+
|
8
|
+
## Note: if you are using the `directories` clause above and you are not
|
9
|
+
## watching the project directory ('.'), then you will want to move
|
10
|
+
## the Guardfile to a watched dir and symlink it back, e.g.
|
11
|
+
#
|
12
|
+
# $ mkdir config
|
13
|
+
# $ mv Guardfile config/
|
14
|
+
# $ ln -s config/Guardfile .
|
15
|
+
#
|
16
|
+
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
17
|
+
|
18
|
+
# Note: The cmd option is now required due to the increasing number of ways
|
19
|
+
# rspec may be run, below are examples of the most common uses.
|
20
|
+
# * bundler: 'bundle exec rspec'
|
21
|
+
# * bundler binstubs: 'bin/rspec'
|
22
|
+
# * spring: 'bin/rspec' (This will use spring if running and you have
|
23
|
+
# installed the spring binstubs per the docs)
|
24
|
+
# * zeus: 'zeus rspec' (requires the server to be started separately)
|
25
|
+
# * 'just' rspec: 'rspec'
|
26
|
+
|
27
|
+
guard :rspec, cmd: "bundle exec rspec" do
|
28
|
+
require "guard/rspec/dsl"
|
29
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
30
|
+
|
31
|
+
# Feel free to open issues for suggestions and improvements
|
32
|
+
|
33
|
+
# RSpec files
|
34
|
+
rspec = dsl.rspec
|
35
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
36
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
37
|
+
watch(rspec.spec_files)
|
38
|
+
|
39
|
+
# Ruby files
|
40
|
+
ruby = dsl.ruby
|
41
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
42
|
+
|
43
|
+
# Rails files
|
44
|
+
rails = dsl.rails(view_extensions: %w(erb haml slim))
|
45
|
+
dsl.watch_spec_files_for(rails.app_files)
|
46
|
+
dsl.watch_spec_files_for(rails.views)
|
47
|
+
|
48
|
+
watch(rails.controllers) do |m|
|
49
|
+
[
|
50
|
+
rspec.spec.("routing/#{m[1]}_routing"),
|
51
|
+
rspec.spec.("controllers/#{m[1]}_controller"),
|
52
|
+
rspec.spec.("acceptance/#{m[1]}")
|
53
|
+
]
|
54
|
+
end
|
55
|
+
|
56
|
+
# Rails config changes
|
57
|
+
watch(rails.spec_helper) { rspec.spec_dir }
|
58
|
+
watch(rails.routes) { "#{rspec.spec_dir}/routing" }
|
59
|
+
watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
|
60
|
+
|
61
|
+
# Capybara features specs
|
62
|
+
watch(rails.view_dirs) { |m| rspec.spec.("features/#{m[1]}") }
|
63
|
+
watch(rails.layouts) { |m| rspec.spec.("features/#{m[1]}") }
|
64
|
+
|
65
|
+
# Turnip features and steps
|
66
|
+
watch(%r{^spec/acceptance/(.+)\.feature$})
|
67
|
+
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
|
68
|
+
Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
|
69
|
+
end
|
70
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Kit Langton
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# Pairity
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
1. Clone this project.
|
6
|
+
2. `cd` into the `pairity` directory.
|
7
|
+
3. Run `rake install`.
|
8
|
+
4. Run `pairity`.
|
9
|
+
5. Follow the instructions to setup Google Sheets and Slack integrations.
|
10
|
+
6. Add people and then save your sheet (instructions below).
|
11
|
+
|
12
|
+
## Usage
|
13
|
+
|
14
|
+
### Generating Pairs
|
15
|
+
|
16
|
+
1. Select **Generate Pairs**
|
17
|
+
2. (Optional) Select **Nope a Pair**, if a you would like to regenerate the pairs without the selected pairing.
|
18
|
+
3. Select **Save & Slack** to save the pairings and post them to your slack channel.
|
19
|
+
|
20
|
+
### Adding People
|
21
|
+
|
22
|
+
1. Run `pairity` in the terminal.
|
23
|
+
2. Select **Edit People**.
|
24
|
+
3. Select **Add**.
|
25
|
+
4. Enter their names, separated by commas:
|
26
|
+
|
27
|
+
`Booba Khan, Fumbo Dango, Papa Trepé, Jane Smith`
|
28
|
+
|
29
|
+
5. Select **Save Changes**.
|
30
|
+
|
31
|
+
### Removing People
|
32
|
+
|
33
|
+
1. Run `pairity` in the terminal.
|
34
|
+
1. Select **Edit People**.
|
35
|
+
2. Select **Remove**.
|
36
|
+
3. Choose the person from the list.
|
37
|
+
4. Select **Save Changes**
|
38
|
+
|
39
|
+
## Development
|
40
|
+
|
41
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
42
|
+
|
43
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
44
|
+
|
45
|
+
## Contributing
|
46
|
+
|
47
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/pairity. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
48
|
+
|
49
|
+
## License
|
50
|
+
|
51
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
52
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "pairity"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|