xcodesnippet 0.0.1
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 +7 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +24 -0
- data/LICENSE +19 -0
- data/README.md +38 -0
- data/Rakefile +9 -0
- data/bin/xcodesnippet +20 -0
- data/lib/xcodesnippet.rb +2 -0
- data/lib/xcodesnippet/commands.rb +3 -0
- data/lib/xcodesnippet/commands/install.rb +65 -0
- data/lib/xcodesnippet/snippet.rb +29 -0
- data/lib/xcodesnippet/version.rb +3 -0
- data/xcodesnippet.gemspec +27 -0
- data/~/Library/Developer/Xcode/UserData/CodeSnippets/0FEF3347-87A3-4D77-AB36-1E7713031AB8.codesnippet +35 -0
- data/~/Library/Developer/Xcode/UserData/CodeSnippets/21868D0D-DF43-4D74-962C-E0FAA0DE1954.codesnippet +35 -0
- data/~/Library/Developer/Xcode/UserData/CodeSnippets/6B5ABDD8-299B-40DA-BC46-483E615ECA28.codesnippet +35 -0
- data/~/Library/Developer/Xcode/UserData/CodeSnippets/BA236964-F3ED-4B06-A782-748885294C23.codesnippet +35 -0
- data/~/Library/Developer/Xcode/UserData/CodeSnippets/CFC361DC-327D-48B3-9CFE-FB3A010ED7A8.codesnippet +35 -0
- data/~/Library/Developer/Xcode/UserData/CodeSnippets/DD7665C9-631D-440B-AF70-CAC2D4E96F6C.codesnippet +35 -0
- metadata +118 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: de278d5098d8decd5ee44297dd1abc0699c3f737
|
4
|
+
data.tar.gz: 1729b2ff0d66d5ff2597d0d240db0ad487e878ae
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9fb80adf5106e7dfb26293d3d8de12c3af14e7dd3bae21ba21845cde493b9a0aec87da5b2343fe244bb1e948c05ccc0589738c1d270d655120b2941f03aad91e
|
7
|
+
data.tar.gz: 4019aeab1f2506ff473570e58266c330194beac42a5ee326ad6bbfd19f6ce2cf8c0e98b84b6cc364901e1f83cd78b367d31fad68f2982cb9871f66d6aafe2e39
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
xcodesnippet (0.0.1)
|
5
|
+
commander (~> 4.1)
|
6
|
+
plist
|
7
|
+
yaml-front-matter
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
commander (4.3.1)
|
13
|
+
highline (~> 1.7.1)
|
14
|
+
highline (1.7.1)
|
15
|
+
plist (3.1.0)
|
16
|
+
rake (10.2.1)
|
17
|
+
yaml-front-matter (0.0.1)
|
18
|
+
|
19
|
+
PLATFORMS
|
20
|
+
ruby
|
21
|
+
|
22
|
+
DEPENDENCIES
|
23
|
+
rake
|
24
|
+
xcodesnippet!
|
data/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2015 Mattt Thompson (http://mattt.me/)
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# xcodesnippet
|
2
|
+
*A command-line interface for installing Xcode Snippets*
|
3
|
+
|
4
|
+
## Installation
|
5
|
+
|
6
|
+
```
|
7
|
+
$ gem install xcodesnippet
|
8
|
+
```
|
9
|
+
|
10
|
+
## Usage
|
11
|
+
|
12
|
+
#### Sourcefile.swift
|
13
|
+
|
14
|
+
```swift
|
15
|
+
---
|
16
|
+
title: "Hello, World!"
|
17
|
+
summary: "Prints 'Hello World'"
|
18
|
+
completion-scope: Function or Method
|
19
|
+
---
|
20
|
+
|
21
|
+
println("Hello, World!")
|
22
|
+
```
|
23
|
+
|
24
|
+
#### Terminal Command
|
25
|
+
|
26
|
+
```
|
27
|
+
$ xcodesnippet install path/to/source.m
|
28
|
+
```
|
29
|
+
|
30
|
+
---
|
31
|
+
|
32
|
+
## Creator
|
33
|
+
|
34
|
+
Mattt Thompson ([@mattt](https://twitter.com/mattt))
|
35
|
+
|
36
|
+
## License
|
37
|
+
|
38
|
+
xcodesnippet is released under an MIT license. See LICENSE for more information.
|
data/Rakefile
ADDED
data/bin/xcodesnippet
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'commander/import'
|
4
|
+
|
5
|
+
$:.push File.expand_path("../../lib", __FILE__)
|
6
|
+
require 'xcodesnippet'
|
7
|
+
|
8
|
+
HighLine.track_eof = false # Fix for built-in Ruby
|
9
|
+
Signal.trap("INT") {} # Suppress backtrace when exiting command
|
10
|
+
|
11
|
+
program :version, XcodeSnippet::VERSION
|
12
|
+
program :description, 'A command-line interface for installing Xcode Snippets'
|
13
|
+
|
14
|
+
program :help, 'Author', 'Mattt Thompson <m@mattt.me>'
|
15
|
+
program :help, 'Website', 'https://github.com/mattt'
|
16
|
+
program :help_formatter, :compact
|
17
|
+
|
18
|
+
default_command :help
|
19
|
+
|
20
|
+
require 'xcodesnippet/commands'
|
data/lib/xcodesnippet.rb
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
require 'yaml/front-matter'
|
3
|
+
require 'fileutils'
|
4
|
+
require 'securerandom'
|
5
|
+
|
6
|
+
USER_XCODE_SNIPPETS_DIRECTORY = "~/Library/Developer/Xcode/UserData/CodeSnippets/"
|
7
|
+
|
8
|
+
command :install do |c|
|
9
|
+
c.syntax = 'codesnippet install [SNIPPET]'
|
10
|
+
c.summary = 'Create and Install an Xcode Snippet'
|
11
|
+
c.description = 'Creates and installs an Xcode .codesnippet file from an source file annotated with YAML front matter.'
|
12
|
+
|
13
|
+
c.example 'description', 'codesnippet install /path/to/code.source'
|
14
|
+
|
15
|
+
c.action do |args, options|
|
16
|
+
say_error "Input file required" and abort unless @input_filepath = args.first
|
17
|
+
say_error "Input file does not exist" and abort unless File.exist?(@input_filepath)
|
18
|
+
|
19
|
+
@content = File.read(@input_filepath)
|
20
|
+
say_error "Input file is empty" and abort if @content.empty?
|
21
|
+
|
22
|
+
extract_front_matter!
|
23
|
+
|
24
|
+
@output_filepath = File.join(USER_XCODE_SNIPPETS_DIRECTORY, @snippet.identifier + ".codesnippet")
|
25
|
+
begin
|
26
|
+
FileUtils.mkdir_p(USER_XCODE_SNIPPETS_DIRECTORY)
|
27
|
+
|
28
|
+
File.open(@output_filepath, 'w') do |f|
|
29
|
+
f.write @snippet.to_plist
|
30
|
+
end
|
31
|
+
rescue => error
|
32
|
+
say_error "Error: #{error.message}" and abort
|
33
|
+
end
|
34
|
+
|
35
|
+
say_ok "Installed Code Snippet"
|
36
|
+
puts @output_filepath
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def extract_front_matter!
|
43
|
+
@snippet = XcodeSnippet::Snippet.new
|
44
|
+
|
45
|
+
front_matter, contents = YAML::FrontMatter.extract(@content)
|
46
|
+
|
47
|
+
if front_matter.empty?
|
48
|
+
say_error "No YAML Front Matter Detected" and abort
|
49
|
+
else
|
50
|
+
@snippet.contents = contents.strip
|
51
|
+
@snippet.completion_prefix = File.basename(@input_filepath, File.extname(@input_filepath))
|
52
|
+
@snippet.language = case File.extname(@input_filepath)
|
53
|
+
when ".swift" then "Xcode.SourceCodeLanguage.Swift"
|
54
|
+
when ".m" then "Xcode.SourceCodeLanguage.Objective-C"
|
55
|
+
when ".mm" then "Xcode.SourceCodeLanguage.Objective-C++"
|
56
|
+
else ""
|
57
|
+
end
|
58
|
+
@snippet.title = front_matter["title"] || ""
|
59
|
+
@snippet.summary = front_matter["summary"] || ""
|
60
|
+
@snippet.completion_scopes = [front_matter["completion-scope"]] || front_matter["completion-scopes"] || "All"
|
61
|
+
@snippet.identifier = SecureRandom.uuid().upcase
|
62
|
+
@snippet.is_user_snippet = true
|
63
|
+
@snippet.version = 0
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'plist'
|
2
|
+
|
3
|
+
module XcodeSnippet
|
4
|
+
class Snippet
|
5
|
+
attr_accessor :completion_prefix
|
6
|
+
attr_accessor :completion_scopes
|
7
|
+
attr_accessor :contents
|
8
|
+
attr_accessor :identifier
|
9
|
+
attr_accessor :is_user_snippet
|
10
|
+
attr_accessor :language
|
11
|
+
attr_accessor :summary
|
12
|
+
attr_accessor :title
|
13
|
+
attr_accessor :version
|
14
|
+
|
15
|
+
def to_plist
|
16
|
+
{
|
17
|
+
"IDECodeSnippetCompletionPrefix" => @completion_prefix,
|
18
|
+
"IDECodeSnippetCompletionScopes" => @completion_scopes,
|
19
|
+
"IDECodeSnippetContents" => @contents,
|
20
|
+
"IDECodeSnippetIdentifier" => @identifier,
|
21
|
+
"IDECodeSnippetLanguage" => @language,
|
22
|
+
"IDECodeSnippetSummary" => @summary,
|
23
|
+
"IDECodeSnippetTitle" => @title,
|
24
|
+
"IDECodeSnippetUserSnippet" => @is_user_snippet,
|
25
|
+
"IDECodeSnippetVersion" => @version
|
26
|
+
}.to_plist
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
|
4
|
+
require "xcodesnippet/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "xcodesnippet"
|
8
|
+
s.authors = ["Mattt Thompson"]
|
9
|
+
s.email = "m@mattt.me"
|
10
|
+
s.license = "MIT"
|
11
|
+
s.homepage = "http://mattt.me"
|
12
|
+
s.version = XcodeSnippet::VERSION
|
13
|
+
s.platform = Gem::Platform::RUBY
|
14
|
+
s.summary = "xcodesnippet"
|
15
|
+
s.description = "A command-line interface for installing Xcode Snippets."
|
16
|
+
|
17
|
+
s.add_dependency "yaml-front-matter"
|
18
|
+
s.add_dependency "plist"
|
19
|
+
s.add_dependency "commander", "~> 4.1"
|
20
|
+
|
21
|
+
s.add_development_dependency "rake"
|
22
|
+
|
23
|
+
s.files = Dir["./**/*"].reject { |file| file =~ /\.\/(bin|log|pkg|script|spec|test|vendor)/ }
|
24
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
25
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
26
|
+
s.require_paths = ["lib"]
|
27
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>IDECodeSnippetCompletionPrefix</key>
|
6
|
+
<string>async</string>
|
7
|
+
<key>IDECodeSnippetCompletionScopes</key>
|
8
|
+
<array>
|
9
|
+
<array>
|
10
|
+
<string>Function</string>
|
11
|
+
<string>Method</string>
|
12
|
+
</array>
|
13
|
+
</array>
|
14
|
+
<key>IDECodeSnippetContents</key>
|
15
|
+
<string>dispatch_async(dispatch_get_global_queue(<#dispatch_queue_priority_t priority#>, <#unsigned long flags#>), ^(void) {
|
16
|
+
<#code#>
|
17
|
+
|
18
|
+
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
19
|
+
<#code#>
|
20
|
+
});
|
21
|
+
});</string>
|
22
|
+
<key>IDECodeSnippetIdentifier</key>
|
23
|
+
<string>0FEF3347-87A3-4D77-AB36-1E7713031AB8</string>
|
24
|
+
<key>IDECodeSnippetLanguage</key>
|
25
|
+
<string>Xcode.SourceCodeLanguage.Objective-C</string>
|
26
|
+
<key>IDECodeSnippetSummary</key>
|
27
|
+
<string>Dispatch to do work in the background, and then to the main queue with the results</string>
|
28
|
+
<key>IDECodeSnippetTitle</key>
|
29
|
+
<string>dispatch_async Pattern for Background Processing</string>
|
30
|
+
<key>IDECodeSnippetUserSnippet</key>
|
31
|
+
<true/>
|
32
|
+
<key>IDECodeSnippetVersion</key>
|
33
|
+
<integer>0</integer>
|
34
|
+
</dict>
|
35
|
+
</plist>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>IDECodeSnippetCompletionPrefix</key>
|
6
|
+
<string>async</string>
|
7
|
+
<key>IDECodeSnippetCompletionScopes</key>
|
8
|
+
<array>
|
9
|
+
<array>
|
10
|
+
<string>Function</string>
|
11
|
+
<string>Method</string>
|
12
|
+
</array>
|
13
|
+
</array>
|
14
|
+
<key>IDECodeSnippetContents</key>
|
15
|
+
<string>dispatch_async(dispatch_get_global_queue(<#dispatch_queue_priority_t priority#>, <#unsigned long flags#>), ^(void) {
|
16
|
+
<#code#>
|
17
|
+
|
18
|
+
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
19
|
+
<#code#>
|
20
|
+
});
|
21
|
+
});</string>
|
22
|
+
<key>IDECodeSnippetIdentifier</key>
|
23
|
+
<string>21868D0D-DF43-4D74-962C-E0FAA0DE1954</string>
|
24
|
+
<key>IDECodeSnippetLanguage</key>
|
25
|
+
<string>Xcode.SourceCodeLanguage.Objective-C</string>
|
26
|
+
<key>IDECodeSnippetSummary</key>
|
27
|
+
<string>Dispatch to do work in the background, and then to the main queue with the results</string>
|
28
|
+
<key>IDECodeSnippetTitle</key>
|
29
|
+
<string>dispatch_async Pattern for Background Processing</string>
|
30
|
+
<key>IDECodeSnippetUserSnippet</key>
|
31
|
+
<true/>
|
32
|
+
<key>IDECodeSnippetVersion</key>
|
33
|
+
<integer>0</integer>
|
34
|
+
</dict>
|
35
|
+
</plist>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>IDECodeSnippetCompletionPrefix</key>
|
6
|
+
<string>async</string>
|
7
|
+
<key>IDECodeSnippetCompletionScopes</key>
|
8
|
+
<array>
|
9
|
+
<array>
|
10
|
+
<string>Function</string>
|
11
|
+
<string>Method</string>
|
12
|
+
</array>
|
13
|
+
</array>
|
14
|
+
<key>IDECodeSnippetContents</key>
|
15
|
+
<string>dispatch_async(dispatch_get_global_queue(<#dispatch_queue_priority_t priority#>, <#unsigned long flags#>), ^(void) {
|
16
|
+
<#code#>
|
17
|
+
|
18
|
+
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
19
|
+
<#code#>
|
20
|
+
});
|
21
|
+
});</string>
|
22
|
+
<key>IDECodeSnippetIdentifier</key>
|
23
|
+
<string>6B5ABDD8-299B-40DA-BC46-483E615ECA28</string>
|
24
|
+
<key>IDECodeSnippetLanguage</key>
|
25
|
+
<string>Xcode.SourceCodeLanguage.Objective-C</string>
|
26
|
+
<key>IDECodeSnippetSummary</key>
|
27
|
+
<string>Dispatch to do work in the background, and then to the main queue with the results</string>
|
28
|
+
<key>IDECodeSnippetTitle</key>
|
29
|
+
<string>dispatch_async Pattern for Background Processing</string>
|
30
|
+
<key>IDECodeSnippetUserSnippet</key>
|
31
|
+
<true/>
|
32
|
+
<key>IDECodeSnippetVersion</key>
|
33
|
+
<integer>0</integer>
|
34
|
+
</dict>
|
35
|
+
</plist>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>IDECodeSnippetCompletionPrefix</key>
|
6
|
+
<string>async</string>
|
7
|
+
<key>IDECodeSnippetCompletionScopes</key>
|
8
|
+
<array>
|
9
|
+
<array>
|
10
|
+
<string>Function</string>
|
11
|
+
<string>Method</string>
|
12
|
+
</array>
|
13
|
+
</array>
|
14
|
+
<key>IDECodeSnippetContents</key>
|
15
|
+
<string>dispatch_async(dispatch_get_global_queue(<#dispatch_queue_priority_t priority#>, <#unsigned long flags#>), ^(void) {
|
16
|
+
<#code#>
|
17
|
+
|
18
|
+
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
19
|
+
<#code#>
|
20
|
+
});
|
21
|
+
});</string>
|
22
|
+
<key>IDECodeSnippetIdentifier</key>
|
23
|
+
<string>BA236964-F3ED-4B06-A782-748885294C23</string>
|
24
|
+
<key>IDECodeSnippetLanguage</key>
|
25
|
+
<string>Xcode.SourceCodeLanguage.Objective-C</string>
|
26
|
+
<key>IDECodeSnippetSummary</key>
|
27
|
+
<string>Dispatch to do work in the background, and then to the main queue with the results</string>
|
28
|
+
<key>IDECodeSnippetTitle</key>
|
29
|
+
<string>dispatch_async Pattern for Background Processing</string>
|
30
|
+
<key>IDECodeSnippetUserSnippet</key>
|
31
|
+
<true/>
|
32
|
+
<key>IDECodeSnippetVersion</key>
|
33
|
+
<integer>0</integer>
|
34
|
+
</dict>
|
35
|
+
</plist>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>IDECodeSnippetCompletionPrefix</key>
|
6
|
+
<string>async</string>
|
7
|
+
<key>IDECodeSnippetCompletionScopes</key>
|
8
|
+
<array>
|
9
|
+
<array>
|
10
|
+
<string>Function</string>
|
11
|
+
<string>Method</string>
|
12
|
+
</array>
|
13
|
+
</array>
|
14
|
+
<key>IDECodeSnippetContents</key>
|
15
|
+
<string>dispatch_async(dispatch_get_global_queue(<#dispatch_queue_priority_t priority#>, <#unsigned long flags#>), ^(void) {
|
16
|
+
<#code#>
|
17
|
+
|
18
|
+
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
19
|
+
<#code#>
|
20
|
+
});
|
21
|
+
});</string>
|
22
|
+
<key>IDECodeSnippetIdentifier</key>
|
23
|
+
<string>CFC361DC-327D-48B3-9CFE-FB3A010ED7A8</string>
|
24
|
+
<key>IDECodeSnippetLanguage</key>
|
25
|
+
<string>Xcode.SourceCodeLanguage.Objective-C</string>
|
26
|
+
<key>IDECodeSnippetSummary</key>
|
27
|
+
<string>Dispatch to do work in the background, and then to the main queue with the results</string>
|
28
|
+
<key>IDECodeSnippetTitle</key>
|
29
|
+
<string>dispatch_async Pattern for Background Processing</string>
|
30
|
+
<key>IDECodeSnippetUserSnippet</key>
|
31
|
+
<true/>
|
32
|
+
<key>IDECodeSnippetVersion</key>
|
33
|
+
<integer>0</integer>
|
34
|
+
</dict>
|
35
|
+
</plist>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>IDECodeSnippetCompletionPrefix</key>
|
6
|
+
<string>async</string>
|
7
|
+
<key>IDECodeSnippetCompletionScopes</key>
|
8
|
+
<array>
|
9
|
+
<array>
|
10
|
+
<string>Function</string>
|
11
|
+
<string>Method</string>
|
12
|
+
</array>
|
13
|
+
</array>
|
14
|
+
<key>IDECodeSnippetContents</key>
|
15
|
+
<string>dispatch_async(dispatch_get_global_queue(<#dispatch_queue_priority_t priority#>, <#unsigned long flags#>), ^(void) {
|
16
|
+
<#code#>
|
17
|
+
|
18
|
+
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
19
|
+
<#code#>
|
20
|
+
});
|
21
|
+
});</string>
|
22
|
+
<key>IDECodeSnippetIdentifier</key>
|
23
|
+
<string>DD7665C9-631D-440B-AF70-CAC2D4E96F6C</string>
|
24
|
+
<key>IDECodeSnippetLanguage</key>
|
25
|
+
<string>Xcode.SourceCodeLanguage.Objective-C</string>
|
26
|
+
<key>IDECodeSnippetSummary</key>
|
27
|
+
<string>Dispatch to do work in the background, and then to the main queue with the results</string>
|
28
|
+
<key>IDECodeSnippetTitle</key>
|
29
|
+
<string>dispatch_async Pattern for Background Processing</string>
|
30
|
+
<key>IDECodeSnippetUserSnippet</key>
|
31
|
+
<true/>
|
32
|
+
<key>IDECodeSnippetVersion</key>
|
33
|
+
<integer>0</integer>
|
34
|
+
</dict>
|
35
|
+
</plist>
|
metadata
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: xcodesnippet
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Mattt Thompson
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-03-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: yaml-front-matter
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: plist
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: commander
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '4.1'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '4.1'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: A command-line interface for installing Xcode Snippets.
|
70
|
+
email: m@mattt.me
|
71
|
+
executables:
|
72
|
+
- xcodesnippet
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ./Gemfile
|
77
|
+
- ./Gemfile.lock
|
78
|
+
- ./lib/xcodesnippet/commands/install.rb
|
79
|
+
- ./lib/xcodesnippet/commands.rb
|
80
|
+
- ./lib/xcodesnippet/snippet.rb
|
81
|
+
- ./lib/xcodesnippet/version.rb
|
82
|
+
- ./lib/xcodesnippet.rb
|
83
|
+
- ./LICENSE
|
84
|
+
- ./Rakefile
|
85
|
+
- ./README.md
|
86
|
+
- ./xcodesnippet.gemspec
|
87
|
+
- ./~/Library/Developer/Xcode/UserData/CodeSnippets/0FEF3347-87A3-4D77-AB36-1E7713031AB8.codesnippet
|
88
|
+
- ./~/Library/Developer/Xcode/UserData/CodeSnippets/21868D0D-DF43-4D74-962C-E0FAA0DE1954.codesnippet
|
89
|
+
- ./~/Library/Developer/Xcode/UserData/CodeSnippets/6B5ABDD8-299B-40DA-BC46-483E615ECA28.codesnippet
|
90
|
+
- ./~/Library/Developer/Xcode/UserData/CodeSnippets/BA236964-F3ED-4B06-A782-748885294C23.codesnippet
|
91
|
+
- ./~/Library/Developer/Xcode/UserData/CodeSnippets/CFC361DC-327D-48B3-9CFE-FB3A010ED7A8.codesnippet
|
92
|
+
- ./~/Library/Developer/Xcode/UserData/CodeSnippets/DD7665C9-631D-440B-AF70-CAC2D4E96F6C.codesnippet
|
93
|
+
- bin/xcodesnippet
|
94
|
+
homepage: http://mattt.me
|
95
|
+
licenses:
|
96
|
+
- MIT
|
97
|
+
metadata: {}
|
98
|
+
post_install_message:
|
99
|
+
rdoc_options: []
|
100
|
+
require_paths:
|
101
|
+
- lib
|
102
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - '>='
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - '>='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
requirements: []
|
113
|
+
rubyforge_project:
|
114
|
+
rubygems_version: 2.1.11
|
115
|
+
signing_key:
|
116
|
+
specification_version: 4
|
117
|
+
summary: xcodesnippet
|
118
|
+
test_files: []
|