jarbler 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6c86b6661dda0e9669619c5bac4a954a400dbeed028cb1944b9f0b781b4771d
4
- data.tar.gz: 987e8bd4e2bd388f1b1642a8b9e911e9774e4c9870eb56c3bb85d053de1e1e1b
3
+ metadata.gz: ff7c6489ae577a03079ca5976e6f8ea2c311593aa2754590b83e37a446f68bc9
4
+ data.tar.gz: 840b7720151675d538e08473857d7fae6a4342f478cf84473ffc231f2414fc46
5
5
  SHA512:
6
- metadata.gz: 4810b94071beeda3eea5fc513646b63033129e38b258b0d274e4b3384705f3b1034ff7a706cf90317c6c0dd5086fea572652c7b89ddeba62bb3faebc68d1f69d
7
- data.tar.gz: b6054b374c79cc5f1d4976d1b486fcc4730e088e54285edb3156f6cd592ca2bf8c665c8fcfbec383fc4e9e2132268744dec11fdc1e81b5fbf0dbdf0d9c5cd40d
6
+ metadata.gz: 444d52de14b8316967b5184c9e814e40d52bcb780d84ef74dc148befea457232182bf83b01ec8c64540959af7d2522d2e20417ed9589771e8cd63779ffd60266
7
+ data.tar.gz: 991f7a004c5383846504ff98c7b0c0cb508e50530d64887e4418dd7b9ec2e788764303fa7358eb43d8d66ec3143118da038ee8cf8b03e5743dbc7b83175ff87b
data/CHANGELOG.md CHANGED
@@ -7,3 +7,8 @@
7
7
  ## [0.1.1] - 2023-04-24
8
8
 
9
9
  - Fixed the bug 'java.lang.ClassNotFoundException: org.jruby.Main' with Windows
10
+
11
+ ## [0.1.2] - 2023-04-24
12
+
13
+ - extract valid Gem paths from Bundler instead of using the environment variable GEM_PATH
14
+
@@ -86,28 +86,28 @@ module Jarbler
86
86
  # @param [String] app_root Application root directory
87
87
  # @return [Array] Array of Gem locations
88
88
  def collect_gem_search_locations(app_root)
89
- # Search locations of gems in Gemfile.lock
90
- possible_gem_search_locations = []
91
- # Add possible local config first in search list
92
- possible_gem_search_locations << bundle_config_bundle_path(app_root) if bundle_config_bundle_path(app_root)
93
- ENV['GEM_PATH'].split(':').each do |gem_path|
94
- possible_gem_search_locations << gem_path
95
- end
89
+ # All active search locations for Gems
90
+ Bundler.setup
91
+ possible_gem_search_locations = Gem.paths.path
96
92
  debug "Possible Gem locations: #{possible_gem_search_locations}"
97
93
  gem_search_locations = []
98
94
  # Check where inside this location the gems may be installed
99
95
  possible_gem_search_locations.each do |gem_search_location|
100
- valid_gem_search_location = nil # No valid path found yet
101
- Find.find(gem_search_location) do |path|
102
- if File.directory?(path) && File.exist?("#{path}/specifications") && File.exist?("#{path}/gems")
103
- valid_gem_search_location = path # Found a valid path
104
- Find.prune # Do not search deeper
96
+ if File.exist?(gem_search_location) && File.directory?(gem_search_location)
97
+ valid_gem_search_location = nil # No valid path found yet
98
+ Find.find(gem_search_location) do |path|
99
+ if File.directory?(path) && File.exist?("#{path}/specifications") && File.exist?("#{path}/gems")
100
+ valid_gem_search_location = path # Found a valid path
101
+ Find.prune # Do not search deeper
102
+ end
103
+ end
104
+ if valid_gem_search_location
105
+ gem_search_locations << valid_gem_search_location
106
+ else
107
+ debug "No valid gem location found in #{gem_search_location}"
105
108
  end
106
- end
107
- if valid_gem_search_location
108
- gem_search_locations << valid_gem_search_location
109
109
  else
110
- debug "No valid gem location found in #{gem_search_location}"
110
+ debug("Gem location #{gem_search_location} does not exist or is not a directory")
111
111
  end
112
112
  end
113
113
  debug "Valid Gem locations: #{gem_search_locations}"
@@ -193,19 +193,6 @@ module Jarbler
193
193
  @config
194
194
  end
195
195
 
196
- # Check if there is an additional local bundle path in .bundle/config
197
- def bundle_config_bundle_path(rails_root)
198
- bundle_path = nil # default
199
- if File.exist?("#{rails_root}/.bundle/config")
200
- bundle_config = YAML.load_file("#{rails_root}/.bundle/config")
201
- if bundle_config && bundle_config['BUNDLE_PATH']
202
- bundle_path = "#{rails_root}/#{bundle_config['BUNDLE_PATH']}"
203
- debug "Local Gem path configured in #{rails_root}/.bundle/config: #{bundle_path}"
204
- end
205
- end
206
- bundle_path
207
- end
208
-
209
196
  # Copy the jruby-jars to the staging directory
210
197
  # @param [String] staging_dir Path to the staging directory
211
198
  # @param [Array] gem_search_locations Array of Gem locations to look for jRuby jars
@@ -219,7 +206,7 @@ module Jarbler
219
206
  break
220
207
  end
221
208
  end
222
- raise "Could not determine location of jRuby jars for release '#{config.jruby_version}' in the following output:\n#{lines}" unless jruby_jars_location
209
+ raise "Could not determine location of jRuby jars for release '#{config.jruby_version}' in the following locations:\n#{gem_search_locations}" unless jruby_jars_location
223
210
  file_utils_copy("#{jruby_jars_location}/lib/jruby-core-#{config.jruby_version}-complete.jar", staging_dir)
224
211
  file_utils_copy("#{jruby_jars_location}/lib/jruby-stdlib-#{config.jruby_version}.jar", staging_dir)
225
212
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Jarbler
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  VERSION_DATE = "2023-04-24"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jarbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Ramm