dirge 0.0.4 → 0.0.5
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/README.rdoc +13 -0
- data/Rakefile +2 -16
- data/VERSION +1 -1
- metadata +36 -11
- data/lib/dirge.rb +0 -40
- data/spec/dirge_spec.rb +0 -33
- data/spec/test:2test/test.rb +0 -1
data/README.rdoc
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
=Dirge
|
2
2
|
|
3
|
+
==DEPRECATED
|
4
|
+
|
5
|
+
This library is no longer maintained. Everything it does and so much more is now provided by
|
6
|
+
http://github.com/joshbuddy/callsite. To get back Dirge's specific functionality, you can do the following
|
7
|
+
|
8
|
+
gem install 'callsite'
|
9
|
+
|
10
|
+
And in ruby
|
11
|
+
|
12
|
+
require 'dirge'
|
13
|
+
|
14
|
+
Now everything below will work as-is!
|
15
|
+
|
3
16
|
==Usage
|
4
17
|
|
5
18
|
require 'dirge'
|
data/Rakefile
CHANGED
@@ -6,24 +6,10 @@ begin
|
|
6
6
|
s.email = "joshbuddy@gmail.com"
|
7
7
|
s.homepage = "http://github.com/joshbuddy/dirge"
|
8
8
|
s.authors = ["Joshua Hull"]
|
9
|
-
s.files = FileList["[A-Z]*"
|
9
|
+
s.files = FileList["[A-Z]*"]
|
10
|
+
s.add_dependency 'callsite', '>=0.0.2'
|
10
11
|
end
|
11
12
|
Jeweler::GemcutterTasks.new
|
12
13
|
rescue LoadError
|
13
14
|
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
14
15
|
end
|
15
|
-
|
16
|
-
require 'spec'
|
17
|
-
require 'spec/rake/spectask'
|
18
|
-
task :spec => 'spec:all'
|
19
|
-
namespace(:spec) do
|
20
|
-
Spec::Rake::SpecTask.new(:all) do |t|
|
21
|
-
t.spec_opts ||= []
|
22
|
-
t.spec_opts << "-rubygems"
|
23
|
-
t.spec_opts << '-rlib/dirge'
|
24
|
-
t.spec_opts << "--options" << "spec/spec.opts"
|
25
|
-
t.spec_files = FileList['spec/**/*_spec.rb']
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dirge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 21
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Joshua Hull
|
@@ -9,10 +15,25 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date: 2010-
|
18
|
+
date: 2010-05-31 00:00:00 -04:00
|
13
19
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: callsite
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 27
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 0
|
33
|
+
- 2
|
34
|
+
version: 0.0.2
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
16
37
|
description: Relative require, relative autoload and __DIR__
|
17
38
|
email: joshbuddy@gmail.com
|
18
39
|
executables: []
|
@@ -25,7 +46,6 @@ files:
|
|
25
46
|
- README.rdoc
|
26
47
|
- Rakefile
|
27
48
|
- VERSION
|
28
|
-
- lib/dirge.rb
|
29
49
|
has_rdoc: true
|
30
50
|
homepage: http://github.com/joshbuddy/dirge
|
31
51
|
licenses: []
|
@@ -36,24 +56,29 @@ rdoc_options:
|
|
36
56
|
require_paths:
|
37
57
|
- lib
|
38
58
|
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
39
60
|
requirements:
|
40
61
|
- - ">="
|
41
62
|
- !ruby/object:Gem::Version
|
63
|
+
hash: 3
|
64
|
+
segments:
|
65
|
+
- 0
|
42
66
|
version: "0"
|
43
|
-
version:
|
44
67
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
45
69
|
requirements:
|
46
70
|
- - ">="
|
47
71
|
- !ruby/object:Gem::Version
|
72
|
+
hash: 3
|
73
|
+
segments:
|
74
|
+
- 0
|
48
75
|
version: "0"
|
49
|
-
version:
|
50
76
|
requirements: []
|
51
77
|
|
52
78
|
rubyforge_project:
|
53
|
-
rubygems_version: 1.3.
|
79
|
+
rubygems_version: 1.3.7
|
54
80
|
signing_key:
|
55
81
|
specification_version: 3
|
56
82
|
summary: Relative require, relative autoload and __DIR__
|
57
|
-
test_files:
|
58
|
-
|
59
|
-
- spec/test:2test/test.rb
|
83
|
+
test_files: []
|
84
|
+
|
data/lib/dirge.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
module Kernel
|
2
|
-
def __DIR_REL__(called_from = nil)
|
3
|
-
called_from ||= caller.first
|
4
|
-
caller_path = called_from[/(.*?(?=:\d+(:|$)))/, 1]
|
5
|
-
caller_path = '.' if caller_path == ''
|
6
|
-
File.expand_path(File.dirname(caller_path))
|
7
|
-
end
|
8
|
-
|
9
|
-
unless method_defined?(:__DIR__)
|
10
|
-
alias_method :__DIR__, :__DIR_REL__
|
11
|
-
end
|
12
|
-
|
13
|
-
unless method_defined?(:require_relative)
|
14
|
-
def require_relative(path)
|
15
|
-
require File.join(__DIR_REL__(caller.first), path)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
class Module
|
21
|
-
unless method_defined?(:autoload_relative)
|
22
|
-
def autoload_relative(name, filename)
|
23
|
-
autoload name, File.join(__DIR_REL__(caller.first), filename)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
class String
|
29
|
-
unless method_defined?(:~@)
|
30
|
-
def ~@
|
31
|
-
File.expand_path(File.join(__DIR_REL__(caller.first), self))
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
class File
|
37
|
-
def self.relative(path)
|
38
|
-
File.expand_path(File.join(__DIR_REL__(caller.first), path))
|
39
|
-
end
|
40
|
-
end
|
data/spec/dirge_spec.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
describe 'Dirge' do
|
2
|
-
it "should resolve a path through String#~" do
|
3
|
-
(~'test:2test/test').should == File.expand_path(File.join(File.dirname(__FILE__), 'test:2test', 'test'))
|
4
|
-
end
|
5
|
-
|
6
|
-
it "should resolve a path through File#relative" do
|
7
|
-
File.relative('test:2test/test').should == File.expand_path(File.join(File.dirname(__FILE__), 'test:2test', 'test'))
|
8
|
-
end
|
9
|
-
|
10
|
-
it 'should require a relative path' do
|
11
|
-
proc {
|
12
|
-
require_relative 'test:2test/test'
|
13
|
-
}.should raise_error(RuntimeError, 'okay okay, you included me')
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'should autoload a relative path' do
|
17
|
-
proc {
|
18
|
-
mod = Module.new do
|
19
|
-
autoload_relative :TestingTime, 'test:2test/test'
|
20
|
-
end
|
21
|
-
mod::TestingTime
|
22
|
-
}.should raise_error(RuntimeError, 'okay okay, you included me')
|
23
|
-
end
|
24
|
-
|
25
|
-
it "should define __DIR__" do
|
26
|
-
__DIR__.should == File.expand_path(File.dirname(__FILE__))
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should define __DIR__ with a custom caller" do
|
30
|
-
__DIR__('testing/test.rb:3').should == File.expand_path('testing')
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
data/spec/test:2test/test.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
raise 'okay okay, you included me'
|