appydave-tools 0.3.3 → 0.3.5

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: 99c323bf20ff261cb8bc480f62755bd2bcf3329f71757336a860ae012519c756
4
- data.tar.gz: 77adbb57ab140ae8edd305b99145d015e60bab9c66193ec221b02dd284619dfe
3
+ metadata.gz: e9ffa5eaaf86ac0e1c3fa37723bdf1de7deef27e8880f34111cd74a7069b3651
4
+ data.tar.gz: 811afb3d402053e6d856e0af6b8373e23dd15758db21f12702c89dfd1bbd8f7d
5
5
  SHA512:
6
- metadata.gz: f553305dd9de4407a078f6c3cb8a1aa73263ab96e7bfe534283b81dfa742ea7c65287480da31f03f549364ca5743b0b49ddffe277592b24b2df3541ff7da0713
7
- data.tar.gz: c631a73481020791d0221dc997332f09163eabbdbf38e03dbfea8198d680ecbf45cf74f18b38df234feaefd530a498aeaac5a2ef29aa0a1fdc73aeb654fcbf68
6
+ metadata.gz: cb885bd5100cdb0142b1807901fe97778e23b9adef88a03b326de2f22e8325c889b418e498ad1efc4e8c52c7eed87735d1d44dec2853370034e1e6c46679c658
7
+ data.tar.gz: 35ee8a319386f6f38dcf5a8cfc3b2a361865740432f1bfac99b5b6d3bd448bca7accf9cfc32b76a6d4994f9be6abf91dae62c42596fdb9dafc56e493b3d5fea9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## [0.3.4](https://github.com/klueless-io/appydave-tools/compare/v0.3.3...v0.3.4) (2024-05-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Add debug capability to ConfigBase and update configurations ([d33c943](https://github.com/klueless-io/appydave-tools/commit/d33c9431a50fa44b2f4db7ccbaf2522105710aa7))
7
+ * resolve cop ([d56f670](https://github.com/klueless-io/appydave-tools/commit/d56f670ec69ea74438947dd1bb7296e7fa28f0f1))
8
+
9
+ ## [0.3.3](https://github.com/klueless-io/appydave-tools/compare/v0.3.2...v0.3.3) (2024-05-18)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * updating configuration with channels and channel_projects ([d4f54aa](https://github.com/klueless-io/appydave-tools/commit/d4f54aa0f455f535b6e265f23e6fba123d099d26))
15
+
1
16
  ## [0.3.2](https://github.com/klueless-io/appydave-tools/compare/v0.3.1...v0.3.2) (2024-05-16)
2
17
 
3
18
 
data/images.log ADDED
File without changes
@@ -1,3 +1,69 @@
1
1
  # Configuration Component
2
2
 
3
- [ChatGPT conversation](https://chatgpt.com/g/g-4dMsIRK3E-ruby-script-assistant/c/d8ea5960-071b-48aa-9fd9-554ca302c7dd)
3
+ [ChatGPT conversation](https://chatgpt.com/g/g-4dMsIRK3E-ruby-script-assistant/c/d8ea5960-071b-48aa-9fd9-554ca302c7dd)
4
+ [ChatGPT confersation for Schema](https://chatgpt.com/c/bb93e7ac-f139-44f9-8b9c-4e74ac2fa461)
5
+
6
+ ## Schema
7
+
8
+ ### Channels Schema
9
+
10
+ - **code**: Short identifier for the channel (e.g., `"ad"`, `"ac"`, `"fv"`).
11
+ - **name**: Full name of the channel (e.g., `"AppyDave"`, `"AppyDave Coding"`, `"FliVideo"`).
12
+ - **youtube_handle**: YouTube handle for the channel (e.g., `"@appydave"`, `"@appydavecoding"`, `"@flivideo"`).
13
+
14
+ #### Example
15
+
16
+ ```json
17
+ {
18
+ "channels": {
19
+ "appydave": {
20
+ "code": "ad",
21
+ "name": "AppyDave",
22
+ "youtube_handle": "@appydave"
23
+ },
24
+ "appydave_coding": {
25
+ "code": "ac",
26
+ "name": "AppyDave Coding",
27
+ "youtube_handle": "@appydavecoding"
28
+ },
29
+ "fli_video": {
30
+ "code": "fv",
31
+ "name": "FliVideo",
32
+ "youtube_handle": "@flivideo"
33
+ }
34
+ }
35
+ }
36
+ ```
37
+
38
+ ### Channel Projects Schema
39
+
40
+ - **content_projects**: Path to the shared folder for content creation (e.g., `"/user/Library/CloudStorage/Dropbox/team-appydave"`).
41
+ - **video_projects**: Path to the local storage folder for active video projects (e.g., `"/user/tube-channels/appy-dave/active"`).
42
+ - **published_projects**: Path to the archive folder for published projects (e.g., `"/Volumes/Expansion/published/appydave"`).
43
+ - **abandoned_projects**: Path to the archive folder for incomplete or failed projects (e.g., `"/Volumes/Expansion/failed/appydave"`).
44
+
45
+ ## Example
46
+ ```json
47
+ {
48
+ "projects": {
49
+ "appydave": {
50
+ "content_projects": "/user/Library/CloudStorage/Dropbox/team-appydave",
51
+ "video_projects": "/user/tube-channels/appy-dave/active",
52
+ "published_projects": "/Volumes/Expansion/published/appydave",
53
+ "abandoned_projects": "/Volumes/Expansion/failed/appydave"
54
+ },
55
+ "appydave_coding": {
56
+ "content_projects": "/user/Library/CloudStorage/Dropbox/team-appydavecoding",
57
+ "video_projects": "/user/tube-channels/a-cast/cast-active",
58
+ "published_projects": "/Volumes/Expansion/published/appydave-coding",
59
+ "abandoned_projects": "/Volumes/Expansion/failed/appydave-coding"
60
+ },
61
+ "fli_video": {
62
+ "content_projects": "/user/Library/CloudStorage/Dropbox/team-flivideo",
63
+ "video_projects": "/user/tube-channels/fli-video/active",
64
+ "published_projects": "/Volumes/Expansion/published/fli-video",
65
+ "abandoned_projects": "/Volumes/Expansion/failed/fli-video"
66
+ }
67
+ }
68
+ }
69
+ ```
@@ -5,10 +5,6 @@ module Appydave
5
5
  module Configuration
6
6
  # Channel projects configuration
7
7
  class ChannelProjectsConfig < ConfigBase
8
- def initialize
9
- super('channel_projects')
10
- end
11
-
12
8
  # Retrieve channel information by channel name (string or symbol)
13
9
  def get_channel_info(channel_name)
14
10
  channel_name = channel_name.to_s
@@ -5,10 +5,6 @@ module Appydave
5
5
  module Configuration
6
6
  # Channels configuration
7
7
  class ChannelsConfig < ConfigBase
8
- def initialize
9
- super('channels')
10
- end
11
-
12
8
  # Retrieve channel information by channel code (string or symbol)
13
9
  def get_channel(channel_key)
14
10
  channel_key = channel_key.to_s
@@ -29,6 +25,16 @@ module Appydave
29
25
  end
30
26
  end
31
27
 
28
+ def key?(key)
29
+ key = key.to_s
30
+ data['channels'].key?(key)
31
+ end
32
+
33
+ def code?(code)
34
+ code = code.to_s
35
+ data['channels'].values.any? { |info| info['code'] == code }
36
+ end
37
+
32
38
  private
33
39
 
34
40
  def default_data
@@ -6,6 +6,8 @@ module Appydave
6
6
  # Configuration class for handling multiple configurations
7
7
  class Config
8
8
  class << self
9
+ include KLog::Logging
10
+
9
11
  attr_accessor :config_path
10
12
  attr_reader :configurations
11
13
 
@@ -19,12 +21,10 @@ module Appydave
19
21
  @configurations[key] = klass.new
20
22
  end
21
23
 
22
- def method_missing(method_name, *args, &block)
23
- if @configurations.key?(method_name)
24
- @configurations[method_name]
25
- else
26
- super
27
- end
24
+ def method_missing(method_name, *_args)
25
+ raise Appydave::Tools::Error, "Configuration not available: #{method_name}" unless @configurations.key?(method_name)
26
+
27
+ @configurations[method_name]
28
28
  end
29
29
 
30
30
  def respond_to_missing?(method_name, include_private = false)
@@ -46,6 +46,11 @@ module Appydave
46
46
  Open3.capture3(open_vscode)
47
47
  end
48
48
 
49
+ def debug
50
+ log.kv 'Configuration Path', config_path
51
+ configurations.each_value(&:debug)
52
+ end
53
+
49
54
  private
50
55
 
51
56
  def ensure_config_directory
@@ -8,9 +8,11 @@ module Appydave
8
8
  module Configuration
9
9
  # Base class for handling common configuration tasks
10
10
  class ConfigBase
11
+ include KLog::Logging
12
+
11
13
  attr_reader :config_path, :data
12
14
 
13
- def initialize(config_name = 'unknown')
15
+ def initialize
14
16
  @config_path = File.join(Config.config_path, "#{config_name}.json")
15
17
  @data = load
16
18
  end
@@ -24,9 +26,27 @@ module Appydave
24
26
 
25
27
  default_data
26
28
  rescue JSON::ParserError
29
+ # log.exception e
27
30
  default_data
28
31
  end
29
32
 
33
+ def name
34
+ self.class.name.split('::')[-1].gsub(/Config$/, '')
35
+ end
36
+
37
+ def config_name
38
+ name.gsub(/([a-z])([A-Z])/, '\1-\2').downcase
39
+ end
40
+
41
+ def debug
42
+ log.kv 'Config', name
43
+ log.kv 'Path', config_path
44
+
45
+ log.json data
46
+ end
47
+
48
+ private
49
+
30
50
  def default_data
31
51
  {}
32
52
  end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Appydave
4
+ module Tools
5
+ module Configuration
6
+ # Configurable module for handling dynamic configurations in tools and components
7
+ module Configurable
8
+ def config
9
+ Appydave::Tools::Configuration::Config
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -5,10 +5,6 @@ module Appydave
5
5
  module Configuration
6
6
  # Global settings that can be referenced by other configurations or tools
7
7
  class SettingsConfig < ConfigBase
8
- def initialize
9
- super('settings')
10
- end
11
-
12
8
  def set(key, value)
13
9
  data[key] = value
14
10
  end
@@ -0,0 +1,22 @@
1
+ # Naming Manager
2
+
3
+ [ChatGPT conversation](https://chatgpt.com/g/g-4dMsIRK3E-ruby-script-assistant/c/cab5e2f7-a607-402f-80b7-9ca262bab8ee)
4
+ [Project Naming Convention](https://chatgpt.com/c/f1cc4bdd-a5ba-494c-bced-461a7f8ce41c)
5
+
6
+ ## Channel Names
7
+
8
+ | Key | Code | Name | YouTube Handle |
9
+ |-----------------|------|-----------------|--------------------|
10
+ | appydave | ad | AppyDave | @appydave |
11
+ | appydave_coding | ac | AppyDave Coding | @appydavecoding |
12
+ | fli_video | fv | FliVideo | @flivideo |
13
+ | winning_prompts | wp | Winning Prompts | @winningprompts |
14
+ | trend10 | t1 | Trend10 | @trend10 |
15
+ | aitldr | tl | AI TLDR | @aitldr |
16
+
17
+
18
+ ## Project Naming Component
19
+
20
+ The Project Naming Component is a tool designed to generate standardized names for projects within the YouTube content creation process.
21
+ It ensures consistency and clarity by combining a unique sequence identifier, an optional channel code, and a descriptive project name into a well-defined format.
22
+ This component is essential for maintaining organized and easily recognizable project names across all channels and project types.
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Appydave
4
+ module Tools
5
+ # Project, channel, and file name management
6
+ module NameManager
7
+ # Parses and generates project names for Appydave video projects
8
+ class ProjectName
9
+ attr_reader :sequence, :channel_code, :project_name
10
+
11
+ def initialize(file_name)
12
+ parse_file_name(file_name)
13
+ end
14
+
15
+ def generate_name
16
+ if channel_code
17
+ "#{sequence}-#{channel_code}-#{project_name}"
18
+ else
19
+ "#{sequence}-#{project_name}"
20
+ end.downcase
21
+ end
22
+
23
+ def to_s
24
+ generate_name
25
+ end
26
+
27
+ private
28
+
29
+ def parse_file_name(file_name)
30
+ file_name = File.basename(file_name, File.extname(file_name))
31
+ parts = file_name.split('-')
32
+
33
+ @sequence = parts[0]
34
+ @project_name = parts[-1]
35
+ @channel_code = parts.length == 3 ? parts[1] : nil
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Appydave
4
4
  module Tools
5
- VERSION = '0.3.3'
5
+ VERSION = '0.3.5'
6
6
  end
7
7
  end
@@ -5,15 +5,24 @@ require 'fileutils'
5
5
  require 'json'
6
6
  require 'open3'
7
7
  require 'optparse'
8
+ require 'k_log'
8
9
 
9
10
  require 'appydave/tools/version'
10
11
  require 'appydave/tools/gpt_context/file_collector'
11
12
 
13
+ require 'appydave/tools/configuration/configurable'
12
14
  require 'appydave/tools/configuration/config_base'
13
15
  require 'appydave/tools/configuration/config'
14
16
  require 'appydave/tools/configuration/settings_config'
15
17
  require 'appydave/tools/configuration/channel_projects_config'
16
18
  require 'appydave/tools/configuration/channels_config'
19
+ require 'appydave/tools/name_manager/project_name'
20
+
21
+ Appydave::Tools::Configuration::Config.configure do |config|
22
+ config.register(:settings, Appydave::Tools::Configuration::SettingsConfig)
23
+ config.register(:channels, Appydave::Tools::Configuration::ChannelsConfig)
24
+ config.register(:channel_projects, Appydave::Tools::Configuration::ChannelProjectsConfig)
25
+ end
17
26
 
18
27
  module Appydave
19
28
  module Tools
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "appydave-tools",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "appydave-tools",
9
- "version": "0.3.3",
9
+ "version": "0.3.5",
10
10
  "devDependencies": {
11
11
  "@klueless-js/semantic-release-rubygem": "github:klueless-js/semantic-release-rubygem",
12
12
  "@semantic-release/changelog": "^6.0.3",
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appydave-tools",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "AppyDave YouTube Automation Tools",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appydave-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-18 00:00:00.000000000 Z
11
+ date: 2024-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clipboard
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: k_log
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  description: " AppyDave YouTube Automation Tools\n"
28
42
  email:
29
43
  - david@ideasmen.com.au
@@ -47,15 +61,19 @@ files:
47
61
  - bin/console
48
62
  - bin/gpt_context.rb
49
63
  - bin/setup
64
+ - images.log
50
65
  - lib/appydave/tools.rb
51
66
  - lib/appydave/tools/configuration/_doc.md
52
67
  - lib/appydave/tools/configuration/channel_projects_config.rb
53
68
  - lib/appydave/tools/configuration/channels_config.rb
54
69
  - lib/appydave/tools/configuration/config.rb
55
70
  - lib/appydave/tools/configuration/config_base.rb
71
+ - lib/appydave/tools/configuration/configurable.rb
56
72
  - lib/appydave/tools/configuration/settings_config copy.xrb
57
73
  - lib/appydave/tools/configuration/settings_config.rb
58
74
  - lib/appydave/tools/gpt_context/file_collector.rb
75
+ - lib/appydave/tools/name_manager/_doc.md
76
+ - lib/appydave/tools/name_manager/project_name.rb
59
77
  - lib/appydave/tools/version.rb
60
78
  - package-lock.json
61
79
  - package.json