ruby-nuggets 0.2.3.253 → 0.2.4.255

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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to ruby-nuggets version 0.2.3
5
+ This documentation refers to ruby-nuggets version 0.2.4
6
6
 
7
7
 
8
8
  == DESCRIPTION
@@ -0,0 +1,2 @@
1
+ # whatever you prefer to call it...
2
+ require File.join(File.dirname(__FILE__), 'singleton_class')
@@ -0,0 +1,2 @@
1
+ # whatever you prefer to call it...
2
+ require File.join(File.dirname(__FILE__), 'singleton_class')
@@ -30,12 +30,14 @@ class Object
30
30
  # call-seq:
31
31
  # object.singleton_class => aClass
32
32
  #
33
- # Returns the singleton class associated with _object_.
33
+ # Returns the singleton (or virtual/eigen/meta) class associated with _object_.
34
34
  def singleton_class
35
35
  class << self; self; end
36
36
  end
37
- alias_method :eigenclass, :singleton_class
38
- alias_method :metaclass, :singleton_class
37
+
38
+ alias_method :virtual_class, :singleton_class
39
+ alias_method :eigenclass, :singleton_class
40
+ alias_method :metaclass, :singleton_class
39
41
 
40
42
  end
41
43
 
@@ -0,0 +1,2 @@
1
+ # whatever you prefer to call it...
2
+ require File.join(File.dirname(__FILE__), 'singleton_class')
@@ -4,7 +4,7 @@ module Nuggets
4
4
 
5
5
  MAJOR = 0
6
6
  MINOR = 2
7
- TINY = 3
7
+ TINY = 4
8
8
 
9
9
  class << self
10
10
 
@@ -1,8 +1,7 @@
1
1
  #--
2
2
  ###############################################################################
3
3
  # #
4
- # A component of ruby-nuggets, some extensions to the Ruby programming #
5
- # language. #
4
+ # ruby-nuggets - some extensions to the Ruby programming language. #
6
5
  # #
7
6
  # Copyright (C) 2007-2008 Jens Wille #
8
7
  # #
@@ -25,3 +24,36 @@
25
24
  ###############################################################################
26
25
  #++
27
26
 
27
+ def Nuggets(*nuggets)
28
+ loaded_nuggets = []
29
+
30
+ load_nuggets = lambda { |base, *nuggets|
31
+ nuggets_by_hierarchy = nuggets.last.is_a?(Hash) ? nuggets.pop : {}
32
+
33
+ nuggets.each { |nugget|
34
+ begin
35
+ require path = File.join(base.to_s, nugget.to_s)
36
+ loaded_nuggets << path
37
+ rescue LoadError
38
+ # if it's a directory, load anything in it
39
+ $LOAD_PATH.each { |dir|
40
+ if File.directory?(dir_path = File.join(dir, path))
41
+ load_nuggets[path, *Dir[File.join(dir_path, '*')].map { |file|
42
+ File.basename(file, '.rb')
43
+ }]
44
+ break
45
+ end
46
+ } and raise # otherwise, re-raise
47
+ end
48
+ }
49
+
50
+ nuggets_by_hierarchy.each { |hierarchy, nuggets|
51
+ nuggets = [nuggets] if nuggets.is_a?(Hash)
52
+ load_nuggets[File.join(base.to_s, hierarchy.to_s), *nuggets]
53
+ }
54
+ }
55
+
56
+ load_nuggets['nuggets', *nuggets]
57
+
58
+ loaded_nuggets
59
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-nuggets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3.253
4
+ version: 0.2.4.255
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Wille
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-07-11 00:00:00 +02:00
12
+ date: 2008-07-13 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -24,65 +24,68 @@ extra_rdoc_files:
24
24
  - ChangeLog
25
25
  - README
26
26
  files:
27
- - lib/nuggets/integer/to_binary_s.rb
28
- - lib/nuggets/integer/factorial.rb
29
- - lib/nuggets/version.rb
30
- - lib/nuggets/object/singleton_class.rb
31
- - lib/nuggets/object/blank.rb
32
- - lib/nuggets/object/msend.rb
33
- - lib/nuggets/enumerable/agrep.rb
34
- - lib/nuggets/enumerable/all_any_extended.rb
35
- - lib/nuggets/enumerable/minmax.rb
27
+ - lib/nuggets.rb
36
28
  - lib/nuggets/all.rb
37
- - lib/nuggets/string/sub_with_md.rb
29
+ - lib/nuggets/version.rb
30
+ - lib/nuggets/io/agrep.rb
31
+ - lib/nuggets/io/modes.rb
32
+ - lib/nuggets/file/which.rb
33
+ - lib/nuggets/integer/factorial.rb
34
+ - lib/nuggets/integer/to_binary_s.rb
35
+ - lib/nuggets/array/to_hash.rb
36
+ - lib/nuggets/array/shuffle.rb
37
+ - lib/nuggets/array/format.rb
38
+ - lib/nuggets/array/in_order.rb
39
+ - lib/nuggets/array/combination.rb
40
+ - lib/nuggets/array/flatten_once.rb
41
+ - lib/nuggets/array/rand.rb
42
+ - lib/nuggets/array/monotone.rb
43
+ - lib/nuggets/uri/exist.rb
44
+ - lib/nuggets/uri/content_type.rb
45
+ - lib/nuggets/proc/bind.rb
46
+ - lib/nuggets/string/word_wrap.rb
38
47
  - lib/nuggets/string/msub.rb
39
48
  - lib/nuggets/string/case.rb
49
+ - lib/nuggets/string/sub_with_md.rb
40
50
  - lib/nuggets/string/evaluate.rb
41
- - lib/nuggets/string/word_wrap.rb
42
51
  - lib/nuggets/string/nsub.rb
43
52
  - lib/nuggets/string/capitalize_first.rb
44
- - lib/nuggets/hash/in_order.rb
45
- - lib/nuggets/hash/insert.rb
46
- - lib/nuggets/proc/bind.rb
47
- - lib/nuggets/array/rand.rb
48
- - lib/nuggets/array/to_hash.rb
49
- - lib/nuggets/array/flatten_once.rb
50
- - lib/nuggets/array/in_order.rb
51
- - lib/nuggets/array/shuffle.rb
52
- - lib/nuggets/array/monotone.rb
53
- - lib/nuggets/array/format.rb
54
- - lib/nuggets/array/combination.rb
53
+ - lib/nuggets/object/blank.rb
54
+ - lib/nuggets/object/metaclass.rb
55
+ - lib/nuggets/object/singleton_class.rb
56
+ - lib/nuggets/object/eigenclass.rb
57
+ - lib/nuggets/object/virtual_class.rb
58
+ - lib/nuggets/object/msend.rb
59
+ - lib/nuggets/numeric/limit.rb
55
60
  - lib/nuggets/numeric/between.rb
56
61
  - lib/nuggets/numeric/signum.rb
57
- - lib/nuggets/numeric/limit.rb
58
62
  - lib/nuggets/numeric/to_multiple.rb
59
- - lib/nuggets/util/added_methods/init.rb
60
- - lib/nuggets/util/added_methods.rb
61
- - lib/nuggets/util/ansicolor2css.rb
62
- - lib/nuggets/util/content_type.rb
63
63
  - lib/nuggets/util/dotted_decimal.rb
64
64
  - lib/nuggets/util/i18n.rb
65
- - lib/nuggets/file/which.rb
66
- - lib/nuggets/uri/content_type.rb
67
- - lib/nuggets/uri/exist.rb
68
- - lib/nuggets/io/modes.rb
69
- - lib/nuggets/io/agrep.rb
65
+ - lib/nuggets/util/ansicolor2css.rb
66
+ - lib/nuggets/util/content_type.rb
67
+ - lib/nuggets/util/added_methods.rb
68
+ - lib/nuggets/util/added_methods/init.rb
69
+ - lib/nuggets/enumerable/minmax.rb
70
+ - lib/nuggets/enumerable/all_any_extended.rb
71
+ - lib/nuggets/enumerable/agrep.rb
72
+ - lib/nuggets/hash/in_order.rb
73
+ - lib/nuggets/hash/insert.rb
70
74
  - COPYING
71
- - HEADER
75
+ - Rakefile
72
76
  - README
73
77
  - ChangeLog
74
- - Rakefile
75
78
  has_rdoc: true
76
79
  homepage: http://prometheus.rubyforge.org/ruby-nuggets
77
80
  post_install_message:
78
81
  rdoc_options:
82
+ - --all
83
+ - --main
84
+ - README
79
85
  - --line-numbers
80
86
  - --inline-source
81
87
  - --title
82
88
  - ruby-nuggets Application documentation
83
- - --main
84
- - README
85
- - --all
86
89
  - --charset
87
90
  - UTF-8
88
91
  require_paths: