brpm_content_framework 0.2.10 → 0.2.11
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 +8 -8
- data/config.yml +1 -1
- data/lib/module_installer.rb +13 -11
- data/tests_no_bundler/brpm_script_executor_spec.rb +0 -2
- data/tests_no_bundler/module_installer_spec.rb +10 -0
- data/tests_no_bundler/spec_helper.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODRkMTkyY2M4OTk1ZTJmNDdlNzIxYTk2ZDMzZjFmNzJhZGQyMjcyMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTk4NGI4N2YyNDFiNTIzYjM4YTI0M2FlNDcyMTdiMWZmMzg3MzczNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjJkYTFiODNlMTBkZjM5MjA5Y2I2MzNkZTg0NjU4NTQ2ZmI0NWM1MDM3MWU4
|
10
|
+
Zjg0MTMyNjIzN2U4OWU3MmMzMzI2ZmU1MjhmNDk2ZWM5NmJiMjFjZDg4NWVj
|
11
|
+
MTJmZDA5M2Q5MmIyNDVmZDc3ODIyYjkwMTc1ZGY0OTk4NjgxOTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODgwNDk2ZjUzZTRlOTJmNjIwYzJhZmM1ZDFmYWE1MGFkNDFhNzllYzgwZjUx
|
14
|
+
ZmJmZjIzZmI4NDljODUxN2RiMzA0NzkxMzNlMDIyMTlmMTRkMjcxZTJkMGE4
|
15
|
+
NDBiYTk3ZWJkMGJiY2RhY2EzZjgxMjZjMmNhOTBkMmFhM2ZkMzM=
|
data/config.yml
CHANGED
data/lib/module_installer.rb
CHANGED
@@ -12,7 +12,7 @@ class ModuleInstaller
|
|
12
12
|
|
13
13
|
brpm_content_spec = specs.find { |spec| spec.name == "brpm_content_framework" } if specs
|
14
14
|
|
15
|
-
|
15
|
+
install_bundle(module_spec)
|
16
16
|
else
|
17
17
|
module_name = module_name_or_path
|
18
18
|
module_spec = Gem::Specification.find_by_name(module_name)
|
@@ -152,18 +152,20 @@ class ModuleInstaller
|
|
152
152
|
return module_spec, specs
|
153
153
|
end
|
154
154
|
|
155
|
-
def
|
156
|
-
|
155
|
+
def install_bundle(spec)
|
156
|
+
gemfile_path = File.join(spec.gem_dir, "Gemfile")
|
157
157
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
result = BrpmAuto.execute_shell(command)
|
158
|
+
unless File.exists?(gemfile_path)
|
159
|
+
raise "This module doesn't have a Gemfile. Expected it at #{gemfile_path}."
|
160
|
+
end
|
162
161
|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
162
|
+
command = "cd #{spec.gem_dir}; bundle install"
|
163
|
+
BrpmAuto.log "Found a Gemfile so executing command '#{command}'..."
|
164
|
+
result = BrpmAuto.execute_shell(command)
|
165
|
+
|
166
|
+
BrpmAuto.log result["stdout"] if result["stdout"] and !result["stdout"].empty?
|
167
|
+
unless result["status"] == 0
|
168
|
+
raise result["stderr"]
|
167
169
|
end
|
168
170
|
end
|
169
171
|
|
@@ -14,6 +14,7 @@ describe 'Module installer' do
|
|
14
14
|
before(:each) do
|
15
15
|
module_installer = ModuleInstaller.new
|
16
16
|
|
17
|
+
Gem::Specification.reset # Mske sure that modules that were installed by other unit tests are taken into account
|
17
18
|
module_specs = Gem::Specification.find_all_by_name(@module_name)
|
18
19
|
module_specs.each do |module_spec|
|
19
20
|
if module_spec.loaded_from.start_with?(ENV["BRPM_HOME"])
|
@@ -28,6 +29,9 @@ describe 'Module installer' do
|
|
28
29
|
module_installer.install_module(@module_name)
|
29
30
|
|
30
31
|
expect{Gem::Specification.find_by_name(@module_name)}.not_to raise_error #(Gem::LoadError)
|
32
|
+
|
33
|
+
spec = Gem::Specification.find_by_name(@module_name)
|
34
|
+
expect(spec.loaded_from.start_with?(ENV["BRPM_HOME"]))
|
31
35
|
end
|
32
36
|
|
33
37
|
it "should install a specific version of a module from rubygems.org" do
|
@@ -35,6 +39,9 @@ describe 'Module installer' do
|
|
35
39
|
module_installer.install_module(@module_name, @module_version)
|
36
40
|
|
37
41
|
expect{Gem::Specification.find_by_name(@module_name, Gem::Requirement.create(Gem::Version.new(@module_version)))}.not_to raise_error #(Gem::LoadError)
|
42
|
+
|
43
|
+
spec = Gem::Specification.find_by_name(@module_name, Gem::Requirement.create(Gem::Version.new(@module_version)))
|
44
|
+
expect(spec.loaded_from.start_with?(ENV["BRPM_HOME"]))
|
38
45
|
end
|
39
46
|
|
40
47
|
it "should install a module from a local gem file" do
|
@@ -44,5 +51,8 @@ describe 'Module installer' do
|
|
44
51
|
module_installer.install_module("temp/#{@module_name}-#{@module_version}.gem")
|
45
52
|
|
46
53
|
expect{Gem::Specification.find_by_name(@module_name, Gem::Requirement.create(Gem::Version.new(@module_version)))}.not_to raise_error #(Gem::LoadError)
|
54
|
+
|
55
|
+
spec = Gem::Specification.find_by_name(@module_name, Gem::Requirement.create(Gem::Version.new(@module_version)))
|
56
|
+
expect(spec.loaded_from.start_with?(ENV["BRPM_HOME"]))
|
47
57
|
end
|
48
58
|
end
|