runeterra_cards 0.5.0 → 0.6.0
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/doc/CHANGELOG.md +5 -0
- data/doc/README.md +2 -2
- data/lib/runeterra_cards/card.rb +12 -4
- data/lib/runeterra_cards/card_set.rb +1 -0
- data/lib/runeterra_cards/cost.rb +1 -0
- data/lib/runeterra_cards/factions.rb +2 -0
- data/lib/runeterra_cards/metadata.rb +1 -1
- data/lib/runeterra_cards/version.rb +1 -1
- data/lib/runeterra_cards.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b69727cd16ea8ffd2f32512a4a24182986f5e034697df5e2c65c263d6cb5de3
|
4
|
+
data.tar.gz: 23788bbbb28132316e2196bccbeb963cc275cba06c58f4e7b65611e1ab2f85be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
18
|
+
spec.add_dependency 'runeterra_cards', '~> 0.6.0'
|
19
19
|
```
|
20
20
|
|
21
21
|
## Updates & Versioning
|
data/lib/runeterra_cards/card.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module RuneterraCards
|
4
|
-
# Represents a card
|
5
|
-
#
|
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
|
-
|
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
|
-
|
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
|
data/lib/runeterra_cards/cost.rb
CHANGED
@@ -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
|
data/lib/runeterra_cards.rb
CHANGED
@@ -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 =
|
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.
|
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-
|
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
|