cocoapods-bb-PodAssistant 0.3.12.0 → 0.3.12.2

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: c66397bead67a3cc7a1742c88936b9d0c68bc6f2691b5cae89114e5d73a2f0de
4
- data.tar.gz: e5ed5ae160c03ab68f15baf4e78204fccd5e942901c6ee7d05a64c31c84f6a77
3
+ metadata.gz: 3440bb4946cc5950fd81fabdcf604815b467a441986b0eddf3787e1226bd5f93
4
+ data.tar.gz: e0d1b5979fe4243979a02265acf29c8e42caf0bca355793c6f8193a78d7e4d31
5
5
  SHA512:
6
- metadata.gz: 7328f0a1f7598b7f590132714baaca654a9aa65baeec718c0e89dc0f4442fdbc70b4f30761ce40eef2f69b7ee44227c1e9248603b928e7443b4bb2d32f24865b
7
- data.tar.gz: cdeaaecfdadb30b3f1e6245ed196e07f091210ce35d900e8af90e20241b69d3a4bb6c99bbc1ef8199b1c6be7f1cda5a1cbe538e8bfe6ea9fdd9b06e60e23bec4
6
+ metadata.gz: b60b8c8959c7be1563c500ea37d754ffc7acab0e3354e34756914932a0c66ce6d5b7165d443d94446e1c1b520b0753e3967f99224bfb800c0a44c8ceac3db6ad
7
+ data.tar.gz: 89e48f338eae8cde2bbf46c4a1cdc214868734a592e8a841cea54656d6372e5a09aebfafc64c2af7cc12df24b732ccde56c583ab275773d28fdb78c16cae1a53
@@ -125,17 +125,22 @@ def isCityApp
125
125
  return bundleId === "com.sinyee.babybus.city"
126
126
  end
127
127
 
128
- # 是否创意世界产品
128
+ # 是否创意世界产品(海外)
129
129
  def isGameWorldApp
130
130
  bundleId = getProjectBundleIdentifier()
131
131
  return bundleId === "com.sinyee.babybus.gameworld"
132
132
  end
133
+ # 是否创意世界产品(国内)
134
+ def isBingoworldApp
135
+ bundleId = getProjectBundleIdentifier()
136
+ return bundleId === "com.joltrix.bingoworld"
137
+ end
133
138
 
134
139
  # 是否矩阵产品
135
140
  def isMatrixApp
136
141
  bundleId = getProjectBundleIdentifier()
137
142
  puts "###bundleId:#{bundleId}###".red
138
- if (isHanZiApp || isQMWApp || isPinyinAppp || isCourseApp || isMathApp || isABCApp || isCityApp) then
143
+ if (isHanZiApp || isQMWApp || isPinyinAppp || isCourseApp || isMathApp || isABCApp || isCityApp || isGameWorldApp || isBingoworldApp) then
139
144
  return false
140
145
  end
141
146
  return true
@@ -2,52 +2,39 @@ require 'json'
2
2
 
3
3
  module BB
4
4
  class JsonParser
5
- attr_reader :json_data
6
-
7
- # 初始化,读取并解析 JSON 文件
5
+ attr_reader :data
6
+
8
7
  def initialize(file_path)
9
- @file_path = file_path
10
- @json_data = read_json
11
- end
12
-
13
- # 读取并解析 JSON 文件
14
- def read_json
15
8
  begin
16
- file_content = File.read(@file_path)
17
- JSON.parse(file_content)
18
- rescue Errno::ENOENT
19
- puts "错误:找不到文件 #{@file_path}"
20
- nil
21
- rescue JSON::ParserError
22
- puts "错误:JSON 解析失败,请检查文件格式"
23
- nil
9
+ json_str = File.read(file_path)
10
+ @data = JSON.parse(json_str)
11
+ rescue JSON::ParserError => e
12
+ puts "JSON解析失败: #{e.message} file_path:#{file_path} json_str:#{json_str}".red
13
+ @data = {}
24
14
  end
25
15
  end
26
-
27
- # 遍历 JSON 并返回 key-value 结构
28
- def traverse_json(data = @json_data, prefix = "", result = {})
29
- return result unless data
30
16
 
31
- case data
32
- when Hash
33
- data.each do |key, value|
34
- traverse_json(value, "#{prefix}#{key}.", result)
35
- end
36
- when Array
37
- data.each_with_index do |value, index|
38
- traverse_json(value, "#{prefix}[#{index}].", result)
39
- end
40
- else
41
- result[prefix.chomp('.')] = data
17
+ # 获取指定 key 的值(支持嵌套)
18
+ def get(*keys)
19
+ keys.reduce(@data) do |current, key|
20
+ return nil unless current.is_a?(Hash) && current.key?(key)
21
+ current[key]
42
22
  end
23
+ end
43
24
 
44
- result
25
+ # 设置指定 key 的值(仅一级 key)
26
+ def set(key, value)
27
+ @data[key] = value
45
28
  end
46
29
 
47
- # 提供给业务方的获取 JSON 数据方法
30
+ # 返回内部完整的 JSON 数据(作为 Hash)
48
31
  def get_json_data
49
- return {} unless @json_data
50
- traverse_json
32
+ @data
33
+ end
34
+
35
+ # 将内部数据重新转为 JSON 字符串
36
+ def to_json(pretty: false)
37
+ pretty ? JSON.pretty_generate(@data) : @data.to_json
51
38
  end
52
39
  end
53
40
  end
@@ -1,3 +1,3 @@
1
1
  module CocoapodsBbPodassistant
2
- VERSION = "0.3.12.0"
2
+ VERSION = "0.3.12.2"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-bb-PodAssistant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.12.0
4
+ version: 0.3.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - humin
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-04 00:00:00.000000000 Z
10
+ date: 2025-04-25 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: cocoapods-core