appydave-tools 0.6.0 → 0.6.1
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 +3 -0
- data/CHANGELOG.md +7 -0
- data/bin/configuration.rb +12 -4
- data/lib/appydave/tools/configuration/config.rb +19 -3
- data/lib/appydave/tools/configuration/models/bank_reconciliation_config.rb +7 -1
- data/lib/appydave/tools/configuration/models/channels_config.rb +20 -1
- data/lib/appydave/tools/version.rb +1 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2822e09cd6989d2fc8576f8d6b842e6ad40429d9931ae6bbdb557d4bb3a2991c
|
4
|
+
data.tar.gz: 4a9bc9044bcde2bd179a66349b5544430fb9fc8cb1a7b7a656fc5ed3ba8bd405
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c619668264809fc3be5b5bab73f360dc0480b7dde5b9e232e336edd62a3f416110dbf59ba705174b6b5f8f158819b01817ccacbb123498ad2e17af1330bcaef
|
7
|
+
data.tar.gz: 4f4c8c4ffbce01ac24a7860939b13f403e9e729d75cb3d7bd68e17a9c37580f2605db3b9667ab4f43a5236ff5803639721ce2452580884c2fe23a3414f031fd9
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# [0.6.0](https://github.com/klueless-io/appydave-tools/compare/v0.5.0...v0.6.0) (2024-05-26)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* refactor channels with locations, removed channel projects ([6b64574](https://github.com/klueless-io/appydave-tools/commit/6b645742b0029a001792c8d405dcae0b1036f2c0))
|
7
|
+
|
1
8
|
# [0.5.0](https://github.com/klueless-io/appydave-tools/compare/v0.4.1...v0.5.0) (2024-05-26)
|
2
9
|
|
3
10
|
|
data/bin/configuration.rb
CHANGED
@@ -1,12 +1,19 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
+
# Example of a simple command line tool to manage configuration files
|
5
|
+
# ad_config -p settings,channels
|
6
|
+
# ad_config -p
|
7
|
+
# ad_config -l
|
8
|
+
# ad_config -c
|
9
|
+
# ad_config -e
|
10
|
+
|
4
11
|
$LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
|
5
12
|
|
6
13
|
require 'pry'
|
7
14
|
require 'appydave/tools'
|
8
15
|
|
9
|
-
options = {}
|
16
|
+
options = { keys: [] }
|
10
17
|
|
11
18
|
OptionParser.new do |opts|
|
12
19
|
opts.banner = 'Usage: config_tool.rb [options]'
|
@@ -23,8 +30,9 @@ OptionParser.new do |opts|
|
|
23
30
|
options[:command] = :create
|
24
31
|
end
|
25
32
|
|
26
|
-
opts.on('-p', '--print', 'Print configuration details') do
|
33
|
+
opts.on('-p', '--print [KEYS]', Array, 'Print configuration details for specified keys') do |keys|
|
27
34
|
options[:command] = :print
|
35
|
+
options[:keys] = keys
|
28
36
|
end
|
29
37
|
|
30
38
|
opts.on_tail('-h', '--help', 'Show this message') do
|
@@ -41,13 +49,13 @@ when :list
|
|
41
49
|
configurations = Appydave::Tools::Configuration::Config.configurations.map do |name, config|
|
42
50
|
{ name: name, path: config.config_path, exists: File.exist?(config.config_path) }
|
43
51
|
end
|
44
|
-
tp configurations, :name, :exists, {
|
52
|
+
tp configurations, :name, :exists, { path: { width: 150 } }
|
45
53
|
when :create
|
46
54
|
Appydave::Tools::Configuration::Config.configure
|
47
55
|
Appydave::Tools::Configuration::Config.save
|
48
56
|
when :print
|
49
57
|
Appydave::Tools::Configuration::Config.configure
|
50
|
-
Appydave::Tools::Configuration::Config.print
|
58
|
+
Appydave::Tools::Configuration::Config.print(*options[:keys])
|
51
59
|
else
|
52
60
|
puts 'No valid command provided. Use --help for usage information.'
|
53
61
|
end
|
@@ -63,9 +63,25 @@ module Appydave
|
|
63
63
|
configurations.each_value(&:debug)
|
64
64
|
end
|
65
65
|
|
66
|
-
def print
|
67
|
-
|
68
|
-
|
66
|
+
# def print
|
67
|
+
# log.kv 'Configuration Path', config_path
|
68
|
+
# configurations.each_value(&:print)
|
69
|
+
# end
|
70
|
+
|
71
|
+
def print(*keys)
|
72
|
+
if keys.empty?
|
73
|
+
keys = configurations.keys
|
74
|
+
else
|
75
|
+
keys.map!(&:to_sym)
|
76
|
+
end
|
77
|
+
|
78
|
+
keys.each do |key|
|
79
|
+
if configurations[key]
|
80
|
+
configurations[key].print
|
81
|
+
else
|
82
|
+
log.error "Configuration not available: #{key}"
|
83
|
+
end
|
84
|
+
end
|
69
85
|
end
|
70
86
|
|
71
87
|
private
|
@@ -34,7 +34,13 @@ module Appydave
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def print
|
37
|
-
log.
|
37
|
+
log.subheading 'Bank Reconciliation - Accounts'
|
38
|
+
|
39
|
+
tp bank_accounts, :account_number, :bsb, :name, :bank
|
40
|
+
|
41
|
+
log.subheading 'Bank Reconciliation - Chart of Accounts'
|
42
|
+
|
43
|
+
tp chart_of_accounts, :code, :narration
|
38
44
|
end
|
39
45
|
|
40
46
|
private
|
@@ -39,11 +39,30 @@ module Appydave
|
|
39
39
|
def print
|
40
40
|
log.heading 'Channel Configuration'
|
41
41
|
|
42
|
-
|
42
|
+
print_channels = channels.map do |channel|
|
43
|
+
{
|
44
|
+
key: channel.key,
|
45
|
+
code: channel.code,
|
46
|
+
name: channel.name,
|
47
|
+
youtube_handle: channel.youtube_handle,
|
48
|
+
content_projects: print_location(channel.locations.content_projects),
|
49
|
+
video_projects: print_location(channel.locations.video_projects),
|
50
|
+
published_projects: print_location(channel.locations.published_projects),
|
51
|
+
abandoned_projects: print_location(channel.locations.abandoned_projects)
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
tp print_channels, :key, :code, :name, :youtube_handle, :content_projects, :video_projects, :published_projects, :abandoned_projects
|
43
56
|
end
|
44
57
|
|
45
58
|
private
|
46
59
|
|
60
|
+
def print_location(location)
|
61
|
+
return 'Not Set' unless location
|
62
|
+
|
63
|
+
File.exist?(location) ? 'TRUE' : 'false'
|
64
|
+
end
|
65
|
+
|
47
66
|
def default_data
|
48
67
|
{ 'channels' => {} }
|
49
68
|
end
|
data/package-lock.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "appydave-tools",
|
3
|
-
"version": "0.6.
|
3
|
+
"version": "0.6.1",
|
4
4
|
"lockfileVersion": 3,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "appydave-tools",
|
9
|
-
"version": "0.6.
|
9
|
+
"version": "0.6.1",
|
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