appydave-tools 0.6.0 → 0.6.1

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: 697361623a5f429c2a7c06047d5669c8a9fcf27ebfb2b7f15ebf6037a4f4e39f
4
- data.tar.gz: a612fe3a884667a7961b3b1306758e405a8988afdddd06ec9f1550b6b50b92c9
3
+ metadata.gz: 2822e09cd6989d2fc8576f8d6b842e6ad40429d9931ae6bbdb557d4bb3a2991c
4
+ data.tar.gz: 4a9bc9044bcde2bd179a66349b5544430fb9fc8cb1a7b7a656fc5ed3ba8bd405
5
5
  SHA512:
6
- metadata.gz: 055b7a37ab1651f8650635f5ea84b9b0df06c91600e92cad505255dd3ed2702c5113b837ddd68cf82d312621591c8a3a4d076db91111b30a0cf565c1c651278c
7
- data.tar.gz: 6bbd3a0a492d0a8a55eee674fd2655b89e9f52953da0357d07cbaf938654009fb1ecf678fa8a432bf41f935001e37840cf92d3a5776f2c736092296e74caa19b
6
+ metadata.gz: 4c619668264809fc3be5b5bab73f360dc0480b7dde5b9e232e336edd62a3f416110dbf59ba705174b6b5f8f158819b01817ccacbb123498ad2e17af1330bcaef
7
+ data.tar.gz: 4f4c8c4ffbce01ac24a7860939b13f403e9e729d75cb3d7bd68e17a9c37580f2605db3b9667ab4f43a5236ff5803639721ce2452580884c2fe23a3414f031fd9
data/.rubocop.yml CHANGED
@@ -115,3 +115,6 @@ RSpec/DescribeClass:
115
115
 
116
116
  RSpec/PendingWithoutReason:
117
117
  Enabled: false
118
+
119
+ Metrics/AbcSize:
120
+ Max: 25
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, { config_path => { column_width: 150 } }
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
- log.kv 'Configuration Path', config_path
68
- configurations.each_value(&:print)
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.heading 'Bank Reconciliation Configuration'
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
- tp channels, :key, :code, :name, :youtube_handle
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Appydave
4
4
  module Tools
5
- VERSION = '0.6.0'
5
+ VERSION = '0.6.1'
6
6
  end
7
7
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "appydave-tools",
3
- "version": "0.6.0",
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.0",
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appydave-tools",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
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.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys