mack-facets 0.6.1.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,6 +34,8 @@
34
34
  <a href="files/lib/mack-facets/extensions/object_rb.html">lib/mack-facets/extensions/object.rb</a><br />
35
35
  <a href="files/lib/mack-facets/extensions/string_rb.html">lib/mack-facets/extensions/string.rb</a><br />
36
36
  <a href="files/lib/mack-facets/extensions/symbol_rb.html">lib/mack-facets/extensions/symbol.rb</a><br />
37
+ <a href="files/lib/mack-facets/extensions/time_rb.html">lib/mack-facets/extensions/time.rb</a><br />
38
+ <a href="files/lib/mack-facets/utils/blank_slate_rb.html">lib/mack-facets/utils/blank_slate.rb</a><br />
37
39
  <a href="files/lib/mack-facets/utils/inflections_rb.html">lib/mack-facets/utils/inflections.rb</a><br />
38
40
  <a href="files/lib/mack-facets/utils/inflector_rb.html">lib/mack-facets/utils/inflector.rb</a><br />
39
41
  <a href="files/lib/mack-facets/utils/options_merger_rb.html">lib/mack-facets/utils/options_merger.rb</a><br />
@@ -20,78 +20,80 @@
20
20
  <div id="index">
21
21
  <h1 class="section-bar">Methods</h1>
22
22
  <div id="index-entries">
23
- <a href="classes/Hash.html#M000003">- (Hash)</a><br />
24
- <a href="classes/Mack/Utils/RegistryMap.html#M000048">add (Mack::Utils::RegistryMap)</a><br />
25
- <a href="classes/Mack/Utils/RegistryMap.html#M000053">add (Mack::Utils::RegistryMap)</a><br />
26
- <a href="classes/Mack/Utils/RegistryList.html#M000064">add (Mack::Utils::RegistryList)</a><br />
27
- <a href="classes/Mack/Utils/RegistryList.html#M000059">add (Mack::Utils::RegistryList)</a><br />
28
- <a href="classes/Class.html#M000017">class_is_a? (Class)</a><br />
29
- <a href="classes/Object.html#M000023">class_parents (Object)</a><br />
30
- <a href="classes/Mack/Utils/RegistryList.html#M000062">clear! (Mack::Utils::RegistryList)</a><br />
31
- <a href="classes/Mack/Utils/RegistryMap.html#M000051">clear! (Mack::Utils::RegistryMap)</a><br />
32
- <a href="classes/String.html#M000032">constantize (String)</a><br />
33
- <a href="classes/Module.html#M000014">convert_security_of_methods (Module)</a><br />
34
- <a href="classes/Array.html#M000012">count (Array)</a><br />
35
- <a href="classes/String.html#M000033">hexdigest (String)</a><br />
36
- <a href="classes/String.html#M000034">hexdigest! (String)</a><br />
37
- <a href="classes/Module.html#M000015">include_safely_into (Module)</a><br />
38
- <a href="classes/Mack/Utils/Inflector.html#M000045">inflections (Mack::Utils::Inflector)</a><br />
39
- <a href="classes/Mack/Utils/RegistryList.html#M000057">initial_state (Mack::Utils::RegistryList)</a><br />
40
- <a href="classes/Mack/Utils/RegistryMap.html#M000046">initial_state (Mack::Utils::RegistryMap)</a><br />
41
- <a href="classes/Array.html#M000013">invert (Array)</a><br />
42
- <a href="classes/Mack/Utils/Inflector.html#M000042">irregular (Mack::Utils::Inflector)</a><br />
43
- <a href="classes/Object.html#M000028">ivar_cache (Object)</a><br />
44
- <a href="classes/Object.html#M000029">ivar_cache_clear (Object)</a><br />
45
- <a href="classes/Hash.html#M000002">join (Hash)</a><br />
46
- <a href="classes/Math.html#M000070">log2 (Math)</a><br />
47
- <a href="classes/Math.html#M000072">max (Math)</a><br />
48
- <a href="classes/String.html#M000031">methodize (String)</a><br />
49
- <a href="classes/Symbol.html#M000001">methodize (Symbol)</a><br />
50
- <a href="classes/Math.html#M000071">min (Math)</a><br />
51
- <a href="classes/Mack/Utils/RegistryList.html#M000067">move_to_bottom (Mack::Utils::RegistryList)</a><br />
52
- <a href="classes/Mack/Utils/RegistryMap.html#M000056">move_to_bottom (Mack::Utils::RegistryMap)</a><br />
53
- <a href="classes/Mack/Utils/RegistryMap.html#M000055">move_to_top (Mack::Utils::RegistryMap)</a><br />
54
- <a href="classes/Mack/Utils/RegistryList.html#M000066">move_to_top (Mack::Utils::RegistryList)</a><br />
55
- <a href="classes/Object.html#M000030">namespaces (Object)</a><br />
56
- <a href="classes/Object.html#M000025">needs_method (Object)</a><br />
57
- <a href="classes/Class.html#M000016">new_instance_of (Class)</a><br />
58
- <a href="classes/Class.html#M000018">parents (Class)</a><br />
59
- <a href="classes/Array.html#M000005">parse_splat_args (Array)</a><br />
60
- <a href="classes/Array.html#M000008">pick_random (Array)</a><br />
61
- <a href="classes/Mack/Utils/Inflector.html#M000040">plural (Mack::Utils::Inflector)</a><br />
62
- <a href="classes/Mack/Utils/Inflector.html#M000044">pluralize (Mack::Utils::Inflector)</a><br />
63
- <a href="classes/Kernel.html#M000068">pp_to_s (Kernel)</a><br />
64
- <a href="classes/Object.html#M000021">print_methods (Object)</a><br />
65
- <a href="classes/Array.html#M000009">random_each (Array)</a><br />
66
- <a href="classes/String.html#M000035">randomize (String)</a><br />
67
- <a href="classes/Array.html#M000006">randomize (Array)</a><br />
68
- <a href="classes/Array.html#M000007">randomize! (Array)</a><br />
69
- <a href="classes/Mack/Utils/RegistryMap.html#M000050">registered_items (Mack::Utils::RegistryMap)</a><br />
70
- <a href="classes/Mack/Utils/RegistryList.html#M000061">registered_items (Mack::Utils::RegistryList)</a><br />
71
- <a href="classes/Mack/Utils/RegistryList.html#M000060">remove (Mack::Utils::RegistryList)</a><br />
72
- <a href="classes/Mack/Utils/RegistryList.html#M000065">remove (Mack::Utils::RegistryList)</a><br />
73
- <a href="classes/Mack/Utils/RegistryMap.html#M000049">remove (Mack::Utils::RegistryMap)</a><br />
74
- <a href="classes/Mack/Utils/RegistryMap.html#M000054">remove (Mack::Utils::RegistryMap)</a><br />
75
- <a href="classes/Mack/Utils/RegistryList.html#M000058">reset! (Mack::Utils::RegistryList)</a><br />
76
- <a href="classes/Mack/Utils/RegistryMap.html#M000052">reset! (Mack::Utils::RegistryMap)</a><br />
77
- <a href="classes/Mack/Utils/RegistryList.html#M000063">reset! (Mack::Utils::RegistryList)</a><br />
78
- <a href="classes/Mack/Utils/RegistryMap.html#M000047">reset! (Mack::Utils::RegistryMap)</a><br />
79
- <a href="classes/Kernel.html#M000069">retryable (Kernel)</a><br />
80
- <a href="classes/Object.html#M000026">running_time (Object)</a><br />
81
- <a href="classes/Object.html#M000020">safely_include_module (Object)</a><br />
82
- <a href="classes/Object.html#M000027">send_with_chain (Object)</a><br />
83
- <a href="classes/Mack/Utils/Inflector.html#M000041">singular (Mack::Utils::Inflector)</a><br />
84
- <a href="classes/Mack/Utils/Inflector.html#M000043">singularize (Mack::Utils::Inflector)</a><br />
85
- <a href="classes/Array.html#M000010">subset? (Array)</a><br />
86
- <a href="classes/Array.html#M000011">superset? (Array)</a><br />
87
- <a href="classes/Object.html#M000024">to_param (Object)</a><br />
88
- <a href="classes/NilClass.html#M000019">to_param (NilClass)</a><br />
89
- <a href="classes/Hash.html#M000004">to_params (Hash)</a><br />
90
- <a href="classes/String.html#M000038">truncate (String)</a><br />
91
- <a href="classes/String.html#M000039">truncate! (String)</a><br />
92
- <a href="classes/String.html#M000036">uri_escape (String)</a><br />
93
- <a href="classes/String.html#M000037">uri_unescape (String)</a><br />
94
- <a href="classes/Object.html#M000022">with_options (Object)</a><br />
23
+ <a href="classes/Hash.html#M000005">- (Hash)</a><br />
24
+ <a href="classes/Mack/Utils/RegistryList.html#M000066">add (Mack::Utils::RegistryList)</a><br />
25
+ <a href="classes/Mack/Utils/RegistryList.html#M000061">add (Mack::Utils::RegistryList)</a><br />
26
+ <a href="classes/Mack/Utils/RegistryMap.html#M000055">add (Mack::Utils::RegistryMap)</a><br />
27
+ <a href="classes/Mack/Utils/RegistryMap.html#M000050">add (Mack::Utils::RegistryMap)</a><br />
28
+ <a href="classes/Class.html#M000019">class_is_a? (Class)</a><br />
29
+ <a href="classes/Object.html#M000025">class_parents (Object)</a><br />
30
+ <a href="classes/Mack/Utils/RegistryMap.html#M000053">clear! (Mack::Utils::RegistryMap)</a><br />
31
+ <a href="classes/Mack/Utils/RegistryList.html#M000064">clear! (Mack::Utils::RegistryList)</a><br />
32
+ <a href="classes/String.html#M000034">constantize (String)</a><br />
33
+ <a href="classes/Module.html#M000016">convert_security_of_methods (Module)</a><br />
34
+ <a href="classes/Array.html#M000014">count (Array)</a><br />
35
+ <a href="classes/String.html#M000035">hexdigest (String)</a><br />
36
+ <a href="classes/String.html#M000036">hexdigest! (String)</a><br />
37
+ <a href="classes/Module.html#M000017">include_safely_into (Module)</a><br />
38
+ <a href="classes/Mack/Utils/Inflector.html#M000047">inflections (Mack::Utils::Inflector)</a><br />
39
+ <a href="classes/Mack/Utils/RegistryMap.html#M000048">initial_state (Mack::Utils::RegistryMap)</a><br />
40
+ <a href="classes/Mack/Utils/RegistryList.html#M000059">initial_state (Mack::Utils::RegistryList)</a><br />
41
+ <a href="classes/Array.html#M000015">invert (Array)</a><br />
42
+ <a href="classes/Mack/Utils/Inflector.html#M000044">irregular (Mack::Utils::Inflector)</a><br />
43
+ <a href="classes/Object.html#M000030">ivar_cache (Object)</a><br />
44
+ <a href="classes/Object.html#M000031">ivar_cache_clear (Object)</a><br />
45
+ <a href="classes/Hash.html#M000004">join (Hash)</a><br />
46
+ <a href="classes/Math.html#M000072">log2 (Math)</a><br />
47
+ <a href="classes/Math.html#M000074">max (Math)</a><br />
48
+ <a href="classes/String.html#M000033">methodize (String)</a><br />
49
+ <a href="classes/Symbol.html#M000003">methodize (Symbol)</a><br />
50
+ <a href="classes/Math.html#M000073">min (Math)</a><br />
51
+ <a href="classes/Mack/Utils/RegistryList.html#M000069">move_to_bottom (Mack::Utils::RegistryList)</a><br />
52
+ <a href="classes/Mack/Utils/RegistryMap.html#M000058">move_to_bottom (Mack::Utils::RegistryMap)</a><br />
53
+ <a href="classes/Mack/Utils/RegistryList.html#M000068">move_to_top (Mack::Utils::RegistryList)</a><br />
54
+ <a href="classes/Mack/Utils/RegistryMap.html#M000057">move_to_top (Mack::Utils::RegistryMap)</a><br />
55
+ <a href="classes/Object.html#M000032">namespaces (Object)</a><br />
56
+ <a href="classes/Object.html#M000027">needs_method (Object)</a><br />
57
+ <a href="classes/Class.html#M000018">new_instance_of (Class)</a><br />
58
+ <a href="classes/Class.html#M000020">parents (Class)</a><br />
59
+ <a href="classes/Array.html#M000007">parse_splat_args (Array)</a><br />
60
+ <a href="classes/Array.html#M000010">pick_random (Array)</a><br />
61
+ <a href="classes/Mack/Utils/Inflector.html#M000042">plural (Mack::Utils::Inflector)</a><br />
62
+ <a href="classes/Mack/Utils/Inflector.html#M000046">pluralize (Mack::Utils::Inflector)</a><br />
63
+ <a href="classes/Kernel.html#M000070">pp_to_s (Kernel)</a><br />
64
+ <a href="classes/Object.html#M000023">print_methods (Object)</a><br />
65
+ <a href="classes/Array.html#M000011">random_each (Array)</a><br />
66
+ <a href="classes/String.html#M000037">randomize (String)</a><br />
67
+ <a href="classes/Array.html#M000008">randomize (Array)</a><br />
68
+ <a href="classes/Array.html#M000009">randomize! (Array)</a><br />
69
+ <a href="classes/Mack/Utils/RegistryMap.html#M000052">registered_items (Mack::Utils::RegistryMap)</a><br />
70
+ <a href="classes/Mack/Utils/RegistryList.html#M000063">registered_items (Mack::Utils::RegistryList)</a><br />
71
+ <a href="classes/Mack/Utils/RegistryList.html#M000067">remove (Mack::Utils::RegistryList)</a><br />
72
+ <a href="classes/Mack/Utils/RegistryList.html#M000062">remove (Mack::Utils::RegistryList)</a><br />
73
+ <a href="classes/Mack/Utils/RegistryMap.html#M000051">remove (Mack::Utils::RegistryMap)</a><br />
74
+ <a href="classes/Mack/Utils/RegistryMap.html#M000056">remove (Mack::Utils::RegistryMap)</a><br />
75
+ <a href="classes/Mack/Utils/RegistryMap.html#M000049">reset! (Mack::Utils::RegistryMap)</a><br />
76
+ <a href="classes/Mack/Utils/RegistryMap.html#M000054">reset! (Mack::Utils::RegistryMap)</a><br />
77
+ <a href="classes/Mack/Utils/RegistryList.html#M000060">reset! (Mack::Utils::RegistryList)</a><br />
78
+ <a href="classes/Mack/Utils/RegistryList.html#M000065">reset! (Mack::Utils::RegistryList)</a><br />
79
+ <a href="classes/Kernel.html#M000071">retryable (Kernel)</a><br />
80
+ <a href="classes/Object.html#M000028">running_time (Object)</a><br />
81
+ <a href="classes/Object.html#M000022">safely_include_module (Object)</a><br />
82
+ <a href="classes/Object.html#M000029">send_with_chain (Object)</a><br />
83
+ <a href="classes/Mack/Utils/Inflector.html#M000043">singular (Mack::Utils::Inflector)</a><br />
84
+ <a href="classes/Mack/Utils/Inflector.html#M000045">singularize (Mack::Utils::Inflector)</a><br />
85
+ <a href="classes/Array.html#M000012">subset? (Array)</a><br />
86
+ <a href="classes/Array.html#M000013">superset? (Array)</a><br />
87
+ <a href="classes/Time.html#M000001">to_date (Time)</a><br />
88
+ <a href="classes/Time.html#M000002">to_datetime (Time)</a><br />
89
+ <a href="classes/Object.html#M000026">to_param (Object)</a><br />
90
+ <a href="classes/NilClass.html#M000021">to_param (NilClass)</a><br />
91
+ <a href="classes/Hash.html#M000006">to_params (Hash)</a><br />
92
+ <a href="classes/String.html#M000040">truncate (String)</a><br />
93
+ <a href="classes/String.html#M000041">truncate! (String)</a><br />
94
+ <a href="classes/String.html#M000038">uri_escape (String)</a><br />
95
+ <a href="classes/String.html#M000039">uri_unescape (String)</a><br />
96
+ <a href="classes/Object.html#M000024">with_options (Object)</a><br />
95
97
  </div>
96
98
  </div>
97
99
  </body>
@@ -1,7 +1,9 @@
1
+ fl = File.join(File.dirname(__FILE__), "mack-facets")
2
+
1
3
  require 'rubygems'
2
4
  require 'digest'
5
+ require File.join(fl, "extensions", "time") # we need this here, otherwise facets 2.4.3 breaks!
3
6
  require 'facets'
4
- require 'facets/ruby'
5
7
  require 'facets/style'
6
8
  require 'facets/blank'
7
9
  require 'facets/hash'
@@ -10,14 +12,14 @@ require 'facets/hash/stringify_keys'
10
12
  require 'facets/module'
11
13
  require 'facets/infinity'
12
14
  require 'facets/times'
15
+ require 'facets/time'
16
+ require 'facets/string'
13
17
  require 'english/inflect'
14
18
  require 'english/numerals'
15
19
  require 'extlib/assertions'
16
20
  require 'extlib/hook'
17
21
 
18
- fl = File.join(File.dirname(__FILE__), "mack-facets")
19
-
20
- [:inflector, :inflections, :options_merger, :registry_list, :registry_map].each do |k|
22
+ [:inflector, :inflections, :options_merger, :registry_list, :registry_map, :blank_slate].each do |k|
21
23
  path = File.join(fl, "utils", "#{k}")
22
24
  require path
23
25
  end
@@ -0,0 +1,25 @@
1
+ class Time
2
+
3
+ unless self.public_instance_methods.include?("to_date")
4
+ if self.private_instance_methods.include?("to_date") || self.protected_instance_methods.include?("to_date")
5
+ public :to_date
6
+ else
7
+ def to_date
8
+ require 'date' # just in case
9
+ jd = Date.__send__(:civil_to_jd, year, mon, mday, Date::ITALY)
10
+ Date.new!(Date.__send__(:jd_to_ajd, jd, 0, 0), 0, Date::ITALY)
11
+ end
12
+ end
13
+ end
14
+
15
+ unless self.public_instance_methods.include?("to_datetime")
16
+ if self.private_instance_methods.include?("to_datetime") || self.protected_instance_methods.include?("to_datetime")
17
+ public :to_datetime
18
+ else
19
+ def to_datetime
20
+ raise NoMethodError.new("to_datetime")
21
+ end
22
+ end
23
+ end
24
+
25
+ end
@@ -0,0 +1,3 @@
1
+ class Mack::Utils::BlankSlate
2
+ instance_methods.each { |m| undef_method m unless m =~ /^__/ }
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mack-facets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - markbates
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-08-29 00:00:00 -04:00
12
+ date: 2008-08-25 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - "="
22
22
  - !ruby/object:Gem::Version
23
- version: 2.4.1
23
+ version: 2.4.3
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: english
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - "="
42
42
  - !ruby/object:Gem::Version
43
- version: 0.9.3
43
+ version: 0.9.4
44
44
  version:
45
45
  description: "mack-facets was developed by: markbates"
46
46
  email: mark@mackframework.com
@@ -63,6 +63,8 @@ files:
63
63
  - lib/mack-facets/extensions/object.rb
64
64
  - lib/mack-facets/extensions/string.rb
65
65
  - lib/mack-facets/extensions/symbol.rb
66
+ - lib/mack-facets/extensions/time.rb
67
+ - lib/mack-facets/utils/blank_slate.rb
66
68
  - lib/mack-facets/utils/inflections.rb
67
69
  - lib/mack-facets/utils/inflector.rb
68
70
  - lib/mack-facets/utils/options_merger.rb
@@ -74,6 +76,7 @@ files:
74
76
  - doc/classes/Class.html
75
77
  - doc/classes/Hash.html
76
78
  - doc/classes/Kernel.html
79
+ - doc/classes/Mack/Utils/BlankSlate.html
77
80
  - doc/classes/Mack/Utils/Inflector.html
78
81
  - doc/classes/Mack/Utils/RegistryList.html
79
82
  - doc/classes/Mack/Utils/RegistryMap.html
@@ -83,6 +86,7 @@ files:
83
86
  - doc/classes/Object.html
84
87
  - doc/classes/String.html
85
88
  - doc/classes/Symbol.html
89
+ - doc/classes/Time.html
86
90
  - doc/created.rid
87
91
  - doc/files/lib/mack-facets/english_extensions/inflect_rb.html
88
92
  - doc/files/lib/mack-facets/english_extensions/numerals_rb.html
@@ -96,6 +100,8 @@ files:
96
100
  - doc/files/lib/mack-facets/extensions/object_rb.html
97
101
  - doc/files/lib/mack-facets/extensions/string_rb.html
98
102
  - doc/files/lib/mack-facets/extensions/symbol_rb.html
103
+ - doc/files/lib/mack-facets/extensions/time_rb.html
104
+ - doc/files/lib/mack-facets/utils/blank_slate_rb.html
99
105
  - doc/files/lib/mack-facets/utils/inflections_rb.html
100
106
  - doc/files/lib/mack-facets/utils/inflector_rb.html
101
107
  - doc/files/lib/mack-facets/utils/options_merger_rb.html