choctop 0.12.1 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/.bundle/config +2 -0
  2. data/.bundle/environment.rb +276 -0
  3. data/{spec/spec.opts → .rspec} +0 -0
  4. data/Gemfile +26 -0
  5. data/Gemfile.lock +89 -0
  6. data/History.txt +5 -0
  7. data/Manifest.txt +27 -2
  8. data/README.rdoc +15 -2
  9. data/Rakefile +7 -15
  10. data/choctop.gemspec +71 -0
  11. data/features/dmg.feature +10 -0
  12. data/features/fixtures/App With Whitespace/App With Whitespace.xcodeproj/TemplateIcon.icns +0 -0
  13. data/features/fixtures/App With Whitespace/App With Whitespace.xcodeproj/project.pbxproj +276 -0
  14. data/features/fixtures/App With Whitespace/App With Whitespace_Prefix.pch +7 -0
  15. data/features/fixtures/App With Whitespace/English.lproj/InfoPlist.strings +0 -0
  16. data/features/fixtures/App With Whitespace/English.lproj/MainMenu.xib +3034 -0
  17. data/features/fixtures/App With Whitespace/Info.plist +30 -0
  18. data/features/fixtures/App With Whitespace/main.m +14 -0
  19. data/features/fixtures/MyBundle.tmbundle/Snippets/hello world.tmSnippet +16 -0
  20. data/features/fixtures/MyBundle.tmbundle/info.plist +10 -0
  21. data/features/fixtures/SampleApp/English.lproj/InfoPlist.strings +0 -0
  22. data/features/fixtures/SampleApp/English.lproj/MainMenu.xib +3034 -0
  23. data/features/fixtures/SampleApp/Info.plist +30 -0
  24. data/features/fixtures/SampleApp/README.txt +1 -0
  25. data/features/fixtures/SampleApp/SampleApp.xcodeproj/TemplateIcon.icns +0 -0
  26. data/features/fixtures/SampleApp/SampleApp.xcodeproj/project.pbxproj +284 -0
  27. data/features/fixtures/SampleApp/SampleApp_Prefix.pch +7 -0
  28. data/features/fixtures/SampleApp/main.m +14 -0
  29. data/features/step_definitions/generator_steps.rb +14 -0
  30. data/features/support/dmg_helpers.rb +14 -0
  31. data/features/support/env.rb +3 -5
  32. data/features/support/matchers.rb +7 -9
  33. data/lib/choctop.rb +26 -5
  34. data/lib/choctop/appcast.rb +2 -3
  35. data/lib/choctop/dmg.rb +19 -6
  36. data/lib/choctop/rake_tasks.rb +4 -0
  37. data/spec/dmg_spec.rb +37 -0
  38. data/spec/fixtures/Info.plist +30 -0
  39. data/spec/spec_helper.rb +3 -2
  40. data/spec/version_helper_spec.rb +26 -0
  41. metadata +108 -36
  42. data/tasks/rspec.rake +0 -21
@@ -0,0 +1,30 @@
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>CFBundleDevelopmentRegion</key>
6
+ <string>English</string>
7
+ <key>CFBundleExecutable</key>
8
+ <string>SampleApp</string>
9
+ <key>CFBundleIconFile</key>
10
+ <string></string>
11
+ <key>CFBundleIdentifier</key>
12
+ <string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
13
+ <key>CFBundleInfoDictionaryVersion</key>
14
+ <string>6.0</string>
15
+ <key>CFBundleName</key>
16
+ <string>${PRODUCT_NAME}</string>
17
+ <key>CFBundlePackageType</key>
18
+ <string>APPL</string>
19
+ <key>CFBundleSignature</key>
20
+ <string>????</string>
21
+ <key>CFBundleVersion</key>
22
+ <string>0.1.0</string>
23
+ <key>NSMainNibFile</key>
24
+ <string>MainMenu</string>
25
+ <key>NSPrincipalClass</key>
26
+ <string>NSApplication</string>
27
+ <key>SUFeedURL</key>
28
+ <string>http://mocra.com/sample_app/my_feed.xml</string>
29
+ </dict>
30
+ </plist>
@@ -0,0 +1 @@
1
+ This is the README for the SampleApp
@@ -0,0 +1,284 @@
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 45;
7
+ objects = {
8
+
9
+ /* Begin PBXBuildFile section */
10
+ 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; };
11
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
12
+ 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
13
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
14
+ /* End PBXBuildFile section */
15
+
16
+ /* Begin PBXFileReference section */
17
+ 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
18
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
19
+ 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
20
+ 1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
21
+ 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
22
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
23
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
24
+ 32CA4F630368D1EE00C91783 /* SampleApp_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleApp_Prefix.pch; sourceTree = "<group>"; };
25
+ 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
26
+ 8D1107320486CEB800E47090 /* SampleApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SampleApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
27
+ /* End PBXFileReference section */
28
+
29
+ /* Begin PBXFrameworksBuildPhase section */
30
+ 8D11072E0486CEB800E47090 /* Frameworks */ = {
31
+ isa = PBXFrameworksBuildPhase;
32
+ buildActionMask = 2147483647;
33
+ files = (
34
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
35
+ );
36
+ runOnlyForDeploymentPostprocessing = 0;
37
+ };
38
+ /* End PBXFrameworksBuildPhase section */
39
+
40
+ /* Begin PBXGroup section */
41
+ 080E96DDFE201D6D7F000001 /* Classes */ = {
42
+ isa = PBXGroup;
43
+ children = (
44
+ );
45
+ name = Classes;
46
+ sourceTree = "<group>";
47
+ };
48
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
49
+ isa = PBXGroup;
50
+ children = (
51
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
52
+ );
53
+ name = "Linked Frameworks";
54
+ sourceTree = "<group>";
55
+ };
56
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
57
+ isa = PBXGroup;
58
+ children = (
59
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */,
60
+ 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
61
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */,
62
+ );
63
+ name = "Other Frameworks";
64
+ sourceTree = "<group>";
65
+ };
66
+ 19C28FACFE9D520D11CA2CBB /* Products */ = {
67
+ isa = PBXGroup;
68
+ children = (
69
+ 8D1107320486CEB800E47090 /* SampleApp.app */,
70
+ );
71
+ name = Products;
72
+ sourceTree = "<group>";
73
+ };
74
+ 29B97314FDCFA39411CA2CEA /* SampleApp */ = {
75
+ isa = PBXGroup;
76
+ children = (
77
+ 080E96DDFE201D6D7F000001 /* Classes */,
78
+ 29B97315FDCFA39411CA2CEA /* Other Sources */,
79
+ 29B97317FDCFA39411CA2CEA /* Resources */,
80
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
81
+ 19C28FACFE9D520D11CA2CBB /* Products */,
82
+ );
83
+ name = SampleApp;
84
+ sourceTree = "<group>";
85
+ };
86
+ 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
87
+ isa = PBXGroup;
88
+ children = (
89
+ 32CA4F630368D1EE00C91783 /* SampleApp_Prefix.pch */,
90
+ 29B97316FDCFA39411CA2CEA /* main.m */,
91
+ );
92
+ name = "Other Sources";
93
+ sourceTree = "<group>";
94
+ };
95
+ 29B97317FDCFA39411CA2CEA /* Resources */ = {
96
+ isa = PBXGroup;
97
+ children = (
98
+ 8D1107310486CEB800E47090 /* Info.plist */,
99
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
100
+ 1DDD58140DA1D0A300B32029 /* MainMenu.xib */,
101
+ );
102
+ name = Resources;
103
+ sourceTree = "<group>";
104
+ };
105
+ 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
106
+ isa = PBXGroup;
107
+ children = (
108
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
109
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
110
+ );
111
+ name = Frameworks;
112
+ sourceTree = "<group>";
113
+ };
114
+ /* End PBXGroup section */
115
+
116
+ /* Begin PBXNativeTarget section */
117
+ 8D1107260486CEB800E47090 /* SampleApp */ = {
118
+ isa = PBXNativeTarget;
119
+ buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "SampleApp" */;
120
+ buildPhases = (
121
+ 8D1107290486CEB800E47090 /* Resources */,
122
+ 8D11072C0486CEB800E47090 /* Sources */,
123
+ 8D11072E0486CEB800E47090 /* Frameworks */,
124
+ );
125
+ buildRules = (
126
+ );
127
+ dependencies = (
128
+ );
129
+ name = SampleApp;
130
+ productInstallPath = "$(HOME)/Applications";
131
+ productName = SampleApp;
132
+ productReference = 8D1107320486CEB800E47090 /* SampleApp.app */;
133
+ productType = "com.apple.product-type.application";
134
+ };
135
+ /* End PBXNativeTarget section */
136
+
137
+ /* Begin PBXProject section */
138
+ 29B97313FDCFA39411CA2CEA /* Project object */ = {
139
+ isa = PBXProject;
140
+ buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SampleApp" */;
141
+ compatibilityVersion = "Xcode 3.1";
142
+ hasScannedForEncodings = 1;
143
+ mainGroup = 29B97314FDCFA39411CA2CEA /* SampleApp */;
144
+ projectDirPath = "";
145
+ projectRoot = "";
146
+ targets = (
147
+ 8D1107260486CEB800E47090 /* SampleApp */,
148
+ );
149
+ };
150
+ /* End PBXProject section */
151
+
152
+ /* Begin PBXResourcesBuildPhase section */
153
+ 8D1107290486CEB800E47090 /* Resources */ = {
154
+ isa = PBXResourcesBuildPhase;
155
+ buildActionMask = 2147483647;
156
+ files = (
157
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
158
+ 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */,
159
+ );
160
+ runOnlyForDeploymentPostprocessing = 0;
161
+ };
162
+ /* End PBXResourcesBuildPhase section */
163
+
164
+ /* Begin PBXSourcesBuildPhase section */
165
+ 8D11072C0486CEB800E47090 /* Sources */ = {
166
+ isa = PBXSourcesBuildPhase;
167
+ buildActionMask = 2147483647;
168
+ files = (
169
+ 8D11072D0486CEB800E47090 /* main.m in Sources */,
170
+ );
171
+ runOnlyForDeploymentPostprocessing = 0;
172
+ };
173
+ /* End PBXSourcesBuildPhase section */
174
+
175
+ /* Begin PBXVariantGroup section */
176
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
177
+ isa = PBXVariantGroup;
178
+ children = (
179
+ 089C165DFE840E0CC02AAC07 /* English */,
180
+ );
181
+ name = InfoPlist.strings;
182
+ sourceTree = "<group>";
183
+ };
184
+ 1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = {
185
+ isa = PBXVariantGroup;
186
+ children = (
187
+ 1DDD58150DA1D0A300B32029 /* English */,
188
+ );
189
+ name = MainMenu.xib;
190
+ sourceTree = "<group>";
191
+ };
192
+ /* End PBXVariantGroup section */
193
+
194
+ /* Begin XCBuildConfiguration section */
195
+ C01FCF4B08A954540054247B /* Debug */ = {
196
+ isa = XCBuildConfiguration;
197
+ buildSettings = {
198
+ ALWAYS_SEARCH_USER_PATHS = NO;
199
+ COPY_PHASE_STRIP = NO;
200
+ FRAMEWORK_SEARCH_PATHS = (
201
+ "$(inherited)",
202
+ "\"$(SRCROOT)/../../../../../../objc/frameworks/Sparkle 1.5b6/With Garbage Collection\"",
203
+ );
204
+ GCC_DYNAMIC_NO_PIC = NO;
205
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
206
+ GCC_MODEL_TUNING = G5;
207
+ GCC_OPTIMIZATION_LEVEL = 0;
208
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
209
+ GCC_PREFIX_HEADER = SampleApp_Prefix.pch;
210
+ INFOPLIST_FILE = Info.plist;
211
+ INSTALL_PATH = "$(HOME)/Applications";
212
+ PRODUCT_NAME = SampleApp;
213
+ };
214
+ name = Debug;
215
+ };
216
+ C01FCF4C08A954540054247B /* Release */ = {
217
+ isa = XCBuildConfiguration;
218
+ buildSettings = {
219
+ ALWAYS_SEARCH_USER_PATHS = NO;
220
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
221
+ FRAMEWORK_SEARCH_PATHS = (
222
+ "$(inherited)",
223
+ "\"$(SRCROOT)/../../../../../../objc/frameworks/Sparkle 1.5b6/With Garbage Collection\"",
224
+ );
225
+ GCC_MODEL_TUNING = G5;
226
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
227
+ GCC_PREFIX_HEADER = SampleApp_Prefix.pch;
228
+ INFOPLIST_FILE = Info.plist;
229
+ INSTALL_PATH = "$(HOME)/Applications";
230
+ PRODUCT_NAME = SampleApp;
231
+ };
232
+ name = Release;
233
+ };
234
+ C01FCF4F08A954540054247B /* Debug */ = {
235
+ isa = XCBuildConfiguration;
236
+ buildSettings = {
237
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
238
+ GCC_C_LANGUAGE_STANDARD = c99;
239
+ GCC_OPTIMIZATION_LEVEL = 0;
240
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
241
+ GCC_WARN_UNUSED_VARIABLE = YES;
242
+ ONLY_ACTIVE_ARCH = YES;
243
+ PREBINDING = NO;
244
+ SDKROOT = macosx10.5;
245
+ };
246
+ name = Debug;
247
+ };
248
+ C01FCF5008A954540054247B /* Release */ = {
249
+ isa = XCBuildConfiguration;
250
+ buildSettings = {
251
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
252
+ GCC_C_LANGUAGE_STANDARD = c99;
253
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
254
+ GCC_WARN_UNUSED_VARIABLE = YES;
255
+ PREBINDING = NO;
256
+ SDKROOT = macosx10.5;
257
+ };
258
+ name = Release;
259
+ };
260
+ /* End XCBuildConfiguration section */
261
+
262
+ /* Begin XCConfigurationList section */
263
+ C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "SampleApp" */ = {
264
+ isa = XCConfigurationList;
265
+ buildConfigurations = (
266
+ C01FCF4B08A954540054247B /* Debug */,
267
+ C01FCF4C08A954540054247B /* Release */,
268
+ );
269
+ defaultConfigurationIsVisible = 0;
270
+ defaultConfigurationName = Release;
271
+ };
272
+ C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SampleApp" */ = {
273
+ isa = XCConfigurationList;
274
+ buildConfigurations = (
275
+ C01FCF4F08A954540054247B /* Debug */,
276
+ C01FCF5008A954540054247B /* Release */,
277
+ );
278
+ defaultConfigurationIsVisible = 0;
279
+ defaultConfigurationName = Release;
280
+ };
281
+ /* End XCConfigurationList section */
282
+ };
283
+ rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
284
+ }
@@ -0,0 +1,7 @@
1
+ //
2
+ // Prefix header for all source files of the 'SampleApp' target in the 'SampleApp' project
3
+ //
4
+
5
+ #ifdef __OBJC__
6
+ #import <Cocoa/Cocoa.h>
7
+ #endif
@@ -0,0 +1,14 @@
1
+ //
2
+ // main.m
3
+ // SampleApp
4
+ //
5
+ // Created by Dr Nic on 19/01/09.
6
+ // Copyright Mocra 2009. All rights reserved.
7
+ //
8
+
9
+ #import <Cocoa/Cocoa.h>
10
+
11
+ int main(int argc, char *argv[])
12
+ {
13
+ return NSApplicationMain(argc, (const char **) argv);
14
+ }
@@ -49,3 +49,17 @@ Given /^a non\-Xcode chcotop project "([^\"]*)" with files: (.*)$/ do |name, fil
49
49
  end
50
50
  files.each { |file| choctop_add_file(file) }
51
51
  end
52
+
53
+ Given /^a TextMate bundle project "([^"]*)"$/ do |name|
54
+ app_path = File.join(File.dirname(__FILE__), "../fixtures", name)
55
+ `cp -r '#{app_path}' #{@tmp_root}/ 2> /dev/null`
56
+ `rm -rf '#{@tmp_root}/#{name}/build'`
57
+ setup_active_project_folder name
58
+ steps <<-CUCUMBER
59
+ Given I run local executable "install_choctop" with arguments "."
60
+ Given Rakefile wired to use development code instead of installed RubyGem
61
+ CUCUMBER
62
+ ENV['NO_FINDER'] = 'YES' # disable Finder during tests
63
+ choctop_add_root
64
+ end
65
+
@@ -0,0 +1,14 @@
1
+ module DmgHelper
2
+ def choctop_add_file(file, position = [347, 65])
3
+ in_project_folder do
4
+ append_to_file "Rakefile", "$choctop.add_file '#{file}', :position=> #{position.inspect}"
5
+ end
6
+ end
7
+
8
+ def choctop_add_root(position = [347, 65])
9
+ in_project_folder do
10
+ append_to_file "Rakefile", "$choctop.add_root :position=> #{position.inspect}"
11
+ end
12
+ end
13
+ end
14
+ World(DmgHelper)
@@ -1,8 +1,6 @@
1
- # require File.dirname(__FILE__) + "/../../lib/choctop"
2
-
3
- require "rubygems"
4
- require 'cucumber'
5
- require 'spec'
1
+ require "bundler"
2
+ Bundler.setup
3
+ Bundler.require :cucumber
6
4
 
7
5
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
8
6
  require 'choctop'
@@ -1,11 +1,9 @@
1
- module Matchers
2
- def contain(expected)
3
- simple_matcher("contain #{expected.inspect}") do |given, matcher|
4
- matcher.failure_message = "expected #{given.inspect} to contain #{expected.inspect}"
5
- matcher.negative_failure_message = "expected #{given.inspect} not to contain #{expected.inspect}"
6
- given.index expected
7
- end
1
+ RSpec::Matchers.define :contain do |expected|
2
+ match do |actual|
3
+ actual.index expected
8
4
  end
9
- end
10
5
 
11
- World(Matchers)
6
+ failure_message_for_should do |actual|
7
+ "expected #{actual.inspect} to contain #{expected.inspect}"
8
+ end
9
+ end
@@ -5,6 +5,7 @@ require "erb"
5
5
  require "uri"
6
6
  require "osx/cocoa"
7
7
  require "RedCloth"
8
+ require "escape"
8
9
 
9
10
  require 'choctop/appcast'
10
11
  require 'choctop/dmg'
@@ -17,7 +18,7 @@ module ChocTop
17
18
  include Dmg
18
19
  include RakeTasks
19
20
 
20
- VERSION = '0.12.1'
21
+ VERSION = '0.13.0'
21
22
 
22
23
  attr_writer :build_opts
23
24
  def build_opts
@@ -147,9 +148,9 @@ module ChocTop
147
148
 
148
149
  # Folder from where all files will be copied into the DMG
149
150
  # Files are copied here if specified with +add_file+ before DMG creation
150
- attr_accessor :src_folder
151
- def src_folder
152
- @src_folder ||= "build/#{build_type}/dmg"
151
+ attr_accessor :dmg_src_folder
152
+ def dmg_src_folder
153
+ @dmg_src_folder ||= "build/#{build_type}/dmg"
153
154
  end
154
155
 
155
156
  # Generated filename for a distribution, from name, version and .dmg
@@ -247,7 +248,10 @@ module ChocTop
247
248
  # file proc { 'README.txt' }, :position => [50, 100]
248
249
  # file :position => [50, 100] { 'README.txt' }
249
250
  # Required option:
250
- # +:position+ - two item array [x, y] window position
251
+ # +:position+ - two item array [x, y] window position
252
+ # Options:
253
+ # +:name+ - override the name of the project when mounted in the DMG
254
+ # +:exclude+ - do not include files/folders
251
255
  def file(*args, &block)
252
256
  path_or_helper, options = args.first.is_a?(Hash) ? [block, args.first] : [args.first, args.last]
253
257
  throw "add_files #{path_or_helper}, :position => [x,y] option is missing" unless options[:position]
@@ -255,6 +259,23 @@ module ChocTop
255
259
  files[path_or_helper] = options
256
260
  end
257
261
  alias_method :add_file, :file
262
+
263
+ # Add the whole project as a mounted item; e.g. a TextMate bundle
264
+ # Examples:
265
+ # root :position => [50, 100]
266
+ # add_root :position => [50, 100], :name => 'My Thing'
267
+ # Required option:
268
+ # +:position+ - two item array [x, y] window position
269
+ # Options:
270
+ # +:name+ - override the name of the project when mounted in the DMG
271
+ # +:exclude+ - do not include files/folders
272
+ def root(options)
273
+ throw "add_root :position => [x,y] option is missing" unless options[:position]
274
+ options[:name] ||= File.basename(File.expand_path("."))
275
+ self.files ||= {}
276
+ files['.'] = options
277
+ end
278
+ alias_method :add_root, :root
258
279
 
259
280
  def initialize
260
281
  $choctop = $sparkle = self # define a global variable for this object ($sparkle is legacy)