Module: Firebug
- Defined in:
- lib/firebug.rb,
lib/firebug/crypto.rb,
lib/firebug/session.rb,
lib/firebug/version.rb,
lib/firebug/serializer.rb,
lib/firebug/unserializer.rb,
lib/firebug/configuration.rb
Defined Under Namespace
Classes: Configuration, Crypto, ParserError, Serializer, Session, Unserializer
Constant Summary collapse
- VERSION =
The current version of Firebug
'1.1.0'
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
17 18 19 |
# File 'lib/firebug.rb', line 17 def configuration @configuration ||= Configuration.new end |
Class Method Details
.configure {|config| ... } ⇒ Object
Configure Firebug inside a block.
30 31 32 |
# File 'lib/firebug.rb', line 30 def configure yield configuration end |
.decrypt(data, key = nil) ⇒ Object
Decrypt data encrypted using CodeIgniters encryption.
70 71 72 |
# File 'lib/firebug.rb', line 70 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.
86 87 88 |
# File 'lib/firebug.rb', line 86 def (data) data.nil? ? {} : Firebug.unserialize(Firebug.decrypt(Base64.strict_decode64(data))) end |
.encrypt(data, key = nil) ⇒ Object
Encrypt data the way CodeIgniter does.
60 61 62 |
# File 'lib/firebug.rb', line 60 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.
78 79 80 |
# File 'lib/firebug.rb', line 78 def (data) Base64.strict_encode64(Firebug.encrypt(Firebug.serialize(data))) end |
.serialize(value) ⇒ String
Serialize a ruby object into a PHP serialized string.
40 41 42 |
# File 'lib/firebug.rb', line 40 def serialize(value) Serializer.parse(value) end |
.unserialize(value) ⇒ Object
Unserialize a PHP serialized string into a ruby object.
50 51 52 |
# File 'lib/firebug.rb', line 50 def unserialize(value) Unserializer.parse(value) end |