appydave-tools 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38e915f4af00415a837d3951bf3b678b881617d820c57cf0842caf1751c272c0
4
- data.tar.gz: 3ec4f4c1093872fd73fe77fa7758ab8ae0926f80c180fc29a6ca0715a26529a2
3
+ metadata.gz: 697361623a5f429c2a7c06047d5669c8a9fcf27ebfb2b7f15ebf6037a4f4e39f
4
+ data.tar.gz: a612fe3a884667a7961b3b1306758e405a8988afdddd06ec9f1550b6b50b92c9
5
5
  SHA512:
6
- metadata.gz: '08f2ed9f573f47a57b19ff3b26c1f141ec42bd4965062fa5b53953a493fb6aaea57b4480c3dc3a53fe920ed24ecf6addbd217ad731adedb0f1d5b32cdec034fd'
7
- data.tar.gz: 26c0225c9185ccca543d3afa56b338bedeb88149989ed4b3e1440e9a9afbf234511401330d5b5d30b955f223382c2b34d724dbb103de0e092cda5023cc48ed17
6
+ metadata.gz: 055b7a37ab1651f8650635f5ea84b9b0df06c91600e92cad505255dd3ed2702c5113b837ddd68cf82d312621591c8a3a4d076db91111b30a0cf565c1c651278c
7
+ data.tar.gz: 6bbd3a0a492d0a8a55eee674fd2655b89e9f52953da0357d07cbaf938654009fb1ecf678fa8a432bf41f935001e37840cf92d3a5776f2c736092296e74caa19b
data/.rubocop.yml CHANGED
@@ -105,7 +105,7 @@ RSpec/NamedSubject:
105
105
  - "**/spec/**/*"
106
106
 
107
107
  RSpec/MultipleExpectations:
108
- Max: 5
108
+ Max: 8
109
109
 
110
110
  RSpec/NestedGroups:
111
111
  Max: 8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [0.5.0](https://github.com/klueless-io/appydave-tools/compare/v0.4.1...v0.5.0) (2024-05-26)
2
+
3
+
4
+ ### Features
5
+
6
+ * add configuration support for bank_reconciliation tool ([cfd6909](https://github.com/klueless-io/appydave-tools/commit/cfd6909d7c1de4c1acd9b84aaea28c9c7a07cc3f))
7
+
1
8
  ## [0.4.1](https://github.com/klueless-io/appydave-tools/compare/v0.4.0...v0.4.1) (2024-05-26)
2
9
 
3
10
 
@@ -61,7 +68,7 @@
61
68
 
62
69
  ### Bug Fixes
63
70
 
64
- * updating configuration with channels and channel_projects ([d4f54aa](https://github.com/klueless-io/appydave-tools/commit/d4f54aa0f455f535b6e265f23e6fba123d099d26))
71
+ * updating configuration with channels and channel_folders ([d4f54aa](https://github.com/klueless-io/appydave-tools/commit/d4f54aa0f455f535b6e265f23e6fba123d099d26))
65
72
 
66
73
  ## [0.3.2](https://github.com/klueless-io/appydave-tools/compare/v0.3.1...v0.3.2) (2024-05-16)
67
74
 
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ $LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
5
+
6
+ require 'pry'
7
+ require 'appydave/tools'
8
+
9
+ options = {}
10
+
11
+ OptionParser.new do |opts|
12
+ opts.banner = 'Usage: config_tool.rb [options]'
13
+
14
+ opts.on('-e', '--edit', 'Edit configuration in Visual Studio Code') do
15
+ options[:command] = :edit
16
+ end
17
+
18
+ opts.on('-l', '--list', 'List all configurations') do
19
+ options[:command] = :list
20
+ end
21
+
22
+ opts.on('-c', '--create', 'Create missing configurations') do
23
+ options[:command] = :create
24
+ end
25
+
26
+ opts.on('-p', '--print', 'Print configuration details') do
27
+ options[:command] = :print
28
+ end
29
+
30
+ opts.on_tail('-h', '--help', 'Show this message') do
31
+ puts opts
32
+ exit
33
+ end
34
+ end.parse!
35
+
36
+ case options[:command]
37
+ when :edit
38
+ Appydave::Tools::Configuration::Config.edit
39
+ when :list
40
+ Appydave::Tools::Configuration::Config.configure
41
+ configurations = Appydave::Tools::Configuration::Config.configurations.map do |name, config|
42
+ { name: name, path: config.config_path, exists: File.exist?(config.config_path) }
43
+ end
44
+ tp configurations, :name, :exists, { config_path => { column_width: 150 } }
45
+ when :create
46
+ Appydave::Tools::Configuration::Config.configure
47
+ Appydave::Tools::Configuration::Config.save
48
+ when :print
49
+ Appydave::Tools::Configuration::Config.configure
50
+ Appydave::Tools::Configuration::Config.print
51
+ else
52
+ puts 'No valid command provided. Use --help for usage information.'
53
+ end
@@ -3,9 +3,6 @@
3
3
  [ChatGPT conversation](https://chatgpt.com/g/g-4dMsIRK3E-ruby-script-assistant/c/d8ea5960-071b-48aa-9fd9-554ca302c7dd)
4
4
  [ChatGPT conversation for Schema](https://chatgpt.com/c/bb93e7ac-f139-44f9-8b9c-4e74ac2fa461)
5
5
 
6
- attr_accessor :code,
7
- :narration
8
-
9
6
 
10
7
  ## Schema
11
8
 
@@ -39,7 +36,7 @@
39
36
  }
40
37
  ```
41
38
 
42
- ### Channel Projects Schema
39
+ ### Channel Folders Schema
43
40
 
44
41
  - **content_projects**: Path to the shared folder for content creation (e.g., `"/user/Library/CloudStorage/Dropbox/team-appydave"`).
45
42
  - **video_projects**: Path to the local storage folder for active video projects (e.g., `"/user/tube-channels/appy-dave/active"`).
@@ -63,6 +63,11 @@ module Appydave
63
63
  configurations.each_value(&:debug)
64
64
  end
65
65
 
66
+ def print
67
+ log.kv 'Configuration Path', config_path
68
+ configurations.each_value(&:print)
69
+ end
70
+
66
71
  private
67
72
 
68
73
  def ensure_config_directory
@@ -75,11 +80,3 @@ module Appydave
75
80
  end
76
81
  end
77
82
  end
78
-
79
- # Configuration example usage
80
- # Appydave::Tools::Configuration::Config.configure do |config|
81
- # config.config_path = File.expand_path('~/.config/appydave') # optional, as this is already the default
82
- # # config.register(:settings, SettingsConfig)
83
- # # config.register(:gpt_context, GptContextConfig)
84
- # # Additional configurations can be registered as needed.
85
- # end
@@ -33,6 +33,10 @@ module Appydave
33
33
  ChartOfAccount.new(entry_data) if entry_data
34
34
  end
35
35
 
36
+ def print
37
+ log.heading 'Bank Reconciliation Configuration'
38
+ end
39
+
36
40
  private
37
41
 
38
42
  def default_data
@@ -36,6 +36,12 @@ module Appydave
36
36
  data['channels'].values.any? { |info| info['code'] == code }
37
37
  end
38
38
 
39
+ def print
40
+ log.heading 'Channel Configuration'
41
+
42
+ tp channels, :key, :code, :name, :youtube_handle
43
+ end
44
+
39
45
  private
40
46
 
41
47
  def default_data
@@ -46,26 +52,55 @@ module Appydave
46
52
  {
47
53
  'code' => '',
48
54
  'name' => '',
49
- 'youtube_handle' => ''
55
+ 'youtube_handle' => '',
56
+ 'locations' => {
57
+ 'content_projects' => '',
58
+ 'video_projects' => '',
59
+ 'published_projects' => '',
60
+ 'abandoned_projects' => ''
61
+ }
50
62
  }
51
63
  end
52
64
 
53
65
  # Type-safe class to access channel properties
54
66
  class ChannelInfo
55
- attr_accessor :key, :code, :name, :youtube_handle
67
+ attr_accessor :key, :code, :name, :youtube_handle, :locations
56
68
 
57
69
  def initialize(key, data)
58
70
  @key = key
59
71
  @code = data['code']
60
72
  @name = data['name']
61
73
  @youtube_handle = data['youtube_handle']
74
+ @locations = ChannelLocation.new(data['locations'] || {})
62
75
  end
63
76
 
64
77
  def to_h
65
78
  {
66
79
  'code' => @code,
67
80
  'name' => @name,
68
- 'youtube_handle' => @youtube_handle
81
+ 'youtube_handle' => @youtube_handle,
82
+ 'locations' => locations.to_h
83
+ }
84
+ end
85
+ end
86
+
87
+ # Type-safe class to access channel location properties
88
+ class ChannelLocation
89
+ attr_accessor :content_projects, :video_projects, :published_projects, :abandoned_projects
90
+
91
+ def initialize(data)
92
+ @content_projects = data['content_projects']
93
+ @video_projects = data['video_projects']
94
+ @published_projects = data['published_projects']
95
+ @abandoned_projects = data['abandoned_projects']
96
+ end
97
+
98
+ def to_h
99
+ {
100
+ 'content_projects' => @content_projects,
101
+ 'video_projects' => @video_projects,
102
+ 'published_projects' => @published_projects,
103
+ 'abandoned_projects' => @abandoned_projects
69
104
  }
70
105
  end
71
106
  end
@@ -27,6 +27,14 @@ module Appydave
27
27
  def download_image_folder
28
28
  get('download-image-folder') || download_folder
29
29
  end
30
+
31
+ def print
32
+ log.subheading 'Settings Configuration'
33
+
34
+ data.each do |key, value|
35
+ log.kv key, value
36
+ end
37
+ end
30
38
  end
31
39
  end
32
40
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Appydave
4
4
  module Tools
5
- VERSION = '0.5.0'
5
+ VERSION = '0.6.0'
6
6
  end
7
7
  end
@@ -17,7 +17,6 @@ require 'appydave/tools/configuration/config'
17
17
  require 'appydave/tools/configuration/models/config_base'
18
18
  require 'appydave/tools/configuration/models/settings_config'
19
19
  require 'appydave/tools/configuration/models/bank_reconciliation_config'
20
- require 'appydave/tools/configuration/models/channel_projects_config'
21
20
  require 'appydave/tools/configuration/models/channels_config'
22
21
  require 'appydave/tools/name_manager/project_name'
23
22
 
@@ -25,8 +24,7 @@ Appydave::Tools::Configuration::Config.set_default do |config|
25
24
  config.config_path = File.expand_path('~/.config/appydave')
26
25
  config.register(:settings, Appydave::Tools::Configuration::Models::SettingsConfig)
27
26
  config.register(:bank_reconciliation, Appydave::Tools::Configuration::Models::BankReconciliationConfig)
28
- config.register(:channels, Appydave::Tools::Configuration::ChannelsConfig)
29
- config.register(:channel_projects, Appydave::Tools::Configuration::ChannelProjectsConfig)
27
+ config.register(:channels, Appydave::Tools::Configuration::Models::ChannelsConfig)
30
28
  end
31
29
 
32
30
  module Appydave
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "appydave-tools",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "appydave-tools",
9
- "version": "0.5.0",
9
+ "version": "0.6.0",
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.5.0",
3
+ "version": "0.6.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.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys
@@ -86,6 +86,7 @@ files:
86
86
  - LICENSE.txt
87
87
  - README.md
88
88
  - Rakefile
89
+ - bin/configuration.rb
89
90
  - bin/console
90
91
  - bin/gpt_context.rb
91
92
  - bin/setup
@@ -95,7 +96,6 @@ files:
95
96
  - lib/appydave/tools/configuration/config.rb
96
97
  - lib/appydave/tools/configuration/configurable.rb
97
98
  - lib/appydave/tools/configuration/models/bank_reconciliation_config.rb
98
- - lib/appydave/tools/configuration/models/channel_projects_config.rb
99
99
  - lib/appydave/tools/configuration/models/channels_config.rb
100
100
  - lib/appydave/tools/configuration/models/config_base.rb
101
101
  - lib/appydave/tools/configuration/models/settings_config copy.xrb
@@ -1,67 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Appydave
4
- module Tools
5
- module Configuration
6
- module Models
7
- # Channel projects configuration
8
- class ChannelProjectsConfig < ConfigBase
9
- # Retrieve channel information by channel name (string or symbol)
10
- def get_channel_info(channel_name)
11
- channel_name = channel_name.to_s
12
- ChannelInfo.new(data['channel_projects'][channel_name] || default_channel_info)
13
- end
14
-
15
- # Set channel information
16
- def set_channel_info(channel_name, channel_info)
17
- data['channel_projects'] ||= {}
18
- data['channel_projects'][channel_name.to_s] = channel_info.to_h
19
- end
20
-
21
- # Retrieve a list of all channel projects
22
- def channel_projects
23
- data['channel_projects'].map do |_name, info|
24
- ChannelInfo.new(info)
25
- end
26
- end
27
-
28
- private
29
-
30
- def default_data
31
- { 'channel_projects' => {} }
32
- end
33
-
34
- def default_channel_info
35
- {
36
- 'content_projects' => '',
37
- 'video_projects' => '',
38
- 'published_projects' => '',
39
- 'abandoned_projects' => ''
40
- }
41
- end
42
-
43
- # Type-safe class to access channel info properties
44
- class ChannelInfo
45
- attr_accessor :content_projects, :video_projects, :published_projects, :abandoned_projects
46
-
47
- def initialize(data)
48
- @content_projects = data['content_projects']
49
- @video_projects = data['video_projects']
50
- @published_projects = data['published_projects']
51
- @abandoned_projects = data['abandoned_projects']
52
- end
53
-
54
- def to_h
55
- {
56
- 'content_projects' => @content_projects,
57
- 'video_projects' => @video_projects,
58
- 'published_projects' => @published_projects,
59
- 'abandoned_projects' => @abandoned_projects
60
- }
61
- end
62
- end
63
- end
64
- end
65
- end
66
- end
67
- end