99_game 1.2.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{LICENSE → LICENSE.txt} +2 -2
- data/README.md +8 -1
- data/bin/99_game +11 -0
- data/lib/99_game.rb +2 -2
- data/spec/99spec.rb +9 -8
- data/spec/spec_helper.rb +2 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c96962a69d0a4bfd4d474e5c6c3d2e1dffa71d07
|
4
|
+
data.tar.gz: 71398ed0684f61ecf2a11a0c8fb3981efe15bc43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fca2b490828686ae8384fb41906c2929a85365907fff34a1ae1afb07c8585c9b18bc6f55128d17cca3b239fd592efb5f0e29e9be29c8d793f35ee077a75b6e4c
|
7
|
+
data.tar.gz: 41aec9e1313c39ad65f643d89a0fd4cb271a0ecb41aff93605168406a178ecbea2d81fb03f748894989967498294aa0cf24cfd1b9723a25f818c919d106a0495
|
data/{LICENSE → LICENSE.txt}
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2014 Zachary Perlmutter
|
3
|
+
Copyright (c) {{{2014}}} {{{Zachary Roth Perlmutter}}}
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/99_game.png)](http://badge.fury.io/rb/99_game)
|
2
|
+
[![Coverage Status](https://img.shields.io/coveralls/Zrp200/99_game.svg)](https://coveralls.io/r/Zrp200/99_game)
|
3
|
+
[![Code Climate](https://codeclimate.com/github/Zrp200/99_game.png)](https://codeclimate.com/github/Zrp200/99_game)
|
4
|
+
[![Dependency Status](https://gemnasium.com/Zrp200/99_game.svg)](https://gemnasium.com/Zrp200/99_game)
|
5
|
+
[![Inline docs](http://inch-ci.org/github/Zrp200/99_game.png?branch=master)](http://inch-ci.org/github/Zrp200/99_game)
|
1
6
|
99_game
|
2
7
|
=======
|
3
8
|
|
4
|
-
|
9
|
+
To install: `gem install 99_game`
|
10
|
+
|
11
|
+
For the rules and arguments: `gem '99_game'`
|
data/bin/99_game
CHANGED
@@ -2,10 +2,21 @@
|
|
2
2
|
require '99_game'
|
3
3
|
BEGIN { # Looks at its arguements
|
4
4
|
ARGV[0] = "-h" if ARGV[0] == "--help"
|
5
|
+
ARGV[0] = "-v" if ARGV[0] == "--version"
|
5
6
|
case ARGV[0]
|
7
|
+
when "-v"
|
8
|
+
puts "1.3.0"
|
9
|
+
exit
|
6
10
|
when "-h"
|
7
11
|
puts "\u00B7 Commands"
|
12
|
+
puts "\t\u00b7 -v/--version - display version
|
8
13
|
puts "\t\u00B7 -h/--help - shows this message\n"
|
14
|
+
puts "\u00B7 Abbrevations"
|
15
|
+
puts "\t\u00B7 J -> Jack"
|
16
|
+
puts "\t\u00b7 Q -> Queen"
|
17
|
+
puts "\t\u00b7 K -> King"
|
18
|
+
puts "\t\u00b7 A -> Ace"
|
19
|
+
puts "\t\u00b7 $ -> Joker"
|
9
20
|
puts "\u00B7 Gameplay"
|
10
21
|
puts "\t\u00B7 Your goal is to get your opponent to bring the value over 99 by playing 1 of your 3 cards."
|
11
22
|
puts "\t\u00B7 A card will usually increase the value by itself, but there are a few exceptions:"
|
data/lib/99_game.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Tests if obj is not nil.
|
2
2
|
def not_nil?(obj)
|
3
|
-
if obj.nil
|
3
|
+
if obj.nil?
|
4
4
|
return false
|
5
5
|
else
|
6
6
|
return true
|
@@ -13,7 +13,7 @@ def converter(input)
|
|
13
13
|
return input.to_i
|
14
14
|
elsif not_nil? abbrev[input.capitalize.to_sym]
|
15
15
|
return abbrev[input.capitalize.to_sym]
|
16
|
-
elsif input.nil || input == String.new
|
16
|
+
elsif input.nil? || input == String.new
|
17
17
|
raise CardError, "Input not allowed"
|
18
18
|
else
|
19
19
|
return input.capitalize
|
data/spec/99spec.rb
CHANGED
@@ -17,14 +17,15 @@ describe "Card" do
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
20
|
-
describe "
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
20
|
+
describe "converter" do
|
21
|
+
context "when a number" do
|
22
|
+
it "should return the input as a number" do
|
23
|
+
expect(converter("5")).to eq 1
|
24
|
+
end
|
25
|
+
end
|
26
|
+
context "when an abbreveation" do
|
27
|
+
it "should expand it" do
|
28
|
+
expect(converter("k")).to eq "King"
|
28
29
|
end
|
29
30
|
end
|
30
31
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require "codeclimate-test-reporter"
|
2
|
+
CodeClimate::TestReporter.start
|
1
3
|
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
4
|
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
5
|
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: 99_game
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zachary Perlmutter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
|
-
This is a text-based interpretation of the card game 99. Comes with the gem in the form of an executable.
|
14
|
+
This is a text-based interpretation of the card game 99. Comes with the gem in the form of an executable. Make sure to read the rules in `99_game -h` before playing
|
15
15
|
email: zrp200@gmail.com
|
16
16
|
executables:
|
17
17
|
- 99_game
|
18
18
|
extensions: []
|
19
19
|
extra_rdoc_files:
|
20
20
|
- README.md
|
21
|
-
- LICENSE
|
21
|
+
- LICENSE.txt
|
22
22
|
files:
|
23
23
|
- ".rspec"
|
24
|
-
- LICENSE
|
24
|
+
- LICENSE.txt
|
25
25
|
- README.md
|
26
26
|
- bin/99_game
|
27
27
|
- lib/99_game.rb
|
@@ -31,7 +31,7 @@ homepage: https://rubygems.org/gems/99_game
|
|
31
31
|
licenses:
|
32
32
|
- MIT
|
33
33
|
metadata:
|
34
|
-
|
34
|
+
Recommended Ruby Version: "~> 2.0.0"
|
35
35
|
post_install_message:
|
36
36
|
rdoc_options: []
|
37
37
|
require_paths:
|
@@ -40,7 +40,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version:
|
43
|
+
version: 1.8.0
|
44
44
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - ">="
|