sublime_text_kit 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 856d1ed15281faf42b62d61ceeae2c9597b12253
4
+ data.tar.gz: 1cfd8b2e1456c1723f5ae90867eb348fe6ad3347
5
+ SHA512:
6
+ metadata.gz: 7c73df56e09e2ab166ef63c75dec2c633f0d49d21910c64fc5dfcddc444bc499352ec1f6900661c55375fafa8490c0baa4d57d12fe5cfd5be72924e6ce92bbbb
7
+ data.tar.gz: 64a904e76eba7342a2c2bc01b0997f301f5e8e811a247276308f04b76e5afe2064280d1401eb6d2d4e38fb71551ac8776863090d3c9b2a94b8baff1ff69cd9aa
checksums.yaml.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ #�N�0H�„A� �j D��y� �Dj)���f���p�%=�ג��{�d ����n/]���m<���q����D ħ(����|4�Q
2
+ ��E\h�a��3���E��e�F%�h�E�0�m�4l5�-���.�i:Fb'��
data/LICENSE.md ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2014 [Red Alchemist](http://www.redalchemist.com).
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,91 @@
1
+ # Overview
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/sublime_text_kit.png)](http://badge.fury.io/rb/sublime_text_kit)
4
+ [![Code Climate GPA](https://codeclimate.com/github/bkuhlmann/sublime_text_kit.png)](https://codeclimate.com/github/bkuhlmann/sublime_text_kit)
5
+ [![Travis CI Status](https://secure.travis-ci.org/bkuhlmann/sublime_text_kit.png)](http://travis-ci.org/bkuhlmann/sublime_text_kit)
6
+
7
+ Provides a collection of utilities that aids in Sublime Text managment. The utilities are fairly sparse at the
8
+ moment but the idea is that this will grow over time.
9
+
10
+ # Features
11
+
12
+ * Rebuilds recent workspace history (via Project -> Recent Projects) from existing project files (assumes
13
+ workspaces are in a single directory) so one can easily toggle between up-to-date project information via
14
+ the COMMAND+CONTROL+P shortcut.
15
+
16
+ # Requirements
17
+
18
+ 0. [Ruby 2.x.x](http://www.ruby-lang.org).
19
+ 0. [Sublime Text 2](http://www.sublimetext.com).
20
+
21
+ # Setup
22
+
23
+ For a secure install, type the following from the command line (recommended):
24
+
25
+ gem cert --add <(curl -Ls http://www.redalchemist.com/gem-public.pem)
26
+ gem install sublime_text_kit -P HighSecurity
27
+
28
+ ...or, for an insecure install, type the following (not recommended):
29
+
30
+ gem install sublime_text_kit
31
+
32
+ You can define settings by creating the following file:
33
+
34
+ ~/.sublime/settings.yml
35
+
36
+ Example:
37
+
38
+ ---
39
+ :workspaces_path: ~/Dropbox/Cache/Sublime
40
+
41
+ # Usage
42
+
43
+ From the command line, type: stk
44
+
45
+ stk -e, [--edit] # Edit settings in default editor (assumes $EDITOR environment variable).
46
+ stk -h, [--help=HELP] # Show this message or get help for a command.
47
+ stk -s, [--session] # Manage session data.
48
+ stk -v, [--version] # Show version.
49
+
50
+ For settion options, type: stk help --session
51
+
52
+ -r, [--rebuild-recent-workspaces] # Rebuild recent workspaces.
53
+
54
+ # Troubleshooting
55
+
56
+ * When rebuilding workspaces, ensure workspaces_path (as defined via settings.yml) points to a directory containing
57
+ both *.sublime-project and *.sublime-workspace files.
58
+
59
+ # Tests
60
+
61
+ To test, do the following:
62
+
63
+ 0. cd to the gem root.
64
+ 0. bundle install
65
+ 0. bundle exec rspec spec
66
+
67
+ # Versioning
68
+
69
+ Read [Semantic Versioning](http://semver.org) for details. Briefly, it means:
70
+
71
+ * Patch (x.y.Z) - Incremented for small, backwards compatible bug fixes.
72
+ * Minor (x.Y.z) - Incremented for new, backwards compatible public API enhancements and/or bug fixes.
73
+ * Major (X.y.z) - Incremented for any backwards incompatible public API changes.
74
+
75
+ # Contributions
76
+
77
+ Read CONTRIBUTING for details.
78
+
79
+ # Credits
80
+
81
+ Developed by [Brooke Kuhlmann](http://www.redalchemist.com) at [Red Alchemist](http://www.redalchemist.com).
82
+
83
+ # License
84
+
85
+ Copyright (c) 2014 [Red Alchemist](http://www.redalchemist.com).
86
+ Read the LICENSE for details.
87
+
88
+ # History
89
+
90
+ Read the CHANGELOG for details.
91
+ Built with [Gemsmith](https://github.com/bkuhlmann/gemsmith).
data/bin/stk ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/ruby
2
+
3
+ require "sublime_text_kit"
4
+ require "sublime_text_kit/cli"
5
+ SublimeTextKit::CLI.start
@@ -0,0 +1,61 @@
1
+ require "yaml"
2
+ require "thor"
3
+ require "thor/actions"
4
+ require "thor_plus/actions"
5
+
6
+ module SublimeTextKit
7
+ class CLI < Thor
8
+ include Thor::Actions
9
+ include ThorPlus::Actions
10
+
11
+ # Initialize.
12
+ def initialize args = [], options = {}, config = {}
13
+ super args, options, config
14
+ @settings_file = File.join ENV["HOME"], ".sublime", "settings.yml"
15
+ @settings = load_yaml @settings_file
16
+ end
17
+
18
+ desc "-s, [--session]", "Manage session data."
19
+ map %w(-s --session) => :session
20
+ method_option :rebuild_recent_workspaces, aliases: "-r", desc: "Rebuild recent workspaces.", type: :boolean, default: false
21
+ def session
22
+ say
23
+
24
+ case
25
+ when options[:rebuild_recent_workspaces] then rebuild_recent_workspaces
26
+ else help("--session")
27
+ end
28
+
29
+ say
30
+ end
31
+
32
+ desc "-e, [--edit]", "Edit settings in default editor (assumes $EDITOR environment variable)."
33
+ map %w(-e --edit) => :edit
34
+ def edit
35
+ `$EDITOR #{@settings_file}`
36
+ end
37
+
38
+ desc "-v, [--version]", "Show version."
39
+ map %w(-v --version) => :version
40
+ def version
41
+ say "Sublime Text Kit " + VERSION
42
+ end
43
+
44
+ desc "-h, [--help=HELP]", "Show this message or get help for a command."
45
+ map %w(-h --help) => :help
46
+ def help task = nil
47
+ say and super
48
+ end
49
+
50
+ private
51
+
52
+ def rebuild_recent_workspaces
53
+ info "Rebuilding recent workspaces..."
54
+ session = SublimeTextKit::Session.new workspaces_path: @settings[:workspaces_path]
55
+ info "Workspaces Path: #{session.workspaces_path}"
56
+ info "Sublime Text Session: #{SublimeTextKit::Session.session_path}"
57
+ session.rebuild_recent_workspaces
58
+ info "Recent workspaces rebuilt."
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,42 @@
1
+ require "oj"
2
+
3
+ module SublimeTextKit
4
+ class Session
5
+ attr_accessor :workspaces_path
6
+
7
+ def self.home_path
8
+ ENV["HOME"]
9
+ end
10
+
11
+ def self.session_path
12
+ "#{home_path}/Library/Application Support/Sublime Text 2/Settings/Session.sublime_session"
13
+ end
14
+
15
+ def initialize workspaces_path: ''
16
+ @workspaces_path = workspaces_path
17
+ end
18
+
19
+ def workspaces
20
+ Dir["#{workspaces_path}/*.sublime-project"].sort
21
+ end
22
+
23
+ def rebuild_recent_workspaces
24
+ session = load_session
25
+
26
+ if session && session["workspaces"] && session["workspaces"]["recent_workspaces"]
27
+ session["workspaces"]["recent_workspaces"] = workspaces
28
+ save_session session
29
+ end
30
+ end
31
+
32
+ private
33
+
34
+ def load_session
35
+ File.exists?(self.class.session_path) ? Oj.load(File.read(self.class.session_path)) : {}
36
+ end
37
+
38
+ def save_session json
39
+ File.open(self.class.session_path, 'w') { |file| file.write Oj.dump(json) }
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,3 @@
1
+ module SublimeTextKit
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,2 @@
1
+ require "sublime_text_kit/version"
2
+ require "sublime_text_kit/session"
data.tar.gz.sig ADDED
Binary file
metadata ADDED
@@ -0,0 +1,300 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sublime_text_kit
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Brooke Kuhlmann
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDhTCCAm2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQ8wDQYDVQQDDAZicm9v
14
+ a2UxHDAaBgoJkiaJk/IsZAEZFgxyZWRhbGNoZW1pc3QxEzARBgoJkiaJk/IsZAEZ
15
+ FgNjb20wHhcNMTMwNjI1MDEzOTUyWhcNMTQwNjI1MDEzOTUyWjBEMQ8wDQYDVQQD
16
+ DAZicm9va2UxHDAaBgoJkiaJk/IsZAEZFgxyZWRhbGNoZW1pc3QxEzARBgoJkiaJ
17
+ k/IsZAEZFgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCoICuy
18
+ DEfASTaScwJxS+wuGY729rx9X6KWktpiee5UT0hSZ8RBum1PU5pfgXdZcZ9rOiGC
19
+ 66qjTN7I08FWpnoz/11M9Wcqd5k1aJXnXeCKRjWmgrnqY2ecbM6CR2OhSIe63l1I
20
+ wNg9ZTx6h2S8AcdJa2cs1kGO0/NZ5PqKn8ZSFUfByJIIP6ygas7MFIh9EuDs+bTU
21
+ OVrOAtfC8rZKZ7iFhPwMeRfn4PnR/q0xfK6UXjjr7ES67/qjAbioZaNfubbe+bc7
22
+ aRcWYGTG8cFuM0PnX4dr2p3ZRXmOYwt+dcZxRZxG099v4IsC0hwttgES64BfDiQc
23
+ PrqZFq63Lzc/j+eBAgMBAAGjgYEwfzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAd
24
+ BgNVHQ4EFgQU43tA2HIdqx0YsONzs1fL6z8l4WQwIgYDVR0RBBswGYEXYnJvb2tl
25
+ QHJlZGFsY2hlbWlzdC5jb20wIgYDVR0SBBswGYEXYnJvb2tlQHJlZGFsY2hlbWlz
26
+ dC5jb20wDQYJKoZIhvcNAQEFBQADggEBADZi/zTFe3ZJ87QbGmqIadqGeqy27/KZ
27
+ tIO5rX7kPoFwIdFyW8XekozEPaWDpwRQ/E0LVz1f/7U6VEmp30tpOgXqHS7GkAlz
28
+ Q1bZjlDMkosXIYd737LfjaQB5YqzoUMWdbPmX5oKXmQMy416GrcLZXW22u5HtrHN
29
+ AT6fTCYrKaY9LWcugrGU7puOo0itBjLUC0YxtBnDGV8h0Fop9DHQ6gATPweQ7R1j
30
+ SJpzzzZ8gO6BKn4fhd+ENNQ333Qy3nuNk07TVIaNnlgeHhowUDuD9T7Z8Lka0pt3
31
+ 4PteiTppsf0SSVAM9zSO5IuFngXMRwWgvjOfXE70f43RDuUVTCSyylc=
32
+ -----END CERTIFICATE-----
33
+ date: 2014-01-28 00:00:00.000000000 Z
34
+ dependencies:
35
+ - !ruby/object:Gem::Dependency
36
+ name: thor
37
+ requirement: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '0.18'
42
+ type: :runtime
43
+ prerelease: false
44
+ version_requirements: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '0.18'
49
+ - !ruby/object:Gem::Dependency
50
+ name: thor_plus
51
+ requirement: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '1.0'
56
+ type: :runtime
57
+ prerelease: false
58
+ version_requirements: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '1.0'
63
+ - !ruby/object:Gem::Dependency
64
+ name: oj
65
+ requirement: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '2.5'
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: '2.5'
77
+ - !ruby/object:Gem::Dependency
78
+ name: rake
79
+ requirement: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: '10.0'
84
+ type: :development
85
+ prerelease: false
86
+ version_requirements: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: '10.0'
91
+ - !ruby/object:Gem::Dependency
92
+ name: pry
93
+ requirement: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ type: :development
99
+ prerelease: false
100
+ version_requirements: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ - !ruby/object:Gem::Dependency
106
+ name: pry-byebug
107
+ requirement: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ type: :development
113
+ prerelease: false
114
+ version_requirements: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ - !ruby/object:Gem::Dependency
120
+ name: pry-remote
121
+ requirement: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ type: :development
127
+ prerelease: false
128
+ version_requirements: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ - !ruby/object:Gem::Dependency
134
+ name: pry-rescue
135
+ requirement: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
140
+ type: :development
141
+ prerelease: false
142
+ version_requirements: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
147
+ - !ruby/object:Gem::Dependency
148
+ name: pry-stack_explorer
149
+ requirement: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
154
+ type: :development
155
+ prerelease: false
156
+ version_requirements: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ version: '0'
161
+ - !ruby/object:Gem::Dependency
162
+ name: pry-vterm_aliases
163
+ requirement: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - ">="
166
+ - !ruby/object:Gem::Version
167
+ version: '0'
168
+ type: :development
169
+ prerelease: false
170
+ version_requirements: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - ">="
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ - !ruby/object:Gem::Dependency
176
+ name: pry-git
177
+ requirement: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - ">="
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ type: :development
183
+ prerelease: false
184
+ version_requirements: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - ">="
187
+ - !ruby/object:Gem::Version
188
+ version: '0'
189
+ - !ruby/object:Gem::Dependency
190
+ name: pry-doc
191
+ requirement: !ruby/object:Gem::Requirement
192
+ requirements:
193
+ - - ">="
194
+ - !ruby/object:Gem::Version
195
+ version: '0'
196
+ type: :development
197
+ prerelease: false
198
+ version_requirements: !ruby/object:Gem::Requirement
199
+ requirements:
200
+ - - ">="
201
+ - !ruby/object:Gem::Version
202
+ version: '0'
203
+ - !ruby/object:Gem::Dependency
204
+ name: rspec
205
+ requirement: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - ">="
208
+ - !ruby/object:Gem::Version
209
+ version: '0'
210
+ type: :development
211
+ prerelease: false
212
+ version_requirements: !ruby/object:Gem::Requirement
213
+ requirements:
214
+ - - ">="
215
+ - !ruby/object:Gem::Version
216
+ version: '0'
217
+ - !ruby/object:Gem::Dependency
218
+ name: aruba
219
+ requirement: !ruby/object:Gem::Requirement
220
+ requirements:
221
+ - - ">="
222
+ - !ruby/object:Gem::Version
223
+ version: '0'
224
+ type: :development
225
+ prerelease: false
226
+ version_requirements: !ruby/object:Gem::Requirement
227
+ requirements:
228
+ - - ">="
229
+ - !ruby/object:Gem::Version
230
+ version: '0'
231
+ - !ruby/object:Gem::Dependency
232
+ name: rb-fsevent
233
+ requirement: !ruby/object:Gem::Requirement
234
+ requirements:
235
+ - - ">="
236
+ - !ruby/object:Gem::Version
237
+ version: '0'
238
+ type: :development
239
+ prerelease: false
240
+ version_requirements: !ruby/object:Gem::Requirement
241
+ requirements:
242
+ - - ">="
243
+ - !ruby/object:Gem::Version
244
+ version: '0'
245
+ - !ruby/object:Gem::Dependency
246
+ name: guard-rspec
247
+ requirement: !ruby/object:Gem::Requirement
248
+ requirements:
249
+ - - ">="
250
+ - !ruby/object:Gem::Version
251
+ version: '0'
252
+ type: :development
253
+ prerelease: false
254
+ version_requirements: !ruby/object:Gem::Requirement
255
+ requirements:
256
+ - - ">="
257
+ - !ruby/object:Gem::Version
258
+ version: '0'
259
+ description: Command line utilities for Sublime Text packaged as a Ruby Gem.
260
+ email: brooke@redalchemist.com
261
+ executables:
262
+ - stk
263
+ extensions: []
264
+ extra_rdoc_files:
265
+ - README.md
266
+ - LICENSE.md
267
+ files:
268
+ - LICENSE.md
269
+ - README.md
270
+ - bin/stk
271
+ - lib/sublime_text_kit.rb
272
+ - lib/sublime_text_kit/cli.rb
273
+ - lib/sublime_text_kit/session.rb
274
+ - lib/sublime_text_kit/version.rb
275
+ homepage: https://github.com/bkuhlmann/sublime_text_kit
276
+ licenses:
277
+ - MIT
278
+ metadata: {}
279
+ post_install_message:
280
+ rdoc_options: []
281
+ require_paths:
282
+ - lib
283
+ required_ruby_version: !ruby/object:Gem::Requirement
284
+ requirements:
285
+ - - "~>"
286
+ - !ruby/object:Gem::Version
287
+ version: '2.0'
288
+ required_rubygems_version: !ruby/object:Gem::Requirement
289
+ requirements:
290
+ - - ">="
291
+ - !ruby/object:Gem::Version
292
+ version: '0'
293
+ requirements: []
294
+ rubyforge_project:
295
+ rubygems_version: 2.2.1
296
+ signing_key:
297
+ specification_version: 4
298
+ summary: Command line utilities for Sublime Text.
299
+ test_files: []
300
+ has_rdoc:
metadata.gz.sig ADDED
Binary file