sublime_text_kit 9.1.0 → 9.6.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: 5e18a60bcea4e410a4e2c7b68927cb76f607eb06cde37fab3a6031f141d43f3b
4
- data.tar.gz: edfc386ffd97eb1b02f56430e7b01d6e12b3c8737bc75922a4ca4ef5ffa0fe11
3
+ metadata.gz: 69803566c44ec04ac2ddb673df6084f90efcb40344c0f396e391e0b56bb106e2
4
+ data.tar.gz: ce5fdc6daa656d3026b9153c59a0ffa0d85c66a009b840432c57c5d74e9ad57b
5
5
  SHA512:
6
- metadata.gz: b248d267aab2d9a936f5dc284b45f981df813200527ab177fd06fc80233bc0efecb9722d18029df3f3b8fa81055792da5dd48a8254fadfe7e703168368ca9128
7
- data.tar.gz: 5e7ae4fdd9331a8a1f43a18a630ce6d3a7b0788790e359b9d71ff2a3c960a026dd46fcc452909e3a942a207aef6dd2c606bdd4a6b65381690ce0b2e5840022b2
6
+ metadata.gz: 3e03f2f696ccd6796d61226f39c8fcc97c8e6c4430023cfbb2dc640d2dfa4d41ba0cd54b40376c0e33ab2ad8ff84979c3016d2a57517323fae7910af8fd54ce9
7
+ data.tar.gz: e8dfdd209bfde7b0f60b41f761659d8c4999abbf005aa15b7c3c38838f346439f20559084db42d1305ea0f693c28d9f654a148a6afd9d68a3ca2a1652d56a6d9
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -150,7 +150,7 @@ additional liability.
150
150
 
151
151
  END OF TERMS AND CONDITIONS
152
152
 
153
- Copyright link:https://www.alchemists.io[Alchemists].
153
+ Copyright 2014 link:https://www.alchemists.io/team/brooke_kuhlmann[Brooke Kuhlmann].
154
154
 
155
155
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
156
156
  compliance with the License. You may obtain a link:https://www.apache.org/licenses/LICENSE-2.0[copy]
@@ -6,6 +6,8 @@
6
6
 
7
7
  [link=http://badge.fury.io/rb/sublime_text_kit]
8
8
  image::https://badge.fury.io/rb/sublime_text_kit.svg[Gem Version]
9
+ [link=https://www.alchemists.io/projects/code_quality]
10
+ image::https://img.shields.io/badge/code_style-alchemists-brightgreen.svg[Alchemists Style Guide]
9
11
  [link=https://circleci.com/gh/bkuhlmann/sublime_text_kit]
10
12
  image::https://circleci.com/gh/bkuhlmann/sublime_text_kit.svg?style=svg[Circle CI Status]
11
13
 
@@ -23,18 +25,16 @@ toc::[]
23
25
 
24
26
  == Screencasts
25
27
 
26
- [link=https://www.alchemists.io/screencasts/sublime_text_kit.html]
27
- image::https://www.alchemists.io/images/screencasts/sublime_text_kit/cover-original.png[Screencast,role=focal_point]
28
+ [link=https://www.alchemists.io/screencasts/sublime_text_kit]
29
+ image::https://www.alchemists.io/images/screencasts/sublime_text_kit/cover.svg[Screencast,600,240,role=focal_point]
28
30
 
29
31
  == Requirements
30
32
 
31
- . https://www.ruby-lang.org[Ruby 2.7.x].
32
- . https://www.sublimetext.com[Sublime Text 3].
33
+ . link:https://www.ruby-lang.org[Ruby]
34
+ . link:https://www.sublimetext.com[Sublime Text]
33
35
 
34
36
  == Setup
35
37
 
36
- === Production
37
-
38
38
  To install, run:
39
39
 
40
40
  [source,bash]
@@ -42,24 +42,6 @@ To install, run:
42
42
  gem install sublime_text_kit
43
43
  ----
44
44
 
45
- === Development
46
-
47
- To contribute, run:
48
-
49
- [source,bash]
50
- ----
51
- git clone https://github.com/bkuhlmann/sublime_text_kit.git
52
- cd sublime_text_kit
53
- bin/setup
54
- ----
55
-
56
- You can also use the IRB console for direct access to all objects:
57
-
58
- [source,bash]
59
- ----
60
- bin/console
61
- ----
62
-
63
45
  == Usage
64
46
 
65
47
  === Command Line Interface (CLI)
@@ -100,7 +82,8 @@ For session options, type: `sublime_text_kit --help --session`
100
82
  For snippet options, type: `sublime_text_kit --help --snippets`
101
83
 
102
84
  ....
103
- -m, [--markdown], [--no-markdown] # Print snippets in Markdown format.
85
+ -a, [--ascii-doc], [--no-ascii-doc] # Print snippets in ASCII Doc format.
86
+ -m, [--markdown], [--no-markdown] # Print snippets in Markdown format.
104
87
  ....
105
88
 
106
89
  === Customization
@@ -162,6 +145,24 @@ The following demonstrates a default Sublime Text setup:
162
145
  * When rebuilding workspaces, ensure workspace_dir (as defined via settings.yml) points to a
163
146
  directory containing `.sublime-project` and `.sublime-workspace` files.
164
147
 
148
+ == Development
149
+
150
+ To contribute, run:
151
+
152
+ [source,bash]
153
+ ----
154
+ git clone https://github.com/bkuhlmann/sublime_text_kit.git
155
+ cd sublime_text_kit
156
+ bin/setup
157
+ ----
158
+
159
+ You can also use the IRB console for direct access to all objects:
160
+
161
+ [source,bash]
162
+ ----
163
+ bin/console
164
+ ----
165
+
165
166
  == Tests
166
167
 
167
168
  To test, run:
@@ -198,4 +199,4 @@ Read link:CHANGES.adoc[CHANGES] for details.
198
199
 
199
200
  == Credits
200
201
 
201
- Engineered by link:https://www.alchemists.io/team/brooke_kuhlmann.html[Brooke Kuhlmann].
202
+ Engineered by link:https://www.alchemists.io/team/brooke_kuhlmann[Brooke Kuhlmann].
@@ -5,6 +5,8 @@ require "sublime_text_kit/metadata/base"
5
5
  require "sublime_text_kit/metadata/project_metadata"
6
6
  require "sublime_text_kit/metadata/workspace_metadata"
7
7
  require "sublime_text_kit/snippets/snippet"
8
+ require "sublime_text_kit/snippets/collector"
9
+ require "sublime_text_kit/snippets/printers/ascii_doc"
8
10
  require "sublime_text_kit/snippets/printers/markdown"
9
11
  require "sublime_text_kit/session"
10
12
  require "sublime_text_kit/cli"
@@ -19,6 +19,7 @@ module SublimeTextKit
19
19
  def initialize args = [], options = {}, config = {}
20
20
  super args, options, config
21
21
  @markdown_printer = Snippets::Printers::Markdown.new
22
+ @ascii_doc_printer = Snippets::Printers::ASCIIDoc.new
22
23
  end
23
24
 
24
25
  desc "-u, [--update]", "Update Sublime Text with current settings."
@@ -44,6 +45,11 @@ module SublimeTextKit
44
45
 
45
46
  desc "-p, [--snippets]", "Print user defined snippets."
46
47
  map %w[-p --snippets] => :snippets
48
+ method_option :ascii_doc,
49
+ aliases: "-a",
50
+ desc: "Print snippets in ASCII Doc format.",
51
+ type: :boolean,
52
+ default: false
47
53
  method_option :markdown,
48
54
  aliases: "-m",
49
55
  desc: "Print snippets in Markdown format.",
@@ -51,7 +57,12 @@ module SublimeTextKit
51
57
  default: false
52
58
  def snippets
53
59
  say
54
- options.markdown? ? markdown_printer.call : help("--snippets")
60
+
61
+ if options.ascii_doc? then ascii_doc_printer.call
62
+ elsif options.markdown? then markdown_printer.call
63
+ else help "--snippets"
64
+ end
65
+
55
66
  say
56
67
  end
57
68
 
@@ -63,9 +74,9 @@ module SublimeTextKit
63
74
  def metadata
64
75
  say
65
76
 
66
- if options[:create] then create_metadata
67
- elsif options[:destroy] then destroy_metadata
68
- elsif options[:rebuild] then rebuild_metadata
77
+ if options.create? then create_metadata
78
+ elsif options.destroy? then destroy_metadata
79
+ elsif options.rebuild? then rebuild_metadata
69
80
  else help "--metadata"
70
81
  end
71
82
 
@@ -108,7 +119,7 @@ module SublimeTextKit
108
119
 
109
120
  private
110
121
 
111
- attr_reader :markdown_printer
122
+ attr_reader :ascii_doc_printer, :markdown_printer
112
123
 
113
124
  def project_roots
114
125
  @project_roots ||= self.class.configuration.to_h.fetch :project_roots, []
@@ -5,7 +5,7 @@ module SublimeTextKit
5
5
  module Identity
6
6
  NAME = "sublime_text_kit"
7
7
  LABEL = "Sublime Text Kit"
8
- VERSION = "9.1.0"
8
+ VERSION = "9.6.0"
9
9
  VERSION_LABEL = "#{LABEL} #{VERSION}"
10
10
  end
11
11
  end
@@ -4,10 +4,6 @@ module SublimeTextKit
4
4
  module Metadata
5
5
  # Processes project metadata.
6
6
  class Project < Base
7
- def initialize project_dir, metadata_dir
8
- super project_dir, metadata_dir
9
- end
10
-
11
7
  def file_extension
12
8
  "sublime-project"
13
9
  end
@@ -4,10 +4,6 @@ module SublimeTextKit
4
4
  module Metadata
5
5
  # Processes workspace metadata.
6
6
  class Workspace < Base
7
- def initialize project_dir, metadata_dir
8
- super project_dir, metadata_dir
9
- end
10
-
11
7
  def file_extension
12
8
  "sublime-workspace"
13
9
  end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "pathname"
4
+ require "rexml/document"
5
+
6
+ module SublimeTextKit
7
+ module Snippets
8
+ class Collector
9
+ DEFAULT_USER_PATH = "Library/Application Support/Sublime Text 3/Packages/User"
10
+
11
+ def initialize model: Snippet, user_path: DEFAULT_USER_PATH, environment: ENV
12
+ @model = model
13
+ @user_path = user_path
14
+ @environment = environment
15
+ end
16
+
17
+ def home_path
18
+ Pathname environment.fetch("HOME")
19
+ end
20
+
21
+ def root_path
22
+ home_path.join user_path
23
+ end
24
+
25
+ def call
26
+ root_path.glob("*.sublime-snippet")
27
+ .map { |path| model.new REXML::Document.new(path.read) }
28
+ .sort_by(&:description)
29
+ end
30
+
31
+ private
32
+
33
+ attr_reader :model, :user_path, :environment
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rexml/document"
4
+
5
+ module SublimeTextKit
6
+ module Snippets
7
+ module Printers
8
+ class ASCIIDoc
9
+ def initialize collector: Collector.new
10
+ @collector = collector
11
+ end
12
+
13
+ def call
14
+ collector.call.each do |snippet|
15
+ puts "* #{snippet.description} - `#{snippet.trigger}`\n"
16
+ end
17
+ end
18
+
19
+ private
20
+
21
+ attr_reader :collector
22
+ end
23
+ end
24
+ end
25
+ end
@@ -1,41 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "rexml/document"
4
-
5
3
  module SublimeTextKit
6
4
  module Snippets
7
5
  module Printers
8
6
  class Markdown
9
- DEFAULT_USER_PATH = "Library/Application Support/Sublime Text 3/Packages/User"
10
-
11
- def initialize user_path = DEFAULT_USER_PATH, environment: ENV
12
- @user_path = user_path
13
- @environment = environment
14
- end
15
-
16
- def home_path
17
- Pathname environment.fetch("HOME")
18
- end
19
-
20
- def root_path
21
- home_path.join user_path
7
+ def initialize collector: Collector.new
8
+ @collector = collector
22
9
  end
23
10
 
24
11
  def call
25
- snippets.sort_by(&:description).each do |snippet|
12
+ collector.call.each do |snippet|
26
13
  puts "- #{snippet.description} - `#{snippet.trigger}`\n"
27
14
  end
28
15
  end
29
16
 
30
17
  private
31
18
 
32
- attr_reader :user_path, :environment
33
-
34
- def snippets
35
- root_path.glob("*.sublime-snippet").map do |path|
36
- Snippet.new REXML::Document.new(File.open(path))
37
- end
38
- end
19
+ attr_reader :collector
39
20
  end
40
21
  end
41
22
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sublime_text_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.1.0
4
+ version: 9.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain:
11
11
  - |
@@ -28,233 +28,51 @@ cert_chain:
28
28
  2XV8FRa7/JimI07sPLC13eLY3xd/aYTi85Z782KIA4j0G8XEEWAX0ouBhlXPocZv
29
29
  QWc=
30
30
  -----END CERTIFICATE-----
31
- date: 2020-04-01 00:00:00.000000000 Z
31
+ date: 2020-12-13 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
- name: runcom
34
+ name: refinements
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '6.0'
39
+ version: '7.16'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '6.0'
46
+ version: '7.16'
47
47
  - !ruby/object:Gem::Dependency
48
- name: thor
48
+ name: runcom
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.20'
53
+ version: '6.4'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0.20'
61
- - !ruby/object:Gem::Dependency
62
- name: bundler-audit
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: '0.6'
68
- type: :development
69
- prerelease: false
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - "~>"
73
- - !ruby/object:Gem::Version
74
- version: '0.6'
75
- - !ruby/object:Gem::Dependency
76
- name: gemsmith
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - "~>"
80
- - !ruby/object:Gem::Version
81
- version: '14.0'
82
- type: :development
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - "~>"
87
- - !ruby/object:Gem::Version
88
- version: '14.0'
89
- - !ruby/object:Gem::Dependency
90
- name: git-cop
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - "~>"
94
- - !ruby/object:Gem::Version
95
- version: '4.0'
96
- type: :development
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - "~>"
101
- - !ruby/object:Gem::Version
102
- version: '4.0'
60
+ version: '6.4'
103
61
  - !ruby/object:Gem::Dependency
104
- name: guard-rspec
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - "~>"
108
- - !ruby/object:Gem::Version
109
- version: '4.7'
110
- type: :development
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - "~>"
115
- - !ruby/object:Gem::Version
116
- version: '4.7'
117
- - !ruby/object:Gem::Dependency
118
- name: pry
119
- requirement: !ruby/object:Gem::Requirement
120
- requirements:
121
- - - "~>"
122
- - !ruby/object:Gem::Version
123
- version: '0.12'
124
- type: :development
125
- prerelease: false
126
- version_requirements: !ruby/object:Gem::Requirement
127
- requirements:
128
- - - "~>"
129
- - !ruby/object:Gem::Version
130
- version: '0.12'
131
- - !ruby/object:Gem::Dependency
132
- name: pry-byebug
133
- requirement: !ruby/object:Gem::Requirement
134
- requirements:
135
- - - "~>"
136
- - !ruby/object:Gem::Version
137
- version: '3.7'
138
- type: :development
139
- prerelease: false
140
- version_requirements: !ruby/object:Gem::Requirement
141
- requirements:
142
- - - "~>"
143
- - !ruby/object:Gem::Version
144
- version: '3.7'
145
- - !ruby/object:Gem::Dependency
146
- name: rake
147
- requirement: !ruby/object:Gem::Requirement
148
- requirements:
149
- - - "~>"
150
- - !ruby/object:Gem::Version
151
- version: '13.0'
152
- type: :development
153
- prerelease: false
154
- version_requirements: !ruby/object:Gem::Requirement
155
- requirements:
156
- - - "~>"
157
- - !ruby/object:Gem::Version
158
- version: '13.0'
159
- - !ruby/object:Gem::Dependency
160
- name: reek
161
- requirement: !ruby/object:Gem::Requirement
162
- requirements:
163
- - - "~>"
164
- - !ruby/object:Gem::Version
165
- version: '6.0'
166
- type: :development
167
- prerelease: false
168
- version_requirements: !ruby/object:Gem::Requirement
169
- requirements:
170
- - - "~>"
171
- - !ruby/object:Gem::Version
172
- version: '6.0'
173
- - !ruby/object:Gem::Dependency
174
- name: rspec
175
- requirement: !ruby/object:Gem::Requirement
176
- requirements:
177
- - - "~>"
178
- - !ruby/object:Gem::Version
179
- version: '3.9'
180
- type: :development
181
- prerelease: false
182
- version_requirements: !ruby/object:Gem::Requirement
183
- requirements:
184
- - - "~>"
185
- - !ruby/object:Gem::Version
186
- version: '3.9'
187
- - !ruby/object:Gem::Dependency
188
- name: rubocop
189
- requirement: !ruby/object:Gem::Requirement
190
- requirements:
191
- - - "~>"
192
- - !ruby/object:Gem::Version
193
- version: '0.79'
194
- type: :development
195
- prerelease: false
196
- version_requirements: !ruby/object:Gem::Requirement
197
- requirements:
198
- - - "~>"
199
- - !ruby/object:Gem::Version
200
- version: '0.79'
201
- - !ruby/object:Gem::Dependency
202
- name: rubocop-performance
203
- requirement: !ruby/object:Gem::Requirement
204
- requirements:
205
- - - "~>"
206
- - !ruby/object:Gem::Version
207
- version: '1.5'
208
- type: :development
209
- prerelease: false
210
- version_requirements: !ruby/object:Gem::Requirement
211
- requirements:
212
- - - "~>"
213
- - !ruby/object:Gem::Version
214
- version: '1.5'
215
- - !ruby/object:Gem::Dependency
216
- name: rubocop-rake
217
- requirement: !ruby/object:Gem::Requirement
218
- requirements:
219
- - - "~>"
220
- - !ruby/object:Gem::Version
221
- version: '0.5'
222
- type: :development
223
- prerelease: false
224
- version_requirements: !ruby/object:Gem::Requirement
225
- requirements:
226
- - - "~>"
227
- - !ruby/object:Gem::Version
228
- version: '0.5'
229
- - !ruby/object:Gem::Dependency
230
- name: rubocop-rspec
231
- requirement: !ruby/object:Gem::Requirement
232
- requirements:
233
- - - "~>"
234
- - !ruby/object:Gem::Version
235
- version: '1.37'
236
- type: :development
237
- prerelease: false
238
- version_requirements: !ruby/object:Gem::Requirement
239
- requirements:
240
- - - "~>"
241
- - !ruby/object:Gem::Version
242
- version: '1.37'
243
- - !ruby/object:Gem::Dependency
244
- name: simplecov
62
+ name: thor
245
63
  requirement: !ruby/object:Gem::Requirement
246
64
  requirements:
247
65
  - - "~>"
248
66
  - !ruby/object:Gem::Version
249
- version: '0.18'
250
- type: :development
67
+ version: '0.20'
68
+ type: :runtime
251
69
  prerelease: false
252
70
  version_requirements: !ruby/object:Gem::Requirement
253
71
  requirements:
254
72
  - - "~>"
255
73
  - !ruby/object:Gem::Version
256
- version: '0.18'
257
- description:
74
+ version: '0.20'
75
+ description:
258
76
  email:
259
77
  - brooke@alchemists.io
260
78
  executables:
@@ -274,6 +92,8 @@ files:
274
92
  - lib/sublime_text_kit/metadata/project_metadata.rb
275
93
  - lib/sublime_text_kit/metadata/workspace_metadata.rb
276
94
  - lib/sublime_text_kit/session.rb
95
+ - lib/sublime_text_kit/snippets/collector.rb
96
+ - lib/sublime_text_kit/snippets/printers/ascii_doc.rb
277
97
  - lib/sublime_text_kit/snippets/printers/markdown.rb
278
98
  - lib/sublime_text_kit/snippets/snippet.rb
279
99
  homepage: https://www.alchemists.io/projects/sublime_text_kit
@@ -284,7 +104,7 @@ metadata:
284
104
  changelog_uri: https://www.alchemists.io/projects/sublime_text_kit/changes.html
285
105
  documentation_uri: https://www.alchemists.io/projects/sublime_text_kit
286
106
  source_code_uri: https://github.com/bkuhlmann/sublime_text_kit
287
- post_install_message:
107
+ post_install_message:
288
108
  rdoc_options: []
289
109
  require_paths:
290
110
  - lib
@@ -299,8 +119,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
299
119
  - !ruby/object:Gem::Version
300
120
  version: '0'
301
121
  requirements: []
302
- rubygems_version: 3.1.2
303
- signing_key:
122
+ rubygems_version: 3.2.0
123
+ signing_key:
304
124
  specification_version: 4
305
125
  summary: A command line interface for managing Sublime Text metadata.
306
126
  test_files: []
metadata.gz.sig CHANGED
Binary file