requires 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -1
  3. data/lib/requires.rb +4 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0dcd409a64090cdeca64d137ee530ea889ab4e33021692e4007534053f1df885
4
- data.tar.gz: 531d02116c822e0ce797ef78d6b1dd850325effff515640aca6ea8043c2b87e9
3
+ metadata.gz: 57f35e16c778fa287257e4ea4b2bbaab9b38f02e56c54b21fe9e85045ead97e2
4
+ data.tar.gz: 3a744da142ac5de0a32f44504a3459c1111cf4e6b11a0cf3f6de9745b33872d7
5
5
  SHA512:
6
- metadata.gz: e41d42d2074c6e698c02677da5532be33380c49e2c859a8f233eb7617aaab50bddb3540e60737c87354f469b577f0962f70a77447b307ee6feb0c6fb87ebf389
7
- data.tar.gz: 5edcd8ac9091f3e2a56c77322f1b9682dd8a532ec83ae2a23d9047aef0b3edd4aa955edafaa63ac4553808fc2b146d5b765ce1b163216b9b58ef72ddf948faf9
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-dierectory'
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'
@@ -6,7 +6,10 @@ def requires(*items)
6
6
 
7
7
  Dir.chdir base_dir do
8
8
  items.each do |item|
9
- if File.directory? item
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.1.1
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: 2019-04-23 00:00:00.000000000 Z
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