cw_card_utils 0.1.12 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c4c153971824b05a57199518aa8143b81eb2b5d827484ad2a864d93423581cf
4
- data.tar.gz: 753fb053d7348cac6b4b65dec309a95f94c98cf4340cc71a00380bf0ea650f02
3
+ metadata.gz: 906b2d48d1b46bac9ddae4395dde482acda9017854a8f43a88b554421bc34da5
4
+ data.tar.gz: de6f89e9b88dc62552f3ad39253ba40522cfceacf78718aa301c30e71598b25e
5
5
  SHA512:
6
- metadata.gz: 2a99b206d6a6abd73a1118016d71979ead2205712da4c57eb1251a43c03d425a880fd6ff63068469cf1926a2c6b4dec1f8e6f95dc13675cc144de1a528723935
7
- data.tar.gz: 97f303620f866c092048ffa473547e0e70ef610453b08194fc7bf30b732bd78ab043bf43118b53856e31fb5a0ccb5d1ef7e966a6f0b6d4b67777ffeee308e507
6
+ metadata.gz: f4c05be5fede670c4dbaaf06a1813db002366dda8e81ff462452fe8252207f7b790ecf22e86bb93b056304f7680886cceff58a83d90ea6cd0a76791bcc8be6a3
7
+ data.tar.gz: f5da3ba07dc6df50857dada5a27760012d7ecdc344c7be49aafddafcae1564997f1530fab99d018cf3e552d273ba02efa62269a16dfecdecad33cbeb1f1f8d84
data/README.md CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  A Ruby gem for analyzing Magic: The Gathering decklists and calculating various metrics.
4
4
 
5
+ > Note: A new preferred namespace is available: `CracklingWit::CardUtils`.
6
+ > The legacy `CwCardUtils` namespace remains for backward compatibility and will be softly deprecated.
7
+ >
8
+ > New usage (preferred):
9
+ >
10
+ > ```ruby
11
+ > require "crackling_wit/card_utils"
12
+ > a = CracklingWit::CardUtils::DecklistParser::Parser.new(decklist_a).parse
13
+ > b = CracklingWit::CardUtils::DecklistParser::Parser.new(decklist_b).parse
14
+ > cmp = CracklingWit::CardUtils::DeckComparator.new(a, b)
15
+ > ```
16
+ >
17
+ > Legacy usage (still supported):
18
+ >
19
+ > ```ruby
20
+ > require "cw_card_utils"
21
+ > a = CwCardUtils::DecklistParser::Parser.new(decklist_a).parse
22
+ > ```
23
+
5
24
  ## Features
6
25
 
7
26
  - Parse decklists (MTGA/MTGO/Moxfield) into a rich `Deck` model
@@ -65,18 +84,36 @@ cmp = CwCardUtils::DeckComparator.new(a, b)
65
84
  pp cmp.compare[:on_play] # => win_rate_a, favored, notes, etc.
66
85
  ```
67
86
 
87
+ New namespace quickstart:
88
+
89
+ ```ruby
90
+ require "crackling_wit/card_utils"
91
+
92
+ a = CracklingWit::CardUtils::DecklistParser::Parser.new(decklist_a).parse
93
+ b = CracklingWit::CardUtils::DecklistParser::Parser.new(decklist_b).parse
94
+
95
+ cmp = CracklingWit::CardUtils::DeckComparator.new(a, b)
96
+ pp cmp.compare[:on_play]
97
+ ```
98
+
68
99
  ## Configuration
69
100
 
70
101
  You can configure the card data source used by the library:
71
102
 
72
103
  ```ruby
73
- # In a Rails initializer (config/initializers/cw_card_utils.rb)
104
+ # Legacy namespace
74
105
  CwCardUtils.configure do |config|
75
106
  config.card_data_source = MyCustomDataSource.new
76
107
  end
77
108
 
109
+ # New namespace (delegates to the same config under the hood)
110
+ CracklingWit::CardUtils.configure do |config|
111
+ config.card_data_source = MyCustomDataSource.new
112
+ end
113
+
78
114
  # Or set it directly
79
115
  CwCardUtils.card_data_source = MyCustomDataSource.new
116
+ CracklingWit::CardUtils.card_data_source = MyCustomDataSource.new
80
117
  ```
81
118
 
82
119
  The default data source is `CwCardUtils::ScryfallCmcData.instance`, which loads card data from a local JSON file.