theusual 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/theusual.rb +15 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d06bb83b87d5c6ad41d336bde87d395c5df640a8
|
4
|
+
data.tar.gz: c32022f2e85c46f58ac6e787567094dfe6d1c252
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
+
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).
|
30
|
+
modules.flatten.map(&:to_s).map do |_module|
|
31
31
|
raise ArgumentError unless MODULES.include? _module
|
32
32
|
|
33
|
-
|
34
|
-
|
33
|
+
begin
|
34
|
+
# load standard lib
|
35
|
+
require _module if needs_load.include? _module
|
35
36
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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.
|
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-
|
11
|
+
date: 2017-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|