theusual 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/theusual.rb +15 -9
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f75c8e5f5477154ae8374e32dfc258210db9e810
4
- data.tar.gz: 8cbbfe9b3d3791bb856c40ad33ddb7cc2040de8c
3
+ metadata.gz: d06bb83b87d5c6ad41d336bde87d395c5df640a8
4
+ data.tar.gz: c32022f2e85c46f58ac6e787567094dfe6d1c252
5
5
  SHA512:
6
- metadata.gz: 5435fb0b05648f38175df7ba94df2aeb5804a6eea6c81e6a12db0eb1c90f18878d25a584bcfd32a5f1ba04c12dde6f623e12eb2cc218f463c46901d7b2086bbb
7
- data.tar.gz: b9344a37d8ab05a0c28849b808363ce2196b0aa7bf0152bceeb9287fa0b836889180506264da906d2394cb32375a601a571a399bb418f75e7eeadf3722bceaa0
6
+ metadata.gz: 2c7cc0bb584f34b2afe291d9e49e1c58c5ed995368259db92061ec197b8e9cdbff47079ab384b92ee57c1a8fc69d000f85b7514bb91e9d9a5a8df7bc76f7e4bf
7
+ data.tar.gz: ae1c5c2545795590cfd5f34cd821247de74baa3908d8b9639a3d51e22da5c3f372bf7ae2c4cbf2020836e127a1a0b6b5c1baba4814ac455dc13a68b48cd22f5b
data/lib/theusual.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module TheUsual
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
 
4
4
  MODULES = [
5
5
  'array',
@@ -23,19 +23,25 @@ module TheUsual
23
23
  'net/ssh' => 'ssh',
24
24
  }
25
25
 
26
- raise ArgumentError if modules.empty?
26
+ raise ArgumentError 'did you mean load(:all) ?' if modules.empty?
27
27
 
28
28
  modules = MODULES if [:all, 'all', '*'].include? modules.first
29
29
 
30
- modules.flatten.map(&:to_s).each do |_module|
30
+ modules.flatten.map(&:to_s).map do |_module|
31
31
  raise ArgumentError unless MODULES.include? _module
32
32
 
33
- # load standard lib
34
- require _module if needs_load.include? _module
33
+ begin
34
+ # load standard lib
35
+ require _module if needs_load.include? _module
35
36
 
36
- # monkey patch
37
- name = paths[_module] || _module
38
- require_relative "theusual/#{name}.rb"
39
- end
37
+ # monkey patch
38
+ name = paths[_module] || _module
39
+ require_relative "theusual/#{name}.rb"
40
+
41
+ _module
42
+ rescue LoadError
43
+ # base gem not installed...skip monkey patch
44
+ end
45
+ end.compact
40
46
  end
41
47
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: theusual
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Pepper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-18 00:00:00.000000000 Z
11
+ date: 2017-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake