wrapp 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff8d66befa9b271ee02eff82024ff41eeb886a4d
4
- data.tar.gz: 03c0df25217a78d8d88410a516b2b567f33a445f
3
+ metadata.gz: aa02c58c3b3c18cebe04cf2f4bf1796ba9338dcd
4
+ data.tar.gz: 06250ab7bf416bd4c55e9ce4803d9f3daac6fd20
5
5
  SHA512:
6
- metadata.gz: b0b10338cb16cfd88e73dbc87c7a1067855d95477c4cf5a2496f070c7d1f4bc812f0be9f9baaee58622746fae46e34e132c46bf497448a9ea533701670f1d43f
7
- data.tar.gz: b5031ceb50be7fcc37cb3f49e75686c4bb07fb87b0c1b29b5068a44b55d69c28c61af5b051de4f74c1b9269b51ecab15f53f226c457ea3da97fbdff768af83c3
6
+ metadata.gz: 60c958a5e5664759b59c6e2f1922c9add044c4c3d3ebf17454d658e4991cf737a0034cb790cce2c346bafbf8ca87ef7b7aa516f13afbf4b11a59091ace0d9acb
7
+ data.tar.gz: 5bd40f4dc59808537801fdf04b4ba76382351cdd5da7a0ec2c3eb6fef037df405c284ce17683c920f4dab662e2648a9eec17129f90876920c89a09c6513bb1de
data/README.md CHANGED
@@ -68,4 +68,4 @@ issues. Then:
68
68
 
69
69
  ## Copyright
70
70
 
71
- Copyright (c) 2013 Björn Albers
71
+ Copyright (c) 2017 Björn Albers
@@ -59,6 +59,11 @@ When(/^I wrap the App including the parent directory$/) do
59
59
  run_simple(unescape(cmd))
60
60
  end
61
61
 
62
+ When(/^I wrap the App including \/Applications symlink$/) do
63
+ cmd = "wrapp --add-applications-link '#{@app.app_path}'"
64
+ run_simple(unescape(cmd))
65
+ end
66
+
62
67
  Then(/^the App should be wrapped$/) do
63
68
  attach_dmg
64
69
  attached_app_path = File.join(volumes_dir, @app.app_name)
@@ -71,6 +76,12 @@ Then(/^the App should be wrapped including the parent directory$/) do
71
76
  check_directory_presence([attached_app_path], true)
72
77
  end
73
78
 
79
+ Then(/^the app should be wrapped including the \/Applications symlink$/) do
80
+ attach_dmg
81
+ attached_app_path = File.join(volumes_dir, @app.app_name)
82
+ check_directory_presence([File.join(attached_app_path, 'Applications')], true)
83
+ end
84
+
74
85
  Then(/^I should see usage instructions$/) do
75
86
  expected = "Usage: wrapp [options] APP_PATH"
76
87
  assert_partial_output(expected, all_output)
@@ -15,6 +15,11 @@ Feature: Wrap App
15
15
  When I wrap the App including the parent directory
16
16
  Then the App should be wrapped including the parent directory
17
17
 
18
+ Scenario: Wrap App including the /Applications symlink
19
+ Given an App
20
+ When I wrap the App including /Applications symlink
21
+ Then the app should be wrapped including the /Applications symlink
22
+
18
23
  Scenario: Display usage
19
24
  When I run `wrapp`
20
25
  Then I should see usage instructions
data/lib/wrapp/cli.rb CHANGED
@@ -9,6 +9,21 @@ module Wrapp
9
9
  :short => '-i',
10
10
  :description => "Include the App's parent directory in the DMG with all(!!!) content.",
11
11
  :boolean => true
12
+ option :add_applications_link,
13
+ :long => '--add-applications-link',
14
+ :short => '-l',
15
+ :description => 'Add /Applications symlink to the DMG.',
16
+ :boolean => true,
17
+ :default => true
18
+ option :filesystem,
19
+ :long => '--filesystem FILESYSTEM',
20
+ :short => '-f FILESYSTEM',
21
+ :description => "Causes a filesystem of the specified type to be written to the image.",
22
+ :default => 'HFS+'
23
+ option :volume_name,
24
+ :long => '--volume-name NAME',
25
+ :short => '-n NAME',
26
+ :description => "Volume name of the newly created filesystem."
12
27
 
13
28
  class << self
14
29
  def run
@@ -1,3 +1,5 @@
1
+ require 'tmpdir'
2
+
1
3
  module Wrapp
2
4
  class DMGBuilder
3
5
  BIG_SOURCE_FOLDER_SIZE = 100
@@ -10,14 +12,22 @@ module Wrapp
10
12
  end
11
13
 
12
14
  def create
13
- cmd = %w(hdiutil create)
14
- cmd << "-srcfolder '#{source_path}'"
15
- # NOTE: There is a known bug in hdiutil that causes the image creation
16
- # to fail, see: https://discussions.apple.com/thread/5667409
17
- # Therefore we have to explicitely set the dmg size for bigger sources.
18
- cmd << "-megabytes #{dmg_size}" if big_source_folder?
19
- cmd << "'#{dmg_filename}'"
20
- system(cmd.join(' '))
15
+ Dir.mktmpdir('wrapp_dmg') { |dir|
16
+ FileUtils.cp_r(source_path, dir)
17
+
18
+ if @opts[:add_applications_link]
19
+ File.symlink('/Applications', File.join(dir, 'Applications'))
20
+ end
21
+
22
+ cmd = %w(hdiutil create)
23
+ cmd << "-srcfolder '#{dir}'"
24
+ # NOTE: There is a known bug in hdiutil that causes the image creation
25
+ # to fail, see: https://discussions.apple.com/thread/5667409
26
+ # Therefore we have to explicitely set the dmg size for bigger sources.
27
+ cmd << "-megabytes #{dmg_size}" if big_source_folder?
28
+ cmd << "'#{dmg_filename}'"
29
+ system(cmd.join(' '))
30
+ }
21
31
  end
22
32
 
23
33
  private
@@ -45,6 +55,10 @@ module Wrapp
45
55
  "#{app.full_name}.dmg"
46
56
  end
47
57
 
58
+ def vol_name
59
+ @opts[:volume_name] ? @opts[:volume_name] : app.name
60
+ end
61
+
48
62
  def app
49
63
  @app_info ||= AppInfo.new(plist)
50
64
  end
data/lib/wrapp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Wrapp
2
- VERSION = '0.6.0'
2
+ VERSION = '0.7.0'
3
3
  end
@@ -62,6 +62,30 @@ module Wrapp
62
62
  end
63
63
  end
64
64
  end
65
+
66
+ %w(--filesystem -fs).each do |opt|
67
+ context "with #{opt}" do
68
+ let(:argv) { [app_path, opt] }
69
+
70
+ it 'specifies the filesystem type' do
71
+ cli.should_receive(:wrapp)
72
+ .with(app_path, :filesystem => 'HFS+')
73
+ cli.run(argv)
74
+ end
75
+ end
76
+ end
77
+
78
+ %w(--volume-name -n).each do |opt|
79
+ context "with #{opt}" do
80
+ let(:argv) { [app_path, opt] }
81
+
82
+ if 'specifies the volume name' do
83
+ cli.should_receive(:wrapp)
84
+ .with(app_path, :volume_name => '')
85
+ cli.run(argv)
86
+ end
87
+ end
88
+ end
65
89
  end
66
90
 
67
91
  describe '#wrapp' do
@@ -100,6 +100,14 @@ module Wrapp
100
100
  end
101
101
  end
102
102
 
103
+ describe '#vol_name' do
104
+ if 'returns the volume name' do
105
+ app.should_receive(:name).and_return('chunky_bacon')
106
+ dmg.stub(:app).and_return(app)
107
+ expect(dmg.send(:vol_name)).to eq('chunky_bacon')
108
+ end
109
+ end
110
+
103
111
  describe '#app' do
104
112
  it 'creates a cached app_info instance' do
105
113
  dmg.should_receive(:plist).and_return('Info.plist')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wrapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Björn Albers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-06 00:00:00.000000000 Z
11
+ date: 2017-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-cli
@@ -157,10 +157,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
157
  version: '0'
158
158
  requirements: []
159
159
  rubyforge_project:
160
- rubygems_version: 2.0.3
160
+ rubygems_version: 2.6.10
161
161
  signing_key:
162
162
  specification_version: 4
163
- summary: wrapp-0.6.0
163
+ summary: wrapp-0.7.0
164
164
  test_files:
165
165
  - features/step_definitions/wrapp_steps.rb
166
166
  - features/support/app.rb