requirer 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91d015723f1ca0247de1080510189ce95e83ec20
4
- data.tar.gz: 6122f047d0ed1372f48784b10de17d6ff00d772e
3
+ metadata.gz: fb3a02ffae64a6c0e5cbc641c2e1b0a01d8c2d1e
4
+ data.tar.gz: 63e600c6c5b35a9cd137f6cd19d67e2ed486def3
5
5
  SHA512:
6
- metadata.gz: ad62d2e43e4bad173a4ac3f049d8b46c0448c73e75c25127402cd0ceff49f8c812c0f9f2884954785afa668dad4183783fc72cc571cb994a064e6c35b9103441
7
- data.tar.gz: 8b58e49bcca92df28c99344a286f370a593fbea13e8c6b63a1c7dc0356e49580f445aa8917e43e5efe164b3394818e4911e80cdb101e06b8ff56abd703a33610
6
+ metadata.gz: 339112bb76cbeb951b2674c99d96b0cb6105fabd42a97d2073485d7a2e9796cf5d785f0afa923340896523c9fce96e939f664c07813c89930d7d17b6c061bdbf
7
+ data.tar.gz: 950a0570b94340255c9cb8a6994c965e91f04b1af49825b083350be5d156d81dee243952330e5c445367bd9375dab16944d8379919ba7ca9c8e091a80cf60c4f
data/.travis.yml CHANGED
@@ -4,7 +4,7 @@ cache: bundler
4
4
  rvm:
5
5
  - jruby
6
6
  - 2.0.0
7
- - 2.1.0
7
+ - 2.1.5
8
8
  - 2.2.0
9
9
 
10
10
  script: 'bundle exec rake'
data/lib/requirer.rb CHANGED
@@ -1,8 +1,8 @@
1
- require "requirer/version"
2
-
3
- class DirUtilsException < StandardError ; end
1
+ require_relative "requirer/version"
4
2
 
5
3
  module Requirer
4
+ class DirUtilsException < StandardError ; end
5
+
6
6
  def dir_tree(path)
7
7
  # "dir_tree #{path}".logit
8
8
  path = find_dir_with(path, $LOAD_PATH)
@@ -1,3 +1,3 @@
1
1
  module Requirer
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -1,25 +1,25 @@
1
- warn 'in requirer_spec'
2
1
  require 'spec_helper'
3
2
 
3
+ # add directory to load_path where test files to load exist
4
4
  $LOAD_PATH.unshift 'spec/dirs_to_require'
5
5
 
6
6
  describe Requirer do
7
7
  before { $bucket = [] }
8
8
 
9
9
  describe 'require directory with depth 1' do
10
- it 'is loaded' do
10
+ it 'file is loaded' do
11
11
  dir_tree 'dir_depth_1'
12
12
  expect($bucket).to eq(['depth_one'])
13
13
  end
14
14
 
15
- it 'is loaded only once even though required twice' do
15
+ it 'file is loaded only once even though required twice' do
16
16
  dir_tree 'dir_depth_1_only'
17
17
  dir_tree 'dir_depth_1_only'
18
18
  expect($bucket).to eq(['depth_one'])
19
19
  end
20
20
  end
21
21
 
22
- describe 'require directory with depth 1' do
22
+ describe 'files in each level of directory tree is loaded' do
23
23
  it 'is breadth first' do
24
24
  dir_tree 'dir_depth_3'
25
25
  expect($bucket).to eq(['depth_one(2)', 'depth_two', 'depth_three'])
@@ -27,7 +27,7 @@ describe Requirer do
27
27
  end
28
28
 
29
29
  describe 'require non-existent directory' do
30
- it 'expect error' do
30
+ it 'raises an error' do
31
31
  expect{ dir_tree('nobody-is-home') }.to raise_error(DirUtilsException)
32
32
  end
33
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: requirer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Murphy-Dye