need 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +5 -0
- data/Manifest.txt +3 -1
- data/README.txt +3 -1
- data/Rakefile +1 -1
- data/lib/need.rb +2 -2
- data/test/test_files/file_a.rb +1 -0
- data/test/test_files/file_b.rb +3 -0
- metadata +6 -4
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/README.txt
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
= need
|
2
2
|
|
3
3
|
* http://need.rubyforge.org
|
4
|
+
* source code - http://github.com/dfg59/need/tree/master
|
4
5
|
|
5
6
|
== DESCRIPTION:
|
6
7
|
|
@@ -31,7 +32,8 @@ location of your file and correctly perform your relative require for you.
|
|
31
32
|
|
32
33
|
== INSTALL:
|
33
34
|
|
34
|
-
* sudo gem install need
|
35
|
+
* rubyforge - sudo gem install need
|
36
|
+
* github - sudo gem install dfg59-need --source=http://gems.github.com
|
35
37
|
|
36
38
|
== LICENSE:
|
37
39
|
|
data/Rakefile
CHANGED
@@ -7,7 +7,7 @@ require './lib/need.rb'
|
|
7
7
|
Hoe.new('need', Need::VERSION) do |p|
|
8
8
|
p.rubyforge_name = 'need'
|
9
9
|
p.author = 'Drew Olson'
|
10
|
-
p.email = '
|
10
|
+
p.email = 'drew@drewolson.org'
|
11
11
|
p.summary = 'Need makes relative requries just work'
|
12
12
|
p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n")
|
13
13
|
p.url = "http://need.rubyforge.org"
|
data/lib/need.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
module Need
|
2
|
-
VERSION = '1.0.
|
2
|
+
VERSION = '1.0.3'
|
3
3
|
|
4
4
|
# need takes a block which should contain a string of the relative path to the file
|
5
5
|
# you wish to need.
|
6
6
|
def need(&block)
|
7
|
-
require File.expand_path(File.join(File.dirname(eval("__FILE__",block
|
7
|
+
require File.expand_path(File.join(File.dirname(eval("__FILE__",block)),block.call))
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
@@ -0,0 +1 @@
|
|
1
|
+
need{"file_b"}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: need
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Drew Olson
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-05-23 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -22,7 +22,7 @@ dependencies:
|
|
22
22
|
version: 1.5.1
|
23
23
|
version:
|
24
24
|
description: "== DESCRIPTION: Need makes ruby relative requires just work. Simply need a file with a relative path and the file will always be required correctly, regardless of what file your application is being launched through. Typically, ruby projects would unshift lib onto $PATH or use the File.dirname(__FILE__) trick. Using need means you don't have to worry about either of these. Assume you have two files, one directly in lib and the other in lib/extensions. Let's assume that file_a in lib requires file_b, in lib/extensions. Previously, you would doing some crazy load path unshifting or use the __FILE__ trick to make these requires flexible enough to work when your app is being accessed by rake, through a test suite, or required as a gem. Now, just use need. In file_a: need{\"extensions/file_b\"}"
|
25
|
-
email:
|
25
|
+
email: drew@drewolson.org
|
26
26
|
executables: []
|
27
27
|
|
28
28
|
extensions: []
|
@@ -37,6 +37,8 @@ files:
|
|
37
37
|
- README.txt
|
38
38
|
- Rakefile
|
39
39
|
- lib/need.rb
|
40
|
+
- test/test_files/file_a.rb
|
41
|
+
- test/test_files/file_b.rb
|
40
42
|
- test/test_need.rb
|
41
43
|
has_rdoc: true
|
42
44
|
homepage: http://need.rubyforge.org
|
@@ -61,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
63
|
requirements: []
|
62
64
|
|
63
65
|
rubyforge_project: need
|
64
|
-
rubygems_version: 1.
|
66
|
+
rubygems_version: 1.1.1
|
65
67
|
signing_key:
|
66
68
|
specification_version: 2
|
67
69
|
summary: Need makes relative requries just work
|