pindo 5.6.4 → 5.6.6

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: 70e757176e983eadd0e4d4009502520c6e8b414be34b00ce0ed38a676af91612
4
- data.tar.gz: 6a22e1362c5911ad1de3e48ae13d2d98bf9f839e61eb1dc844b1a8487cfd3f45
3
+ metadata.gz: a103f5b0b21922ee65ea260859524a5d28e3d51e51d261f422a49e2c05e5d28a
4
+ data.tar.gz: 2e369bea1dd6cce3d79090818bda9a76fa7f09be3421cd1258a9f078e7603509
5
5
  SHA512:
6
- metadata.gz: d08b59f594d1940371367f0fcafed27a9521738fe24ebb3319615f058f17482525344e7a516da6ddce45d635ad3631e58a237a6fa87263c311ecdaadf4988842
7
- data.tar.gz: 14e49d65c3c4977101f8be8c253ba912aceb9a15822d30532c48d8090dce700dedce03bd60e9e85dbdc07f57065ec1a144d09ec811d6e5a6e659e9ea46e34eac
6
+ metadata.gz: 50126fe316c91e26e05325badb5b85c3ec92ac5f03037bc14e694feea9d62ad31624cd42f0c85d5364e008294473db031eca50f48532b9b6a6b5dfc3c000d1c9
7
+ data.tar.gz: 5a91cf5933357cff53735dbf7664f2df83e01bb6eb2afae3def775ca82a06903de611201532dcb8d63ea207e64f29ecba67b38066214cb37a17fc351136d610c
@@ -26,6 +26,7 @@ module Pindo
26
26
  @command_group = nil # 命令组名称
27
27
  @verbose = false # 是否输出详细日志
28
28
  @loaded_file_cache = nil # 已加载但未应用的文件缓存数据
29
+ @cache_confirmed = false # 标记缓存确认是否已完成
29
30
  ensure_cache_dir
30
31
  end
31
32
 
@@ -88,6 +89,7 @@ module Pindo
88
89
  @file_cache_loaded = false
89
90
  @cache_enabled = false
90
91
  @command_group = nil
92
+ @cache_confirmed = false
91
93
  # 暂不清理内存缓存,让同一进程内可以复用
92
94
  end
93
95
 
@@ -462,6 +464,15 @@ module Pindo
462
464
  return false unless @cache_enabled
463
465
  return false unless @loaded_file_cache
464
466
 
467
+ # 如果已经确认过缓存,直接返回(避免嵌套调用时重复询问)
468
+ if @cache_confirmed
469
+ puts "[PindoContext] 缓存已确认,跳过重复询问" if verbose?
470
+ # 检查内存中是否已有缓存数据
471
+ project_path = get_project_path
472
+ root_command = @command_group || @current_command
473
+ return @memory_selections.dig(project_path, root_command) != nil
474
+ end
475
+
465
476
  project_path = get_project_path
466
477
  root_command = @command_group || @current_command
467
478
 
@@ -534,6 +545,8 @@ module Pindo
534
545
  symbol_key = key.to_sym
535
546
  @memory_selections[project_path][root_command][symbol_key] = symbolize_keys(value)
536
547
  end
548
+ # 标记缓存已确认,避免嵌套调用时重复询问
549
+ @cache_confirmed = true
537
550
  return true
538
551
  else
539
552
  puts "清除缓存,重新选择\n"
@@ -546,6 +559,8 @@ module Pindo
546
559
  # 保存清理后的缓存到文件
547
560
  save_file_cache
548
561
  end
562
+ # 标记缓存已确认(用户选择不使用)
563
+ @cache_confirmed = true
549
564
  return false
550
565
  end
551
566
  end
@@ -57,29 +57,50 @@ module Pindo
57
57
 
58
58
  def write_gitignore(git_root_dir)
59
59
  gitignore_path = File.join(git_root_dir, '.gitignore')
60
- gitignore_content = <<~GITIGNORE
61
- # pindo_common_ignore_1.0.0
62
- build_ios.log
63
- feishu.json
64
- CHANGELOG.md
65
-
66
- # Platform specific directories
67
- /GoodPlatform/iOS/config.json
68
- /GoodPlatform/iOS/*
69
- /GoodPlatform/iOS/build/*
70
- /GoodPlatform/Android/*
71
- /GoodPlatform/BaseiOS/Unity/*
72
- /GoodPlatform/BaseiOS/Pods/
73
- /GoodPlatform/BaseiOS/build/
74
- /GoodPlatform/BaseiOS/config.json
75
- /GoodPlatform/BaseiOS/Podfile.lock
76
-
77
- /GoodPlatform/BaseAndroid/Unity/*
78
- GITIGNORE
79
- # Append to existing .gitignore or create new one
80
- File.open(gitignore_path, 'a') do |f|
81
- f.puts("\n# Added by Pindo")
82
- f.puts(gitignore_content)
60
+
61
+ # 定义要添加的gitignore规则数组
62
+ ignore_rules = [
63
+ 'build_ios.log',
64
+ 'feishu.json',
65
+ 'CHANGELOG.md',
66
+ 'GoodPlatform/iOS/*',
67
+ 'GoodPlatform/Android/*',
68
+ 'GoodPlatform/BaseiOS/Unity/*',
69
+ 'GoodPlatform/BaseiOS/Pods/',
70
+ 'GoodPlatform/BaseiOS/build',
71
+ 'GoodPlatform/BaseiOS/config.json',
72
+ 'GoodPlatform/BaseiOS/Podfile.lock',
73
+ 'GoodPlatform/BaseAndroid/Unity/*',
74
+ 'GoodPlatform/BaseAndroid/build',
75
+ 'GoodPlatform/WebGL',
76
+ 'config.json',
77
+ 'Assets/Packages',
78
+ 'Assets/WebGLTemplates.meta',
79
+ 'Assets/WebGLTemplates/',
80
+ 'Packages/packages-lock.json'
81
+ ]
82
+
83
+ # 读取现有的gitignore内容
84
+ existing_lines = []
85
+ if File.exist?(gitignore_path)
86
+ existing_lines = File.readlines(gitignore_path).map(&:strip)
87
+ end
88
+
89
+ # 过滤出需要添加的规则(不存在的)
90
+ rules_to_add = ignore_rules.reject { |rule| existing_lines.include?(rule) }
91
+
92
+ # 如果有需要添加的规则,则添加
93
+ unless rules_to_add.empty?
94
+ File.open(gitignore_path, 'a') do |f|
95
+ # 检查是否已有Pindo标记,如果没有则添加
96
+ pindo_marker = '# Added by Pindo (pindo_common_ignore_1.0.0)'
97
+ f.puts("\n#{pindo_marker}") unless existing_lines.include?(pindo_marker.strip)
98
+
99
+ # 添加每条新规则
100
+ rules_to_add.each do |rule|
101
+ f.puts(rule)
102
+ end
103
+ end
83
104
  end
84
105
  end
85
106
 
data/lib/pindo/version.rb CHANGED
@@ -6,7 +6,7 @@ require 'time'
6
6
 
7
7
  module Pindo
8
8
 
9
- VERSION = "5.6.4"
9
+ VERSION = "5.6.6"
10
10
 
11
11
  class VersionCheck
12
12
  RUBYGEMS_API = 'https://rubygems.org/api/v1/gems/pindo.json'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pindo
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.6.4
4
+ version: 5.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - wade
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-10-11 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: claide
@@ -479,7 +479,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
479
479
  - !ruby/object:Gem::Version
480
480
  version: '0'
481
481
  requirements: []
482
- rubygems_version: 3.6.3
482
+ rubygems_version: 3.6.9
483
483
  specification_version: 3
484
484
  summary: easy work
485
485
  test_files: []