sublime_text_kit 16.5.0 → 17.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/sublime_text_kit/cli/actions/metadata/create.rb +3 -3
- data/lib/sublime_text_kit/cli/actions/metadata/delete.rb +3 -3
- data/lib/sublime_text_kit/cli/actions/metadata/recreate.rb +3 -3
- data/lib/sublime_text_kit/cli/actions/snippets.rb +2 -2
- data/lib/sublime_text_kit/cli/actions/update.rb +3 -3
- data/lib/sublime_text_kit/configuration/model.rb +1 -1
- data/lib/sublime_text_kit/container.rb +17 -11
- data/lib/sublime_text_kit/sessions/rebuilder.rb +3 -3
- data/lib/sublime_text_kit/snippets/collector.rb +5 -5
- data/lib/sublime_text_kit/snippets/printer.rb +2 -2
- data/sublime_text_kit.gemspec +8 -8
- data.tar.gz.sig +0 -0
- metadata +17 -19
- metadata.gz.sig +0 -0
- data/lib/sublime_text_kit/configuration/transformers/session_path.rb +0 -32
- data/lib/sublime_text_kit/configuration/transformers/user_dir.rb +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd38fa57176a35624995cc09f3716997f7b2c8dc2f1278923f3650ab27d10526
|
4
|
+
data.tar.gz: af231156c15382772e3d2be7ebfa5af272e98c8dbcfb3f7d680af3dcb0b9d041
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d3a0b00bf9e83760060d8776b4cb8b3f02e240162225315f6bfaf9753b63ef4ce5143eafd430ae5c0e10e398cd6df74dbb5184fd55a24fc96163bb46be1c164
|
7
|
+
data.tar.gz: 8e42cf0873c00d73ab298e39db6682a76d95bc7bd149fd5a48d13b56a564f5e98f85d753ba8ecf54a8d4a63f6ec940030fafdc5be35d2783162fc78c13f9ed97
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -9,7 +9,7 @@ module SublimeTextKit
|
|
9
9
|
module Metadata
|
10
10
|
# Creates project metadata.
|
11
11
|
class Create < Sod::Action
|
12
|
-
include Import[:
|
12
|
+
include Import[:settings, :logger]
|
13
13
|
|
14
14
|
using Refinements::Pathname
|
15
15
|
|
@@ -33,13 +33,13 @@ module SublimeTextKit
|
|
33
33
|
attr_reader :handler
|
34
34
|
|
35
35
|
def process_projects
|
36
|
-
|
36
|
+
settings.project_dirs.each do |directory|
|
37
37
|
handler.with_project(directory, metadata_dir).create
|
38
38
|
handler.with_workspace(directory, metadata_dir).create
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
def metadata_dir = Pathname(
|
42
|
+
def metadata_dir = Pathname(settings.metadata_dir).expand_path
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
@@ -9,7 +9,7 @@ module SublimeTextKit
|
|
9
9
|
module Metadata
|
10
10
|
# Deletes project metadata.
|
11
11
|
class Delete < Sod::Action
|
12
|
-
include Import[:
|
12
|
+
include Import[:settings, :logger]
|
13
13
|
|
14
14
|
using Refinements::Pathname
|
15
15
|
|
@@ -33,13 +33,13 @@ module SublimeTextKit
|
|
33
33
|
attr_reader :handler
|
34
34
|
|
35
35
|
def process_projects
|
36
|
-
|
36
|
+
settings.project_dirs.each do |directory|
|
37
37
|
handler.with_project(directory, metadata_dir).delete
|
38
38
|
handler.with_workspace(directory, metadata_dir).delete
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
def metadata_dir = Pathname(
|
42
|
+
def metadata_dir = Pathname(settings.metadata_dir).expand_path
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
@@ -9,7 +9,7 @@ module SublimeTextKit
|
|
9
9
|
module Metadata
|
10
10
|
# Recreates project metadata.
|
11
11
|
class Recreate < Sod::Action
|
12
|
-
include Import[:
|
12
|
+
include Import[:settings, :logger]
|
13
13
|
|
14
14
|
using Refinements::Pathname
|
15
15
|
|
@@ -33,13 +33,13 @@ module SublimeTextKit
|
|
33
33
|
attr_reader :handler
|
34
34
|
|
35
35
|
def process_projects
|
36
|
-
|
36
|
+
settings.project_dirs.each do |directory|
|
37
37
|
handler.with_project(directory, metadata_dir).recreate
|
38
38
|
handler.with_workspace(directory, metadata_dir).recreate
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
def metadata_dir = Pathname(
|
42
|
+
def metadata_dir = Pathname(settings.metadata_dir).expand_path
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
@@ -7,13 +7,13 @@ module SublimeTextKit
|
|
7
7
|
module Actions
|
8
8
|
# Handles snippets action.
|
9
9
|
class Snippets < Sod::Action
|
10
|
-
include Import[:
|
10
|
+
include Import[:settings, :logger]
|
11
11
|
|
12
12
|
description "View snippets."
|
13
13
|
|
14
14
|
on %w[-s --snippets], argument: "[FORMAT]", allow: %w[markdown ascii_doc]
|
15
15
|
|
16
|
-
default { Container[:
|
16
|
+
default { Container[:settings].snippets_format }
|
17
17
|
|
18
18
|
def initialize(printer: SublimeTextKit::Snippets::Printer.new, **)
|
19
19
|
super(**)
|
@@ -7,7 +7,7 @@ module SublimeTextKit
|
|
7
7
|
module Actions
|
8
8
|
# Handles update action.
|
9
9
|
class Update < Sod::Action
|
10
|
-
include Import[:
|
10
|
+
include Import[:settings, :logger]
|
11
11
|
|
12
12
|
description "Update project and session metadata based on current settings."
|
13
13
|
|
@@ -35,13 +35,13 @@ module SublimeTextKit
|
|
35
35
|
attr_reader :metadata, :session
|
36
36
|
|
37
37
|
def create_metadata
|
38
|
-
|
38
|
+
settings.project_dirs.each do |directory|
|
39
39
|
metadata.with_project(directory, metadata_dir).create
|
40
40
|
metadata.with_workspace(directory, metadata_dir).create
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
def metadata_dir = Pathname(
|
44
|
+
def metadata_dir = Pathname(settings.metadata_dir).expand_path
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
@@ -11,23 +11,29 @@ module SublimeTextKit
|
|
11
11
|
module Container
|
12
12
|
extend Containable
|
13
13
|
|
14
|
-
register :
|
15
|
-
self[:defaults].add_loader(:environment, %w[HOME])
|
16
|
-
.add_loader(:yaml, self[:xdg_config].active)
|
17
|
-
.add_transformer(Configuration::Transformers::SessionPath.new)
|
18
|
-
.add_transformer(Configuration::Transformers::UserDir.new)
|
19
|
-
.then { |registry| Etcher.call registry }
|
20
|
-
end
|
21
|
-
|
22
|
-
register :defaults do
|
14
|
+
register :registry do
|
23
15
|
Etcher::Registry.new(contract: Configuration::Contract, model: Configuration::Model)
|
24
16
|
.add_loader(:yaml, self[:defaults_path])
|
17
|
+
.add_loader(:environment, only: %w[HOME])
|
18
|
+
.add_loader(:yaml, self[:xdg_config].active)
|
19
|
+
.add_transformer(
|
20
|
+
:root,
|
21
|
+
:session_path,
|
22
|
+
fallback: "~/Library/Application Support/Sublime Text/Local" \
|
23
|
+
"/Session.sublime_session"
|
24
|
+
)
|
25
|
+
.add_transformer(
|
26
|
+
:root,
|
27
|
+
:user_dir,
|
28
|
+
fallback: "~/Library/Application Support/Sublime Text/Packages/User"
|
29
|
+
)
|
25
30
|
end
|
26
31
|
|
32
|
+
register(:settings) { Etcher.call(self[:registry]).dup }
|
27
33
|
register(:specification) { Spek::Loader.call "#{__dir__}/../../sublime_text_kit.gemspec" }
|
28
34
|
register(:defaults_path) { Pathname(__dir__).join("configuration/defaults.yml") }
|
29
|
-
register(:xdg_config) { Runcom::Config.new "sublime_text_kit/
|
35
|
+
register(:xdg_config) { Runcom::Config.new "sublime_text_kit/settings.yml" }
|
30
36
|
register(:logger) { Cogger.new id: :sublime_text_kit }
|
31
|
-
register :
|
37
|
+
register :io, STDOUT
|
32
38
|
end
|
33
39
|
end
|
@@ -7,7 +7,7 @@ module SublimeTextKit
|
|
7
7
|
module Sessions
|
8
8
|
# Manages the rebuilding of session information.
|
9
9
|
class Rebuilder
|
10
|
-
include Import[:
|
10
|
+
include Import[:settings]
|
11
11
|
|
12
12
|
using Refinements::Pathname
|
13
13
|
|
@@ -30,9 +30,9 @@ module SublimeTextKit
|
|
30
30
|
|
31
31
|
def write(json) = JSON.dump(json).then { |content| source_path.write content }
|
32
32
|
|
33
|
-
def metadata_dir =
|
33
|
+
def metadata_dir = settings.metadata_dir
|
34
34
|
|
35
|
-
def source_path =
|
35
|
+
def source_path = settings.session_path
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
@@ -6,7 +6,7 @@ module SublimeTextKit
|
|
6
6
|
module Snippets
|
7
7
|
# Collects and loads all snippets into memory for further processing.
|
8
8
|
class Collector
|
9
|
-
include Import[:
|
9
|
+
include Import[:settings]
|
10
10
|
|
11
11
|
using Refinements::Pathname
|
12
12
|
|
@@ -16,10 +16,10 @@ module SublimeTextKit
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def call
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
settings.user_dir
|
20
|
+
.files("*.sublime-snippet")
|
21
|
+
.map { |path| reader.call path }
|
22
|
+
.sort_by(&:description)
|
23
23
|
end
|
24
24
|
|
25
25
|
private
|
@@ -4,7 +4,7 @@ module SublimeTextKit
|
|
4
4
|
module Snippets
|
5
5
|
# Prints snippets as a list.
|
6
6
|
class Printer
|
7
|
-
include Import[:
|
7
|
+
include Import[:io]
|
8
8
|
|
9
9
|
def initialize(collector: Collector.new, **)
|
10
10
|
super(**)
|
@@ -13,7 +13,7 @@ module SublimeTextKit
|
|
13
13
|
|
14
14
|
def call bullet
|
15
15
|
collector.call.each do |snippet|
|
16
|
-
|
16
|
+
io.puts "#{bullet} #{snippet.description} - `#{snippet.trigger}`"
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
data/sublime_text_kit.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "sublime_text_kit"
|
5
|
-
spec.version = "
|
5
|
+
spec.version = "17.0.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"
|
@@ -23,15 +23,15 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.cert_chain = [Gem.default_cert_path]
|
24
24
|
|
25
25
|
spec.required_ruby_version = "~> 3.3"
|
26
|
-
spec.add_dependency "cogger", "~> 0.
|
27
|
-
spec.add_dependency "containable", "~> 0.
|
26
|
+
spec.add_dependency "cogger", "~> 0.21"
|
27
|
+
spec.add_dependency "containable", "~> 0.2"
|
28
28
|
spec.add_dependency "dry-monads", "~> 1.6"
|
29
29
|
spec.add_dependency "dry-schema", "~> 1.13"
|
30
|
-
spec.add_dependency "etcher", "~>
|
31
|
-
spec.add_dependency "infusible", "~> 3.
|
32
|
-
spec.add_dependency "refinements", "~> 12.
|
33
|
-
spec.add_dependency "runcom", "~> 11.
|
34
|
-
spec.add_dependency "sod", "~> 0.
|
30
|
+
spec.add_dependency "etcher", "~> 2.0"
|
31
|
+
spec.add_dependency "infusible", "~> 3.8"
|
32
|
+
spec.add_dependency "refinements", "~> 12.5"
|
33
|
+
spec.add_dependency "runcom", "~> 11.5"
|
34
|
+
spec.add_dependency "sod", "~> 0.12"
|
35
35
|
spec.add_dependency "spek", "~> 3.0"
|
36
36
|
spec.add_dependency "zeitwerk", "~> 2.6"
|
37
37
|
|
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:
|
4
|
+
version: 17.0.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: 2024-
|
38
|
+
date: 2024-07-06 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: cogger
|
@@ -43,28 +43,28 @@ dependencies:
|
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '0.
|
46
|
+
version: '0.21'
|
47
47
|
type: :runtime
|
48
48
|
prerelease: false
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '0.
|
53
|
+
version: '0.21'
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
55
|
name: containable
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '0.
|
60
|
+
version: '0.2'
|
61
61
|
type: :runtime
|
62
62
|
prerelease: false
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '0.
|
67
|
+
version: '0.2'
|
68
68
|
- !ruby/object:Gem::Dependency
|
69
69
|
name: dry-monads
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
@@ -99,70 +99,70 @@ dependencies:
|
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
102
|
+
version: '2.0'
|
103
103
|
type: :runtime
|
104
104
|
prerelease: false
|
105
105
|
version_requirements: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
107
|
- - "~>"
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: '
|
109
|
+
version: '2.0'
|
110
110
|
- !ruby/object:Gem::Dependency
|
111
111
|
name: infusible
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
114
|
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: '3.
|
116
|
+
version: '3.8'
|
117
117
|
type: :runtime
|
118
118
|
prerelease: false
|
119
119
|
version_requirements: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
121
121
|
- - "~>"
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version: '3.
|
123
|
+
version: '3.8'
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: refinements
|
126
126
|
requirement: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
128
|
- - "~>"
|
129
129
|
- !ruby/object:Gem::Version
|
130
|
-
version: '12.
|
130
|
+
version: '12.5'
|
131
131
|
type: :runtime
|
132
132
|
prerelease: false
|
133
133
|
version_requirements: !ruby/object:Gem::Requirement
|
134
134
|
requirements:
|
135
135
|
- - "~>"
|
136
136
|
- !ruby/object:Gem::Version
|
137
|
-
version: '12.
|
137
|
+
version: '12.5'
|
138
138
|
- !ruby/object:Gem::Dependency
|
139
139
|
name: runcom
|
140
140
|
requirement: !ruby/object:Gem::Requirement
|
141
141
|
requirements:
|
142
142
|
- - "~>"
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
version: '11.
|
144
|
+
version: '11.5'
|
145
145
|
type: :runtime
|
146
146
|
prerelease: false
|
147
147
|
version_requirements: !ruby/object:Gem::Requirement
|
148
148
|
requirements:
|
149
149
|
- - "~>"
|
150
150
|
- !ruby/object:Gem::Version
|
151
|
-
version: '11.
|
151
|
+
version: '11.5'
|
152
152
|
- !ruby/object:Gem::Dependency
|
153
153
|
name: sod
|
154
154
|
requirement: !ruby/object:Gem::Requirement
|
155
155
|
requirements:
|
156
156
|
- - "~>"
|
157
157
|
- !ruby/object:Gem::Version
|
158
|
-
version: '0.
|
158
|
+
version: '0.12'
|
159
159
|
type: :runtime
|
160
160
|
prerelease: false
|
161
161
|
version_requirements: !ruby/object:Gem::Requirement
|
162
162
|
requirements:
|
163
163
|
- - "~>"
|
164
164
|
- !ruby/object:Gem::Version
|
165
|
-
version: '0.
|
165
|
+
version: '0.12'
|
166
166
|
- !ruby/object:Gem::Dependency
|
167
167
|
name: spek
|
168
168
|
requirement: !ruby/object:Gem::Requirement
|
@@ -215,8 +215,6 @@ files:
|
|
215
215
|
- lib/sublime_text_kit/configuration/contract.rb
|
216
216
|
- lib/sublime_text_kit/configuration/defaults.yml
|
217
217
|
- lib/sublime_text_kit/configuration/model.rb
|
218
|
-
- lib/sublime_text_kit/configuration/transformers/session_path.rb
|
219
|
-
- lib/sublime_text_kit/configuration/transformers/user_dir.rb
|
220
218
|
- lib/sublime_text_kit/container.rb
|
221
219
|
- lib/sublime_text_kit/import.rb
|
222
220
|
- lib/sublime_text_kit/metadata/handler.rb
|
@@ -255,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
255
253
|
- !ruby/object:Gem::Version
|
256
254
|
version: '0'
|
257
255
|
requirements: []
|
258
|
-
rubygems_version: 3.5.
|
256
|
+
rubygems_version: 3.5.14
|
259
257
|
signing_key:
|
260
258
|
specification_version: 4
|
261
259
|
summary: A command line interface for managing Sublime Text metadata.
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "dry/monads"
|
4
|
-
|
5
|
-
module SublimeTextKit
|
6
|
-
module Configuration
|
7
|
-
module Transformers
|
8
|
-
# Transforms session path into fully qualified path based on home directory.
|
9
|
-
class SessionPath
|
10
|
-
include Dry::Monads[:result]
|
11
|
-
|
12
|
-
DEFAULT = "Library/Application Support/Sublime Text/Local/Session.sublime_session"
|
13
|
-
|
14
|
-
def initialize key = :session_path, default: DEFAULT
|
15
|
-
@key = key
|
16
|
-
@default = default
|
17
|
-
end
|
18
|
-
|
19
|
-
def call attributes
|
20
|
-
return Success attributes unless attributes.key? :home
|
21
|
-
|
22
|
-
Pathname(attributes[:home]).join(default)
|
23
|
-
.then { |value| Success attributes.merge!(key => value) }
|
24
|
-
end
|
25
|
-
|
26
|
-
private
|
27
|
-
|
28
|
-
attr_reader :key, :default
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "dry/monads"
|
4
|
-
|
5
|
-
module SublimeTextKit
|
6
|
-
module Configuration
|
7
|
-
module Transformers
|
8
|
-
# Transforms user directory into fully qualified path based on home directory.
|
9
|
-
class UserDir
|
10
|
-
include Dry::Monads[:result]
|
11
|
-
|
12
|
-
DEFAULT = "Library/Application Support/Sublime Text/Packages/User"
|
13
|
-
|
14
|
-
def initialize key = :user_dir, default: DEFAULT
|
15
|
-
@key = key
|
16
|
-
@default = default
|
17
|
-
end
|
18
|
-
|
19
|
-
def call attributes
|
20
|
-
return Success attributes unless attributes.key? :home
|
21
|
-
|
22
|
-
Pathname(attributes[:home]).join(default)
|
23
|
-
.then { |value| Success attributes.merge!(key => value) }
|
24
|
-
end
|
25
|
-
|
26
|
-
private
|
27
|
-
|
28
|
-
attr_reader :key, :default
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|