appydave-tools 0.3.2 → 0.3.4
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 +4 -4
- data/.rubocop.yml +0 -3
- data/CHANGELOG.md +15 -0
- data/lib/appydave/tools/configuration/_doc.md +67 -1
- data/lib/appydave/tools/configuration/channel_projects_config.rb +65 -0
- data/lib/appydave/tools/configuration/channels_config.rb +74 -0
- data/lib/appydave/tools/configuration/config.rb +7 -0
- data/lib/appydave/tools/configuration/config_base.rb +26 -2
- data/lib/appydave/tools/configuration/settings_config.rb +0 -4
- data/lib/appydave/tools/name_manager/_doc.md +21 -0
- data/lib/appydave/tools/name_manager/project_name.rb +40 -0
- data/lib/appydave/tools/version.rb +1 -1
- data/lib/appydave/tools.rb +4 -0
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +20 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5e47cee4b8a3f0c9d7d1714bceeb4a02780cfe441348466ecd822e4e454d0fe
|
4
|
+
data.tar.gz: 3f035ac5b9e34e819a79c17f3c19a9646ec246017493a63ba20a1096ae86c95f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59aa944562e5a3c28c47e053a49df7d9ea6236268736263dca2d29022ed4d3a70d1a3fe9668b080183dfce38fe520efac252aa2c0fe11f40aa7491a325f88570
|
7
|
+
data.tar.gz: 55aa8b91b2992fec8968f214baefc896ab816e56a77ff0f724b99d0f3ac10d8eb8446e220beecbac5398b3b23cf46bad14b8fe3dc785af25573cbbbf077e0f87
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
## [0.3.3](https://github.com/klueless-io/appydave-tools/compare/v0.3.2...v0.3.3) (2024-05-18)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* updating configuration with channels and channel_projects ([d4f54aa](https://github.com/klueless-io/appydave-tools/commit/d4f54aa0f455f535b6e265f23e6fba123d099d26))
|
7
|
+
|
8
|
+
## [0.3.2](https://github.com/klueless-io/appydave-tools/compare/v0.3.1...v0.3.2) (2024-05-16)
|
9
|
+
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
13
|
+
* updating settings configuration and tests ([18bdf2b](https://github.com/klueless-io/appydave-tools/commit/18bdf2bb2605f51a5779dfe649c40e98c2bd77ef))
|
14
|
+
* updating settings configuration and tests ([487ce36](https://github.com/klueless-io/appydave-tools/commit/487ce366b857ce38ed91b35e4b6cc15a8ef56d35))
|
15
|
+
|
1
16
|
## [0.3.1](https://github.com/klueless-io/appydave-tools/compare/v0.3.0...v0.3.1) (2024-05-16)
|
2
17
|
|
3
18
|
|
@@ -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
|
+
```
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appydave
|
4
|
+
module Tools
|
5
|
+
module Configuration
|
6
|
+
# Channel projects configuration
|
7
|
+
class ChannelProjectsConfig < ConfigBase
|
8
|
+
# Retrieve channel information by channel name (string or symbol)
|
9
|
+
def get_channel_info(channel_name)
|
10
|
+
channel_name = channel_name.to_s
|
11
|
+
ChannelInfo.new(data['channel_projects'][channel_name] || default_channel_info)
|
12
|
+
end
|
13
|
+
|
14
|
+
# Set channel information
|
15
|
+
def set_channel_info(channel_name, channel_info)
|
16
|
+
data['channel_projects'] ||= {}
|
17
|
+
data['channel_projects'][channel_name.to_s] = channel_info.to_h
|
18
|
+
end
|
19
|
+
|
20
|
+
# Retrieve a list of all channel projects
|
21
|
+
def channel_projects
|
22
|
+
data['channel_projects'].map do |_name, info|
|
23
|
+
ChannelInfo.new(info)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def default_data
|
30
|
+
{ 'channel_projects' => {} }
|
31
|
+
end
|
32
|
+
|
33
|
+
def default_channel_info
|
34
|
+
{
|
35
|
+
'content_projects' => '',
|
36
|
+
'video_projects' => '',
|
37
|
+
'published_projects' => '',
|
38
|
+
'abandoned_projects' => ''
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
# Type-safe class to access channel info properties
|
43
|
+
class ChannelInfo
|
44
|
+
attr_accessor :content_projects, :video_projects, :published_projects, :abandoned_projects
|
45
|
+
|
46
|
+
def initialize(data)
|
47
|
+
@content_projects = data['content_projects']
|
48
|
+
@video_projects = data['video_projects']
|
49
|
+
@published_projects = data['published_projects']
|
50
|
+
@abandoned_projects = data['abandoned_projects']
|
51
|
+
end
|
52
|
+
|
53
|
+
def to_h
|
54
|
+
{
|
55
|
+
'content_projects' => @content_projects,
|
56
|
+
'video_projects' => @video_projects,
|
57
|
+
'published_projects' => @published_projects,
|
58
|
+
'abandoned_projects' => @abandoned_projects
|
59
|
+
}
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appydave
|
4
|
+
module Tools
|
5
|
+
module Configuration
|
6
|
+
# Channels configuration
|
7
|
+
class ChannelsConfig < ConfigBase
|
8
|
+
# Retrieve channel information by channel code (string or symbol)
|
9
|
+
def get_channel(channel_key)
|
10
|
+
channel_key = channel_key.to_s
|
11
|
+
info = data['channels'][channel_key] || default_channel_info
|
12
|
+
ChannelInfo.new(channel_key, info)
|
13
|
+
end
|
14
|
+
|
15
|
+
# Set channel information
|
16
|
+
def set_channel(channel_key, channel_info)
|
17
|
+
data['channels'] ||= {}
|
18
|
+
data['channels'][channel_key.to_s] = channel_info.to_h
|
19
|
+
end
|
20
|
+
|
21
|
+
# Retrieve a list of all channels
|
22
|
+
def channels
|
23
|
+
data['channels'].map do |key, info|
|
24
|
+
ChannelInfo.new(key, info)
|
25
|
+
end
|
26
|
+
end
|
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
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def default_data
|
41
|
+
{ 'channels' => {} }
|
42
|
+
end
|
43
|
+
|
44
|
+
def default_channel_info
|
45
|
+
{
|
46
|
+
'code' => '',
|
47
|
+
'name' => '',
|
48
|
+
'youtube_handle' => ''
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
# Type-safe class to access channel properties
|
53
|
+
class ChannelInfo
|
54
|
+
attr_accessor :key, :code, :name, :youtube_handle
|
55
|
+
|
56
|
+
def initialize(key, data)
|
57
|
+
@key = key
|
58
|
+
@code = data['code']
|
59
|
+
@name = data['name']
|
60
|
+
@youtube_handle = data['youtube_handle']
|
61
|
+
end
|
62
|
+
|
63
|
+
def to_h
|
64
|
+
{
|
65
|
+
'code' => @code,
|
66
|
+
'name' => @name,
|
67
|
+
'youtube_handle' => @youtube_handle
|
68
|
+
}
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -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
|
|
@@ -46,6 +48,11 @@ module Appydave
|
|
46
48
|
Open3.capture3(open_vscode)
|
47
49
|
end
|
48
50
|
|
51
|
+
def debug
|
52
|
+
log.kv 'Configuration Path', config_path
|
53
|
+
configurations.each_value(&:debug)
|
54
|
+
end
|
55
|
+
|
49
56
|
private
|
50
57
|
|
51
58
|
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
|
15
|
+
def initialize
|
14
16
|
@config_path = File.join(Config.config_path, "#{config_name}.json")
|
15
17
|
@data = load
|
16
18
|
end
|
@@ -22,8 +24,30 @@ module Appydave
|
|
22
24
|
def load
|
23
25
|
return JSON.parse(File.read(config_path)) if File.exist?(config_path)
|
24
26
|
|
25
|
-
|
27
|
+
default_data
|
26
28
|
rescue JSON::ParserError
|
29
|
+
# log.exception e
|
30
|
+
default_data
|
31
|
+
end
|
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
|
+
|
50
|
+
def default_data
|
27
51
|
{}
|
28
52
|
end
|
29
53
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Naming Manager
|
2
|
+
|
3
|
+
[ChatGPT conversation](https://chatgpt.com/g/g-4dMsIRK3E-ruby-script-assistant/c/cab5e2f7-a607-402f-80b7-9ca262bab8ee)
|
4
|
+
|
5
|
+
## Channel Names
|
6
|
+
|
7
|
+
| Key | Code | Name | YouTube Handle |
|
8
|
+
|-----------------|------|-----------------|--------------------|
|
9
|
+
| appydave | ad | AppyDave | @appydave |
|
10
|
+
| appydave_coding | ac | AppyDave Coding | @appydavecoding |
|
11
|
+
| fli_video | fv | FliVideo | @flivideo |
|
12
|
+
| winning_prompts | wp | Winning Prompts | @winningprompts |
|
13
|
+
| trend10 | t1 | Trend10 | @trend10 |
|
14
|
+
| aitldr | tl | AI TLDR | @aitldr |
|
15
|
+
|
16
|
+
|
17
|
+
## Project Naming Component
|
18
|
+
|
19
|
+
The Project Naming Component is a tool designed to generate standardized names for projects within the YouTube content creation process.
|
20
|
+
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.
|
21
|
+
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
|
data/lib/appydave/tools.rb
CHANGED
@@ -5,6 +5,7 @@ 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'
|
@@ -12,6 +13,9 @@ require 'appydave/tools/gpt_context/file_collector'
|
|
12
13
|
require 'appydave/tools/configuration/config_base'
|
13
14
|
require 'appydave/tools/configuration/config'
|
14
15
|
require 'appydave/tools/configuration/settings_config'
|
16
|
+
require 'appydave/tools/configuration/channel_projects_config'
|
17
|
+
require 'appydave/tools/configuration/channels_config'
|
18
|
+
require 'appydave/tools/name_manager/project_name'
|
15
19
|
|
16
20
|
module Appydave
|
17
21
|
module Tools
|
data/package-lock.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "appydave-tools",
|
3
|
-
"version": "0.3.
|
3
|
+
"version": "0.3.4",
|
4
4
|
"lockfileVersion": 3,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "appydave-tools",
|
9
|
-
"version": "0.3.
|
9
|
+
"version": "0.3.4",
|
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
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.
|
4
|
+
version: 0.3.4
|
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-
|
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
|
@@ -49,11 +63,15 @@ files:
|
|
49
63
|
- bin/setup
|
50
64
|
- lib/appydave/tools.rb
|
51
65
|
- lib/appydave/tools/configuration/_doc.md
|
66
|
+
- lib/appydave/tools/configuration/channel_projects_config.rb
|
67
|
+
- lib/appydave/tools/configuration/channels_config.rb
|
52
68
|
- lib/appydave/tools/configuration/config.rb
|
53
69
|
- lib/appydave/tools/configuration/config_base.rb
|
54
70
|
- lib/appydave/tools/configuration/settings_config copy.xrb
|
55
71
|
- lib/appydave/tools/configuration/settings_config.rb
|
56
72
|
- lib/appydave/tools/gpt_context/file_collector.rb
|
73
|
+
- lib/appydave/tools/name_manager/_doc.md
|
74
|
+
- lib/appydave/tools/name_manager/project_name.rb
|
57
75
|
- lib/appydave/tools/version.rb
|
58
76
|
- package-lock.json
|
59
77
|
- package.json
|