k_manager 0.0.32 → 0.0.36

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: e3058f62c501f797ee6ae5e970d0a0a59d333e3ebb290dc83c0b691fa33bc0c9
4
- data.tar.gz: b63576b8b85f8b475dea7aa6ba7df77118393bfdd9908a14a3d760e2a004bd47
3
+ metadata.gz: c5c48c7059e984d1169c49fc9f6a09bf76fccf4e365d38c5c2e59ff16c33c252
4
+ data.tar.gz: 43c93a025caaac0c35c4efbb64d04649dfd3956fc545b18b9488905df38d2d46
5
5
  SHA512:
6
- metadata.gz: c158cd92a983e7df6d184f336118e44171fa33250511a872fba764d243c6dcf24f110d90b1e96d86ebab534dfa2450087c18f9d4466aa39a9e1d7958ee04d532
7
- data.tar.gz: 28bd874b203cdf3d71bbcfbb029a465bad51ec71e355f42af85a50ca2e9c1366260b422b94df9f2e453db65aee90c3945d59c0db69697ef93fe91979f9f2274a
6
+ metadata.gz: 5e93f772f235c721d062543c44531c2936cde540d07b68f5dd38616bdfd523c844b07151a287af69eb6a4bad7b4b63e3b1534f06a5ab71ad635265d6ffb3a32e
7
+ data.tar.gz: f49f54d2b4d63f84cebfc3e1c67fc17ad53b17619d86b4cad32fbed365d38c80a7ef7ea19be040b865ac284363159e1ed2f4d308e41edd6222e3b7966efe79b5
data/.builders/boot.rb CHANGED
@@ -6,35 +6,25 @@ CONFIG_KEY = :k_manager
6
6
 
7
7
  log.kv 'working folder', Dir.pwd
8
8
 
9
- Handlebars::Helpers.configure do |config|
10
- config.helper_config_file = File.join(Gem.loaded_specs['handlebars-helpers'].full_gem_path, '.handlebars_helpers.json')
11
- config.string_formatter_config_file = File.join(Gem.loaded_specs['handlebars-helpers'].full_gem_path, '.handlebars_string_formatters.json')
12
- end
13
-
14
- def camel
15
- require 'handlebars/helpers/string_formatting/camel'
16
- Handlebars::Helpers::StringFormatting::Camel.new
17
- end
18
-
19
- def titleize
20
- require 'handlebars/helpers/string_formatting/titleize'
21
- Handlebars::Helpers::StringFormatting::Titleize.new
22
- end
23
-
24
- def pluralize
25
- require 'handlebars/helpers/inflection/pluralize'
26
- Handlebars::Helpers::Inflection::Pluralize.new
27
- end
28
-
29
- def singularize
30
- require 'handlebars/helpers/inflection/singularize'
31
- Handlebars::Helpers::Inflection::Singularize.new
32
- end
33
-
34
- def dasherize
35
- require 'handlebars/helpers/string_formatting/dasherize'
36
- Handlebars::Helpers::StringFormatting::Dasherize.new
37
- end
9
+ KConfig.configure do |config|
10
+ config.handlebars.defaults.add_all_defaults
11
+ end
12
+
13
+ # def camel
14
+ # Cmdlet::Case::Camel.new
15
+ # end
16
+ # def titleize
17
+ # Cmdlet::Case::Title.new
18
+ # end
19
+ # def pluralize
20
+ # Cmdlet::Case::Pluralize.new
21
+ # end
22
+ # def singularize
23
+ # Cmdlet::Case::Singularize.new
24
+ # end
25
+ # def dasherize
26
+ # Cmdlet::Case::Dash.new
27
+ # end
38
28
 
39
29
  def k_builder
40
30
  @k_builder ||= KBuilder::BaseBuilder.init(KConfig.configuration(CONFIG_KEY))
data/.rubocop.yml CHANGED
@@ -42,7 +42,7 @@ Metrics/MethodLength:
42
42
  Layout/LineLength:
43
43
  Max: 200
44
44
  # Ignores annotate output
45
- IgnoredPatterns: ['\A# \*\*']
45
+ AllowedPatterns: ['\A# \*\*']
46
46
  IgnoreCopDirectives: true
47
47
 
48
48
  Lint/UnusedMethodArgument:
data/Gemfile CHANGED
@@ -16,7 +16,7 @@ group :development, :test do
16
16
  gem 'guard-bundler'
17
17
  gem 'guard-rspec'
18
18
  gem 'guard-rubocop'
19
- gem 'rake', '~> 12.0'
19
+ gem 'rake'
20
20
  gem 'rake-compiler', require: false
21
21
  gem 'rspec', '~> 3.0'
22
22
  gem 'rubocop'
@@ -28,7 +28,8 @@ end
28
28
  if ENV['KLUE_LOCAL_GEMS']&.to_s&.downcase == 'true'
29
29
  group :development, :test do
30
30
  puts 'Using Local GEMs'
31
- gem 'handlebars-helpers' , path: '../handlebars-helpers'
31
+ # gem 'handlebars-helpers' , path: '../handlebars-helpers'
32
+ gem 'handlebarsjs' , path: '../handlebarsjs'
32
33
  gem 'k_builder' , path: '../k_builder'
33
34
  gem 'k_builder-dotnet' , path: '../k_builder-dotnet'
34
35
  # gem 'k_builder-package_json' , path: '../k_builder-package_json'
data/k_manager.gemspec CHANGED
@@ -22,9 +22,10 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  # spec.metadata['allowed_push_host'] = "Set to 'http://mygemserver.com'"
24
24
 
25
- spec.metadata['homepage_uri'] = spec.homepage
26
- spec.metadata['source_code_uri'] = 'https://github.com/klueless-io/k_manager'
27
- spec.metadata['changelog_uri'] = 'https://github.com/klueless-io/k_manager/commits/master'
25
+ spec.metadata['homepage_uri'] = spec.homepage
26
+ spec.metadata['source_code_uri'] = 'https://github.com/klueless-io/k_manager'
27
+ spec.metadata['changelog_uri'] = 'https://github.com/klueless-io/k_manager/commits/master'
28
+ spec.metadata['rubygems_mfa_required'] = 'true'
28
29
 
29
30
  # Specify which files should be added to the gem when it is released.
30
31
  # The `git ls-files -z` loads the RubyGem files that have been added into git.
@@ -38,6 +39,7 @@ Gem::Specification.new do |spec|
38
39
  spec.require_paths = ['lib']
39
40
  # spec.extensions = ['ext/k_manager/extconf.rb']
40
41
 
42
+ spec.add_dependency 'cmdlet', '~> 0'
41
43
  spec.add_dependency 'drawio_dsl', '~> 0.1'
42
44
  spec.add_dependency 'dry-struct', '~> 1'
43
45
  spec.add_dependency 'filewatcher', '~> 2.0.0.beta5'
@@ -52,7 +54,4 @@ Gem::Specification.new do |spec|
52
54
  # spec.add_dependency 'k_type' , '~> 0.0.0'
53
55
  # spec.add_dependency 'k_util' , '~> 0.0.0'
54
56
  spec.add_dependency 'dry-cli', '~> 0.7.0'
55
- spec.metadata = {
56
- 'rubygems_mfa_required' => 'true'
57
- }
58
57
  end
@@ -76,6 +76,7 @@ module KManager
76
76
  end
77
77
  # rubocop:enable Metrics/ParameterLists
78
78
 
79
+ # rubocop:disable Metrics/CyclomaticComplexity
79
80
  def setup_builder_from_template(name, builder_folder, template_root_folder, template, **opts)
80
81
  return false unless template
81
82
 
@@ -83,6 +84,8 @@ module KManager
83
84
  template_folder = File.join(template_root_folder, template)
84
85
  starter_config = template_starter_config(template_folder)
85
86
 
87
+ log.error("Starter config not found for template: #{template}") unless starter_config
88
+
86
89
  return false unless starter_config
87
90
 
88
91
  builder = get_builder(builder_folder, template_folder)
@@ -93,6 +96,7 @@ module KManager
93
96
  builder.add_file(relative_file, template_file: relative_file, **{ name: name }.merge(opts))
94
97
  end
95
98
  end
99
+ # rubocop:enable Metrics/CyclomaticComplexity
96
100
 
97
101
  def template_starter_config(template_folder)
98
102
  starter_file = File.join(template_folder, '.starter.json')
@@ -104,9 +108,16 @@ module KManager
104
108
 
105
109
  # rubocop:disable Metrics/AbcSize
106
110
  def get_builder(builder_folder, template_folder)
107
- Handlebars::Helpers.configure do |config|
108
- config.helper_config_file = File.join(Gem.loaded_specs['handlebars-helpers'].full_gem_path, '.handlebars_helpers.json')
109
- config.string_formatter_config_file = File.join(Gem.loaded_specs['handlebars-helpers'].full_gem_path, '.handlebars_string_formatters.json')
111
+ # Handlebars::Helpers.configure do |config|
112
+ # config.helper_config_file = File.join(Gem.loaded_specs['handlebars-helpers'].full_gem_path, '.handlebars_helpers.json')
113
+ # config.string_formatter_config_file = File.join(Gem.loaded_specs['handlebars-helpers'].full_gem_path, '.handlebars_string_formatters.json')
114
+ # end
115
+
116
+ KConfig.configure do |config|
117
+ config.handlebars.defaults.add_array_defaults
118
+ config.handlebars.defaults.add_case_defaults
119
+ config.handlebars.defaults.add_comparison_defaults
120
+ config.handlebars.defaults.add_inflection_defaults
110
121
  end
111
122
 
112
123
  KConfig.configure(:starter_template) do |config|
@@ -25,7 +25,9 @@ module KManager
25
25
  # Infer key is the file name without the extension stored in dash-case
26
26
  def infer_key
27
27
  file_name = Pathname.new(source_path).basename.sub_ext('').to_s
28
- Handlebars::Helpers::StringFormatting::Snake.new.parse(file_name)
28
+
29
+ # Handlebars::Helpers::StringFormatting::Snake.new.parse(file_name)
30
+ Cmdlet::Case::Snake.new.call(file_name)
29
31
  end
30
32
 
31
33
  def default_scheme
@@ -4,8 +4,6 @@ require 'securerandom'
4
4
 
5
5
  module KManager
6
6
  module Resources
7
- require 'handlebars/helpers/string_formatting/dasherize'
8
-
9
7
  # A memory resource represents content that is generated programmatically and just stored in memory.
10
8
  class MemResource < KManager::Resources::BaseResource
11
9
  def initialize(**opts)
@@ -2,8 +2,6 @@
2
2
 
3
3
  module KManager
4
4
  module Resources
5
- require 'handlebars/helpers/string_formatting/dasherize'
6
-
7
5
  # A web resource represents content that is loaded via a web URI.
8
6
  #
9
7
  # Web resources do not support watchers and so if you want to handle
@@ -21,7 +19,7 @@ module KManager
21
19
  # Infer key is the file name without the extension stored in dash-case
22
20
  def infer_key
23
21
  last_segment = uri.path.split('/').last
24
- Handlebars::Helpers::StringFormatting::Snake.new.parse(last_segment)
22
+ Cmdlet::Case::Snake.new.call(last_segment)
25
23
  end
26
24
 
27
25
  def default_scheme
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KManager
4
- VERSION = '0.0.32'
4
+ VERSION = '0.0.36'
5
5
  end
data/lib/k_manager.rb CHANGED
@@ -5,6 +5,7 @@ require 'dry-struct'
5
5
  require 'forwardable'
6
6
  require 'k_log'
7
7
  require 'k_config'
8
+ require 'cmdlet'
8
9
  require 'k_doc'
9
10
  require 'k_domain'
10
11
  require 'k_director'
@@ -13,10 +14,6 @@ require 'k_builder'
13
14
  require 'k_ext/github'
14
15
  require 'drawio_dsl'
15
16
 
16
- # IS THIS NEEDED? this was used for infer_key
17
- require 'handlebars/helpers/string_formatting/dasherize'
18
- require 'handlebars/helpers/string_formatting/snake'
19
-
20
17
  require 'k_manager/version'
21
18
  require 'k_manager/overview/models'
22
19
  require 'k_manager/overview/queries'
@@ -133,7 +130,7 @@ module KManager
133
130
  end
134
131
  end
135
132
 
136
- if ENV['KLUE_DEBUG']&.to_s&.downcase == 'true'
133
+ if ENV.fetch('KLUE_DEBUG', 'false').downcase == 'true'
137
134
  namespace = 'KManager::Version'
138
135
  file_path = $LOADED_FEATURES.find { |f| f.include?('k_manager/version') }
139
136
  version = KManager::VERSION.ljust(9)
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: k_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.32
4
+ version: 0.0.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-08 00:00:00.000000000 Z
11
+ date: 2022-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: cmdlet
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: drawio_dsl
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -241,6 +255,9 @@ homepage: http://appydave.com/gems/k-manager
241
255
  licenses:
242
256
  - MIT
243
257
  metadata:
258
+ homepage_uri: http://appydave.com/gems/k-manager
259
+ source_code_uri: https://github.com/klueless-io/k_manager
260
+ changelog_uri: https://github.com/klueless-io/k_manager/commits/master
244
261
  rubygems_mfa_required: 'true'
245
262
  post_install_message:
246
263
  rdoc_options: []
@@ -257,7 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
257
274
  - !ruby/object:Gem::Version
258
275
  version: '0'
259
276
  requirements: []
260
- rubygems_version: 3.2.33
277
+ rubygems_version: 3.1.6
261
278
  signing_key:
262
279
  specification_version: 4
263
280
  summary: K Manager provides a managed host for documents, resources and code generator