shoes-package 4.0.0.pre7 → 4.0.0.pre8
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 +4 -4
- data/lib/shoes/package/configuration.rb +2 -1
- data/lib/shoes/package/version.rb +1 -1
- metadata +23 -36
- data/Guardfile +0 -4
- data/Rakefile +0 -1
- data/shoes-package.gemspec +0 -21
- data/spec/configuration_spec.rb +0 -209
- data/spec/spec_helper.rb +0 -69
- data/spec/support/shared_config.rb +0 -15
- data/spec/swt_app_spec.rb +0 -130
- data/spec/swt_jar_spec.rb +0 -66
- data/spec/test_app/app.yaml +0 -17
- data/spec/test_app/bin/hello_world +0 -3
- data/spec/test_app/dir_to_ignore/file_to_ignore.txt +0 -1
- data/spec/test_app/img/boots.icns +0 -0
- data/spec/test_app/img/boots.ico +0 -0
- data/spec/test_app/img/boots_512x512x32.png +0 -0
- data/spec/test_app/sibling.rb +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9b5bb9d7084b21501f365f96292ee3849ac0c120
|
|
4
|
+
data.tar.gz: a469da43c74cdd6c99401bf9ad7afe65c11ed479
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: af95d9171a37c398c5476e1111574ac90ce5987a25fe7b8e642bc1605ff9f0ca445d0813b003455d2d067634d958844cc5e01adc3875c96e966b6ac319f6f1e2
|
|
7
|
+
data.tar.gz: c0fba6e9818d936531ce915a485f2a1296ff5f46c08aa6b121978dc8be8b43deed56b29c8ba91b4b7cf9a4f9d3065862db2b79b525ba7fe0f06433ba3e5d9900
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
require 'bundler'
|
|
1
2
|
require 'pathname'
|
|
2
3
|
require 'yaml'
|
|
3
4
|
require 'furoshiki/configuration'
|
|
@@ -70,7 +71,7 @@ class Shoes
|
|
|
70
71
|
file, dir = config_for_single_file_app(pathname)
|
|
71
72
|
end
|
|
72
73
|
|
|
73
|
-
config = YAML.
|
|
74
|
+
config = YAML.safe_load(file.read, [Symbol])
|
|
74
75
|
config[:working_dir] = dir
|
|
75
76
|
config[:gems] = merge_gems(base_config, config)
|
|
76
77
|
create(config)
|
metadata
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: shoes-package
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.0.0.
|
|
4
|
+
version: 4.0.0.pre8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Team Shoes
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-01-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
15
15
|
requirements:
|
|
16
16
|
- - '='
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 4.0.0.
|
|
18
|
+
version: 4.0.0.pre8
|
|
19
19
|
name: shoes-core
|
|
20
20
|
prerelease: false
|
|
21
21
|
type: :runtime
|
|
@@ -23,13 +23,13 @@ dependencies:
|
|
|
23
23
|
requirements:
|
|
24
24
|
- - '='
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 4.0.0.
|
|
26
|
+
version: 4.0.0.pre8
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 0.
|
|
32
|
+
version: 0.4.0
|
|
33
33
|
name: furoshiki
|
|
34
34
|
prerelease: false
|
|
35
35
|
type: :runtime
|
|
@@ -37,34 +37,33 @@ dependencies:
|
|
|
37
37
|
requirements:
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: 0.
|
|
40
|
+
version: 0.4.0
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0'
|
|
47
|
+
name: bundler
|
|
48
|
+
prerelease: false
|
|
49
|
+
type: :runtime
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0'
|
|
41
55
|
description: Application packaging for Shoes, the best little GUI toolkit for Ruby. Shoes makes building for Mac, Windows, and Linux super simple.
|
|
42
56
|
email:
|
|
43
|
-
- shoes@
|
|
57
|
+
- shoes@lists.mvmanila.com
|
|
44
58
|
executables: []
|
|
45
59
|
extensions: []
|
|
46
60
|
extra_rdoc_files: []
|
|
47
61
|
files:
|
|
48
|
-
- Guardfile
|
|
49
|
-
- Rakefile
|
|
50
62
|
- lib/shoes/package/configuration.rb
|
|
51
63
|
- lib/shoes/package/jar.rb
|
|
52
64
|
- lib/shoes/package/jar_app.rb
|
|
53
65
|
- lib/shoes/package/version.rb
|
|
54
66
|
- lib/warbler/traits/shoes.rb
|
|
55
|
-
- shoes-package.gemspec
|
|
56
|
-
- spec/configuration_spec.rb
|
|
57
|
-
- spec/spec_helper.rb
|
|
58
|
-
- spec/support/shared_config.rb
|
|
59
|
-
- spec/swt_app_spec.rb
|
|
60
|
-
- spec/swt_jar_spec.rb
|
|
61
|
-
- spec/test_app/app.yaml
|
|
62
|
-
- spec/test_app/bin/hello_world
|
|
63
|
-
- spec/test_app/dir_to_ignore/file_to_ignore.txt
|
|
64
|
-
- spec/test_app/img/boots.icns
|
|
65
|
-
- spec/test_app/img/boots.ico
|
|
66
|
-
- spec/test_app/img/boots_512x512x32.png
|
|
67
|
-
- spec/test_app/sibling.rb
|
|
68
67
|
homepage: https://github.com/shoes/shoes4
|
|
69
68
|
licenses:
|
|
70
69
|
- MIT
|
|
@@ -85,20 +84,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
85
84
|
version: 1.3.1
|
|
86
85
|
requirements: []
|
|
87
86
|
rubyforge_project:
|
|
88
|
-
rubygems_version: 2.6.
|
|
87
|
+
rubygems_version: 2.6.10
|
|
89
88
|
signing_key:
|
|
90
89
|
specification_version: 4
|
|
91
90
|
summary: Application packaging for Shoes, the best little GUI toolkit for Ruby.
|
|
92
|
-
test_files:
|
|
93
|
-
- spec/configuration_spec.rb
|
|
94
|
-
- spec/spec_helper.rb
|
|
95
|
-
- spec/support/shared_config.rb
|
|
96
|
-
- spec/swt_app_spec.rb
|
|
97
|
-
- spec/swt_jar_spec.rb
|
|
98
|
-
- spec/test_app/app.yaml
|
|
99
|
-
- spec/test_app/bin/hello_world
|
|
100
|
-
- spec/test_app/dir_to_ignore/file_to_ignore.txt
|
|
101
|
-
- spec/test_app/img/boots.icns
|
|
102
|
-
- spec/test_app/img/boots.ico
|
|
103
|
-
- spec/test_app/img/boots_512x512x32.png
|
|
104
|
-
- spec/test_app/sibling.rb
|
|
91
|
+
test_files: []
|
data/Guardfile
DELETED
data/Rakefile
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require 'bundler/gem_tasks'
|
data/shoes-package.gemspec
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
|
-
require File.expand_path('lib/shoes/package/version')
|
|
3
|
-
|
|
4
|
-
Gem::Specification.new do |s|
|
|
5
|
-
s.name = "shoes-package"
|
|
6
|
-
s.version = Shoes::Package::VERSION
|
|
7
|
-
s.platform = Gem::Platform::RUBY
|
|
8
|
-
s.authors = ["Team Shoes"]
|
|
9
|
-
s.email = ["shoes@librelist.com"]
|
|
10
|
-
s.homepage = "https://github.com/shoes/shoes4"
|
|
11
|
-
s.summary = 'Application packaging for Shoes, the best little GUI toolkit for Ruby.'
|
|
12
|
-
s.description = 'Application packaging for Shoes, the best little GUI toolkit for Ruby. Shoes makes building for Mac, Windows, and Linux super simple.'
|
|
13
|
-
s.license = 'MIT'
|
|
14
|
-
|
|
15
|
-
s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
|
16
|
-
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
|
17
|
-
s.require_paths = ["lib"]
|
|
18
|
-
|
|
19
|
-
s.add_dependency "shoes-core", Shoes::Package::VERSION
|
|
20
|
-
s.add_dependency "furoshiki", "~> 0.3.1"
|
|
21
|
-
end
|
data/spec/configuration_spec.rb
DELETED
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
require_relative 'spec_helper'
|
|
2
|
-
require 'shoes/package/configuration'
|
|
3
|
-
|
|
4
|
-
describe Shoes::Package::Configuration do
|
|
5
|
-
context "defaults" do
|
|
6
|
-
subject { Shoes::Package::Configuration.create }
|
|
7
|
-
|
|
8
|
-
its(:name) { should eq('Shoes App') }
|
|
9
|
-
its(:shortname) { should eq('shoesapp') }
|
|
10
|
-
its(:ignore) { should eq(['pkg']) }
|
|
11
|
-
its(:gems) { should include('shoes-core') }
|
|
12
|
-
its(:version) { should eq('0.0.0') }
|
|
13
|
-
its(:release) { should eq('Rookie') }
|
|
14
|
-
its(:icons) { should be_an_instance_of(Hash) }
|
|
15
|
-
its(:dmg) { should be_an_instance_of(Hash) }
|
|
16
|
-
its(:run) { should be_nil }
|
|
17
|
-
its(:working_dir) { should eq(Pathname.new(Dir.pwd)) }
|
|
18
|
-
it { is_expected.not_to be_valid } # no :run
|
|
19
|
-
|
|
20
|
-
# TODO: Implement
|
|
21
|
-
describe "#icons" do
|
|
22
|
-
it 'osx is nil' do
|
|
23
|
-
expect(subject.icons[:osx]).to be_nil
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
it 'gtk is nil' do
|
|
27
|
-
expect(subject.icons[:gtk]).to be_nil
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
it 'win32 is nil' do
|
|
31
|
-
expect(subject.icons[:win32]).to be_nil
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# TODO: Implement
|
|
36
|
-
describe "#dmg" do
|
|
37
|
-
it "ds_store is nil" do
|
|
38
|
-
expect(subject.dmg[:ds_store]).to be_nil
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
it "background is nil" do
|
|
42
|
-
expect(subject.dmg[:background]).to be_nil
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
describe "#to_hash" do
|
|
47
|
-
it "round-trips" do
|
|
48
|
-
expect(Shoes::Package::Configuration.create(subject.to_hash)).to eq(subject)
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
context "with options" do
|
|
54
|
-
include_context 'config'
|
|
55
|
-
subject { Shoes::Package::Configuration.load(@config_filename) }
|
|
56
|
-
|
|
57
|
-
its(:name) { should eq('Sugar Clouds') }
|
|
58
|
-
its(:shortname) { should eq('sweet-nebulae') }
|
|
59
|
-
its(:ignore) { should include('pkg') }
|
|
60
|
-
its(:run) { should eq('bin/hello_world') }
|
|
61
|
-
its(:gems) { should include('rspec') }
|
|
62
|
-
its(:gems) { should include('shoes-core') }
|
|
63
|
-
its(:version) { should eq('0.0.1') }
|
|
64
|
-
its(:release) { should eq('Mindfully') }
|
|
65
|
-
its(:icons) { should be_an_instance_of(Hash) }
|
|
66
|
-
its(:dmg) { should be_an_instance_of(Hash) }
|
|
67
|
-
its(:working_dir) { should eq(@config_filename.dirname) }
|
|
68
|
-
it { is_expected.to be_valid }
|
|
69
|
-
|
|
70
|
-
describe "#icons" do
|
|
71
|
-
it 'has osx' do
|
|
72
|
-
expect(subject.icons[:osx]).to eq('img/boots.icns')
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
it 'has gtk' do
|
|
76
|
-
expect(subject.icons[:gtk]).to eq('img/boots_512x512x32.png')
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
it 'has win32' do
|
|
80
|
-
expect(subject.icons[:win32]).to eq('img/boots.ico')
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
describe "#dmg" do
|
|
85
|
-
it "has ds_store" do
|
|
86
|
-
expect(subject.dmg[:ds_store]).to eq('path/to/custom/.DS_Store')
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
it "has background" do
|
|
90
|
-
expect(subject.dmg[:background]).to eq('path/to/custom/background.png')
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
it "incorporates custom features" do
|
|
95
|
-
expect(subject.custom).to eq('my custom feature')
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
it "round-trips" do
|
|
99
|
-
expect(Shoes::Package::Configuration.create(subject.to_hash)).to eq(subject)
|
|
100
|
-
end
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
context "with name, but without explicit shortname" do
|
|
104
|
-
let(:options) { {name: "Sugar Clouds"} }
|
|
105
|
-
subject { Shoes::Package::Configuration.create options }
|
|
106
|
-
|
|
107
|
-
its(:name) { should eq("Sugar Clouds") }
|
|
108
|
-
its(:shortname) { should eq("sugarclouds") }
|
|
109
|
-
end
|
|
110
|
-
|
|
111
|
-
context "when the file to run doens't exist" do
|
|
112
|
-
let(:options) { {run: "path/to/non-existent/file"} }
|
|
113
|
-
subject { Shoes::Package::Configuration.create options }
|
|
114
|
-
|
|
115
|
-
it { is_expected.not_to be_valid }
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
context "when osx icon is not specified" do
|
|
119
|
-
include_context 'config'
|
|
120
|
-
let(:valid_config) { Shoes::Package::Configuration.load(@config_filename) }
|
|
121
|
-
let(:options) { valid_config.to_hash.merge(icons: {}) }
|
|
122
|
-
subject { Shoes::Package::Configuration.create(options) }
|
|
123
|
-
|
|
124
|
-
it "sets osx icon path to nil" do
|
|
125
|
-
expect(subject.icons[:osx]).to be_nil
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
it "is valid" do
|
|
129
|
-
expect(subject).to be_valid
|
|
130
|
-
end
|
|
131
|
-
end
|
|
132
|
-
|
|
133
|
-
context "when osx icon is specified, but doesn't exist" do
|
|
134
|
-
let(:options) { {icons: {osx: "path/to/non-existent/file"}} }
|
|
135
|
-
subject { Shoes::Package::Configuration.create options }
|
|
136
|
-
|
|
137
|
-
it "sets osx icon path" do
|
|
138
|
-
expect(subject.icons[:osx]).to eq("path/to/non-existent/file")
|
|
139
|
-
end
|
|
140
|
-
|
|
141
|
-
it { is_expected.not_to be_valid }
|
|
142
|
-
end
|
|
143
|
-
|
|
144
|
-
context "auto-loading" do
|
|
145
|
-
include_context 'config'
|
|
146
|
-
|
|
147
|
-
shared_examples "config with path" do
|
|
148
|
-
it "finds the config" do
|
|
149
|
-
Dir.chdir File.dirname(__FILE__) do
|
|
150
|
-
config = Shoes::Package::Configuration.load(path)
|
|
151
|
-
expect(config.shortname).to eq('sweet-nebulae')
|
|
152
|
-
end
|
|
153
|
-
end
|
|
154
|
-
end
|
|
155
|
-
|
|
156
|
-
context "with an 'app.yaml'" do
|
|
157
|
-
let(:path) { @config_filename }
|
|
158
|
-
it_behaves_like "config with path"
|
|
159
|
-
end
|
|
160
|
-
|
|
161
|
-
context "with a path to a directory containing an 'app.yaml'" do
|
|
162
|
-
let(:path) { @config_filename.parent }
|
|
163
|
-
it_behaves_like "config with path"
|
|
164
|
-
end
|
|
165
|
-
|
|
166
|
-
context "with a path to a file that is siblings with an 'app.yaml'" do
|
|
167
|
-
let(:path) { @config_filename.parent.join('sibling.rb') }
|
|
168
|
-
it_behaves_like "config with path"
|
|
169
|
-
end
|
|
170
|
-
|
|
171
|
-
context "with a path that exists, but no 'app.yaml'" do
|
|
172
|
-
let(:path) { @config_filename.parent.join('bin/hello_world') }
|
|
173
|
-
subject { Shoes::Package::Configuration.load(path) }
|
|
174
|
-
|
|
175
|
-
its(:name) { should eq('hello_world') }
|
|
176
|
-
its(:shortname) { should eq('hello_world') }
|
|
177
|
-
end
|
|
178
|
-
|
|
179
|
-
context "when the file doesn't exist" do
|
|
180
|
-
it "blows up" do
|
|
181
|
-
expect do
|
|
182
|
-
Shoes::Package::Configuration.load('some/bogus/path')
|
|
183
|
-
end.to raise_error(/No such file or directory/)
|
|
184
|
-
end
|
|
185
|
-
end
|
|
186
|
-
|
|
187
|
-
context "with additional gems" do
|
|
188
|
-
let(:path) { @config_filename }
|
|
189
|
-
let(:additional_config) { { gems: gems } }
|
|
190
|
-
let(:config) { Shoes::Package::Configuration.load(path, additional_config) }
|
|
191
|
-
|
|
192
|
-
context "one gem" do
|
|
193
|
-
let(:gems) { 'shoes-swt' }
|
|
194
|
-
|
|
195
|
-
it "adds one additional" do
|
|
196
|
-
expect(config.gems).to include('shoes-swt')
|
|
197
|
-
end
|
|
198
|
-
end
|
|
199
|
-
|
|
200
|
-
context "multiple gems" do
|
|
201
|
-
let(:gems) { ['shoes-swt', 'shoes-extras'] }
|
|
202
|
-
|
|
203
|
-
it "adds multiple additional gems" do
|
|
204
|
-
expect(config.gems & gems).to eq(gems)
|
|
205
|
-
end
|
|
206
|
-
end
|
|
207
|
-
end
|
|
208
|
-
end
|
|
209
|
-
end
|
data/spec/spec_helper.rb
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# Packaging caches files in $HOME/.furoshiki/cache by default.
|
|
2
|
-
# For testing, we override $HOME using $FUROSHIKI_HOME
|
|
3
|
-
FUROSHIKI_SPEC_DIR = Pathname.new(__FILE__).dirname.expand_path.to_s
|
|
4
|
-
ENV['FUROSHIKI_HOME'] = FUROSHIKI_SPEC_DIR
|
|
5
|
-
|
|
6
|
-
SHOES_PACKAGE_SPEC_ROOT = File.expand_path('..', __FILE__)
|
|
7
|
-
|
|
8
|
-
$LOAD_PATH << File.expand_path(SHOES_PACKAGE_SPEC_ROOT)
|
|
9
|
-
$LOAD_PATH << File.expand_path('../../lib', __FILE__)
|
|
10
|
-
$LOAD_PATH << File.expand_path('../../../shoes-core/lib', __FILE__)
|
|
11
|
-
|
|
12
|
-
require 'pathname'
|
|
13
|
-
require 'rspec/its'
|
|
14
|
-
|
|
15
|
-
Dir["#{SHOES_PACKAGE_SPEC_ROOT}/support/**/*.rb"].each { |f| require f }
|
|
16
|
-
|
|
17
|
-
module PackageHelpers
|
|
18
|
-
# need these values from a context block, so let doesn't work
|
|
19
|
-
def spec_dir
|
|
20
|
-
Pathname.new(__FILE__).join('..').cleanpath
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def input_dir
|
|
24
|
-
spec_dir.join 'support', 'zip'
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# Guards for running or not running specs. Specs in the guarded block only
|
|
29
|
-
# run if the guard conditions are met.
|
|
30
|
-
#
|
|
31
|
-
module Guard
|
|
32
|
-
# Runs specs only if platform matches
|
|
33
|
-
#
|
|
34
|
-
# @example
|
|
35
|
-
# platform_is :windows do
|
|
36
|
-
# it "does something only on windows" do
|
|
37
|
-
# # specification
|
|
38
|
-
# end
|
|
39
|
-
# end
|
|
40
|
-
def platform_is(platform)
|
|
41
|
-
yield if send "platform_is_#{platform}"
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
# Runs specs only if platform does not match
|
|
45
|
-
#
|
|
46
|
-
# @example
|
|
47
|
-
# platform_is_not :windows do
|
|
48
|
-
# it "does something only on posix systems" do
|
|
49
|
-
# # specification
|
|
50
|
-
# end
|
|
51
|
-
# end
|
|
52
|
-
def platform_is_not(platform)
|
|
53
|
-
yield unless send "platform_is_#{platform}"
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
def platform_is_windows
|
|
57
|
-
RbConfig::CONFIG['host_os'] =~ /windows|mswin/i
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
def platform_is_linux
|
|
61
|
-
RbConfig::CONFIG['host_os'] =~ /linux/i
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
def platform_is_osx
|
|
65
|
-
RbConfig::CONFIG['host_os'] =~ /darwin/i
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
include Guard
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
require 'yaml'
|
|
2
|
-
require 'pathname'
|
|
3
|
-
|
|
4
|
-
shared_context 'config' do
|
|
5
|
-
before :all do
|
|
6
|
-
@config_filename = Pathname.new(__FILE__).join('../../test_app/app.yaml').cleanpath
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
shared_context 'package' do
|
|
11
|
-
before :all do
|
|
12
|
-
@app_dir = Pathname.new(__FILE__).join '../../test_app'
|
|
13
|
-
@output_dir = @app_dir.join 'pkg'
|
|
14
|
-
end
|
|
15
|
-
end
|
data/spec/swt_app_spec.rb
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
require_relative 'spec_helper'
|
|
2
|
-
require 'shoes/package/configuration'
|
|
3
|
-
require 'shoes/package/jar_app'
|
|
4
|
-
|
|
5
|
-
include PackageHelpers
|
|
6
|
-
|
|
7
|
-
describe Shoes::Package::JarApp do
|
|
8
|
-
include_context 'config'
|
|
9
|
-
include_context 'package'
|
|
10
|
-
|
|
11
|
-
let(:config) { Shoes::Package::Configuration.load @config_filename }
|
|
12
|
-
subject { Shoes::Package::JarApp.new config }
|
|
13
|
-
|
|
14
|
-
let(:launcher) { @output_file.join('Contents/MacOS/JavaAppLauncher') }
|
|
15
|
-
let(:icon) { @output_file.join('Contents/Resources/boots.icns') }
|
|
16
|
-
let(:jar) { @output_file.join('Contents/Java/sweet-nebulae.jar') }
|
|
17
|
-
|
|
18
|
-
# $FUROSHIKI_HOME is set in spec_helper.rb for testing purposes,
|
|
19
|
-
# but should default to $HOME
|
|
20
|
-
context "when not setting $FUROSHIKI_HOME" do
|
|
21
|
-
before do
|
|
22
|
-
@old_furoshiki_home = ENV['FUROSHIKI_HOME']
|
|
23
|
-
ENV['FUROSHIKI_HOME'] = nil
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
its(:cache_dir) { should eq(Pathname.new(Dir.home).join('.furoshiki', 'cache')) }
|
|
27
|
-
|
|
28
|
-
after do
|
|
29
|
-
ENV['FUROSHIKI_HOME'] = @old_furoshiki_home
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
context "default" do
|
|
34
|
-
let(:cache_dir) { Pathname.new(SHOES_PACKAGE_SPEC_ROOT).join('.furoshiki', 'cache') }
|
|
35
|
-
its(:cache_dir) { should eq(cache_dir) }
|
|
36
|
-
|
|
37
|
-
it "sets package dir to {pwd}/pkg" do
|
|
38
|
-
Dir.chdir @app_dir do
|
|
39
|
-
expect(subject.default_package_dir).to eq(@app_dir.join('pkg'))
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
its(:template_path) { should eq(cache_dir.join('shoes-app-template-0.0.2.zip')) }
|
|
44
|
-
its(:remote_template_url) { should eq(Shoes::Package::Configuration::JAR_APP_TEMPLATE_URL) }
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
context "when creating a .app" do
|
|
48
|
-
before :all do
|
|
49
|
-
@output_dir.rmtree if @output_dir.exist?
|
|
50
|
-
@output_dir.mkpath
|
|
51
|
-
app_name = 'Sugar Clouds.app'
|
|
52
|
-
@output_file = @output_dir.join app_name
|
|
53
|
-
config = Shoes::Package::Configuration.load @config_filename
|
|
54
|
-
@subject = Shoes::Package::JarApp.new config
|
|
55
|
-
@subject.package
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
subject { @subject }
|
|
59
|
-
|
|
60
|
-
its(:template_path) { should exist }
|
|
61
|
-
|
|
62
|
-
it "creates a .app" do
|
|
63
|
-
expect(@output_file).to exist
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
it "includes launcher" do
|
|
67
|
-
expect(launcher).to exist
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
# Windows can't test this
|
|
71
|
-
platform_is_not :windows do
|
|
72
|
-
it "makes launcher executable" do
|
|
73
|
-
expect(launcher).to be_executable
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
it "deletes generic icon" do
|
|
78
|
-
expect(icon.parent.join('GenericApp.icns')).not_to exist
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
it "injects icon" do
|
|
82
|
-
expect(icon).to exist
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
it "injects jar" do
|
|
86
|
-
expect(jar).to exist
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
it "removes any extraneous jars" do
|
|
90
|
-
jar_dir_contents = @output_file.join("Contents/Java").children
|
|
91
|
-
expect(jar_dir_contents.reject { |f| f == jar }).to be_empty
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
describe "Info.plist" do
|
|
95
|
-
require 'plist'
|
|
96
|
-
before :all do
|
|
97
|
-
@plist = Plist.parse_xml(@output_file.join('Contents/Info.plist'))
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
it "sets identifier" do
|
|
101
|
-
expect(@plist['CFBundleIdentifier']).to eq('com.hackety.shoes.sweet-nebulae')
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
it "sets display name" do
|
|
105
|
-
expect(@plist['CFBundleDisplayName']).to eq('Sugar Clouds')
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
it "sets bundle name" do
|
|
109
|
-
expect(@plist['CFBundleName']).to eq('Sugar Clouds')
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
it "sets icon" do
|
|
113
|
-
expect(@plist['CFBundleIconFile']).to eq('boots.icns')
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
it "sets version" do
|
|
117
|
-
expect(@plist['CFBundleVersion']).to eq('0.0.1')
|
|
118
|
-
end
|
|
119
|
-
end
|
|
120
|
-
end
|
|
121
|
-
|
|
122
|
-
describe "with an invalid configuration" do
|
|
123
|
-
let(:config) { Shoes::Package::Configuration.create }
|
|
124
|
-
subject { Shoes::Package::JarApp.new config }
|
|
125
|
-
|
|
126
|
-
it "fails to initialize" do
|
|
127
|
-
expect { subject }.to raise_error(Furoshiki::ConfigurationError)
|
|
128
|
-
end
|
|
129
|
-
end
|
|
130
|
-
end
|
data/spec/swt_jar_spec.rb
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
require_relative 'spec_helper'
|
|
2
|
-
require 'shoes/package/configuration'
|
|
3
|
-
require 'shoes/package/jar'
|
|
4
|
-
|
|
5
|
-
include PackageHelpers
|
|
6
|
-
|
|
7
|
-
describe Furoshiki::Jar do
|
|
8
|
-
include_context 'config'
|
|
9
|
-
include_context 'package'
|
|
10
|
-
|
|
11
|
-
context "when creating a .jar" do
|
|
12
|
-
before :all do
|
|
13
|
-
@output_dir.rmtree if @output_dir.exist?
|
|
14
|
-
@output_dir.mkpath
|
|
15
|
-
config = Shoes::Package::Configuration.load(@config_filename)
|
|
16
|
-
@subject = Shoes::Package::Jar.new(config)
|
|
17
|
-
@jar_path = @subject.package
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
let(:jar_name) { 'sweet-nebulae.jar' }
|
|
21
|
-
let(:output_file) { Pathname.new(@output_dir.join(jar_name)) }
|
|
22
|
-
subject { @subject }
|
|
23
|
-
|
|
24
|
-
it "creates a .jar" do
|
|
25
|
-
expect(output_file).to exist
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
it "returns path to .jar" do
|
|
29
|
-
expect(@jar_path).to eq(output_file.to_s)
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
it "creates .jar smaller than 60MB" do
|
|
33
|
-
expect(File.size(output_file)).to be < 60 * 1024 * 1024
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
context "inspecting contents" do
|
|
37
|
-
let(:jar) { Zip::File.new(output_file) }
|
|
38
|
-
|
|
39
|
-
it "includes shoes-core" do
|
|
40
|
-
shoes_core = jar.glob "gems/shoes-core*"
|
|
41
|
-
expect(shoes_core.length).to equal(1)
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
it "includes shoes-swt" do
|
|
45
|
-
shoes_swt = jar.glob "gems/shoes-swt*"
|
|
46
|
-
expect(shoes_swt.length).to equal(1)
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
it "excludes directories recursively" do
|
|
50
|
-
expect(jar.entries).not_to include("dir_to_ignore/file_to_ignore")
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
its(:default_dir) { should eq(@output_dir) }
|
|
55
|
-
its(:filename) { should eq(jar_name) }
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
describe "with an invalid configuration" do
|
|
59
|
-
let(:config) { Shoes::Package::Configuration.create }
|
|
60
|
-
subject { Shoes::Package::Jar.new(config) }
|
|
61
|
-
|
|
62
|
-
it "fails to initialize" do
|
|
63
|
-
expect { subject }.to raise_error(Furoshiki::ConfigurationError)
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
end
|
data/spec/test_app/app.yaml
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
name: Sugar Clouds
|
|
2
|
-
shortname: sweet-nebulae
|
|
3
|
-
ignore:
|
|
4
|
-
- pkg
|
|
5
|
-
- dir_to_ignore
|
|
6
|
-
run: bin/hello_world
|
|
7
|
-
gems: rspec
|
|
8
|
-
version: 0.0.1
|
|
9
|
-
release: Mindfully
|
|
10
|
-
icons:
|
|
11
|
-
osx: img/boots.icns
|
|
12
|
-
gtk: img/boots_512x512x32.png
|
|
13
|
-
win32: img/boots.ico
|
|
14
|
-
dmg:
|
|
15
|
-
ds_store: path/to/custom/.DS_Store
|
|
16
|
-
background: path/to/custom/background.png
|
|
17
|
-
custom: my custom feature
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
should be ignored
|
|
Binary file
|
data/spec/test_app/img/boots.ico
DELETED
|
Binary file
|
|
Binary file
|
data/spec/test_app/sibling.rb
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# Just a sibling of 'app.yaml'
|