appydave-tools 0.36.0 → 0.38.0

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.
@@ -107,49 +107,32 @@ module Appydave
107
107
  end
108
108
 
109
109
  def current_branch
110
- `git -C "#{brand_path}" rev-parse --abbrev-ref HEAD 2>/dev/null`.strip
111
- rescue StandardError
112
- 'unknown'
110
+ GitHelper.current_branch(brand_path)
113
111
  end
114
112
 
115
113
  def remote_url
116
- result = `git -C "#{brand_path}" remote get-url origin 2>/dev/null`.strip
117
- result.empty? ? nil : result
118
- rescue StandardError
119
- nil
114
+ GitHelper.remote_url(brand_path)
120
115
  end
121
116
 
122
117
  def modified_files_count
123
- `git -C "#{brand_path}" status --porcelain 2>/dev/null | grep -E "^.M|^M" | wc -l`.strip.to_i
124
- rescue StandardError
125
- 0
118
+ GitHelper.modified_files_count(brand_path)
126
119
  end
127
120
 
128
121
  def untracked_files_count
129
- `git -C "#{brand_path}" status --porcelain 2>/dev/null | grep -E "^\\?\\?" | wc -l`.strip.to_i
130
- rescue StandardError
131
- 0
122
+ GitHelper.untracked_files_count(brand_path)
132
123
  end
133
124
 
134
125
  def commits_ahead
135
- `git -C "#{brand_path}" rev-list --count @{upstream}..HEAD 2>/dev/null`.strip.to_i
136
- rescue StandardError
137
- 0
126
+ GitHelper.commits_ahead(brand_path)
138
127
  end
139
128
 
140
129
  def commits_behind
141
- `git -C "#{brand_path}" rev-list --count HEAD..@{upstream} 2>/dev/null`.strip.to_i
142
- rescue StandardError
143
- 0
130
+ GitHelper.commits_behind(brand_path)
144
131
  end
145
132
 
146
133
  # Check if repo has uncommitted changes (matches old script: git diff-index --quiet HEAD --)
147
134
  def uncommitted_changes?
148
- # git diff-index returns 0 if clean, 1 if there are changes
149
- system("git -C \"#{brand_path}\" diff-index --quiet HEAD -- 2>/dev/null")
150
- !$CHILD_STATUS.success?
151
- rescue StandardError
152
- false
135
+ GitHelper.uncommitted_changes?(brand_path)
153
136
  end
154
137
 
155
138
  # Show file list using git status --short (matches old script)
@@ -768,11 +768,7 @@ module Appydave
768
768
 
769
769
  # Calculate total size of a directory
770
770
  def calculate_directory_size(dir_path)
771
- total = 0
772
- Dir.glob(File.join(dir_path, '**', '*'), File::FNM_DOTMATCH).each do |file|
773
- total += File.size(file) if File.file?(file)
774
- end
775
- total
771
+ FileHelper.calculate_directory_size(dir_path)
776
772
  end
777
773
  end
778
774
  end
@@ -241,40 +241,27 @@ module Appydave
241
241
  end
242
242
 
243
243
  def current_branch
244
- `git -C "#{brand_path}" rev-parse --abbrev-ref HEAD 2>/dev/null`.strip
245
- rescue StandardError
246
- 'unknown'
244
+ GitHelper.current_branch(brand_path)
247
245
  end
248
246
 
249
247
  def remote_url
250
- result = `git -C "#{brand_path}" remote get-url origin 2>/dev/null`.strip
251
- result.empty? ? nil : result
252
- rescue StandardError
253
- nil
248
+ GitHelper.remote_url(brand_path)
254
249
  end
255
250
 
256
251
  def modified_files_count
257
- `git -C "#{brand_path}" status --porcelain 2>/dev/null | grep -E "^.M|^M" | wc -l`.strip.to_i
258
- rescue StandardError
259
- 0
252
+ GitHelper.modified_files_count(brand_path)
260
253
  end
261
254
 
262
255
  def untracked_files_count
263
- `git -C "#{brand_path}" status --porcelain 2>/dev/null | grep -E "^\\?\\?" | wc -l`.strip.to_i
264
- rescue StandardError
265
- 0
256
+ GitHelper.untracked_files_count(brand_path)
266
257
  end
267
258
 
268
259
  def commits_ahead
269
- `git -C "#{brand_path}" rev-list --count @{upstream}..HEAD 2>/dev/null`.strip.to_i
270
- rescue StandardError
271
- 0
260
+ GitHelper.commits_ahead(brand_path)
272
261
  end
273
262
 
274
263
  def commits_behind
275
- `git -C "#{brand_path}" rev-list --count HEAD..@{upstream} 2>/dev/null`.strip.to_i
276
- rescue StandardError
277
- 0
264
+ GitHelper.commits_behind(brand_path)
278
265
  end
279
266
  end
280
267
  end
@@ -268,13 +268,7 @@ module Appydave
268
268
 
269
269
  # Format bytes into human-readable format
270
270
  def format_bytes(bytes)
271
- if bytes < 1024
272
- "#{bytes}B"
273
- elsif bytes < 1024 * 1024
274
- "#{(bytes / 1024.0).round(1)}KB"
275
- else
276
- "#{(bytes / 1024.0 / 1024.0).round(1)}MB"
277
- end
271
+ FileHelper.format_size(bytes)
278
272
  end
279
273
  end
280
274
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Appydave
4
4
  module Tools
5
- VERSION = '0.36.0'
5
+ VERSION = '0.38.0'
6
6
  end
7
7
  end
@@ -52,6 +52,9 @@ require 'appydave/tools/prompt_tools/prompt_completion'
52
52
  require 'appydave/tools/subtitle_processor/clean'
53
53
  require 'appydave/tools/subtitle_processor/join'
54
54
 
55
+ require 'appydave/tools/dam/errors'
56
+ require 'appydave/tools/dam/file_helper'
57
+ require 'appydave/tools/dam/git_helper'
55
58
  require 'appydave/tools/dam/config'
56
59
  require 'appydave/tools/dam/project_resolver'
57
60
  require 'appydave/tools/dam/config_loader'
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appydave-tools",
3
- "version": "0.36.0",
3
+ "version": "0.38.0",
4
4
  "description": "AppyDave YouTube Automation Tools",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appydave-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.36.0
4
+ version: 0.38.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys
@@ -228,6 +228,8 @@ files:
228
228
  - bin/youtube_automation.rb
229
229
  - bin/youtube_manager.rb
230
230
  - docs/README.md
231
+ - docs/ai-instructions/code-quality-retrospective.md
232
+ - docs/ai-instructions/defensive-logging-audit.md
231
233
  - docs/architecture/cli/cli-pattern-comparison.md
232
234
  - docs/architecture/cli/cli-patterns.md
233
235
  - docs/architecture/configuration/configuration-systems.md
@@ -248,6 +250,9 @@ files:
248
250
  - docs/archive/test-coverage-quick-wins.md
249
251
  - docs/archive/tool-discovery.md
250
252
  - docs/archive/tool-documentation-analysis.md
253
+ - docs/code-quality/README.md
254
+ - docs/code-quality/implementation-plan.md
255
+ - docs/code-quality/report-2025-01-21.md
251
256
  - docs/guides/configuration-setup.md
252
257
  - docs/guides/platforms/windows/README.md
253
258
  - docs/guides/platforms/windows/dam-testing-plan-windows-powershell.md
@@ -294,6 +299,9 @@ files:
294
299
  - lib/appydave/tools/configuration/openai.rb
295
300
  - lib/appydave/tools/dam/config.rb
296
301
  - lib/appydave/tools/dam/config_loader.rb
302
+ - lib/appydave/tools/dam/errors.rb
303
+ - lib/appydave/tools/dam/file_helper.rb
304
+ - lib/appydave/tools/dam/git_helper.rb
297
305
  - lib/appydave/tools/dam/manifest_generator.rb
298
306
  - lib/appydave/tools/dam/project_listing.rb
299
307
  - lib/appydave/tools/dam/project_resolver.rb