deck-of-cards 0.0.3 → 0.0.4

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.
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - ruby-head
5
+ - jruby-head
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
1
  # Deck of Cards
2
+ [![Build Status](https://secure.travis-ci.org/Havenwood/deck-of-cards.png?branch=master)](http://travis-ci.org/Havenwood/deck-of-cards)
3
+ [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/Havenwood/deck-of-cards)
2
4
 
3
5
  ## Installation
4
6
 
@@ -18,4 +18,6 @@ Gem::Specification.new do |s|
18
18
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
+
22
+ s.add_development_dependency 'rake'
21
23
  end
@@ -1,18 +1,4 @@
1
- class Card
2
- attr_reader :rank, :suit
3
-
4
- def initialize rank, suit
5
- @rank, @suit = rank, suit
6
- end
7
-
8
- def inspect
9
- "#<#{@rank} of #{@suit}>"
10
- end
11
-
12
- def to_s
13
- "#{@rank} of #{@suit}"
14
- end
15
-
1
+ Card = Struct.new :rank, :suit do
16
2
  include Comparable
17
3
 
18
4
  def <=> other_card
@@ -20,7 +6,7 @@ class Card
20
6
  end
21
7
 
22
8
  def value
23
- case @rank
9
+ case rank
24
10
  when 'Ace'
25
11
  14
26
12
  when 'King'
@@ -30,7 +16,11 @@ class Card
30
16
  when 'Jack'
31
17
  11
32
18
  else
33
- @rank
19
+ rank
34
20
  end
35
21
  end
22
+
23
+ def to_s
24
+ "#{rank} of #{suit}"
25
+ end
36
26
  end
@@ -1,3 +1,3 @@
1
1
  class DeckOfCards
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deck-of-cards
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,23 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
  date: 2012-11-23 00:00:00.000000000 Z
13
- dependencies: []
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
14
30
  description: A minimalist 'deck of cards' Ruby gem.
15
31
  email:
16
32
  - shannonskipper@gmail.com
@@ -18,6 +34,7 @@ executables: []
18
34
  extensions: []
19
35
  extra_rdoc_files: []
20
36
  files:
37
+ - .travis.yml
21
38
  - Gemfile
22
39
  - Gemfile.lock
23
40
  - README.md