sublime_text_kit 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +52 -31
- data/bin/stk +1 -1
- data/lib/sublime_text_kit/cli.rb +8 -19
- data/lib/sublime_text_kit/identity.rb +8 -3
- data/lib/sublime_text_kit/metadata/base.rb +6 -7
- data/lib/sublime_text_kit/metadata/project_metadata.rb +1 -0
- data/lib/sublime_text_kit/metadata/workspace_metadata.rb +1 -0
- data/lib/sublime_text_kit/session.rb +6 -6
- data/lib/tasks/rspec.rake +6 -0
- data/lib/tasks/rubocop.rake +6 -0
- metadata +52 -30
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d9e9aa5ee813bd01378aa676a7e5bc791bfdb7c
|
4
|
+
data.tar.gz: 815656149157d6e29e1460ce7aa940ff3c1d91ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52d69e28ef667843eb1d9a5e4f808435e9903c1e3f2065bed201bd4d8cec86d5d78413c392946eb29a9f1b8e679354a108cc28585506377ee418f9261701d1c8
|
7
|
+
data.tar.gz: 8897f213815a660c1347e658203ab1bd9cad204c27c84d9a654e971d0d55b3da67938ac18dd79afcc76a2fe163e6087cc37e21f72bc6866c9c63a287e698d3a7
|
data/README.md
CHANGED
@@ -1,13 +1,34 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
[](http://badge.fury.io/rb/sublime_text_kit)
|
4
|
+
[](https://codeclimate.com/github/bkuhlmann/sublime_text_kit)
|
5
|
+
[](https://codeclimate.com/github/bkuhlmann/sublime_text_kit)
|
6
|
+
[](https://gemnasium.com/bkuhlmann/sublime_text_kit)
|
7
|
+
[](https://travis-ci.org/bkuhlmann/sublime_text_kit)
|
8
|
+
[](https://www.patreon.com/bkuhlmann)
|
9
|
+
|
10
|
+
A command line interface for managing Sublime Text metadata.
|
11
|
+
|
12
|
+
<!-- Tocer[start]: Auto-generated, don't remove. -->
|
13
|
+
|
14
|
+
# Table of Contents
|
15
|
+
|
16
|
+
- [Features](#features)
|
17
|
+
- [Requirements](#requirements)
|
18
|
+
- [Setup](#setup)
|
19
|
+
- [Upgrading](#upgrading)
|
20
|
+
- [Usage](#usage)
|
21
|
+
- [Workflow](#workflow)
|
22
|
+
- [Troubleshooting](#troubleshooting)
|
23
|
+
- [Tests](#tests)
|
24
|
+
- [Versioning](#versioning)
|
25
|
+
- [Code of Conduct](#code-of-conduct)
|
26
|
+
- [Contributions](#contributions)
|
27
|
+
- [License](#license)
|
28
|
+
- [History](#history)
|
29
|
+
- [Credits](#credits)
|
30
|
+
|
31
|
+
<!-- Tocer[finish]: Auto-generated, don't remove. -->
|
11
32
|
|
12
33
|
# Features
|
13
34
|
|
@@ -21,8 +42,8 @@ Provides a collection of utilities that aid in Sublime Text management.
|
|
21
42
|
|
22
43
|
# Requirements
|
23
44
|
|
24
|
-
0. [MRI 2.x.x](
|
25
|
-
0. [Sublime Text 2](
|
45
|
+
0. [MRI 2.x.x](https://www.ruby-lang.org).
|
46
|
+
0. [Sublime Text 2](https://www.sublimetext.com).
|
26
47
|
|
27
48
|
# Setup
|
28
49
|
|
@@ -66,6 +87,17 @@ If using the example settings shown above and assuming the following directory s
|
|
66
87
|
~/Dropbox/Cache/Sublime/sublime_text_kit.sublime-project
|
67
88
|
~/Dropbox/Cache/Sublime/sublime_text_kit.sublime-workspace
|
68
89
|
|
90
|
+
## Upgrading
|
91
|
+
|
92
|
+
For those upgrading from Sublime Text Kit v2.0.0 or earlier, be mindful of the following changes:
|
93
|
+
|
94
|
+
0. Ensure you are using Sublime Text 3 (it is currently in Beta but your v2.0.0 license will work).
|
95
|
+
0. Update the `~/.sublime/settings.yml` file to switch from a `workspace_dir` to a `metadata_dir` instead.
|
96
|
+
0. Run the following commands to rebuild your project/workspace and session metadata:
|
97
|
+
|
98
|
+
stk -m -R # Destroys and rebuilds your existing project/workspace metadata to Sublime Text 3 format.
|
99
|
+
skt -s -r # Rebuilds your session history with project metadata as generated above.
|
100
|
+
|
69
101
|
# Usage
|
70
102
|
|
71
103
|
From the command line, type: `stk`
|
@@ -87,24 +119,7 @@ For session options, type: `stk --session`
|
|
87
119
|
|
88
120
|
-r, [--rebuild-session], [--no-rebuild-session] # Rebuild session metadata.
|
89
121
|
|
90
|
-
|
91
|
-
|
92
|
-
To test, run:
|
93
|
-
|
94
|
-
bundle exec rspec spec
|
95
|
-
|
96
|
-
# Upgrading
|
97
|
-
|
98
|
-
For those upgrading from Sublime Text Kit v2.0.0 or earlier, be mindful of the following changes:
|
99
|
-
|
100
|
-
0. Ensure you are using Sublime Text 3 (it is currently in Beta but your v2.0.0 license will work).
|
101
|
-
0. Update the `~/.sublime/settings.yml` file to switch from a `workspace_dir` to a `metadata_dir` instead.
|
102
|
-
0. Run the following commands to rebuild your project/workspace and session metadata:
|
103
|
-
|
104
|
-
stk -m -R # Destroys and rebuilds your existing project/workspace metadata to Sublime Text 3 format.
|
105
|
-
skt -s -r # Rebuilds your session history with project metadata as generated above.
|
106
|
-
|
107
|
-
# Workflow
|
122
|
+
## Workflow
|
108
123
|
|
109
124
|
The following demonstrates a default Sublime Text setup:
|
110
125
|
|
@@ -117,12 +132,18 @@ The following demonstrates a default Sublime Text setup:
|
|
117
132
|
you can (fuzzy type) project names to jump between them.
|
118
133
|
0. Breeze through your project workload with ease. :)
|
119
134
|
|
120
|
-
|
135
|
+
## Troubleshooting
|
121
136
|
|
122
137
|
- When rebuilding workspaces, ensure Sublime Text is shutdown or changes won't be applied.
|
123
138
|
- When rebuilding workspaces, ensure workspace_dir (as defined via settings.yml) points to a directory containing
|
124
139
|
*.sublime-project and *.sublime-workspace files.
|
125
140
|
|
141
|
+
# Tests
|
142
|
+
|
143
|
+
To test, run:
|
144
|
+
|
145
|
+
bundle exec rake
|
146
|
+
|
126
147
|
# Versioning
|
127
148
|
|
128
149
|
Read [Semantic Versioning](http://semver.org) for details. Briefly, it means:
|
data/bin/stk
CHANGED
data/lib/sublime_text_kit/cli.rb
CHANGED
@@ -3,11 +3,14 @@ require "thor"
|
|
3
3
|
require "thor/actions"
|
4
4
|
require "thor_plus/actions"
|
5
5
|
|
6
|
-
|
6
|
+
module SublimeTextKit
|
7
|
+
# The Command Line Interface (CLI) for the gem.
|
7
8
|
class CLI < Thor
|
8
9
|
include Thor::Actions
|
9
10
|
include ThorPlus::Actions
|
10
11
|
|
12
|
+
package_name SublimeTextKit::Identity.version_label
|
13
|
+
|
11
14
|
# Initialize.
|
12
15
|
def initialize args = [], options = {}, config = {}
|
13
16
|
super args, options, config
|
@@ -55,36 +58,22 @@ require "thor_plus/actions"
|
|
55
58
|
say
|
56
59
|
end
|
57
60
|
|
58
|
-
desc "-
|
59
|
-
map %w(-s --session) => :session
|
60
|
-
method_option :rebuild_session, aliases: "-r", desc: "Rebuild session metadata.", type: :boolean, default: false
|
61
|
-
def session
|
62
|
-
say
|
63
|
-
|
64
|
-
case
|
65
|
-
when options[:rebuild_session] then rebuild_session
|
66
|
-
else help("--session")
|
67
|
-
end
|
68
|
-
|
69
|
-
say
|
70
|
-
end
|
71
|
-
|
72
|
-
desc "-e, [--edit]", "Edit settings in default editor (assumes $EDITOR environment variable)."
|
61
|
+
desc "-e, [--edit]", "Edit #{SublimeTextKit::Identity.label} settings in default editor."
|
73
62
|
map %w(-e --edit) => :edit
|
74
63
|
def edit
|
75
64
|
`#{editor} #{@settings_file}`
|
76
65
|
end
|
77
66
|
|
78
|
-
desc "-v, [--version]", "Show version."
|
67
|
+
desc "-v, [--version]", "Show #{SublimeTextKit::Identity.label} version."
|
79
68
|
map %w(-v --version) => :version
|
80
69
|
def version
|
81
|
-
say SublimeTextKit::Identity.
|
70
|
+
say SublimeTextKit::Identity.version_label
|
82
71
|
end
|
83
72
|
|
84
73
|
desc "-h, [--help=HELP]", "Show this message or get help for a command."
|
85
74
|
map %w(-h --help) => :help
|
86
75
|
def help task = nil
|
87
|
-
say
|
76
|
+
say && super
|
88
77
|
end
|
89
78
|
|
90
79
|
private
|
@@ -1,4 +1,5 @@
|
|
1
1
|
module SublimeTextKit
|
2
|
+
# Gem identity information.
|
2
3
|
module Identity
|
3
4
|
def self.name
|
4
5
|
"sublime_text_kit"
|
@@ -9,11 +10,15 @@ module SublimeTextKit
|
|
9
10
|
end
|
10
11
|
|
11
12
|
def self.version
|
12
|
-
"3.
|
13
|
+
"3.2.0"
|
13
14
|
end
|
14
15
|
|
15
|
-
def self.
|
16
|
-
|
16
|
+
def self.version_label
|
17
|
+
"#{label} #{version}"
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.file_name
|
21
|
+
".#{name}rc"
|
17
22
|
end
|
18
23
|
end
|
19
24
|
end
|
@@ -3,6 +3,7 @@ require "pathname"
|
|
3
3
|
|
4
4
|
module SublimeTextKit
|
5
5
|
module Metadata
|
6
|
+
# Abstract class for processing metadata.
|
6
7
|
class Base
|
7
8
|
attr_reader :name, :project_dir, :metadata_dir, :metadata_file
|
8
9
|
|
@@ -11,12 +12,12 @@ module SublimeTextKit
|
|
11
12
|
return unless valid_dir?(instance.project_dir, "Projects")
|
12
13
|
return unless valid_dir?(instance.metadata_dir, "Metadata")
|
13
14
|
|
14
|
-
project_paths = ::Pathname.new(instance.project_dir).children.select
|
15
|
+
project_paths = ::Pathname.new(instance.project_dir).children.select(&:directory?)
|
15
16
|
project_paths.each { |project_dir| new(project_dir, metadata_dir).save }
|
16
17
|
end
|
17
18
|
|
18
19
|
def self.delete metadata_dir
|
19
|
-
instance = new
|
20
|
+
instance = new "", metadata_dir
|
20
21
|
return unless valid_dir?(instance.metadata_dir, "Metadata")
|
21
22
|
|
22
23
|
::Pathname.glob("#{instance.metadata_dir}/*.#{instance.file_extension}").each(&:delete)
|
@@ -38,13 +39,10 @@ module SublimeTextKit
|
|
38
39
|
end
|
39
40
|
|
40
41
|
def save
|
41
|
-
|
42
|
-
|
43
|
-
end
|
42
|
+
return if File.exist? metadata_file
|
43
|
+
File.open(metadata_file, "w") { |file| file.write MultiJson.dump(to_h, pretty: true) }
|
44
44
|
end
|
45
45
|
|
46
|
-
private
|
47
|
-
|
48
46
|
def self.valid_dir? dir, label
|
49
47
|
if File.exist?(dir)
|
50
48
|
true
|
@@ -53,6 +51,7 @@ module SublimeTextKit
|
|
53
51
|
false
|
54
52
|
end
|
55
53
|
end
|
54
|
+
private_class_method :valid_dir?
|
56
55
|
end
|
57
56
|
end
|
58
57
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require "multi_json"
|
2
2
|
|
3
3
|
module SublimeTextKit
|
4
|
+
# Manages Sublime Text session data.
|
4
5
|
class Session
|
5
6
|
attr_reader :metadata_dir
|
6
7
|
|
@@ -22,21 +23,20 @@ module SublimeTextKit
|
|
22
23
|
|
23
24
|
def rebuild_recent_workspaces
|
24
25
|
session = load_session
|
26
|
+
return unless session && session["workspaces"] && session["workspaces"]["recent_workspaces"]
|
25
27
|
|
26
|
-
|
27
|
-
|
28
|
-
save_session session
|
29
|
-
end
|
28
|
+
session["workspaces"]["recent_workspaces"] = workspaces
|
29
|
+
save_session session
|
30
30
|
end
|
31
31
|
|
32
32
|
private
|
33
33
|
|
34
34
|
def load_session
|
35
|
-
File.
|
35
|
+
File.exist?(self.class.session_path) ? MultiJson.load(File.read(self.class.session_path)) : {}
|
36
36
|
end
|
37
37
|
|
38
38
|
def save_session json
|
39
|
-
File.open(self.class.session_path,
|
39
|
+
File.open(self.class.session_path, "w") { |file| file.write MultiJson.dump(json, pretty: true) }
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
metadata
CHANGED
@@ -1,36 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sublime_text_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
|
-
cert_chain:
|
11
|
-
-
|
12
|
-
-----BEGIN CERTIFICATE-----
|
13
|
-
MIIDeDCCAmCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBBMQ8wDQYDVQQDDAZicm9v
|
14
|
-
a2UxGjAYBgoJkiaJk/IsZAEZFgphbGNoZW1pc3RzMRIwEAYKCZImiZPyLGQBGRYC
|
15
|
-
aW8wHhcNMTUwNzA1MTQ1MzExWhcNMTYwNzA0MTQ1MzExWjBBMQ8wDQYDVQQDDAZi
|
16
|
-
cm9va2UxGjAYBgoJkiaJk/IsZAEZFgphbGNoZW1pc3RzMRIwEAYKCZImiZPyLGQB
|
17
|
-
GRYCaW8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzhOVcvLGBCceM
|
18
|
-
PppVpJLUKsnskWzc1VqBXmv30feKNw+MOxMQaDsIP421qwqGO/2JHY60Kuobssk+
|
19
|
-
8/wqZkVFF/FFKxoQjuhlhc+VWLm8jWgXd4N1kwO2yytscQTzxc5qXarwA+36fqVH
|
20
|
-
RhBAHhjka+HdBI+6o3CXRHJoC47iav+QpR7u/wYl3gNq6MJO3MmTKqHegEDLjRN0
|
21
|
-
FJAr3bRAwq03ZtTuAVA2bdKLGThehe1RRRtJHJ/PHpmL2c203/GTXYtG6C8ILZIp
|
22
|
-
ZroTqQ8yglCJ+3hSOmodZqSAQ0Rj7GJgtuNH81qlSrHu5sTvoZjGmEqSIhvsSJ80
|
23
|
-
wKoPdZnFAgMBAAGjezB5MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
|
24
|
-
BBSUnF478a5lB4xuOBiktJdMJv6JmDAfBgNVHREEGDAWgRRicm9va2VAYWxjaGVt
|
25
|
-
aXN0cy5pbzAfBgNVHRIEGDAWgRRicm9va2VAYWxjaGVtaXN0cy5pbzANBgkqhkiG
|
26
|
-
9w0BAQUFAAOCAQEAT7KtBXWsq1KA7NOSMeFEDeSvhrgdLwCG/37pIu0rjvx9iAW4
|
27
|
-
gncxV0MccqIUtaF+lekjlXkIO+rXAVjvdha23KtpFTW90dYXp4NLPnPlSdyvYzJy
|
28
|
-
FIAaWGvujOT8xEu4umd45q5aepE8li4bR071i5Z7F0trKNVYYrxjQFmH5SSKYRT/
|
29
|
-
fXtICtAh1de3z3SOSK58IMPwjuoApYBxiqlmx0Uhla7mrzCE5+NmLPit3hLH6JFK
|
30
|
-
aSif+qBc6oHD7EQWPF5cZkzkIURuwNwPBngZGxIKaMAgRhjGFXzUMAaq++r59cS9
|
31
|
-
xTfQ4k6fglKEgpnLAXiKdo2c8Ym+X4rIKFfedQ==
|
32
|
-
-----END CERTIFICATE-----
|
33
|
-
date: 2015-07-05 00:00:00.000000000 Z
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-12-02 00:00:00.000000000 Z
|
34
12
|
dependencies:
|
35
13
|
- !ruby/object:Gem::Dependency
|
36
14
|
name: thor
|
@@ -88,6 +66,20 @@ dependencies:
|
|
88
66
|
- - "~>"
|
89
67
|
- !ruby/object:Gem::Version
|
90
68
|
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: gemsmith
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
91
83
|
- !ruby/object:Gem::Dependency
|
92
84
|
name: pry
|
93
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -117,7 +109,7 @@ dependencies:
|
|
117
109
|
- !ruby/object:Gem::Version
|
118
110
|
version: '0'
|
119
111
|
- !ruby/object:Gem::Dependency
|
120
|
-
name: pry-
|
112
|
+
name: pry-remote
|
121
113
|
requirement: !ruby/object:Gem::Requirement
|
122
114
|
requirements:
|
123
115
|
- - ">="
|
@@ -131,7 +123,7 @@ dependencies:
|
|
131
123
|
- !ruby/object:Gem::Version
|
132
124
|
version: '0'
|
133
125
|
- !ruby/object:Gem::Dependency
|
134
|
-
name: pry-
|
126
|
+
name: pry-state
|
135
127
|
requirement: !ruby/object:Gem::Requirement
|
136
128
|
requirements:
|
137
129
|
- - ">="
|
@@ -158,6 +150,20 @@ dependencies:
|
|
158
150
|
- - ">="
|
159
151
|
- !ruby/object:Gem::Version
|
160
152
|
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: pry-stack_explorer
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
161
167
|
- !ruby/object:Gem::Dependency
|
162
168
|
name: rspec
|
163
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -228,6 +234,20 @@ dependencies:
|
|
228
234
|
- - ">="
|
229
235
|
- !ruby/object:Gem::Version
|
230
236
|
version: '0'
|
237
|
+
- !ruby/object:Gem::Dependency
|
238
|
+
name: rubocop
|
239
|
+
requirement: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - ">="
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '0'
|
244
|
+
type: :development
|
245
|
+
prerelease: false
|
246
|
+
version_requirements: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
248
|
+
- - ">="
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: '0'
|
231
251
|
- !ruby/object:Gem::Dependency
|
232
252
|
name: codeclimate-test-reporter
|
233
253
|
requirement: !ruby/object:Gem::Requirement
|
@@ -242,7 +262,7 @@ dependencies:
|
|
242
262
|
- - ">="
|
243
263
|
- !ruby/object:Gem::Version
|
244
264
|
version: '0'
|
245
|
-
description:
|
265
|
+
description: A command line interface for managing Sublime Text metadata.
|
246
266
|
email:
|
247
267
|
- brooke@alchemists.io
|
248
268
|
executables:
|
@@ -262,6 +282,8 @@ files:
|
|
262
282
|
- lib/sublime_text_kit/metadata/project_metadata.rb
|
263
283
|
- lib/sublime_text_kit/metadata/workspace_metadata.rb
|
264
284
|
- lib/sublime_text_kit/session.rb
|
285
|
+
- lib/tasks/rspec.rake
|
286
|
+
- lib/tasks/rubocop.rake
|
265
287
|
homepage: https://github.com/bkuhlmann/sublime_text_kit
|
266
288
|
licenses:
|
267
289
|
- MIT
|
@@ -282,8 +304,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
282
304
|
version: '0'
|
283
305
|
requirements: []
|
284
306
|
rubyforge_project:
|
285
|
-
rubygems_version: 2.
|
307
|
+
rubygems_version: 2.5.0
|
286
308
|
signing_key:
|
287
309
|
specification_version: 4
|
288
|
-
summary:
|
310
|
+
summary: A command line interface for managing Sublime Text metadata.
|
289
311
|
test_files: []
|
checksums.yaml.gz.sig
DELETED
Binary file
|
data.tar.gz.sig
DELETED
Binary file
|
metadata.gz.sig
DELETED
Binary file
|