runeterra_cards 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 143a6e1907badc2fc066202446fa5106a8ddfda903e195b4fadd2a8c45fcc824
4
- data.tar.gz: '0669ded1c45362335feddb5f5f8846407f61a85a04a458877fb728ace2a99cc1'
3
+ metadata.gz: 4b69727cd16ea8ffd2f32512a4a24182986f5e034697df5e2c65c263d6cb5de3
4
+ data.tar.gz: 23788bbbb28132316e2196bccbeb963cc275cba06c58f4e7b65611e1ab2f85be
5
5
  SHA512:
6
- metadata.gz: 88a8a01c7a0971da6c084210bbd0b5121add3faf6dd5b28ac12c1235ad5023adeda8729af3fe8b96479a895aab48769a87b81dddabe9d662cc15514cf003ebe6
7
- data.tar.gz: 289070859e22694e9014fad41b6fce31a867489541080644c4a98adee6fa87afa653a08ea68cdbe536af3fe3a9875386b508e0f73d0b1301f98152cf3d5203fd
6
+ metadata.gz: bb9a9cb799052f642e211e039473be974e58dd818acdafda4cf0595544929d73368a5bcc213d020f4d31124d50b08379436dbd8ccc0ce22e15cc95ef2aabe4a3
7
+ data.tar.gz: 135faf1d286264dc9a888b97a301be51c57301ca02be62f5b97998d23ac69c3cc5b4a748c216145dd05c047e26b756d49bc727a75e0477cf52565da9bf01ce47
data/doc/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.6.0] - 2021-08-25
8
+ ### Added
9
+ - Support for the Bandle City faction.
10
+ - Support for version 4 deck codes.
11
+
7
12
  ## [0.5.0] - 2021-03-05
8
13
  ### Added
9
14
  - Support for the Shurima faction.
data/doc/README.md CHANGED
@@ -9,13 +9,13 @@ This library makes it easy to decode Legends of Runeterra deck codes, load Data
9
9
  Add the following to your `Gemfile`:
10
10
 
11
11
  ```
12
- gem 'runeterra_cards', '~> 0.5.0'
12
+ gem 'runeterra_cards', '~> 0.6.0'
13
13
  ```
14
14
 
15
15
  Or, if you're building a Gem, your `.gemspec`:
16
16
 
17
17
  ```
18
- spec.add_dependency 'runeterra_cards', '~> 0.5.0'
18
+ spec.add_dependency 'runeterra_cards', '~> 0.6.0'
19
19
  ```
20
20
 
21
21
  ## Updates & Versioning
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RuneterraCards
4
- # Represents a card
5
- # @deprecated
4
+ # Represents a card.
5
+ #
6
+ # @todo: add getters for set, faction, card number
6
7
  class Card
7
8
  # The card code, for example "01DE123"
8
9
  # @return [String]
@@ -24,12 +25,19 @@ module RuneterraCards
24
25
  end
25
26
  end
26
27
 
27
- #:nodoc:
28
+ # Returns +true+ if _this_ and _other_ both have the same card code.
29
+ #
30
+ # @param other [Card]
31
+ # @return [Boolean]
28
32
  def eql?(other)
29
33
  code.eql?(other.code)
30
34
  end
31
35
 
32
- #:nodoc:
36
+ # Compute a hash code for this card. Two cards with the same card code will have the same hash code (and will
37
+ # compare using {#eql?}).
38
+ #
39
+ # @see Object#hash.
40
+ # @return [Integer]
33
41
  def hash
34
42
  code.hash
35
43
  end
@@ -6,6 +6,7 @@ module RuneterraCards
6
6
  # Represents a collection of cards.
7
7
  #
8
8
  # @todo The API to this class is very unstable and will change a lot in a coming release.
9
+ # @todo add #== !
9
10
  class CardSet
10
11
  # Extract this bitmask so Mutant can't see it, until this fix is released https://github.com/mbj/mutant/pull/1218
11
12
  HIGH_BIT = 0b1000_0000
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # @todo could be more obvious what's wrong when you call == on the wrong class e.g. a number
3
4
  module RuneterraCards
4
5
  # Represents the cost of a {CardSet}, as wildcards or shards.
5
6
  # To get the cost of a {CardSet} you need to call {Metadata#cost_of}, as rarity (and therefore cost) is a property
@@ -15,6 +15,7 @@ module RuneterraCards
15
15
  6 => 'BW',
16
16
  7 => 'SH',
17
17
  9 => 'MT',
18
+ 10 => 'BC',
18
19
  }.freeze
19
20
  public_constant :FACTION_IDENTIFIERS_FROM_INT
20
21
 
@@ -32,6 +33,7 @@ module RuneterraCards
32
33
  'BW' => 6,
33
34
  'SH' => 7,
34
35
  'MT' => 9,
36
+ 'BC' => 10,
35
37
  }.freeze
36
38
  public_constant :FACTION_INTS_FROM_IDENTIFIER
37
39
  end
@@ -33,7 +33,7 @@ module RuneterraCards
33
33
  data = JSON.parse(file)
34
34
  data.each do |card_data|
35
35
  card = CardMetadata.new(card_data)
36
- @cards[card.card_code] = card
36
+ @cards[card.card_code] = card # TODO: warn or error if there are duplicate card codes!
37
37
  end
38
38
  end
39
39
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuneterraCards
4
4
  # The version of this library
5
- VERSION = '0.5.0'
5
+ VERSION = '0.6.0'
6
6
  public_constant :VERSION
7
7
  end
@@ -16,6 +16,6 @@ require 'runeterra_cards/cost'
16
16
  # You might also want to check out the {file:doc/README.md} and the {file:doc/CHANGELOG.md}.
17
17
  module RuneterraCards
18
18
  # The version of deck encoding supported
19
- SUPPORTED_VERSION = 3
19
+ SUPPORTED_VERSION = 4
20
20
  public_constant :SUPPORTED_VERSION
21
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runeterra_cards
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James "zofrex" Sanderson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-05 00:00:00.000000000 Z
11
+ date: 2021-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base32
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: 13.0.1
125
+ - !ruby/object:Gem::Dependency
126
+ name: redcarpet
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 3.5.1
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 3.5.1
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: rubocop
127
141
  requirement: !ruby/object:Gem::Requirement