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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86d75deec625cd4f7fdc41c6161c5a38a8fec6b1
4
- data.tar.gz: 4b70ddd8a01388b0fff3065eecb9603d6c1de9aa
3
+ metadata.gz: 0348af66452b0695266e8851955c74cb513c6d33
4
+ data.tar.gz: b433848ae1903bf318a884ec0f9488d2c348b08a
5
5
  SHA512:
6
- metadata.gz: 44f9801dd4a70e8da39508320cbf92e6d12936b3269aa20de18a6ec52bbc2d61ca7975ef665d099c884e5a65b40a2c8f2c380f610a5b08a50e7e0b883f196c44
7
- data.tar.gz: d21e8196688d16948f569bfa514f67703c75d29ce23aff29f979c788b483c495cd4ae510fee5d982cd44776bb327f0881ff860dd7f26d92bad0a3f843ce22390
6
+ metadata.gz: 4a8a09d3e326fc70173eccf345d80b08d9ac02bb1b06eeafcbb0f59cd9983dc43dc259616f000dd187e9426ba024aefdd92a9ef4c859b4191176893aa1951e7c
7
+ data.tar.gz: a4aca9f94ff5ce9ab7a57724ef189f6f847e4350fd675b3cdb32c56700d3d8a94917a38bf16910e64713a7f814c6e4097ef9bc99de6dfbace7900a890e9984bc
data/.travis.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  rvm:
2
2
  - 1.9.3
3
3
  - 2.0.0
4
- - 2.1.0
4
+ - 2.1.1
5
5
 
6
6
  branches:
7
7
  only:
data/README.md CHANGED
@@ -22,7 +22,8 @@ This provides the following benefits:
22
22
 
23
23
  # Usage
24
24
 
25
- Clone this project (gem coming soon) and bundle install:
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Appbundler
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -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 a batchfile stub" do
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.1.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-03-18 00:00:00.000000000 Z
11
+ date: 2014-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake