choctop 0.11.0 → 0.11.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.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.11.1 2009-11-17
2
+
3
+ * New attribute 'source_dir': specify an alternate src folder for the built project (default: build/Release)
4
+
5
+ == 0.11.0 2009-11-16
1
6
 
2
7
  * ChocTop no longer solely for Cocoa applications
3
8
  * Applications shortcut only included if the primary target is a .app bundle
data/features/dmg.feature CHANGED
@@ -14,6 +14,20 @@ Feature: Can build a customised DMG image from application build
14
14
  And file ".background/background.jpg" in mounted volume is invisible
15
15
  And file ".VolumeIcon.icns" in mounted volume is created
16
16
 
17
+ Scenario: Build a DMG with alternate build folder
18
+ Given a Cocoa app with choctop installed called "SampleApp"
19
+ When I invoke task "rake build"
20
+ And I move "build" to "alternate_build"
21
+ And I set choctop attribute "source_dir" to "alternate_build/Release"
22
+ When I invoke task "rake dmg NO_BUILD=1"
23
+ Then file "appcast/build/SampleApp-0.1.0.dmg" is created
24
+ When dmg "appcast/build/SampleApp-0.1.0.dmg" is mounted as "SampleApp"
25
+ Then folder "SampleApp.app" in mounted volume is created
26
+ And file "Applications" in mounted volume is created
27
+ And file ".background/background.jpg" in mounted volume is created
28
+ And file ".background/background.jpg" in mounted volume is invisible
29
+ And file ".VolumeIcon.icns" in mounted volume is created
30
+
17
31
  Scenario: Build a DMG with a whitespace name
18
32
  Given a Cocoa app with choctop installed called "App With Whitespace"
19
33
  When I invoke task "rake dmg"
@@ -12,6 +12,12 @@ Given /^is configured for an asset file "([^\"]*)" to be included in dmg$/ do |f
12
12
  choctop_add_file(file)
13
13
  end
14
14
 
15
+ Given /^I set choctop attribute "([^\"]*)" to "([^\"]*)"$/ do |attribute, value|
16
+ in_project_folder do
17
+ append_to_file "Rakefile", "$choctop.#{attribute} = #{value.inspect}"
18
+ end
19
+ end
20
+
15
21
  When /^dmg "(.*)" is mounted as "(.*)"$/ do |dmg, name|
16
22
  @stdout = File.expand_path(File.join(@tmp_root, "hdiutil.out"))
17
23
  in_project_folder do
data/lib/choctop.rb CHANGED
@@ -11,7 +11,7 @@ require "active_support"
11
11
  require "RedCloth"
12
12
 
13
13
  class ChocTop
14
- VERSION = '0.11.0'
14
+ VERSION = '0.11.1'
15
15
 
16
16
  # Path to the Info.plist
17
17
  # Default: "Info.plist"
@@ -33,7 +33,7 @@ class ChocTop
33
33
  end
34
34
 
35
35
  def target_bundle
36
- @target_bundle ||= Dir["build/#{build_type}/#{name}.*"].first
36
+ @target_bundle ||= Dir["#{source_dir}/#{name}.*"].first
37
37
  end
38
38
 
39
39
  # The build type of the distributed DMG file
@@ -89,11 +89,18 @@ class ChocTop
89
89
  # Default: -aCv
90
90
  attr_accessor :rsync_args
91
91
 
92
+ # The base folder to find the built bundle/application
93
+ # Default: build/Release (rather build/#{build_type})
94
+ attr_accessor :source_dir
95
+ def source_dir
96
+ @source_dir ||= "build/#{build_type}"
97
+ end
98
+
92
99
  # Folder from where all files will be copied into the DMG
93
100
  # Files are copied here if specified with +add_file+ before DMG creation
94
- attr_accessor :src_folder
95
- def src_folder
96
- @src_folder ||= "build/#{build_type}/dmg"
101
+ attr_accessor :dmg_pkg_folder
102
+ def dmg_pkg_folder
103
+ @dmg_pkg_folder ||= "#{source_dir}/dmg"
97
104
  end
98
105
 
99
106
  # Generated filename for a distribution, from name, version and .dmg
@@ -237,9 +244,9 @@ class ChocTop
237
244
  return unless Object.const_defined?("Rake")
238
245
 
239
246
  desc "Build Xcode #{build_type}"
240
- task :build => "build/#{build_type}/#{target}/Contents/Info.plist"
247
+ task :build => "#{source_dir}/#{target}/Contents/Info.plist"
241
248
 
242
- task "build/#{build_type}/#{target}/Contents/Info.plist" do
249
+ task "#{source_dir}/#{target}/Contents/Info.plist" do
243
250
  make_build
244
251
  end
245
252
 
data/lib/choctop/dmg.rb CHANGED
@@ -16,9 +16,9 @@ module ChocTop::Dmg
16
16
  end
17
17
 
18
18
  def copy_files
19
- FileUtils.mkdir_p(src_folder)
19
+ FileUtils.mkdir_p(dmg_pkg_folder)
20
20
  files.each do |path, options|
21
- FileUtils.cp_r(path, src_folder)
21
+ FileUtils.cp_r(path, dmg_pkg_folder)
22
22
  end
23
23
  end
24
24
 
@@ -27,7 +27,7 @@ module ChocTop::Dmg
27
27
  copy_files
28
28
  FileUtils.mkdir_p build_path
29
29
  FileUtils.mkdir_p mountpoint # TODO can we remove random mountpoints?
30
- sh "hdiutil create -format UDRW -quiet -volname '#{name}' -srcfolder '#{src_folder}' '#{pkg}'"
30
+ sh "hdiutil create -format UDRW -quiet -volname '#{name}' -srcfolder '#{dmg_pkg_folder}' '#{pkg}'"
31
31
  sh "hdiutil attach '#{pkg}' -mountpoint '#{volume_path}' -noautoopen -quiet"
32
32
  sh "bless --folder '#{volume_path}' --openfolder '#{volume_path}'"
33
33
  sh "sleep 1"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: choctop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dr Nic Williams
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-11-16 00:00:00 +10:00
13
+ date: 2009-11-17 00:00:00 +10:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency