requires 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/lib/requires.rb +4 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57f35e16c778fa287257e4ea4b2bbaab9b38f02e56c54b21fe9e85045ead97e2
|
4
|
+
data.tar.gz: 3a744da142ac5de0a32f44504a3459c1111cf4e6b11a0cf3f6de9745b33872d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7f8e780f10352145323af0e402935d12ddb31b7a335fcb8ecc4e63d76f40118a53a6d1cd0127edb5aa9d9bdfef39bc20e3589b5e6bf9905b5d4d7d095e5321b
|
7
|
+
data.tar.gz: 7d4aa0fb6adcf3bf6725d2b78d2798326e3ba0de6ca83ce155a376348bb56c23efd2d163ed948a068f9b44e0dfe39ba2a5db9090c4958449aa14c7e26446a254
|
data/README.md
CHANGED
@@ -13,7 +13,10 @@ It lets you...
|
|
13
13
|
requires 'any_file', 'with/or/without/extension.rb'
|
14
14
|
|
15
15
|
# ...require directories
|
16
|
-
requires 'first/directory', 'second-
|
16
|
+
requires 'first/directory', 'second-directory'
|
17
|
+
|
18
|
+
# ...require with a glob
|
19
|
+
requires 'base_*', 'directory/*_base'
|
17
20
|
|
18
21
|
# ...require any other library
|
19
22
|
requires 'yaml', 'lib/important', 'lib'
|
data/lib/requires.rb
CHANGED
@@ -6,7 +6,10 @@ def requires(*items)
|
|
6
6
|
|
7
7
|
Dir.chdir base_dir do
|
8
8
|
items.each do |item|
|
9
|
-
if
|
9
|
+
if item.include? '*'
|
10
|
+
item += ".rb" unless item.end_with? '.rb'
|
11
|
+
Dir["#{item}"].sort.each { |file| require "./#{file}" }
|
12
|
+
elsif File.directory? item
|
10
13
|
Dir["#{item}/**/*.rb"].sort.each { |file| require "./#{file}" }
|
11
14
|
elsif File.file? "#{item}.rb" or File.file? item
|
12
15
|
require "./#{item}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: requires
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A simple gem to require them all!
|
14
14
|
email: db@dannyben.com
|