pubid-core 1.6.0 → 1.6.1

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: b85bcef46a9327cb4c9ae474a84dea3b3986990082459b2f2bb37aa1c7578861
4
- data.tar.gz: b7caa4de8dd3ac5c9e9b0d9bed0f3690207f48b5ec6366d4515a2ab138ab5b92
3
+ metadata.gz: aabe12fe28f76fe076039f7892f88403b63c6e431a353e1f2b5db9ebf27ce591
4
+ data.tar.gz: a57eaa375a21548c73c75ea46a3579453be3ecf10144934e8978ec2070bdc0ab
5
5
  SHA512:
6
- metadata.gz: 70ab4b5c6c3393811c898e3d66dbb9c1f1f80b34a5f9337697748ef06a6ee5f3331828b731b776fedeb44379c7766dda901cca146e15ba62731b17258e7d7cb5
7
- data.tar.gz: 518912efd803e1ee6cef6d189fd618f4f52300109d057b35f9061437a199488b74c09cf2cafbb9622fe9a49c4e8fd7a0cea96e4e2861f53b6014e06277444c80
6
+ metadata.gz: 640c8a09c817ea315dce2c928dad5cb0de559edada389753579c2c353f22049b605fdf9920647dcc79ed407d53b29ae7db5938e93acf92cc0ee8bd836ce31b8c
7
+ data.tar.gz: 259c44ede6446b78474b5f8acdb9cc30e31f39530a0a9dce7136f591c964c15570b6411491d72f2b9a4df114f2e243eb78bb4314bab7f2e2ceb9e5d0a5af40f6
@@ -1,6 +1,10 @@
1
1
  module Pubid::Core
2
2
  class Configuration
3
- attr_accessor :stages, :default_type, :type_class, :types, :type_names
3
+ attr_accessor :stages, :default_type, :type_class, :types, :type_names, :stage_class
4
4
 
5
+ def initialize
6
+ @type_class = Pubid::Core::Type
7
+ @stage_class = Pubid::Core::Stage
8
+ end
5
9
  end
6
10
  end
@@ -44,15 +44,15 @@ module Pubid::Core
44
44
  end
45
45
 
46
46
  def build_stage(**args)
47
- Stage.new(config: @config, **args)
47
+ @config.stage_class.new(config: @config, **args)
48
48
  end
49
49
 
50
50
  def parse_stage(stage)
51
- Stage.parse(stage, config: @config)
51
+ @config.stage_class.parse(stage, config: @config)
52
52
  end
53
53
 
54
54
  def has_stage?(stage)
55
- Stage.has_stage?(stage, config: @config)
55
+ @config.stage_class.has_stage?(stage, config: @config)
56
56
  end
57
57
 
58
58
  def build_type(type, **args)
@@ -56,11 +56,11 @@ module Pubid::Core
56
56
 
57
57
  def self.parse(stage, config:)
58
58
  if /\A[\d.]+\z/.match?(stage)
59
- Stage.new(harmonized_code: stage, config: config)
59
+ new(harmonized_code: stage, config: config)
60
60
  else
61
61
  raise Errors::StageInvalidError unless stage.is_a?(Symbol) || stage.is_a?(String) || stage.is_a?(Parslet::Slice)
62
62
 
63
- Stage.new(abbr: stage.to_s, config: config)
63
+ new(abbr: stage.to_s, config: config)
64
64
  end
65
65
  end
66
66
 
@@ -1,5 +1,5 @@
1
1
  module Pubid
2
2
  module Core
3
- VERSION = "1.6.0".freeze
3
+ VERSION = "1.6.1".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pubid-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-18 00:00:00.000000000 Z
11
+ date: 2023-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake