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.
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Public: New preferred namespace entrypoint.
4
+ # Usage:
5
+ # require "crackling_wit/card_utils"
6
+ # CracklingWit::CardUtils::DeckComparator.new(...)
7
+ #
8
+ # This file aliases the existing implementation under the new namespace
9
+ # to provide a zero-churn migration path. All classes/modules remain
10
+ # implemented in CwCardUtils and are re-exported here.
11
+
12
+ require_relative "../cw_card_utils"
13
+
14
+ module CracklingWit
15
+ module CardUtils
16
+ # Delegate configuration to the legacy module
17
+ class << self
18
+ def card_data_source=(source)
19
+ ::CwCardUtils.card_data_source = source
20
+ end
21
+
22
+ def card_data_source
23
+ ::CwCardUtils.card_data_source
24
+ end
25
+
26
+ def configure(&block)
27
+ ::CwCardUtils.configure(&block)
28
+ end
29
+ end
30
+
31
+ # Re-export legacy constants under the new namespace
32
+ Error = ::CwCardUtils::Error
33
+ CardDataSource = ::CwCardUtils::CardDataSource
34
+ CurveCalculator = ::CwCardUtils::CurveCalculator
35
+ DecklistParser = ::CwCardUtils::DecklistParser
36
+ ScryfallCmcData = ::CwCardUtils::ScryfallCmcData
37
+ SynergyProbability = ::CwCardUtils::SynergyProbability
38
+ DeckComparator = ::CwCardUtils::DeckComparator
39
+ VERSION = ::CwCardUtils::VERSION
40
+ end
41
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Top-level namespace for CracklingWit gems
4
+ module CracklingWit
5
+ end
@@ -8,5 +8,5 @@ module CwCardUtils
8
8
  # 日本語: 現在のバージョン文字列です。
9
9
  #
10
10
  # @return [String]
11
- VERSION = "0.1.12"
11
+ VERSION = "0.2.1"
12
12
  end
data/lib/cw_card_utils.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # require_relative "crackling_wit/card_utils"
4
+
3
5
  require_relative "cw_card_utils/version"
4
6
  require_relative "cw_card_utils/curve_calculator"
5
7
  require_relative "cw_card_utils/decklist_parser"
@@ -16,6 +18,20 @@ module CwCardUtils
16
18
  # 日本語: このライブラリ用の基本的なエラークラスです。
17
19
  class Error < StandardError; end
18
20
 
21
+ # NOTE: Soft deprecation bridge to the new namespace
22
+ # Users can migrate to `CracklingWit::CardUtils`. All functionality remains.
23
+ module Bridge
24
+ module_function
25
+
26
+ def warn_once
27
+ return if @warned
28
+ @warned = true
29
+ warn("[cw_card_utils] DEPRECATION: Use `CracklingWit::CardUtils` instead of `CwCardUtils`. The old namespace will be removed in a future major release.")
30
+ rescue StandardError
31
+ # no-op in environments where warn is suppressed
32
+ end
33
+ end
34
+
19
35
  # Public: Configuration for the library.
20
36
  # 日本語: ライブラリの設定を行います。
21
37
  class << self
@@ -39,6 +55,7 @@ module CwCardUtils
39
55
  # @yield [CwCardUtils]
40
56
  # @return [void]
41
57
  def configure
58
+ Bridge.warn_once
42
59
  yield self if block_given?
43
60
  end
44
61
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cw_card_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Stenhouse
@@ -36,6 +36,8 @@ files:
36
36
  - README.md
37
37
  - Rakefile
38
38
  - data/scryfall.cards.cmc.json
39
+ - lib/crackling_wit.rb
40
+ - lib/crackling_wit/card_utils.rb
39
41
  - lib/cw_card_utils.rb
40
42
  - lib/cw_card_utils/curve_calculator.rb
41
43
  - lib/cw_card_utils/deck_comparator.rb