Module: Gibbler
- Extended by:
- Attic
- Defined in:
- lib/gibbler.rb,
lib/gibbler/object.rb,
lib/gibbler/aliases.rb,
lib/gibbler/history.rb
Overview
Gibbler
“Hola, Tanneritos”
Defined Under Namespace
Modules: Array, Block, Complex, DateTime, File, Hash, History, Nil, Object, Range, String, Time Classes: BadDigest, Digest, Error, NoHistory, NoRevert
Constant Summary collapse
- VERSION =
"0.6.2"- @@gibbler_debug =
false- @@gibbler_digest_type =
::Digest::SHA1
Class Method Summary collapse
-
.debug? ⇒ Boolean
Returns the current debug status (true or false).
-
.digest(str) ⇒ Object
Sends
strto Digest::SHA1.hexdigest. -
.digest_type ⇒ Object
Returns the current digest class.
-
.digest_type=(v) ⇒ Object
Specify a different digest class.
- .disable_debug ⇒ Object
- .enable_debug ⇒ Object
- .gibbler_debug(*args) ⇒ Object
-
.included(obj) ⇒ Object
Raises an exception.
Class Method Details
.debug? ⇒ Boolean
Returns the current debug status (true or false)
38 |
# File 'lib/gibbler.rb', line 38 def self.debug?; @@gibbler_debug; end |
.digest(str) ⇒ Object
Sends str to Digest::SHA1.hexdigest. If another digest class has been specified, that class will be used instead. See: digest_type
47 48 49 |
# File 'lib/gibbler.rb', line 47 def self.digest(str) @@gibbler_digest_type.hexdigest str end |
.digest_type ⇒ Object
Returns the current digest class.
42 |
# File 'lib/gibbler.rb', line 42 def self.digest_type; @@gibbler_digest_type; end |
.digest_type=(v) ⇒ Object
34 35 36 |
# File 'lib/gibbler.rb', line 34 def self.digest_type=(v) @@gibbler_digest_type = v end |
.disable_debug ⇒ Object
40 |
# File 'lib/gibbler.rb', line 40 def self.disable_debug; @@gibbler_debug = false; end |
.enable_debug ⇒ Object
39 |
# File 'lib/gibbler.rb', line 39 def self.enable_debug; @@gibbler_debug = true; end |
.gibbler_debug(*args) ⇒ Object
51 52 53 54 |
# File 'lib/gibbler.rb', line 51 def self.gibbler_debug(*args) return unless Gibbler.debug? p args end |
.included(obj) ⇒ Object
Raises an exception. The correct usage is to include a Gibbler::Object:
-
Gibbler::Complex
-
Gibbler::String
-
Gibbler::Object
-
etc …
61 62 63 |
# File 'lib/gibbler.rb', line 61 def self.included(obj) raise "You probably want to include Gibbler::Complex or Gibbler::Object" end |