appbundler 0.1.0.beta.0 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NWM2ZTg4NzM2MDA5Njg1ZGFmMmMzZTZhNzFiZGQ1ZTQxMGM5NDcxNw==
5
- data.tar.gz: !binary |-
6
- MDMxNTdmODAwZmFjZjA1NzQ5NDAwNjUzZjU1NjZiNDY5N2U3YWQ2Mw==
2
+ SHA1:
3
+ metadata.gz: 86d75deec625cd4f7fdc41c6161c5a38a8fec6b1
4
+ data.tar.gz: 4b70ddd8a01388b0fff3065eecb9603d6c1de9aa
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- Y2JjYTRkYjEwMjA5MDZjMzYyZmU5YTExYjZlY2RmNDZjMWNhZjQ0YjE2YzRm
10
- OGE0YTFjYjc2Y2M1MWMzNTcxY2IyODU3YTIxY2Q4NzEyY2U2M2ZhODhhOTRl
11
- NmViNjk0YjA5Y2U4YTE4NzUzNDc3ZWQwOTA3YzEyNmQ4MDFlNWE=
12
- data.tar.gz: !binary |-
13
- Yjk3ZjE1MzU1NzA2ZGEwOTllYjljZjI5YzVlZWU1MTg3OWY5MWNhOGU4N2Q0
14
- ODYxNWNhNmM4YzY0NjM2YzIwM2JmZjk4YzlhYzk1YmY3ZTg5Njg0ODAxYmNl
15
- ZTFhZjFmY2UwNDBjYmYxM2ZkMjliMTdhZDVlZjQ5YzNhYjMxNDc=
6
+ metadata.gz: 44f9801dd4a70e8da39508320cbf92e6d12936b3269aa20de18a6ec52bbc2d61ca7975ef665d099c884e5a65b40a2c8f2c380f610a5b08a50e7e0b883f196c44
7
+ data.tar.gz: d21e8196688d16948f569bfa514f67703c75d29ce23aff29f979c788b483c495cd4ae510fee5d982cd44776bb327f0881ff860dd7f26d92bad0a3f843ce22390
@@ -45,8 +45,30 @@ module Appbundler
45
45
  File.join(app_root, "Gemfile.lock")
46
46
  end
47
47
 
48
+ def ruby
49
+ Gem.ruby
50
+ end
51
+
52
+ def batchfile_stub
53
+ ruby_relpath_windows = ruby_relative_path.gsub('/', '\\')
54
+ <<-E
55
+ @ECHO OFF
56
+ "%~dp0\\#{ruby_relpath_windows}" "%~dpn0" %*
57
+ E
58
+ end
59
+
60
+ # Relative path from #target_bin_dir to #ruby. This is used to
61
+ # generate batch files for windows in a way that the package can be
62
+ # installed in a custom location. On Unix we don't support custom
63
+ # install locations so this isn't needed.
64
+ def ruby_relative_path
65
+ ruby_pathname = Pathname.new(ruby)
66
+ bindir_pathname = Pathname.new(target_bin_dir)
67
+ ruby_pathname.relative_path_from(bindir_pathname).to_s
68
+ end
69
+
48
70
  def shebang
49
- "#!#{Gem.ruby}\n"
71
+ "#!#{ruby}\n"
50
72
  end
51
73
 
52
74
  # A specially formatted comment that documents the format version of the
@@ -1,3 +1,3 @@
1
1
  module Appbundler
2
- VERSION = "0.1.0.beta.0"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -61,6 +61,10 @@ describe Appbundler do
61
61
  app.stub(:gemfile_lock_specs).and_return(all_specs)
62
62
  end
63
63
 
64
+ it "finds the running ruby interpreter" do
65
+ expect(app.ruby).to eq(Gem.ruby)
66
+ end
67
+
64
68
  it "finds all runtime dependencies of the app" do
65
69
  # we want to find the minimum set of gems that we need to activate to run
66
70
  # the application. To do this, we look at the app's runtime deps and
@@ -98,6 +102,27 @@ describe Appbundler do
98
102
  expect(app.runtime_activate).to include(expected)
99
103
  end
100
104
 
105
+ context "on windows" do
106
+
107
+ let(:target_bindir) { "C:/opscode/chef/bin" }
108
+
109
+ before do
110
+ app.stub(:ruby).and_return("C:/opscode/chef/embedded/bin/ruby.exe")
111
+ end
112
+
113
+ it "computes the relative path to ruby" do
114
+ expect(app.ruby_relative_path).to eq("../embedded/bin/ruby.exe")
115
+ end
116
+
117
+ it "generates a batchfile stub" do
118
+ expected_batch_code=<<-E
119
+ @ECHO OFF
120
+ "%~dp0\\..\\embedded\\bin\\ruby.exe" "%~dpn0" %*
121
+ E
122
+ expect(app.batchfile_stub).to eq(expected_batch_code)
123
+ end
124
+ end
125
+
101
126
  end
102
127
 
103
128
  context "when created with the example application" do
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appbundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.beta.0
4
+ version: 0.1.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-02-28 00:00:00.000000000 Z
11
+ date: 2014-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
@@ -42,14 +42,14 @@ dependencies:
42
42
  name: pry
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
@@ -107,17 +107,17 @@ require_paths:
107
107
  - lib
108
108
  required_ruby_version: !ruby/object:Gem::Requirement
109
109
  requirements:
110
- - - ! '>='
110
+ - - '>='
111
111
  - !ruby/object:Gem::Version
112
112
  version: '0'
113
113
  required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ! '>'
115
+ - - '>='
116
116
  - !ruby/object:Gem::Version
117
- version: 1.3.1
117
+ version: '0'
118
118
  requirements: []
119
119
  rubyforge_project:
120
- rubygems_version: 2.2.0
120
+ rubygems_version: 2.0.3
121
121
  signing_key:
122
122
  specification_version: 4
123
123
  summary: Extracts a dependency solution from bundler's Gemfile.lock to speed gem activation