Module: Firebug
- Defined in:
- lib/firebug.rb,
lib/firebug/crypto.rb,
lib/firebug/errors.rb,
lib/firebug/session.rb,
lib/firebug/version.rb,
lib/firebug/serializer.rb,
lib/firebug/unserializer.rb,
lib/firebug/configuration.rb,
lib/firebug/string_io_reader.rb
Overview
:nodoc:
Defined Under Namespace
Classes: Configuration, Crypto, FirebugMcrypt, Serializer, Session, StringIOReader, Unserializer
Constant Summary collapse
- Error =
Base error class.
Class.new(StandardError)
- ParserError =
An error unserializing a string.
Class.new(Error)
- VERSION =
The current version of Firebug
'1.4.2'
Class Attribute Summary collapse
-
.configuration ⇒ Firebug::Configuration
(also: config)
Firebug configuration.
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Object
Configure Firebug inside a block.
-
.decrypt(data, key = nil) ⇒ Object
Decrypt data encrypted using CodeIgniters encryption.
-
.decrypt_cookie(data) ⇒ Object
Decodes the base64 encoded string, decrypts, and unserializes.
-
.encrypt(data, key = nil) ⇒ Object
Encrypt data the way CodeIgniter does.
-
.encrypt_cookie(data) ⇒ String
Serializes, encrypts, and base64 encodes the data.
-
.serialize(value) ⇒ String
Serialize a ruby object into a PHP serialized string.
-
.unserialize(value) ⇒ Object
Unserialize a PHP serialized string into a ruby object.
Class Attribute Details
.configuration ⇒ Firebug::Configuration Also known as: config
Firebug configuration
18 19 20 |
# File 'lib/firebug.rb', line 18 def configuration @configuration ||= Configuration.new end |
Class Method Details
.configure {|config| ... } ⇒ Object
Configure Firebug inside a block.
31 32 33 |
# File 'lib/firebug.rb', line 31 def configure yield configuration end |
.decrypt(data, key = nil) ⇒ Object
Decrypt data encrypted using CodeIgniters encryption.
71 72 73 |
# File 'lib/firebug.rb', line 71 def decrypt(data, key=nil) Crypto.new(key.nil? ? config.key : key).decrypt(data) end |
.decrypt_cookie(data) ⇒ Object
Decodes the base64 encoded string, decrypts, and unserializes.
87 88 89 |
# File 'lib/firebug.rb', line 87 def (data) data.nil? ? {} : Firebug.unserialize(Firebug.decrypt(Base64.strict_decode64(data))) end |
.encrypt(data, key = nil) ⇒ Object
Encrypt data the way CodeIgniter does.
61 62 63 |
# File 'lib/firebug.rb', line 61 def encrypt(data, key=nil) Crypto.new(key.nil? ? config.key : key).encrypt(data) end |
.encrypt_cookie(data) ⇒ String
Serializes, encrypts, and base64 encodes the data.
79 80 81 |
# File 'lib/firebug.rb', line 79 def (data) Base64.strict_encode64(Firebug.encrypt(Firebug.serialize(data))) end |
.serialize(value) ⇒ String
Serialize a ruby object into a PHP serialized string.
41 42 43 |
# File 'lib/firebug.rb', line 41 def serialize(value) Serializer.parse(value) end |
.unserialize(value) ⇒ Object
Unserialize a PHP serialized string into a ruby object.
51 52 53 |
# File 'lib/firebug.rb', line 51 def unserialize(value) Unserializer.parse(value) end |