property_synthesize_dealloc 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,27 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>NSServices</key>
6
+ <array>
7
+ <dict>
8
+ <key>NSMenuItem</key>
9
+ <dict>
10
+ <key>default</key>
11
+ <string>psd</string>
12
+ </dict>
13
+ <key>NSMessage</key>
14
+ <string>runWorkflowAsService</string>
15
+ <key>NSRequiredContext</key>
16
+ <dict>
17
+ <key>NSApplicationIdentifier</key>
18
+ <string>com.apple.dt.Xcode</string>
19
+ </dict>
20
+ <key>NSSendTypes</key>
21
+ <array>
22
+ <string>public.utf8-plain-text</string>
23
+ </array>
24
+ </dict>
25
+ </array>
26
+ </dict>
27
+ </plist>
@@ -0,0 +1,280 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>AMApplicationBuild</key>
6
+ <string>247.1</string>
7
+ <key>AMApplicationVersion</key>
8
+ <string>2.1.1</string>
9
+ <key>AMDocumentVersion</key>
10
+ <string>2</string>
11
+ <key>actions</key>
12
+ <array>
13
+ <dict>
14
+ <key>action</key>
15
+ <dict>
16
+ <key>AMAccepts</key>
17
+ <dict>
18
+ <key>Container</key>
19
+ <string>List</string>
20
+ <key>Optional</key>
21
+ <true/>
22
+ <key>Types</key>
23
+ <array>
24
+ <string>com.apple.cocoa.string</string>
25
+ </array>
26
+ </dict>
27
+ <key>AMActionVersion</key>
28
+ <string>2.0.1</string>
29
+ <key>AMParameterProperties</key>
30
+ <dict>
31
+ <key>COMMAND_STRING</key>
32
+ <dict/>
33
+ <key>CheckedForUserDefaultShell</key>
34
+ <dict/>
35
+ <key>inputMethod</key>
36
+ <dict/>
37
+ <key>shell</key>
38
+ <dict/>
39
+ <key>source</key>
40
+ <dict/>
41
+ </dict>
42
+ <key>AMProvides</key>
43
+ <dict>
44
+ <key>Container</key>
45
+ <string>List</string>
46
+ <key>Types</key>
47
+ <array>
48
+ <string>com.apple.cocoa.string</string>
49
+ </array>
50
+ </dict>
51
+ <key>ActionBundlePath</key>
52
+ <string>/System/Library/Automator/Run Shell Script.action</string>
53
+ <key>ActionName</key>
54
+ <string>Run Shell Script</string>
55
+ <key>ActionParameters</key>
56
+ <dict>
57
+ <key>COMMAND_STRING</key>
58
+ <string>#!/usr/bin/ruby
59
+
60
+ require 'rubygems'
61
+ require "property_synthesize_dealloc"
62
+
63
+ property = PropertySynthesizeDealloc.new
64
+ property.selection = STDIN.read
65
+ property.psd!
66
+
67
+ </string>
68
+ <key>CheckedForUserDefaultShell</key>
69
+ <true/>
70
+ <key>inputMethod</key>
71
+ <integer>0</integer>
72
+ <key>shell</key>
73
+ <string>/usr/bin/ruby</string>
74
+ <key>source</key>
75
+ <string></string>
76
+ </dict>
77
+ <key>Application</key>
78
+ <array>
79
+ <string>Automator</string>
80
+ </array>
81
+ <key>BundleIdentifier</key>
82
+ <string>com.apple.RunShellScript</string>
83
+ <key>CFBundleVersion</key>
84
+ <string>2.0.1</string>
85
+ <key>CanShowSelectedItemsWhenRun</key>
86
+ <false/>
87
+ <key>CanShowWhenRun</key>
88
+ <true/>
89
+ <key>Category</key>
90
+ <array>
91
+ <string>AMCategoryUtilities</string>
92
+ </array>
93
+ <key>Class Name</key>
94
+ <string>RunShellScriptAction</string>
95
+ <key>InputUUID</key>
96
+ <string>4C90405F-E0E6-4EDD-81C4-2869C61EEB6B</string>
97
+ <key>Keywords</key>
98
+ <array>
99
+ <string>Shell</string>
100
+ <string>Script</string>
101
+ <string>Command</string>
102
+ <string>Run</string>
103
+ <string>Unix</string>
104
+ </array>
105
+ <key>OutputUUID</key>
106
+ <string>D906EA66-535C-4961-B8BD-A4F36619D768</string>
107
+ <key>UUID</key>
108
+ <string>D77A22C2-8D66-4361-9B84-0A61BC667A04</string>
109
+ <key>UnlocalizedApplications</key>
110
+ <array>
111
+ <string>Automator</string>
112
+ </array>
113
+ <key>arguments</key>
114
+ <dict>
115
+ <key>0</key>
116
+ <dict>
117
+ <key>default value</key>
118
+ <integer>0</integer>
119
+ <key>name</key>
120
+ <string>inputMethod</string>
121
+ <key>required</key>
122
+ <string>0</string>
123
+ <key>type</key>
124
+ <string>0</string>
125
+ <key>uuid</key>
126
+ <string>0</string>
127
+ </dict>
128
+ <key>1</key>
129
+ <dict>
130
+ <key>default value</key>
131
+ <string></string>
132
+ <key>name</key>
133
+ <string>source</string>
134
+ <key>required</key>
135
+ <string>0</string>
136
+ <key>type</key>
137
+ <string>0</string>
138
+ <key>uuid</key>
139
+ <string>1</string>
140
+ </dict>
141
+ <key>2</key>
142
+ <dict>
143
+ <key>default value</key>
144
+ <false/>
145
+ <key>name</key>
146
+ <string>CheckedForUserDefaultShell</string>
147
+ <key>required</key>
148
+ <string>0</string>
149
+ <key>type</key>
150
+ <string>0</string>
151
+ <key>uuid</key>
152
+ <string>2</string>
153
+ </dict>
154
+ <key>3</key>
155
+ <dict>
156
+ <key>default value</key>
157
+ <string></string>
158
+ <key>name</key>
159
+ <string>COMMAND_STRING</string>
160
+ <key>required</key>
161
+ <string>0</string>
162
+ <key>type</key>
163
+ <string>0</string>
164
+ <key>uuid</key>
165
+ <string>3</string>
166
+ </dict>
167
+ <key>4</key>
168
+ <dict>
169
+ <key>default value</key>
170
+ <string>/bin/sh</string>
171
+ <key>name</key>
172
+ <string>shell</string>
173
+ <key>required</key>
174
+ <string>0</string>
175
+ <key>type</key>
176
+ <string>0</string>
177
+ <key>uuid</key>
178
+ <string>4</string>
179
+ </dict>
180
+ </dict>
181
+ <key>isViewVisible</key>
182
+ <true/>
183
+ <key>location</key>
184
+ <string>413.000000:549.000000</string>
185
+ <key>nibPath</key>
186
+ <string>/System/Library/Automator/Run Shell Script.action/Contents/Resources/English.lproj/main.nib</string>
187
+ </dict>
188
+ <key>isViewVisible</key>
189
+ <true/>
190
+ </dict>
191
+ </array>
192
+ <key>connectors</key>
193
+ <dict/>
194
+ <key>state</key>
195
+ <dict>
196
+ <key>AMLogTabViewSelectedIndex</key>
197
+ <integer>0</integer>
198
+ <key>libraryState</key>
199
+ <dict>
200
+ <key>actionsMajorSplitViewState</key>
201
+ <dict>
202
+ <key>expandedPosition</key>
203
+ <real>0.0</real>
204
+ <key>subviewState</key>
205
+ <array>
206
+ <string>0.000000, 0.000000, 458.000000, 510.000000, NO</string>
207
+ <string>0.000000, 511.000000, 458.000000, 239.000000, NO</string>
208
+ </array>
209
+ </dict>
210
+ <key>actionsMinorSplitViewState</key>
211
+ <dict>
212
+ <key>expandedPosition</key>
213
+ <real>0.0</real>
214
+ <key>subviewState</key>
215
+ <array>
216
+ <string>0.000000, 0.000000, 163.000000, 510.000000, NO</string>
217
+ <string>164.000000, 0.000000, 294.000000, 510.000000, NO</string>
218
+ </array>
219
+ </dict>
220
+ <key>variablesMajorSplitViewState</key>
221
+ <dict>
222
+ <key>expandedPosition</key>
223
+ <real>0.0</real>
224
+ <key>subviewState</key>
225
+ <array>
226
+ <string>0.000000, 0.000000, 350.000000, 555.000000, NO</string>
227
+ <string>0.000000, 556.000000, 350.000000, 148.000000, NO</string>
228
+ </array>
229
+ </dict>
230
+ <key>variablesMinorSplitViewState</key>
231
+ <dict>
232
+ <key>expandedPosition</key>
233
+ <real>0.0</real>
234
+ <key>subviewState</key>
235
+ <array>
236
+ <string>0.000000, 0.000000, 163.000000, 555.000000, NO</string>
237
+ <string>164.000000, 0.000000, 186.000000, 555.000000, NO</string>
238
+ </array>
239
+ </dict>
240
+ </dict>
241
+ <key>majorSplitViewState</key>
242
+ <dict>
243
+ <key>expandedPosition</key>
244
+ <real>337</real>
245
+ <key>subviewState</key>
246
+ <array>
247
+ <string>0.000000, 0.000000, 458.000000, 795.000000, NO</string>
248
+ <string>459.000000, 0.000000, 826.000000, 795.000000, NO</string>
249
+ </array>
250
+ </dict>
251
+ <key>minorSplitViewState</key>
252
+ <dict>
253
+ <key>expandedPosition</key>
254
+ <real>0.0</real>
255
+ <key>subviewState</key>
256
+ <array>
257
+ <string>0.000000, 0.000000, 826.000000, 604.000000, NO</string>
258
+ <string>0.000000, 614.000000, 826.000000, 162.000000, NO</string>
259
+ </array>
260
+ </dict>
261
+ <key>windowFrame</key>
262
+ <string>{{421, 260}, {1284, 872}}</string>
263
+ <key>workflowViewScrollPosition</key>
264
+ <string>{{0, 0}, {826, 604}}</string>
265
+ </dict>
266
+ <key>workflowMetaData</key>
267
+ <dict>
268
+ <key>serviceApplicationBundleID</key>
269
+ <string>com.apple.dt.Xcode</string>
270
+ <key>serviceApplicationPath</key>
271
+ <string>/Developer/Applications/Xcode.app</string>
272
+ <key>serviceInputTypeIdentifier</key>
273
+ <string>com.apple.Automator.text</string>
274
+ <key>serviceOutputTypeIdentifier</key>
275
+ <string>com.apple.Automator.nothing</string>
276
+ <key>workflowTypeIdentifier</key>
277
+ <string>com.apple.Automator.servicesMenu</string>
278
+ </dict>
279
+ </dict>
280
+ </plist>
data/README.markdown CHANGED
@@ -8,6 +8,7 @@ Xcode 4 no longer supports user scripts but instead uses Services.
8
8
  You can create a Service with Automator.
9
9
  Do the same as below except put the code in a Run Shell Script.
10
10
  Set the Application to Xcode and the input as Text.
11
+ Or, use the one provided in the AutomatorService folder.
11
12
 
12
13
  # Instructions #
13
14
 
@@ -29,7 +30,7 @@ Make a user script in Xcode with the following:
29
30
  property.psd!
30
31
 
31
32
  Then select the ivars you wish to make property, synthesize and dealloc declarations and execute using either a user script or
32
- if using Xcode 4, a Service (as described in the Update above).
33
+ if using Xcode 4, a Service (as described in the Update above and provide in the AutomatorService folder).
33
34
 
34
35
 
35
36
  # Overriding defaults #
@@ -41,7 +42,7 @@ Just add the path as a parameter to PropertySynthesizeDealloc.new.
41
42
 
42
43
 
43
44
  Here is the skeleton. Make sure to use this as a starting point.
44
- These are currently the only options supported.
45
+ Supported options.
45
46
 
46
47
  settings:
47
48
  sleep_time: 0.1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
data/lib/converter.rb CHANGED
@@ -27,8 +27,8 @@ class Converter
27
27
 
28
28
  @properties << "@property (#{use_nonatomic(mem_label)}) #{("IBOutlet " if @outlet)}#{label} #{star}#{variable}\n"
29
29
  @synthesize << "@synthesize #{variable}\n"
30
- @release << "\t[self set#{cap_first_letter_of(variable).chomp}:nil];\n" unless mem_label == 'assign'
31
- @unload << "\t[self set#{cap_first_letter_of(variable).chomp}:nil];\n"
30
+ @release << "\tself.#{clean_var(variable)} = nil;\n" unless mem_label == 'assign'
31
+ @unload << "\tself.#{clean_var(variable)} = nil;\n"
32
32
  end
33
33
  end
34
34
 
@@ -37,6 +37,10 @@ class Converter
37
37
  def log(msg)
38
38
  File.open(File.expand_path("~/desktop/errors.txt"), 'a+') { |f| f.puts msg + "\n" }
39
39
  end
40
+
41
+ def clean_var(var)
42
+ var.gsub(';', '').chomp
43
+ end
40
44
 
41
45
  def memory_management(label)
42
46
  return "copy" if @copy.include?(label)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{property_synthesize_dealloc}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Craig Williams"]
12
- s.date = %q{2011-03-19}
12
+ s.date = %q{2011-03-20}
13
13
  s.description = %q{Creates property, synthesize and dealloc statements from selected ivar declarations for the header and implementation files in an Xcode project.}
14
14
  s.email = %q{cwilliams.allancraig@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -18,6 +18,9 @@ Gem::Specification.new do |s|
18
18
  ]
19
19
  s.files = [
20
20
  ".rvmrc",
21
+ "AutomatorService/Property Synthesize Dealloc.workflow/Contents/Info.plist",
22
+ "AutomatorService/Property Synthesize Dealloc.workflow/Contents/QuickLook/Preview.png",
23
+ "AutomatorService/Property Synthesize Dealloc.workflow/Contents/document.wflow",
21
24
  "Gemfile",
22
25
  "Gemfile.lock",
23
26
  "LICENSE.txt",
@@ -34,6 +37,7 @@ Gem::Specification.new do |s|
34
37
  "pkg/property_synthesize_dealloc-0.1.1.gem",
35
38
  "pkg/property_synthesize_dealloc-0.1.2.gem",
36
39
  "pkg/property_synthesize_dealloc-0.2.0.gem",
40
+ "pkg/property_synthesize_dealloc-0.2.1.gem",
37
41
  "property_synthesize_dealloc.gemspec",
38
42
  "spec/property_synthesize_dealloc_spec.rb",
39
43
  "spec/spec_helper.rb",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: property_synthesize_dealloc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Craig Williams
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-19 00:00:00 -06:00
18
+ date: 2011-03-20 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -131,6 +131,9 @@ extra_rdoc_files:
131
131
  - README.markdown
132
132
  files:
133
133
  - .rvmrc
134
+ - AutomatorService/Property Synthesize Dealloc.workflow/Contents/Info.plist
135
+ - AutomatorService/Property Synthesize Dealloc.workflow/Contents/QuickLook/Preview.png
136
+ - AutomatorService/Property Synthesize Dealloc.workflow/Contents/document.wflow
134
137
  - Gemfile
135
138
  - Gemfile.lock
136
139
  - LICENSE.txt
@@ -147,6 +150,7 @@ files:
147
150
  - pkg/property_synthesize_dealloc-0.1.1.gem
148
151
  - pkg/property_synthesize_dealloc-0.1.2.gem
149
152
  - pkg/property_synthesize_dealloc-0.2.0.gem
153
+ - pkg/property_synthesize_dealloc-0.2.1.gem
150
154
  - property_synthesize_dealloc.gemspec
151
155
  - spec/property_synthesize_dealloc_spec.rb
152
156
  - spec/spec_helper.rb