ittf_points 0.1.0 → 0.1.1
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 +4 -4
- data/README.md +4 -0
- data/exe/ittf_points +3 -1
- data/ittf_points.gemspec +1 -0
- data/lib/ittf_points/cli.rb +20 -0
- data/lib/ittf_points/version.rb +1 -1
- data/lib/ittf_points.rb +1 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34cd41e76d9704e52cc256e6a7ccf6ec40592650
|
4
|
+
data.tar.gz: 9d23f0e90987fad46dcc37a6e623f44c255f8140
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 963436b10f1398e308698c604df4fda9280be8746d084fe3d34c3807becd9d5ddcf039d869670877e5e26519dc172e03013947ac0b3febfcfc6eaf580287ea83
|
7
|
+
data.tar.gz: deda73744c09d33e16d178faeeff493d4793f7689d3de3d3652e962ec0c4ee58a7653294cd75dbff9605fc7211751b06f2af75e142e15affe0cf3d86cae43812
|
data/README.md
CHANGED
@@ -32,6 +32,10 @@ p1.win([2122, 1471, 2621]).lose(2788)
|
|
32
32
|
puts p1.new_rating_points
|
33
33
|
```
|
34
34
|
|
35
|
+
### CLI
|
36
|
+
|
37
|
+
$ ittf_points player 2731 --win 2122 1471 2621 --lose 2788
|
38
|
+
|
35
39
|
## Contributing
|
36
40
|
|
37
41
|
Bug reports and pull requests are welcome on GitHub at https://github.com/hachy/ittf_points.
|
data/exe/ittf_points
CHANGED
data/ittf_points.gemspec
CHANGED
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
+
spec.add_dependency 'thor'
|
21
22
|
spec.add_development_dependency 'bundler', '~> 1.10'
|
22
23
|
spec.add_development_dependency 'rake', '~> 10.0'
|
23
24
|
spec.add_development_dependency 'rspec'
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'thor'
|
2
|
+
|
3
|
+
module IttfPoints
|
4
|
+
class CLI < Thor
|
5
|
+
desc 'player RATING_POINTS', 'Show new rating points'
|
6
|
+
method_option :win, aliases: '-w', type: :array
|
7
|
+
method_option :lose, aliases: '-l', type: :array
|
8
|
+
def player(points, weight = :W2)
|
9
|
+
player = Player.new(rating_points: points, weight: weight)
|
10
|
+
if options[:win]
|
11
|
+
player.win(options[:win])
|
12
|
+
end
|
13
|
+
if options[:lose]
|
14
|
+
player.lose(options[:lose])
|
15
|
+
end
|
16
|
+
puts "New Added Rating Points: #{player.new_added_rating_points}"
|
17
|
+
puts "New Rating Points: #{player.new_rating_points}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/ittf_points/version.rb
CHANGED
data/lib/ittf_points.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ittf_points
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hachy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,6 +86,7 @@ files:
|
|
72
86
|
- exe/ittf_points
|
73
87
|
- ittf_points.gemspec
|
74
88
|
- lib/ittf_points.rb
|
89
|
+
- lib/ittf_points/cli.rb
|
75
90
|
- lib/ittf_points/player.rb
|
76
91
|
- lib/ittf_points/r.rb
|
77
92
|
- lib/ittf_points/version.rb
|