stibium-bundled 0.0.4 → 0.0.5

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: 540a8ad588f6dbeb56f350aa54908bd240c2ec1f321d3885bfa1e5884cf45491
4
- data.tar.gz: edfeef841ad795136cf3a6c41ea711f00f6029d160d46fb63197daed1cfb36e3
3
+ metadata.gz: 07b95bed1d5e25b2e7643cd39dad69c98b29d7c890ef4d8438e9f1d2464b97dc
4
+ data.tar.gz: c88884879dc4c99f53616d7cc37c8549b0fde70bd746c29c30ff215a6fb41206
5
5
  SHA512:
6
- metadata.gz: c7839c5a74b6e12312fcf17729d3cf315e9242898d718c59f6501dae93bc34fd1da9cc8b1afe9ec1add479d4bd84115121931ead5a630c18caf54a99cac2d1f6
7
- data.tar.gz: f27014af349f61a57484ed1f4d1d4fb1083c9ef84a0950b7e017f01d0ff82db75c547be623a71e2852fe9d604cc2c538e15d6a1a34ea29a6e5326bc3bada52f3
6
+ metadata.gz: 31d41d66a2011c50a70d2b0e6bf48661456bb5207a02ee31bf9e2c07afb91126e4158cbf736b8502945bcbae549206fe60bc5caee0655a20fb2658efffd1308f
7
+ data.tar.gz: 2cb77bc217b3b140f589374e27e7b3068058412b1e6bf978855ff8bc50a8bd3ad0fb46f1b143fd9de994eda5b5330e71f0612cf0761850281ff3ecbee47096c9
data/README.md CHANGED
@@ -68,13 +68,19 @@ locate it:
68
68
  ```ruby
69
69
  # file: lib/awesome_gem.rb
70
70
 
71
+ autoload(:Pathname, 'pathname')
72
+ autoload(:RbConfig, 'rbconfig')
73
+
71
74
  module AwesomeGem
72
- Pathname.new("#{__dir__}/..").expand_path.tap do |basedir|
75
+ Pathname.new("#{__dir__}/..").expand_path.yield_self do |basedir|
73
76
  begin
74
77
  require 'stibium/bundled'
75
78
  rescue LoadError
76
- basedir.join('{**/,}bundle', RUBY_ENGINE, RUBY_VERSION, '{bundler,}/gems/*/stibium-bundled.gemspec').tap do |s|
77
- Pathname.glob(s).first&.dirname.tap { |gem_dir| require gem_dir.join('lib/stibium/bundled') }
79
+ [
80
+ [RUBY_ENGINE, RbConfig::CONFIG.fetch('ruby_version'), 'bundler/gems/*/stibium-bundled.gemspec'],
81
+ [RUBY_ENGINE, RbConfig::CONFIG.fetch('ruby_version'), 'gems/stibium-bundled-*/lib/'],
82
+ ].map { |parts| basedir.join(*['{**/,}bundle'].concat(parts)) }.yield_self do |patterns|
83
+ Pathname.glob(patterns).first&.dirname.tap { |gem_dir| require gem_dir.join('lib/stibium/bundled') }
78
84
  end
79
85
  end
80
86
 
@@ -41,12 +41,16 @@ class Stibium::Bundled::Bundle::Config::Reader
41
41
  #
42
42
  # @param file [Pathname]
43
43
  #
44
+ # @raise [RuntimeError]
44
45
  # @return [Hash{String => Object}]
45
46
  def scrutinize(file)
46
47
  return {} if ignore_config?
47
48
 
48
49
  return {} unless file.file? and file.readable?
49
50
 
50
- file.read.yield_self { |content| YAML.safe_load(content) }
51
+ file.read
52
+ .yield_self { |content| YAML.safe_load(content) }
53
+ .yield_self { |result| result.nil? ? {} : result }
54
+ .tap { |result| raise RuntimeError, "Hash expected, got #{result.class}" unless result.is_a?(Hash) }
51
55
  end
52
56
  end
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  major: 0
3
3
  minor: 0
4
- patch: 4
4
+ patch: 5
5
5
  authors: ['Dimitri Arrigoni']
6
6
  email: 'dimitri@arrigoni.me'
7
- date: '2021-02-07'
7
+ date: '2021-02-09'
8
8
  summary: 'Denote bundle state'
9
9
  description: 'Denote bundle state and (optionally) load bundler/setup according to the configuration.'
10
10
  homepage: 'https://github.com/SwagDevOps/stibium-bundled'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stibium-bundled
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitri Arrigoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-07 00:00:00.000000000 Z
11
+ date: 2021-02-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Denote bundle state and (optionally) load bundler/setup according to
14
14
  the configuration.