relative 1.0.0 → 1.0.1
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 +3 -0
- data/Manifest.txt +1 -0
- data/Rakefile +1 -3
- data/examples/example.rb +16 -0
- metadata +4 -2
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/Rakefile
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
# -*- ruby -*-
|
|
2
2
|
|
|
3
|
-
$LOAD_PATH.unshift("lib")
|
|
4
|
-
|
|
5
3
|
require 'rubygems'
|
|
6
4
|
require 'hoe'
|
|
7
5
|
|
|
8
6
|
$stderr = STDERR
|
|
9
7
|
|
|
10
|
-
Hoe.new('relative', "1.0.
|
|
8
|
+
Hoe.new('relative', "1.0.1") do |p|
|
|
11
9
|
p.remote_rdoc_dir = ''
|
|
12
10
|
p.developer('DesigningPatterns', 'technical.inquiries@designingpatterns.com')
|
|
13
11
|
end
|
data/examples/example.rb
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
require 'rubygems'
|
|
3
|
+
require 'relative'
|
|
4
|
+
|
|
5
|
+
relative_path = "../Rakefile"
|
|
6
|
+
|
|
7
|
+
print("====================================================================\n")
|
|
8
|
+
print("The absolute path of #{relative_path} (relative to #{__FILE__}):\n")
|
|
9
|
+
print("#{File.expand_path_relative_to_caller(relative_path)}\n")
|
|
10
|
+
print("====================================================================\n")
|
|
11
|
+
print("The Pathname of #{relative_path} (relative to #{__FILE__}):\n")
|
|
12
|
+
print("#{Pathname.new(relative_path).expand_path_relative_to_caller()}\n")
|
|
13
|
+
print("====================================================================\n")
|
|
14
|
+
print("The contents of #{relative_path} (relative to #{__FILE__}):\n")
|
|
15
|
+
print("#{IO.read(PathRelativeToCaller.new(relative_path))}")
|
|
16
|
+
print("====================================================================\n")
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: relative
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- DesigningPatterns
|
|
@@ -14,6 +14,7 @@ default_executable:
|
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: hoe
|
|
17
|
+
type: :runtime
|
|
17
18
|
version_requirement:
|
|
18
19
|
version_requirements: !ruby/object:Gem::Requirement
|
|
19
20
|
requirements:
|
|
@@ -38,6 +39,7 @@ files:
|
|
|
38
39
|
- History.txt
|
|
39
40
|
- README.txt
|
|
40
41
|
- Rakefile
|
|
42
|
+
- examples/example.rb
|
|
41
43
|
- lib/relative.rb
|
|
42
44
|
- lib/relative/file.rb
|
|
43
45
|
- lib/relative/kernel.rb
|
|
@@ -70,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
70
72
|
requirements: []
|
|
71
73
|
|
|
72
74
|
rubyforge_project: relative
|
|
73
|
-
rubygems_version: 1.0
|
|
75
|
+
rubygems_version: 1.2.0
|
|
74
76
|
signing_key:
|
|
75
77
|
specification_version: 2
|
|
76
78
|
summary: The relative library enhances Ruby's core and standard libraries to support naming, opening, and reading files relative to the Ruby file currently being interpreted (the contents of the __ FILE __ identifier)
|