furoshiki 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/furoshiki/version.rb +1 -1
- metadata +25 -79
- data/.gitignore +0 -24
- data/.rspec +0 -2
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/.travis.yml +0 -11
- data/Gemfile +0 -4
- data/README.rdoc +0 -66
- data/Rakefile +0 -26
- data/example/Rakefile +0 -4
- data/furoshiki.gemspec +0 -27
- data/spec/app_spec.rb +0 -142
- data/spec/configuration_spec.rb +0 -28
- data/spec/fixtures/config.yaml +0 -1
- data/spec/fixtures/test_app/app.yaml +0 -17
- data/spec/fixtures/test_app/bin/hello_world +0 -3
- data/spec/fixtures/test_app/dir_to_ignore/file_to_ignore.txt +0 -1
- data/spec/fixtures/test_app/img/boots.icns +0 -0
- data/spec/fixtures/test_app/img/boots.ico +0 -0
- data/spec/fixtures/test_app/img/boots_512x512x32.png +0 -0
- data/spec/fixtures/test_app/sibling.rb +0 -1
- data/spec/fixtures/test_project/bin/hello.rb +0 -1
- data/spec/fixtures/test_project/dir_to_ignore/file_to_ignore.txt +0 -1
- data/spec/jar_spec.rb +0 -69
- data/spec/spec_helper.rb +0 -85
- data/spec/support/shared_config.rb +0 -19
- data/spec/support/shared_zip.rb +0 -23
- data/spec/support/zip/a/a.rb +0 -3
- data/spec/support/zip/a/b/b.png +0 -0
- data/spec/support/zip/a/b/c/c.rb +0 -3
- data/spec/util_spec.rb +0 -57
- data/spec/zip/directory_contents_spec.rb +0 -30
- data/spec/zip/directory_spec.rb +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1d32dc5465e95025e50c5d21471f5d52384b56c
|
4
|
+
data.tar.gz: f6c54405cff72df1aa6f96b2040d2b077c56928c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcf40eafe968ba9a044b7389c465c64726099d4fabeb0d32d662ae9c932f5c6ba0cc2b550636c090a26ba4732c719c74c4117b17a5ba20a02ce577ca7236c183
|
7
|
+
data.tar.gz: bf16aaa636595a789937c474beb31265cfb0503b4fe0225b11feee3ed7d664f40acaeb42f809dc3e346ab44c998e2cec7ca74ae1e1683065cb470681215f561d
|
data/lib/furoshiki/version.rb
CHANGED
metadata
CHANGED
@@ -1,33 +1,34 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: furoshiki
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- Team Shoes
|
7
8
|
- Steve Klabnik
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2017-01-06 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
requirement: !ruby/object:Gem::Requirement
|
15
16
|
requirements:
|
16
|
-
- - ~>
|
17
|
+
- - "~>"
|
17
18
|
- !ruby/object:Gem::Version
|
18
|
-
version:
|
19
|
+
version: 2.0.4
|
19
20
|
name: warbler
|
20
21
|
prerelease: false
|
21
22
|
type: :runtime
|
22
23
|
version_requirements: !ruby/object:Gem::Requirement
|
23
24
|
requirements:
|
24
|
-
- - ~>
|
25
|
+
- - "~>"
|
25
26
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
27
|
+
version: 2.0.4
|
27
28
|
- !ruby/object:Gem::Dependency
|
28
29
|
requirement: !ruby/object:Gem::Requirement
|
29
30
|
requirements:
|
30
|
-
- -
|
31
|
+
- - ">="
|
31
32
|
- !ruby/object:Gem::Version
|
32
33
|
version: '0'
|
33
34
|
name: plist
|
@@ -35,13 +36,13 @@ dependencies:
|
|
35
36
|
type: :runtime
|
36
37
|
version_requirements: !ruby/object:Gem::Requirement
|
37
38
|
requirements:
|
38
|
-
- -
|
39
|
+
- - ">="
|
39
40
|
- !ruby/object:Gem::Version
|
40
41
|
version: '0'
|
41
42
|
- !ruby/object:Gem::Dependency
|
42
43
|
requirement: !ruby/object:Gem::Requirement
|
43
44
|
requirements:
|
44
|
-
- -
|
45
|
+
- - ">="
|
45
46
|
- !ruby/object:Gem::Version
|
46
47
|
version: 1.0.0
|
47
48
|
name: rubyzip
|
@@ -49,13 +50,13 @@ dependencies:
|
|
49
50
|
type: :runtime
|
50
51
|
version_requirements: !ruby/object:Gem::Requirement
|
51
52
|
requirements:
|
52
|
-
- -
|
53
|
+
- - ">="
|
53
54
|
- !ruby/object:Gem::Version
|
54
55
|
version: 1.0.0
|
55
56
|
- !ruby/object:Gem::Dependency
|
56
57
|
requirement: !ruby/object:Gem::Requirement
|
57
58
|
requirements:
|
58
|
-
- -
|
59
|
+
- - ">="
|
59
60
|
- !ruby/object:Gem::Version
|
60
61
|
version: '0'
|
61
62
|
name: rake
|
@@ -63,13 +64,13 @@ dependencies:
|
|
63
64
|
type: :development
|
64
65
|
version_requirements: !ruby/object:Gem::Requirement
|
65
66
|
requirements:
|
66
|
-
- -
|
67
|
+
- - ">="
|
67
68
|
- !ruby/object:Gem::Version
|
68
69
|
version: '0'
|
69
70
|
- !ruby/object:Gem::Dependency
|
70
71
|
requirement: !ruby/object:Gem::Requirement
|
71
72
|
requirements:
|
72
|
-
- -
|
73
|
+
- - ">="
|
73
74
|
- !ruby/object:Gem::Version
|
74
75
|
version: 3.0.0
|
75
76
|
name: rspec
|
@@ -77,13 +78,13 @@ dependencies:
|
|
77
78
|
type: :development
|
78
79
|
version_requirements: !ruby/object:Gem::Requirement
|
79
80
|
requirements:
|
80
|
-
- -
|
81
|
+
- - ">="
|
81
82
|
- !ruby/object:Gem::Version
|
82
83
|
version: 3.0.0
|
83
84
|
- !ruby/object:Gem::Dependency
|
84
85
|
requirement: !ruby/object:Gem::Requirement
|
85
86
|
requirements:
|
86
|
-
- -
|
87
|
+
- - ">="
|
87
88
|
- !ruby/object:Gem::Version
|
88
89
|
version: '0'
|
89
90
|
name: rspec-its
|
@@ -91,13 +92,13 @@ dependencies:
|
|
91
92
|
type: :development
|
92
93
|
version_requirements: !ruby/object:Gem::Requirement
|
93
94
|
requirements:
|
94
|
-
- -
|
95
|
+
- - ">="
|
95
96
|
- !ruby/object:Gem::Version
|
96
97
|
version: '0'
|
97
98
|
- !ruby/object:Gem::Dependency
|
98
99
|
requirement: !ruby/object:Gem::Requirement
|
99
100
|
requirements:
|
100
|
-
- -
|
101
|
+
- - ">="
|
101
102
|
- !ruby/object:Gem::Version
|
102
103
|
version: '0'
|
103
104
|
name: pry
|
@@ -105,26 +106,16 @@ dependencies:
|
|
105
106
|
type: :development
|
106
107
|
version_requirements: !ruby/object:Gem::Requirement
|
107
108
|
requirements:
|
108
|
-
- -
|
109
|
+
- - ">="
|
109
110
|
- !ruby/object:Gem::Version
|
110
111
|
version: '0'
|
111
112
|
description: Create .app, .exe, and $LINUX_PACKAGE versions of your application, with its own embedded Ruby.
|
112
|
-
email:
|
113
|
+
email: shoes@lists.mvmanila.com
|
113
114
|
executables: []
|
114
115
|
extensions: []
|
115
116
|
extra_rdoc_files: []
|
116
117
|
files:
|
117
|
-
- .gitignore
|
118
|
-
- .rspec
|
119
|
-
- .ruby-gemset
|
120
|
-
- .ruby-version
|
121
|
-
- .travis.yml
|
122
|
-
- Gemfile
|
123
118
|
- LICENSE
|
124
|
-
- README.rdoc
|
125
|
-
- Rakefile
|
126
|
-
- example/Rakefile
|
127
|
-
- furoshiki.gemspec
|
128
119
|
- lib/furoshiki.rb
|
129
120
|
- lib/furoshiki/configuration.rb
|
130
121
|
- lib/furoshiki/exceptions.rb
|
@@ -139,30 +130,8 @@ files:
|
|
139
130
|
- lib/furoshiki/zip/directory_contents.rb
|
140
131
|
- lib/furoshiki/zip/recursive.rb
|
141
132
|
- lib/warbler/traits/furoshiki.rb
|
142
|
-
- spec/app_spec.rb
|
143
|
-
- spec/configuration_spec.rb
|
144
|
-
- spec/fixtures/config.yaml
|
145
|
-
- spec/fixtures/test_app/app.yaml
|
146
|
-
- spec/fixtures/test_app/bin/hello_world
|
147
|
-
- spec/fixtures/test_app/dir_to_ignore/file_to_ignore.txt
|
148
|
-
- spec/fixtures/test_app/img/boots.icns
|
149
|
-
- spec/fixtures/test_app/img/boots.ico
|
150
|
-
- spec/fixtures/test_app/img/boots_512x512x32.png
|
151
|
-
- spec/fixtures/test_app/sibling.rb
|
152
|
-
- spec/fixtures/test_project/bin/hello.rb
|
153
|
-
- spec/fixtures/test_project/dir_to_ignore/file_to_ignore.txt
|
154
|
-
- spec/jar_spec.rb
|
155
|
-
- spec/spec_helper.rb
|
156
|
-
- spec/support/shared_config.rb
|
157
|
-
- spec/support/shared_zip.rb
|
158
|
-
- spec/support/zip/a/a.rb
|
159
|
-
- spec/support/zip/a/b/b.png
|
160
|
-
- spec/support/zip/a/b/c/c.rb
|
161
|
-
- spec/util_spec.rb
|
162
|
-
- spec/zip/directory_contents_spec.rb
|
163
|
-
- spec/zip/directory_spec.rb
|
164
133
|
- vendor/appbundler-1.0.jar
|
165
|
-
homepage: http://github.com/
|
134
|
+
homepage: http://github.com/shoes/furoshiki
|
166
135
|
licenses: []
|
167
136
|
metadata: {}
|
168
137
|
post_install_message:
|
@@ -171,41 +140,18 @@ require_paths:
|
|
171
140
|
- lib
|
172
141
|
required_ruby_version: !ruby/object:Gem::Requirement
|
173
142
|
requirements:
|
174
|
-
- -
|
143
|
+
- - ">="
|
175
144
|
- !ruby/object:Gem::Version
|
176
145
|
version: '0'
|
177
146
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
178
147
|
requirements:
|
179
|
-
- -
|
148
|
+
- - ">="
|
180
149
|
- !ruby/object:Gem::Version
|
181
150
|
version: '0'
|
182
151
|
requirements: []
|
183
152
|
rubyforge_project:
|
184
|
-
rubygems_version: 2.
|
153
|
+
rubygems_version: 2.6.8
|
185
154
|
signing_key:
|
186
155
|
specification_version: 4
|
187
156
|
summary: Package and distribute applications with Ruby.
|
188
|
-
test_files:
|
189
|
-
- spec/app_spec.rb
|
190
|
-
- spec/configuration_spec.rb
|
191
|
-
- spec/fixtures/config.yaml
|
192
|
-
- spec/fixtures/test_app/app.yaml
|
193
|
-
- spec/fixtures/test_app/bin/hello_world
|
194
|
-
- spec/fixtures/test_app/dir_to_ignore/file_to_ignore.txt
|
195
|
-
- spec/fixtures/test_app/img/boots.icns
|
196
|
-
- spec/fixtures/test_app/img/boots.ico
|
197
|
-
- spec/fixtures/test_app/img/boots_512x512x32.png
|
198
|
-
- spec/fixtures/test_app/sibling.rb
|
199
|
-
- spec/fixtures/test_project/bin/hello.rb
|
200
|
-
- spec/fixtures/test_project/dir_to_ignore/file_to_ignore.txt
|
201
|
-
- spec/jar_spec.rb
|
202
|
-
- spec/spec_helper.rb
|
203
|
-
- spec/support/shared_config.rb
|
204
|
-
- spec/support/shared_zip.rb
|
205
|
-
- spec/support/zip/a/a.rb
|
206
|
-
- spec/support/zip/a/b/b.png
|
207
|
-
- spec/support/zip/a/b/c/c.rb
|
208
|
-
- spec/util_spec.rb
|
209
|
-
- spec/zip/directory_contents_spec.rb
|
210
|
-
- spec/zip/directory_spec.rb
|
211
|
-
has_rdoc:
|
157
|
+
test_files: []
|
data/.gitignore
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
## MAC OS
|
2
|
-
.DS_Store
|
3
|
-
|
4
|
-
## TEXTMATE
|
5
|
-
*.tmproj
|
6
|
-
tmtags
|
7
|
-
|
8
|
-
## EMACS
|
9
|
-
*~
|
10
|
-
\#*
|
11
|
-
.\#*
|
12
|
-
|
13
|
-
## VIM
|
14
|
-
*.swp
|
15
|
-
|
16
|
-
## PROJECT::GENERAL
|
17
|
-
coverage
|
18
|
-
rdoc
|
19
|
-
pkg
|
20
|
-
.rvmrc
|
21
|
-
Gemfile.lock
|
22
|
-
|
23
|
-
## PROJECT::SPECIFIC
|
24
|
-
spec/.furoshiki
|
data/.rspec
DELETED
data/.ruby-gemset
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
furoshiki
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
jruby-1.7.18
|
data/.travis.yml
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
script: "rspec"
|
3
|
-
rvm: jruby
|
4
|
-
notifications:
|
5
|
-
irc: "irc.freenode.org#shoes"
|
6
|
-
email:
|
7
|
-
recipients:
|
8
|
-
- wasnotrice@gmail.com
|
9
|
-
- tobias.pfeiffer@student.hpi.uni-potsdam.de
|
10
|
-
on_success: change # [always|never|change] # default: change
|
11
|
-
on_failure: change # [always|never|change] # default: always
|
data/Gemfile
DELETED
data/README.rdoc
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
= furoshiki {<img src="https://travis-ci.org/shoes/furoshiki.png?branch=master" alt="Build Status" />}[https://travis-ci.org/shoes/furoshiki] {<img src="https://codeclimate.com/github/shoes/furoshiki.png" />}[https://codeclimate.com/github/shoes/furoshiki]
|
2
|
-
|
3
|
-
風呂敷 (Furoshiki) is a simple way to package your Ruby applications for
|
4
|
-
distribution on Windows, Linux, and OSX. A 風呂敷 is "a type of traditional
|
5
|
-
Japanese wrapping cloth that were frequently used to transport clothes, gifts,
|
6
|
-
or other goods."
|
7
|
-
|
8
|
-
== ALPHA WARNING
|
9
|
-
|
10
|
-
This is all super alpha, and is subject to change at any time.
|
11
|
-
|
12
|
-
== Packaging Shoes apps
|
13
|
-
|
14
|
-
For the moment, we only really package Shoes apps. See ALPHA WARNING above ;)
|
15
|
-
|
16
|
-
path = 'path/to/your/shoes-app' # See Furoshiki::Shoes::Configuration
|
17
|
-
config = Furoshiki::Shoes::Configuration.load(path)
|
18
|
-
packager = Furoshiki::Shoes.new(:swt, :app, config)
|
19
|
-
packager.package
|
20
|
-
|
21
|
-
Or use the shoes4 command line interface:
|
22
|
-
|
23
|
-
bin/shoes -p swt:app path/to/your/shoes-app
|
24
|
-
|
25
|
-
Eventually, we will be able to package non-Shoes apps too.
|
26
|
-
|
27
|
-
== Inspiration
|
28
|
-
|
29
|
-
The inspiriation for 風呂敷 came from Shoes[http://shoesrb.com]. One of Shoes'
|
30
|
-
best features is packaging up scripts made with Shoes into their own
|
31
|
-
executables. You could take any little script and make a .app, .exe, or .run
|
32
|
-
file. However, this code was really complicated, and made Shoes hard to
|
33
|
-
maintain. It was often the source of people's problems when trying to build
|
34
|
-
Shoes of their own. So, while working on Shoes 4, I decided to see if anyone
|
35
|
-
else was doing anything similar. I came across the .app for
|
36
|
-
libgosu[http://code.google.com/p/gosu/wiki/RubyPackagingOnOsx], which was doing
|
37
|
-
a similar thing. After emailing Julian, I decided that if this was useful for
|
38
|
-
Shoes, and useful for libgosu, it'd probably be useful for other projects, too.
|
39
|
-
So I've set out to figure out the Shoes packager, play with the libgosu
|
40
|
-
versions, and come up with an easy way for you to bundle and distribute GUI
|
41
|
-
programs written in Ruby.
|
42
|
-
|
43
|
-
== Helping out with 風呂敷
|
44
|
-
|
45
|
-
It's easy! Just clone it down and do the usual bundler thing:
|
46
|
-
|
47
|
-
$ git clone https://github.com/shoes/furoshiki.git
|
48
|
-
$ cd furoshiki
|
49
|
-
$ gem install bundler
|
50
|
-
$ bundle
|
51
|
-
|
52
|
-
Easy-peasy.
|
53
|
-
|
54
|
-
=== Note on Patches/Pull Requests
|
55
|
-
|
56
|
-
* Fork the project.
|
57
|
-
* Make your feature addition or bug fix.
|
58
|
-
* Add tests for it. This is important so I don't break it in a
|
59
|
-
future version unintentionally.
|
60
|
-
* Commit, do not mess with rakefile, version, or history.
|
61
|
-
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
62
|
-
* Send me a pull request. Bonus points for topic branches.
|
63
|
-
|
64
|
-
== Copyright
|
65
|
-
|
66
|
-
Copyright (c) 2010 Steve Klabnik. See LICENSE for details.
|
data/Rakefile
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'bundler'
|
2
|
-
require 'rake/clean'
|
3
|
-
require 'rspec/core/rake_task'
|
4
|
-
Bundler::GemHelper.install_tasks
|
5
|
-
|
6
|
-
@types = %w[rb]
|
7
|
-
namespace :whitespace do
|
8
|
-
desc 'Removes trailing whitespace'
|
9
|
-
task :cleanup do
|
10
|
-
@types.each do |type|
|
11
|
-
sh %{find . -name '*.#{type}' -exec sed -i '' 's/ *$//g' {} \\;}
|
12
|
-
end
|
13
|
-
end
|
14
|
-
desc 'Turns tabs into two spaces'
|
15
|
-
task :retab do
|
16
|
-
@types.each do |type|
|
17
|
-
sh %{find . -name '*.#{type}' -exec sed -i '' 's/\t/ /g' {} \\;}
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
CLEAN.include('spec/shoes/.furoshiki', 'spec/shoes/sample_app')
|
23
|
-
|
24
|
-
RSpec::Core::RakeTask.new(:spec)
|
25
|
-
|
26
|
-
task :default => :spec
|
data/example/Rakefile
DELETED
data/furoshiki.gemspec
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
require "furoshiki/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |s|
|
6
|
-
s.name = "furoshiki"
|
7
|
-
s.version = Furoshiki::VERSION
|
8
|
-
s.authors = ["Steve Klabnik"]
|
9
|
-
s.email = "steve@steveklabnik.com"
|
10
|
-
s.homepage = "http://github.com/steveklabnik/furoshiki"
|
11
|
-
s.summary = %q{Package and distribute applications with Ruby.}
|
12
|
-
s.description = %q{Create .app, .exe, and $LINUX_PACKAGE versions of your application, with its own embedded Ruby.}
|
13
|
-
|
14
|
-
s.files = `git ls-files`.split("\n")
|
15
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
|
-
s.require_paths = ["lib"]
|
18
|
-
|
19
|
-
s.add_dependency "warbler", '~> 1.4.4'
|
20
|
-
s.add_dependency "plist"
|
21
|
-
s.add_dependency 'rubyzip', '>= 1.0.0'
|
22
|
-
|
23
|
-
s.add_development_dependency 'rake'
|
24
|
-
s.add_development_dependency 'rspec', '>= 3.0.0'
|
25
|
-
s.add_development_dependency 'rspec-its'
|
26
|
-
s.add_development_dependency 'pry'
|
27
|
-
end
|
data/spec/app_spec.rb
DELETED
@@ -1,142 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'pathname'
|
3
|
-
require 'furoshiki/jar_app'
|
4
|
-
|
5
|
-
include PackageHelpers
|
6
|
-
|
7
|
-
describe Furoshiki::JarApp do
|
8
|
-
include_context 'generic furoshiki config'
|
9
|
-
include_context 'generic furoshiki project'
|
10
|
-
|
11
|
-
let(:config) {Furoshiki::Configuration.new @custom_config }
|
12
|
-
subject {Furoshiki::JarApp.new config}
|
13
|
-
|
14
|
-
let(:launcher) { @output_file.join('Contents/MacOS/JavaAppLauncher') }
|
15
|
-
let(:icon) { @output_file.join('Contents/Resources/Shoes.icns') }
|
16
|
-
let(:jar) { @output_file.join('Contents/Java/rubyapp.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
|
-
|
27
|
-
its(:cache_dir) { should eq(Pathname.new(Dir.home).join('.furoshiki', 'cache')) }
|
28
|
-
|
29
|
-
after do
|
30
|
-
ENV['FUROSHIKI_HOME'] = @old_furoshiki_home
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
context "default" do
|
35
|
-
let(:cache_dir) { Pathname.new(FUROSHIKI_SPEC_DIR).join('.furoshiki', 'cache') }
|
36
|
-
its(:cache_dir) { should eq(cache_dir) }
|
37
|
-
|
38
|
-
it "sets package dir to {pwd}/pkg" do
|
39
|
-
Dir.chdir @app_dir do
|
40
|
-
expect(subject.default_package_dir).to eq(@app_dir.join 'pkg')
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
it "caches current version of template" do
|
45
|
-
expect(subject.template_path).to eq(cache_dir.join('shoes-app-template-0.0.2.zip'))
|
46
|
-
end
|
47
|
-
its(:remote_template_url) { should eq(Furoshiki::Configuration::JAR_APP_TEMPLATE_URL) }
|
48
|
-
end
|
49
|
-
|
50
|
-
context "when creating a .app" do
|
51
|
-
before :all do
|
52
|
-
#@output_dir.rmtree if @output_dir.exist?
|
53
|
-
@output_dir.mkpath
|
54
|
-
|
55
|
-
app_name = 'Ruby App.app'
|
56
|
-
@output_file = @output_dir.join app_name
|
57
|
-
|
58
|
-
# Config picks up Dir.pwd
|
59
|
-
Dir.chdir @app_dir do
|
60
|
-
config = Furoshiki::Configuration.new(@custom_config)
|
61
|
-
@subject = Furoshiki::JarApp.new(config)
|
62
|
-
@subject.package
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
subject { @subject }
|
67
|
-
|
68
|
-
its(:template_path) { should exist }
|
69
|
-
|
70
|
-
it "creates a .app" do
|
71
|
-
expect(@output_file).to exist
|
72
|
-
end
|
73
|
-
|
74
|
-
it "includes launcher" do
|
75
|
-
expect(launcher).to exist
|
76
|
-
end
|
77
|
-
|
78
|
-
# Windows can't test this
|
79
|
-
platform_is_not :windows do
|
80
|
-
it "makes launcher executable" do
|
81
|
-
expect(launcher).to be_executable
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
it "deletes generic icon" do
|
86
|
-
expect(icon.parent.join('GenericApp.icns')).not_to exist
|
87
|
-
end
|
88
|
-
|
89
|
-
it "injects icon" do
|
90
|
-
expect(icon).to exist
|
91
|
-
end
|
92
|
-
|
93
|
-
it "injects jar" do
|
94
|
-
expect(jar).to exist
|
95
|
-
end
|
96
|
-
|
97
|
-
it "removes any extraneous jars" do
|
98
|
-
jar_dir_contents = @output_file.join("Contents/Java").children
|
99
|
-
expect(jar_dir_contents.reject {|f| f == jar }).to be_empty
|
100
|
-
end
|
101
|
-
|
102
|
-
describe "Info.plist" do
|
103
|
-
require 'plist'
|
104
|
-
before :all do
|
105
|
-
@plist = Plist.parse_xml(@output_file.join 'Contents/Info.plist')
|
106
|
-
end
|
107
|
-
|
108
|
-
it "sets identifier" do
|
109
|
-
expect(@plist['CFBundleIdentifier']).to eq('com.hackety.shoes.rubyapp')
|
110
|
-
end
|
111
|
-
|
112
|
-
it "sets display name" do
|
113
|
-
expect(@plist['CFBundleDisplayName']).to eq('Ruby App')
|
114
|
-
end
|
115
|
-
|
116
|
-
it "sets bundle name" do
|
117
|
-
expect(@plist['CFBundleName']).to eq('Ruby App')
|
118
|
-
end
|
119
|
-
|
120
|
-
it "sets icon" do
|
121
|
-
expect(@plist['CFBundleIconFile']).to eq('Shoes.icns')
|
122
|
-
end
|
123
|
-
|
124
|
-
it "sets version" do
|
125
|
-
expect(@plist['CFBundleVersion']).to eq('0.0.0')
|
126
|
-
end
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
describe "with an invalid configuration" do
|
131
|
-
let(:config) { Furoshiki::Configuration.new }
|
132
|
-
subject { Furoshiki::JarApp.new config }
|
133
|
-
|
134
|
-
before do
|
135
|
-
allow(config).to receive(:valid?) { false }
|
136
|
-
end
|
137
|
-
|
138
|
-
it "fails to initialize" do
|
139
|
-
expect { subject }.to raise_error(Furoshiki::ConfigurationError)
|
140
|
-
end
|
141
|
-
end
|
142
|
-
end
|
data/spec/configuration_spec.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'furoshiki/configuration'
|
3
|
-
|
4
|
-
describe Furoshiki::Configuration do
|
5
|
-
subject(:config) { Furoshiki::Configuration.new(raw_config) }
|
6
|
-
|
7
|
-
let(:raw_config) { { warbler_extensions: OtherCustomization,
|
8
|
-
ignore: "pkg" } }
|
9
|
-
|
10
|
-
class OtherCustomization < Furoshiki::WarblerExtensions
|
11
|
-
def customize(config)
|
12
|
-
# Actual behavior with shoes-package overrides the application name, so
|
13
|
-
# for testing purposes reset it here too.
|
14
|
-
config.pathmaps.application = ["shoes-app/%p"]
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
it "is valid by default" do
|
19
|
-
expect(config).to be_valid
|
20
|
-
end
|
21
|
-
|
22
|
-
it "uses correct application path for exclusions" do
|
23
|
-
raw_config[:warbler_extensions] = OtherCustomization
|
24
|
-
raw_config[:ignore] = "pkg"
|
25
|
-
|
26
|
-
expect(config.to_warbler_config.excludes).to include("shoes-app/pkg")
|
27
|
-
end
|
28
|
-
end
|
data/spec/fixtures/config.yaml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
gems: 'rubyzip'
|
@@ -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
|
Binary file
|
Binary file
|
@@ -1 +0,0 @@
|
|
1
|
-
# Just a sibling of 'app.yaml'
|
@@ -1 +0,0 @@
|
|
1
|
-
puts "Hello, world!"
|
@@ -1 +0,0 @@
|
|
1
|
-
should be ignored
|
data/spec/jar_spec.rb
DELETED
@@ -1,69 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require_relative 'spec_helper'
|
3
|
-
require 'pathname'
|
4
|
-
require 'furoshiki/jar'
|
5
|
-
|
6
|
-
include PackageHelpers
|
7
|
-
|
8
|
-
describe Furoshiki::Jar do
|
9
|
-
include_context 'generic furoshiki config'
|
10
|
-
include_context 'generic furoshiki project'
|
11
|
-
|
12
|
-
context "when creating a .jar" do
|
13
|
-
before :all do
|
14
|
-
@output_dir.rmtree if @output_dir.exist?
|
15
|
-
@output_dir.mkpath
|
16
|
-
|
17
|
-
# Config picks up Dir.pwd
|
18
|
-
Dir.chdir @app_dir do
|
19
|
-
config = Furoshiki::Configuration.new(@custom_config)
|
20
|
-
@subject = Furoshiki::Jar.new(config)
|
21
|
-
@jar_path = @subject.package(@output_dir)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
let(:jar_name) { 'rubyapp.jar' }
|
26
|
-
let(:output_file) { Pathname.new(@output_dir.join jar_name) }
|
27
|
-
subject { @subject }
|
28
|
-
|
29
|
-
it "creates a .jar" do
|
30
|
-
expect(output_file).to exist
|
31
|
-
end
|
32
|
-
|
33
|
-
it "returns path to .jar" do
|
34
|
-
expect(@jar_path).to eq(output_file.to_s)
|
35
|
-
end
|
36
|
-
|
37
|
-
it "creates .jar smaller than 50MB" do
|
38
|
-
expect(File.size(output_file)).to be < 50 * 1024 * 1024
|
39
|
-
end
|
40
|
-
|
41
|
-
context "inspecting contents" do
|
42
|
-
let (:jar) { Zip::File.new(output_file) }
|
43
|
-
|
44
|
-
it "includes a specified gem" do
|
45
|
-
expect(jar.glob "gems/rubyzip*").to_not be_empty
|
46
|
-
end
|
47
|
-
|
48
|
-
it "does not include a non-specified gem" do
|
49
|
-
expect(jar.glob "gems/warbler*").to be_empty
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
its(:default_dir) { should eq(@output_dir) }
|
54
|
-
its(:filename) { should eq(jar_name) }
|
55
|
-
end
|
56
|
-
|
57
|
-
describe "with an invalid configuration" do
|
58
|
-
let(:config) { Furoshiki::Configuration.new }
|
59
|
-
subject { Furoshiki::Jar.new(config) }
|
60
|
-
|
61
|
-
before do
|
62
|
-
allow(config).to receive(:valid?) { false }
|
63
|
-
end
|
64
|
-
|
65
|
-
it "fails to initialize" do
|
66
|
-
expect { subject }.to raise_error(Furoshiki::ConfigurationError)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,85 +0,0 @@
|
|
1
|
-
require 'rspec'
|
2
|
-
require 'rspec/its'
|
3
|
-
require 'pry'
|
4
|
-
require 'pathname'
|
5
|
-
|
6
|
-
# Packaging caches files in $HOME/.furoshiki/cache by default.
|
7
|
-
# For testing, we override $HOME using $FUROSHIKI_HOME
|
8
|
-
FUROSHIKI_SPEC_DIR = Pathname.new(__FILE__).dirname.expand_path.to_s
|
9
|
-
ENV['FUROSHIKI_HOME'] = FUROSHIKI_SPEC_DIR
|
10
|
-
|
11
|
-
# Guards for running or not running specs. Specs in the guarded block only
|
12
|
-
# run if the guard conditions are met.
|
13
|
-
#
|
14
|
-
module Guard
|
15
|
-
# Runs specs only if platform matches
|
16
|
-
#
|
17
|
-
# @example
|
18
|
-
# platform_is :windows do
|
19
|
-
# it "does something only on windows" do
|
20
|
-
# # specification
|
21
|
-
# end
|
22
|
-
# end
|
23
|
-
def platform_is(platform)
|
24
|
-
yield if self.send "platform_is_#{platform.to_s}"
|
25
|
-
end
|
26
|
-
|
27
|
-
# Runs specs only if platform does not match
|
28
|
-
#
|
29
|
-
# @example
|
30
|
-
# platform_is_not :windows do
|
31
|
-
# it "does something only on posix systems" do
|
32
|
-
# # specification
|
33
|
-
# end
|
34
|
-
# end
|
35
|
-
def platform_is_not(platform)
|
36
|
-
yield unless self.send "platform_is_#{platform.to_s}"
|
37
|
-
end
|
38
|
-
|
39
|
-
def platform_is_windows
|
40
|
-
return RbConfig::CONFIG['host_os'] =~ /windows|mswin/i
|
41
|
-
end
|
42
|
-
|
43
|
-
def platform_is_linux
|
44
|
-
return RbConfig::CONFIG['host_os'] =~ /linux/i
|
45
|
-
end
|
46
|
-
|
47
|
-
def platform_is_osx
|
48
|
-
return RbConfig::CONFIG['host_os'] =~ /darwin/i
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
include Guard
|
53
|
-
|
54
|
-
module PackageHelpers
|
55
|
-
# need these values from a context block, so let doesn't work
|
56
|
-
def spec_dir
|
57
|
-
Pathname.new(__FILE__).join('..').cleanpath
|
58
|
-
end
|
59
|
-
|
60
|
-
def input_dir
|
61
|
-
spec_dir.join 'support', 'zip'
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
module ZipHelpers
|
66
|
-
include PackageHelpers
|
67
|
-
# dir = Pathname.new('spec/support/zip')
|
68
|
-
# add_trailing_slash(dir) #=> '/path/to/spec/support/zip/'
|
69
|
-
def add_trailing_slash(dir)
|
70
|
-
dir.to_s + "/"
|
71
|
-
end
|
72
|
-
|
73
|
-
def relative_input_paths(from_dir)
|
74
|
-
Pathname.glob(input_dir + "**/*").map do |p|
|
75
|
-
directory = true if p.directory?
|
76
|
-
relative_path = p.relative_path_from(from_dir).to_s
|
77
|
-
relative_path = add_trailing_slash(relative_path) if directory
|
78
|
-
relative_path
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
spec_root = File.dirname(__FILE__)
|
84
|
-
Dir["#{spec_root}/support/**/*.rb"].each { |f| require f }
|
85
|
-
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require 'yaml'
|
2
|
-
require 'pathname'
|
3
|
-
require 'furoshiki/util'
|
4
|
-
|
5
|
-
shared_context 'generic furoshiki config' do
|
6
|
-
before :all do
|
7
|
-
@config_filename = Pathname.new(__FILE__).join('../../fixtures/config.yaml').cleanpath
|
8
|
-
yaml = YAML.load(@config_filename.open)
|
9
|
-
@custom_config = Object.new.extend(Furoshiki::Util).deep_symbolize_keys(yaml)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
shared_context 'generic furoshiki project' do
|
14
|
-
before :all do
|
15
|
-
@app_dir = Pathname.new(__FILE__).join('../../fixtures/test_project')
|
16
|
-
@output_dir = @app_dir.join('pkg')
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
data/spec/support/shared_zip.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
include ZipHelpers
|
2
|
-
|
3
|
-
shared_context 'package' do
|
4
|
-
before :all do
|
5
|
-
@app_dir = spec_dir.join 'fixtures/test_app'
|
6
|
-
@output_dir = @app_dir.join 'pkg'
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
shared_context 'zip' do
|
11
|
-
include_context 'package'
|
12
|
-
let(:output_file) { @output_dir.join 'zip_directory_spec.zip' }
|
13
|
-
let(:zip) { Zip::File.open output_file }
|
14
|
-
|
15
|
-
before :all do
|
16
|
-
@output_dir.mkpath
|
17
|
-
@output_file = @output_dir.join 'zip_directory_spec.zip'
|
18
|
-
end
|
19
|
-
|
20
|
-
after :all do
|
21
|
-
FileUtils.rm_rf @output_dir
|
22
|
-
end
|
23
|
-
end
|
data/spec/support/zip/a/a.rb
DELETED
data/spec/support/zip/a/b/b.png
DELETED
Binary file
|
data/spec/support/zip/a/b/c/c.rb
DELETED
data/spec/util_spec.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
require_relative 'spec_helper'
|
2
|
-
|
3
|
-
describe "Utility functions" do
|
4
|
-
let(:utils) { Object.new.extend(Furoshiki::Util) }
|
5
|
-
let(:hash_with_string_keys) {
|
6
|
-
{
|
7
|
-
'one' => 1,
|
8
|
-
:two => 2,
|
9
|
-
'three' => {
|
10
|
-
'a' => 'apple',
|
11
|
-
:b => 'banana',
|
12
|
-
'c' => :cantaloupe
|
13
|
-
}
|
14
|
-
}
|
15
|
-
}
|
16
|
-
let(:hash_with_symbolized_keys) {
|
17
|
-
{
|
18
|
-
:one => 1,
|
19
|
-
:two => 2,
|
20
|
-
:three => {
|
21
|
-
:a => 'apple',
|
22
|
-
:b => 'banana',
|
23
|
-
:c => :cantaloupe
|
24
|
-
}
|
25
|
-
}
|
26
|
-
}
|
27
|
-
let(:hash_of_defaults) {
|
28
|
-
{
|
29
|
-
:one => 'uno',
|
30
|
-
:three => 'tres',
|
31
|
-
:four => 'cuatro'
|
32
|
-
}
|
33
|
-
}
|
34
|
-
let(:merged_hash_with_symbolized_keys) {
|
35
|
-
{
|
36
|
-
:one => 1,
|
37
|
-
:two => 2,
|
38
|
-
:three => {
|
39
|
-
:a => 'apple',
|
40
|
-
:b => 'banana',
|
41
|
-
:c => :cantaloupe
|
42
|
-
},
|
43
|
-
:four => 'cuatro'
|
44
|
-
}
|
45
|
-
}
|
46
|
-
|
47
|
-
it "symbolizes hash keys" do
|
48
|
-
symbolized = utils.deep_symbolize_keys(hash_with_string_keys)
|
49
|
-
expect(symbolized).to eq(hash_with_symbolized_keys)
|
50
|
-
end
|
51
|
-
|
52
|
-
it "merges with hash of defaults" do
|
53
|
-
merged = utils.merge_with_symbolized_keys(hash_of_defaults, hash_with_string_keys)
|
54
|
-
expect(merged).to eq(merged_hash_with_symbolized_keys)
|
55
|
-
end
|
56
|
-
|
57
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'fileutils'
|
3
|
-
require 'furoshiki/zip'
|
4
|
-
|
5
|
-
describe Furoshiki::Zip::DirectoryContents do
|
6
|
-
|
7
|
-
context "output file" do
|
8
|
-
include_context 'zip'
|
9
|
-
|
10
|
-
before :all do
|
11
|
-
zip_directory_contents = Furoshiki::Zip::DirectoryContents.new input_dir, @output_file
|
12
|
-
zip_directory_contents.write
|
13
|
-
@zip = Zip::File.open @output_file
|
14
|
-
end
|
15
|
-
|
16
|
-
it "exists" do
|
17
|
-
expect(@output_file).to exist
|
18
|
-
end
|
19
|
-
|
20
|
-
it "does not include input directory without parents" do
|
21
|
-
expect(@zip.entries.map(&:name)).not_to include(add_trailing_slash input_dir.basename)
|
22
|
-
end
|
23
|
-
|
24
|
-
relative_input_paths(input_dir).each do |path|
|
25
|
-
it "includes all children of input directory" do
|
26
|
-
expect(@zip.entries.map(&:name)).to include(path)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
data/spec/zip/directory_spec.rb
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'fileutils'
|
3
|
-
require 'furoshiki/zip'
|
4
|
-
|
5
|
-
describe Furoshiki::Zip::Directory do
|
6
|
-
subject { Furoshiki::Zip::Directory.new input_dir, output_file }
|
7
|
-
|
8
|
-
context "output file" do
|
9
|
-
include_context 'zip'
|
10
|
-
|
11
|
-
before :all do
|
12
|
-
zip_directory = Furoshiki::Zip::Directory.new input_dir, @output_file
|
13
|
-
zip_directory.write
|
14
|
-
@zip = ::Zip::File.open @output_file
|
15
|
-
end
|
16
|
-
|
17
|
-
it "exists" do
|
18
|
-
expect(@output_file).to exist
|
19
|
-
end
|
20
|
-
|
21
|
-
it "includes input directory without parents" do
|
22
|
-
expect(@zip.entries.map(&:name)).to include(add_trailing_slash input_dir.basename)
|
23
|
-
end
|
24
|
-
|
25
|
-
relative_input_paths(input_dir.parent).each do |path|
|
26
|
-
it "includes all children of input directory" do
|
27
|
-
expect(@zip.entries.map(&:name)).to include(path)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
it "doesn't include extra files" do
|
32
|
-
number_of_files = Dir.glob("#{input_dir}/**/*").push(input_dir).length
|
33
|
-
expect(@zip.entries.length).to eq(number_of_files)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|