appydave-tools 0.3.4 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/images.log +0 -0
- data/lib/appydave/tools/configuration/config.rb +16 -7
- data/lib/appydave/tools/configuration/configurable.rb +14 -0
- data/lib/appydave/tools/gpt_context/file_collector.rb +2 -0
- data/lib/appydave/tools/name_manager/_doc.md +1 -0
- data/lib/appydave/tools/name_manager/project_name.rb +15 -3
- data/lib/appydave/tools/version.rb +1 -1
- data/lib/appydave/tools.rb +8 -0
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adb0c7689faee4bc0c113a06a96f5c1f3e8537bfa7aff27486ce993edad0a87a
|
4
|
+
data.tar.gz: 834961331dacd537494daddd88347f0688499c9f5399b147c0ae1176aa683360
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16676ca28b4c46c6b1bec9aef3ed9c103e426fa582d748bf6d6e4234e002bdfef9dc98e487d5b96a883df4b1e986ebfc7d9d20388a587207c092ec32a778d2e7
|
7
|
+
data.tar.gz: d8360470ac1f0015d40c7d6acb9cb7afaf10231f0486015dab83c4f4e88e30fa792419e135b96302c749e38bc999bbfb7884be27d63b56975e1a99e245ff405c
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
## [0.3.5](https://github.com/klueless-io/appydave-tools/compare/v0.3.4...v0.3.5) (2024-05-19)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* add support for configurable ([82852f8](https://github.com/klueless-io/appydave-tools/commit/82852f805809b133278de70be24314e83a1d4b05))
|
7
|
+
|
8
|
+
## [0.3.4](https://github.com/klueless-io/appydave-tools/compare/v0.3.3...v0.3.4) (2024-05-19)
|
9
|
+
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
13
|
+
* Add debug capability to ConfigBase and update configurations ([d33c943](https://github.com/klueless-io/appydave-tools/commit/d33c9431a50fa44b2f4db7ccbaf2522105710aa7))
|
14
|
+
* resolve cop ([d56f670](https://github.com/klueless-io/appydave-tools/commit/d56f670ec69ea74438947dd1bb7296e7fa28f0f1))
|
15
|
+
|
1
16
|
## [0.3.3](https://github.com/klueless-io/appydave-tools/compare/v0.3.2...v0.3.3) (2024-05-18)
|
2
17
|
|
3
18
|
|
data/images.log
ADDED
File without changes
|
@@ -10,9 +10,16 @@ module Appydave
|
|
10
10
|
|
11
11
|
attr_accessor :config_path
|
12
12
|
attr_reader :configurations
|
13
|
+
attr_reader :default_block
|
13
14
|
|
14
15
|
def configure
|
15
|
-
|
16
|
+
if block_given?
|
17
|
+
yield self
|
18
|
+
elsif default_block
|
19
|
+
default_block.call(self)
|
20
|
+
else
|
21
|
+
raise Appydave::Tools::Error, 'No configuration block provided'
|
22
|
+
end
|
16
23
|
ensure_config_directory
|
17
24
|
end
|
18
25
|
|
@@ -21,12 +28,10 @@ module Appydave
|
|
21
28
|
@configurations[key] = klass.new
|
22
29
|
end
|
23
30
|
|
24
|
-
def method_missing(method_name, *
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
super
|
29
|
-
end
|
31
|
+
def method_missing(method_name, *_args)
|
32
|
+
raise Appydave::Tools::Error, "Configuration not available: #{method_name}" unless @configurations.key?(method_name)
|
33
|
+
|
34
|
+
@configurations[method_name]
|
30
35
|
end
|
31
36
|
|
32
37
|
def respond_to_missing?(method_name, include_private = false)
|
@@ -37,6 +42,10 @@ module Appydave
|
|
37
42
|
configurations.each_value(&:save)
|
38
43
|
end
|
39
44
|
|
45
|
+
def set_default(&block)
|
46
|
+
@default_block = block
|
47
|
+
end
|
48
|
+
|
40
49
|
def load
|
41
50
|
configurations.each_value(&:load)
|
42
51
|
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
|
@@ -6,6 +6,8 @@ module Appydave
|
|
6
6
|
module NameManager
|
7
7
|
# Parses and generates project names for Appydave video projects
|
8
8
|
class ProjectName
|
9
|
+
include Appydave::Tools::Configuration::Configurable
|
10
|
+
|
9
11
|
attr_reader :sequence, :channel_code, :project_name
|
10
12
|
|
11
13
|
def initialize(file_name)
|
@@ -29,10 +31,20 @@ module Appydave
|
|
29
31
|
def parse_file_name(file_name)
|
30
32
|
file_name = File.basename(file_name, File.extname(file_name))
|
31
33
|
parts = file_name.split('-')
|
34
|
+
length = parts.length
|
35
|
+
|
36
|
+
@sequence = part(parts, 0)
|
37
|
+
code = part(parts, 1)
|
38
|
+
if config.channels.code?(code)
|
39
|
+
@channel_code = code
|
40
|
+
@project_name = parts[2..length].join('-')
|
41
|
+
else
|
42
|
+
@project_name = parts[1..length].join('-')
|
43
|
+
end
|
44
|
+
end
|
32
45
|
|
33
|
-
|
34
|
-
|
35
|
-
@channel_code = parts.length == 3 ? parts[1] : nil
|
46
|
+
def part(parts, index)
|
47
|
+
parts[index] if parts.length > index
|
36
48
|
end
|
37
49
|
end
|
38
50
|
end
|
data/lib/appydave/tools.rb
CHANGED
@@ -10,6 +10,7 @@ require 'k_log'
|
|
10
10
|
require 'appydave/tools/version'
|
11
11
|
require 'appydave/tools/gpt_context/file_collector'
|
12
12
|
|
13
|
+
require 'appydave/tools/configuration/configurable'
|
13
14
|
require 'appydave/tools/configuration/config_base'
|
14
15
|
require 'appydave/tools/configuration/config'
|
15
16
|
require 'appydave/tools/configuration/settings_config'
|
@@ -17,6 +18,13 @@ require 'appydave/tools/configuration/channel_projects_config'
|
|
17
18
|
require 'appydave/tools/configuration/channels_config'
|
18
19
|
require 'appydave/tools/name_manager/project_name'
|
19
20
|
|
21
|
+
Appydave::Tools::Configuration::Config.set_default do |config|
|
22
|
+
config.config_path = File.expand_path('~/.config/appydave')
|
23
|
+
config.register(:settings, Appydave::Tools::Configuration::SettingsConfig)
|
24
|
+
config.register(:channels, Appydave::Tools::Configuration::ChannelsConfig)
|
25
|
+
config.register(:channel_projects, Appydave::Tools::Configuration::ChannelProjectsConfig)
|
26
|
+
end
|
27
|
+
|
20
28
|
module Appydave
|
21
29
|
module Tools
|
22
30
|
# raise Appydave::Tools::Error, 'Sample message'
|
data/package-lock.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "appydave-tools",
|
3
|
-
"version": "0.3.
|
3
|
+
"version": "0.3.6",
|
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.6",
|
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,7 +1,7 @@
|
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Cruwys
|
@@ -61,12 +61,14 @@ files:
|
|
61
61
|
- bin/console
|
62
62
|
- bin/gpt_context.rb
|
63
63
|
- bin/setup
|
64
|
+
- images.log
|
64
65
|
- lib/appydave/tools.rb
|
65
66
|
- lib/appydave/tools/configuration/_doc.md
|
66
67
|
- lib/appydave/tools/configuration/channel_projects_config.rb
|
67
68
|
- lib/appydave/tools/configuration/channels_config.rb
|
68
69
|
- lib/appydave/tools/configuration/config.rb
|
69
70
|
- lib/appydave/tools/configuration/config_base.rb
|
71
|
+
- lib/appydave/tools/configuration/configurable.rb
|
70
72
|
- lib/appydave/tools/configuration/settings_config copy.xrb
|
71
73
|
- lib/appydave/tools/configuration/settings_config.rb
|
72
74
|
- lib/appydave/tools/gpt_context/file_collector.rb
|