appbundler 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/README.md +2 -1
- data/lib/appbundler/app.rb +6 -0
- data/lib/appbundler/version.rb +1 -1
- data/spec/appbundler/app_spec.rb +30 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0348af66452b0695266e8851955c74cb513c6d33
|
4
|
+
data.tar.gz: b433848ae1903bf318a884ec0f9488d2c348b08a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a8a09d3e326fc70173eccf345d80b08d9ac02bb1b06eeafcbb0f59cd9983dc43dc259616f000dd187e9426ba024aefdd92a9ef4c859b4191176893aa1951e7c
|
7
|
+
data.tar.gz: a4aca9f94ff5ce9ab7a57724ef189f6f847e4350fd675b3cdb32c56700d3d8a94917a38bf16910e64713a7f814c6e4097ef9bc99de6dfbace7900a890e9984bc
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -22,7 +22,8 @@ This provides the following benefits:
|
|
22
22
|
|
23
23
|
# Usage
|
24
24
|
|
25
|
-
|
25
|
+
Install via rubygems: `gem install appbundler` or clone this project and
|
26
|
+
bundle install:
|
26
27
|
|
27
28
|
```
|
28
29
|
git clone https://github.com/opscode/appbundler.git
|
data/lib/appbundler/app.rb
CHANGED
@@ -32,6 +32,12 @@ module Appbundler
|
|
32
32
|
File.open(stub_path, "wb", 0755) do |f|
|
33
33
|
f.write(binstub(real_executable_path))
|
34
34
|
end
|
35
|
+
if RUBY_PLATFORM =~ /mswin|mingw|windows/
|
36
|
+
batch_wrapper_path = "#{stub_path}.bat"
|
37
|
+
File.open(batch_wrapper_path, "wb", 0755) do |f|
|
38
|
+
f.write(batchfile_stub)
|
39
|
+
end
|
40
|
+
end
|
35
41
|
end
|
36
42
|
|
37
43
|
executables_to_create
|
data/lib/appbundler/version.rb
CHANGED
data/spec/appbundler/app_spec.rb
CHANGED
@@ -114,13 +114,14 @@ describe Appbundler do
|
|
114
114
|
expect(app.ruby_relative_path).to eq("../embedded/bin/ruby.exe")
|
115
115
|
end
|
116
116
|
|
117
|
-
it "generates
|
117
|
+
it "generates batchfile stub code" do
|
118
118
|
expected_batch_code=<<-E
|
119
119
|
@ECHO OFF
|
120
120
|
"%~dp0\\..\\embedded\\bin\\ruby.exe" "%~dpn0" %*
|
121
121
|
E
|
122
122
|
expect(app.batchfile_stub).to eq(expected_batch_code)
|
123
123
|
end
|
124
|
+
|
124
125
|
end
|
125
126
|
|
126
127
|
end
|
@@ -234,6 +235,34 @@ E
|
|
234
235
|
expect(shellout!(binary_2).stdout).to eq("binary 2 ran\n")
|
235
236
|
end
|
236
237
|
|
238
|
+
context "on windows" do
|
239
|
+
|
240
|
+
let(:expected_ruby_relpath) do
|
241
|
+
app.ruby_relative_path.gsub('/', '\\')
|
242
|
+
end
|
243
|
+
|
244
|
+
let(:expected_batch_code) do
|
245
|
+
<<-E
|
246
|
+
@ECHO OFF
|
247
|
+
"%~dp0\\#{expected_ruby_relpath}" "%~dpn0" %*
|
248
|
+
E
|
249
|
+
end
|
250
|
+
|
251
|
+
before do
|
252
|
+
stub_const("RUBY_PLATFORM", "mingw")
|
253
|
+
end
|
254
|
+
|
255
|
+
it "creates a batchfile wrapper for each executable" do
|
256
|
+
app.write_executable_stubs
|
257
|
+
binary_1 = File.join(target_bindir, "app-binary-1.bat")
|
258
|
+
binary_2 = File.join(target_bindir, "app-binary-2.bat")
|
259
|
+
expect(File.exist?(binary_1)).to be_true
|
260
|
+
expect(File.exist?(binary_2)).to be_true
|
261
|
+
expect(IO.read(binary_1)).to eq(expected_batch_code)
|
262
|
+
expect(IO.read(binary_2)).to eq(expected_batch_code)
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
237
266
|
end
|
238
267
|
|
239
268
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appbundler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- danielsdeleo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|