load-me 0.1.0
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/.document +5 -0
- data/.gitignore +39 -0
- data/LICENSE +20 -0
- data/README.markdown +29 -0
- data/Rakefile +47 -0
- data/VERSION +1 -0
- data/lib/load-me.rb +21 -0
- data/spec/load-me_spec.rb +18 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +12 -0
- metadata +86 -0
data/.document
ADDED
data/.gitignore
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# rcov generated
|
2
|
+
coverage
|
3
|
+
|
4
|
+
# rdoc generated
|
5
|
+
rdoc
|
6
|
+
|
7
|
+
# yard generated
|
8
|
+
doc
|
9
|
+
.yardoc
|
10
|
+
|
11
|
+
# jeweler generated
|
12
|
+
pkg
|
13
|
+
|
14
|
+
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
|
15
|
+
#
|
16
|
+
# * Create a file at ~/.gitignore
|
17
|
+
# * Include files you want ignored
|
18
|
+
# * Run: git config --global core.excludesfile ~/.gitignore
|
19
|
+
#
|
20
|
+
# After doing this, these files will be ignored in all your git projects,
|
21
|
+
# saving you from having to 'pollute' every project you touch with them
|
22
|
+
#
|
23
|
+
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
|
24
|
+
#
|
25
|
+
# For MacOS:
|
26
|
+
#
|
27
|
+
#.DS_Store
|
28
|
+
#
|
29
|
+
# For TextMate
|
30
|
+
#*.tmproj
|
31
|
+
#tmtags
|
32
|
+
#
|
33
|
+
# For emacs:
|
34
|
+
#*~
|
35
|
+
#\#*
|
36
|
+
#.\#*
|
37
|
+
#
|
38
|
+
# For vim:
|
39
|
+
#*.swp
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Kristian Mandrup
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.markdown
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# load-me ##
|
2
|
+
|
3
|
+
## Installation ##
|
4
|
+
|
5
|
+
`$ gem install load-me`
|
6
|
+
|
7
|
+
## Usage ##
|
8
|
+
|
9
|
+
<pre>
|
10
|
+
require 'load-me'
|
11
|
+
|
12
|
+
# add paths relative to ../lib from current file path
|
13
|
+
LoadPath.relative_to(__FILE__, '../lib')
|
14
|
+
|
15
|
+
# add folders to loadpath
|
16
|
+
LoadPath.add('sound', 'network')
|
17
|
+
|
18
|
+
# change context (base path) and add some more...
|
19
|
+
LoadPath.relative_to(__FILE__, '../supporting/lib')
|
20
|
+
LoadPath.add('mixins', 'helpers')
|
21
|
+
</pre>
|
22
|
+
|
23
|
+
## TODO ##
|
24
|
+
|
25
|
+
Suggestions for improvement are welcome!
|
26
|
+
|
27
|
+
## Copyright ##
|
28
|
+
|
29
|
+
Copyright (c) 2010 Kristian Mandrup. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# require 'rubygems'
|
2
|
+
# require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "load-me"
|
8
|
+
gem.summary = %Q{Facilitates working with ruby $LOAD_PATH}
|
9
|
+
gem.description = %Q{Facilitates working with ruby $LOAD_PATH with some static functions}
|
10
|
+
gem.email = "kmandrup@gmail.com"
|
11
|
+
gem.homepage = "http://github.com/kristianmandrup/load-me"
|
12
|
+
gem.authors = ["Kristian Mandrup"]
|
13
|
+
gem.add_development_dependency "rspec", ">= 2.0.0"
|
14
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
15
|
+
|
16
|
+
# add more gem options here
|
17
|
+
end
|
18
|
+
rescue LoadError
|
19
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
20
|
+
end
|
21
|
+
|
22
|
+
# require 'rspec/rake_task'
|
23
|
+
# Rspec::Core::RakeTask.new(:spec) do |spec|
|
24
|
+
# # spec.libs << 'lib' << 'spec'
|
25
|
+
# # spec.spec_files = FileList['spec/**/*_spec.rb']
|
26
|
+
# end
|
27
|
+
#
|
28
|
+
# require 'rspec/rake_task'
|
29
|
+
# Rspec::Core::RakeTask.new(:rcov) do |spec|
|
30
|
+
# # spec.libs << 'lib' << 'spec'
|
31
|
+
# # spec.pattern = 'spec/**/*_spec.rb'
|
32
|
+
# # spec.rcov = true
|
33
|
+
# end
|
34
|
+
|
35
|
+
# task :spec => :check_dependencies
|
36
|
+
#
|
37
|
+
# task :default => :spec
|
38
|
+
|
39
|
+
# require 'rake/rdoctask'
|
40
|
+
# Rake::RDocTask.new do |rdoc|
|
41
|
+
# version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
42
|
+
#
|
43
|
+
# rdoc.rdoc_dir = 'rdoc'
|
44
|
+
# rdoc.title = "load-me #{version}"
|
45
|
+
# rdoc.rdoc_files.include('README*')
|
46
|
+
# rdoc.rdoc_files.include('lib/**/*.rb')
|
47
|
+
# end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
data/lib/load-me.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
module LoadPath
|
2
|
+
class << self
|
3
|
+
attr_accessor :base_path
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.relative_to(file, path)
|
7
|
+
@base_path = File.join(File.dirname(file), path)
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.add(*names)
|
11
|
+
names.each do |dir|
|
12
|
+
path = get_path(dir)
|
13
|
+
$LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
protected
|
18
|
+
def self.get_path(dir)
|
19
|
+
path = File.expand_path(File.join(base_path, dir))
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
require 'pathname'
|
3
|
+
|
4
|
+
describe "LoadMe" do
|
5
|
+
it "works" do
|
6
|
+
LoadPath.relative_to(__FILE__, '../fixtures')
|
7
|
+
LoadPath.add('sound', 'network')
|
8
|
+
|
9
|
+
$LOAD_PATH.should include File.join(path, 'sound')
|
10
|
+
$LOAD_PATH.should include File.join(path, 'network')
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def path
|
16
|
+
File.expand_path(File.join(File.dirname(__FILE__), '../fixtures'))
|
17
|
+
end
|
18
|
+
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: load-me
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
version: 0.1.0
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Kristian Mandrup
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-03-18 00:00:00 -04:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: rspec
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 2
|
29
|
+
- 0
|
30
|
+
- 0
|
31
|
+
version: 2.0.0
|
32
|
+
type: :development
|
33
|
+
version_requirements: *id001
|
34
|
+
description: Facilitates working with ruby $LOAD_PATH with some static functions
|
35
|
+
email: kmandrup@gmail.com
|
36
|
+
executables: []
|
37
|
+
|
38
|
+
extensions: []
|
39
|
+
|
40
|
+
extra_rdoc_files:
|
41
|
+
- LICENSE
|
42
|
+
- README.markdown
|
43
|
+
files:
|
44
|
+
- .document
|
45
|
+
- .gitignore
|
46
|
+
- LICENSE
|
47
|
+
- Rakefile
|
48
|
+
- VERSION
|
49
|
+
- lib/load-me.rb
|
50
|
+
- spec/load-me_spec.rb
|
51
|
+
- spec/spec.opts
|
52
|
+
- spec/spec_helper.rb
|
53
|
+
- README.markdown
|
54
|
+
has_rdoc: true
|
55
|
+
homepage: http://github.com/kristianmandrup/load-me
|
56
|
+
licenses: []
|
57
|
+
|
58
|
+
post_install_message:
|
59
|
+
rdoc_options:
|
60
|
+
- --charset=UTF-8
|
61
|
+
require_paths:
|
62
|
+
- lib
|
63
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
segments:
|
68
|
+
- 0
|
69
|
+
version: "0"
|
70
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
segments:
|
75
|
+
- 0
|
76
|
+
version: "0"
|
77
|
+
requirements: []
|
78
|
+
|
79
|
+
rubyforge_project:
|
80
|
+
rubygems_version: 1.3.6
|
81
|
+
signing_key:
|
82
|
+
specification_version: 3
|
83
|
+
summary: Facilitates working with ruby $LOAD_PATH
|
84
|
+
test_files:
|
85
|
+
- spec/load-me_spec.rb
|
86
|
+
- spec/spec_helper.rb
|