Bauble 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.
Files changed (2) hide show
  1. data/lib/bauble.rb +28 -0
  2. metadata +53 -0
data/lib/bauble.rb ADDED
@@ -0,0 +1,28 @@
1
+ # A simple sub-module system. A bauble is
2
+ # a directory structure containing ruby code.
3
+ # A bauble named +myBauble+ should live in a
4
+ # directory named +myBauble+. It's source
5
+ # code should live in +myBauble/lib+ just like
6
+ # a gem. There should be a +lib/myBauble.rb+ file
7
+ # which is the root of the bauble.
8
+ #
9
+ # Users of the bauble will use it by saying
10
+ #
11
+ # Bauble.use("myPath/myBauble")
12
+ #
13
+ # This will cause +myPath/myBauble/lib+ to be added to
14
+ # the +LOAD_PATH+ and will automatically require
15
+ # +myPath/myBauble/lib/myBauble.rb+
16
+ #
17
+
18
+ module Bauble
19
+ def self.use(bauble)
20
+ bauble_name = File.basename(bauble)
21
+ ensure_in_path "#{bauble}/lib"
22
+ require bauble_name
23
+ end
24
+
25
+ def self.ensure_in_path(path)
26
+ $LOAD_PATH << path unless $LOAD_PATH.include? path
27
+ end
28
+ end
metadata ADDED
@@ -0,0 +1,53 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: Bauble
3
+ version: !ruby/object:Gem::Version
4
+ version: "0.1"
5
+ platform: ruby
6
+ authors:
7
+ - unclebob
8
+ autorequire: bauble
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-07-16 00:00:00 -05:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description:
17
+ email: unclebob@objectmentor.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
24
+ files:
25
+ - lib/bauble.rb
26
+ has_rdoc: true
27
+ homepage:
28
+ post_install_message:
29
+ rdoc_options: []
30
+
31
+ require_paths:
32
+ - lib
33
+ required_ruby_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: "0"
38
+ version:
39
+ required_rubygems_version: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: "0"
44
+ version:
45
+ requirements: []
46
+
47
+ rubyforge_project:
48
+ rubygems_version: 1.0.1
49
+ signing_key:
50
+ specification_version: 2
51
+ summary: A simple sub-module system.
52
+ test_files: []
53
+