sublime_text_kit 15.0.2 → 15.1.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: e52d68a4e82fba2e7dc49a8856fa8bfa430f44e4d45eeccc63ccdfffcb3a8222
4
- data.tar.gz: 9fbca89659ec12819b56ac2ff9cd7a8189c53efaf875d6ede76de1db0136ea01
3
+ metadata.gz: 426bb0cdbed624a74a7ff55c0a8c4e9a0bc5abd3388e23b39ca6d154e75cb840
4
+ data.tar.gz: a61ec489dcfdd0dabbefe2347463af29c37d64acf2eb60019af2d6af12410957
5
5
  SHA512:
6
- metadata.gz: dc510b1a5685a230217225d73db20d8c58f568d939524465393a41d135b3cec9332c408c1db5cbd5463f49a56597cfb3513b65bee52f825059ef717f7b103ae9
7
- data.tar.gz: 355749789d8fee3f696f8c62817277085f624a53ac4b58076c8ff9905dba1f6f074ef546a4af0fcdc67e9993480856be63b6b0a67cd9b90abca520a5d8b0d810
6
+ metadata.gz: 89453df047772967f865f828785ebd7104ad59656552296b49a96e443086a5e5672d44fe05d27642b0240d00830a8b6c9a3228ed521027e18c16481219303e78
7
+ data.tar.gz: 92f0eb14e8aba757f34781bb570291e647ef01d4bc0489b04febf9337b595f9a0eb8a9f401f2bf046578f69cdc20b48ddfa9123916e02a7d525c9a867b52c5c7
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -47,25 +47,7 @@ gem install sublime_text_kit
47
47
 
48
48
  From the command line, type: `sublime_text_kit`
49
49
 
50
- ....
51
- USAGE
52
- sublime_text_kit [OPTIONS]
53
- sublime_text_kit COMMAND [OPTIONS]
54
-
55
- OPTIONS
56
- -S, --session Rebuild session metadata.
57
- -s, --snippets [FORMAT] View snippets.
58
- Use: markdown or ascii_doc.
59
- Default: ascii_doc.
60
- -u, --update Update project and session metadata based on current settings.
61
- -v, --version Show version.
62
- -h, --help [COMMAND] Show this message.
63
-
64
- COMMANDS
65
- config Manage configuration.
66
- Path is dynamic per current directory.
67
- metadata Manage project metadata.
68
- ....
50
+ image:https://alchemists.io/images/projects/sublime_text_kit/screenshots/usage.png[Usage,width=773,height=413,role=focal_point]
69
51
 
70
52
  === Customization
71
53
 
data/exe/sublime_text_kit CHANGED
@@ -3,4 +3,4 @@
3
3
 
4
4
  require "sublime_text_kit"
5
5
 
6
- SublimeTextKit::CLI::Shell.new.call ARGV
6
+ SublimeTextKit::CLI::Shell.new.call
@@ -5,20 +5,9 @@ require "refinements/pathnames"
5
5
  module SublimeTextKit
6
6
  module Configuration
7
7
  # Models the configuration.
8
- Model = Struct.new(
9
- :project_roots,
10
- :metadata_dir,
11
- :snippets_format,
12
- :session_path,
13
- :user_dir
14
- ) do
8
+ Model = Struct.new :project_roots, :metadata_dir, :snippets_format, :session_path, :user_dir do
15
9
  using Refinements::Pathnames
16
10
 
17
- def initialize(**)
18
- super
19
- freeze
20
- end
21
-
22
11
  def project_dirs
23
12
  Array(project_roots).map { |path| Pathname(path).expand_path }
24
13
  .flat_map(&:directories)
@@ -9,22 +9,23 @@ module SublimeTextKit
9
9
  class SessionPath
10
10
  include Dry::Monads[:result]
11
11
 
12
- def initialize
13
- path = "Library/Application Support/Sublime Text/Local/Session.sublime_session"
12
+ DEFAULT = "Library/Application Support/Sublime Text/Local/Session.sublime_session"
14
13
 
15
- @path = path
14
+ def initialize key = :session_path, default: DEFAULT
15
+ @key = key
16
+ @default = default
16
17
  end
17
18
 
18
19
  def call content
19
20
  return Success content unless content.key? :home
20
21
 
21
- Pathname(content[:home]).join(path)
22
- .then { |session_path| Success content.merge!(session_path:) }
22
+ Pathname(content[:home]).join(default)
23
+ .then { |value| Success content.merge!(key => value) }
23
24
  end
24
25
 
25
26
  private
26
27
 
27
- attr_reader :path
28
+ attr_reader :key, :default
28
29
  end
29
30
  end
30
31
  end
@@ -9,20 +9,23 @@ module SublimeTextKit
9
9
  class UserDir
10
10
  include Dry::Monads[:result]
11
11
 
12
- def initialize path = "Library/Application Support/Sublime Text/Packages/User"
13
- @path = path
12
+ DEFAULT = "Library/Application Support/Sublime Text/Packages/User"
13
+
14
+ def initialize key = :user_dir, default: DEFAULT
15
+ @key = key
16
+ @default = default
14
17
  end
15
18
 
16
19
  def call content
17
20
  return Success content unless content.key? :home
18
21
 
19
- Pathname(content[:home]).join(path)
20
- .then { |user_dir| Success content.merge!(user_dir:) }
22
+ Pathname(content[:home]).join(default)
23
+ .then { |value| Success content.merge!(key => value) }
21
24
  end
22
25
 
23
26
  private
24
27
 
25
- attr_reader :path
28
+ attr_reader :key, :default
26
29
  end
27
30
  end
28
31
  end
@@ -11,7 +11,7 @@ module SublimeTextKit
11
11
  module Container
12
12
  extend Dry::Container::Mixin
13
13
 
14
- register :configuration do
14
+ register :configuration, memoize: true do
15
15
  self[:defaults].add_loader(Etcher::Loaders::Environment.new(%w[HOME]))
16
16
  .add_loader(Etcher::Loaders::YAML.new(self[:xdg_config].active))
17
17
  .add_transformer(Configuration::Transformers::SessionPath.new)
@@ -19,15 +19,18 @@ module SublimeTextKit
19
19
  .then { |registry| Etcher.call registry }
20
20
  end
21
21
 
22
- register :defaults do
22
+ register :defaults, memoize: true do
23
23
  Etcher::Registry.new(contract: Configuration::Contract, model: Configuration::Model)
24
24
  .add_loader(Etcher::Loaders::YAML.new(self[:defaults_path]))
25
25
  end
26
26
 
27
- register(:defaults_path) { Pathname(__dir__).join("configuration/defaults.yml") }
28
- register(:xdg_config) { Runcom::Config.new "sublime_text_kit/configuration.yml" }
29
- register(:specification) { Spek::Loader.call "#{__dir__}/../../sublime_text_kit.gemspec" }
30
- register(:kernel) { Kernel }
31
- register(:logger) { Cogger.new formatter: :emoji }
27
+ register :specification, memoize: true do
28
+ Spek::Loader.call "#{__dir__}/../../sublime_text_kit.gemspec"
29
+ end
30
+
31
+ register(:defaults_path, memoize: true) { Pathname(__dir__).join("configuration/defaults.yml") }
32
+ register(:xdg_config, memoize: true) { Runcom::Config.new "sublime_text_kit/configuration.yml" }
33
+ register(:logger, memoize: true) { Cogger.new formatter: :emoji }
34
+ register :kernel, Kernel
32
35
  end
33
36
  end
@@ -2,12 +2,14 @@
2
2
 
3
3
  require "zeitwerk"
4
4
 
5
- Zeitwerk::Loader.for_gem
6
- .then do |loader|
7
- loader.inflector.inflect "ascii_doc" => "ASCIIDoc", "cli" => "CLI"
8
- loader.setup
9
- end
5
+ Zeitwerk::Loader.new.then do |loader|
6
+ loader.inflector.inflect "ascii_doc" => "ASCIIDoc", "cli" => "CLI"
7
+ loader.tag = File.basename __FILE__, ".rb"
8
+ loader.push_dir __dir__
9
+ loader.setup
10
+ end
10
11
 
11
12
  # Main namespace.
12
13
  module SublimeTextKit
14
+ def self.loader(registry = Zeitwerk::Registry) = registry.loader_for __FILE__
13
15
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "sublime_text_kit"
5
- spec.version = "15.0.2"
5
+ spec.version = "15.1.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/sublime_text_kit"
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sublime_text_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.0.2
4
+ version: 15.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -35,7 +35,7 @@ cert_chain:
35
35
  3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
36
36
  gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
37
37
  -----END CERTIFICATE-----
38
- date: 2023-06-22 00:00:00.000000000 Z
38
+ date: 2023-10-01 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: cogger
@@ -255,7 +255,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
255
255
  - !ruby/object:Gem::Version
256
256
  version: '0'
257
257
  requirements: []
258
- rubygems_version: 3.4.14
258
+ rubygems_version: 3.4.20
259
259
  signing_key:
260
260
  specification_version: 4
261
261
  summary: A command line interface for managing Sublime Text metadata.
metadata.gz.sig CHANGED
Binary file