Module: Humpass
- Defined in:
- lib/humpass.rb,
lib/humpass/version.rb,
lib/humpass/database.rb,
lib/humpass/lock_word.rb,
lib/humpass/configuration.rb,
lib/humpass/data_structure.rb,
lib/humpass/password_generator.rb
Defined Under Namespace
Modules: PasswordGenerator
Classes: Configuration, DataStructure, Database, LockWord
Constant Summary
collapse
- VERSION =
"0.3.2"
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.configuration ⇒ Object
Returns the value of attribute configuration.
3
4
5
|
# File 'lib/humpass/configuration.rb', line 3
def configuration
@configuration
end
|
.data_structure ⇒ Object
Returns the value of attribute data_structure.
4
5
6
|
# File 'lib/humpass/data_structure.rb', line 4
def data_structure
@data_structure
end
|
.database ⇒ Object
Returns the value of attribute database.
7
8
9
|
# File 'lib/humpass/database.rb', line 7
def database
@database
end
|
.lockwords ⇒ Object
Returns the value of attribute lockwords.
3
4
5
|
# File 'lib/humpass/lock_word.rb', line 3
def lockwords
@lockwords
end
|
Class Method Details
12
13
14
15
16
|
# File 'lib/humpass/configuration.rb', line 12
def self.configure
self.configuration ||= Configuration.new
yield(configuration)
initial_setup(configuration.master_password)
end
|
.generate_password(place) ⇒ Object
13
14
15
16
17
|
# File 'lib/humpass.rb', line 13
def self.generate_password(place)
password = Humpass::PasswordGenerator.generate_password
Humpass.data_structure.add_password(place, password)
password
end
|
.get_password(place) ⇒ Object
24
25
26
|
# File 'lib/humpass.rb', line 24
def self.get_password(place)
Humpass.data_structure.get_password(place)
end
|
.initial_setup(master_password = nil) ⇒ Object
6
7
8
9
10
|
# File 'lib/humpass/configuration.rb', line 6
def self.initial_setup(master_password = nil)
set_database(configuration.database_path)
set_data_structure
self
end
|
.list_passwords ⇒ Object
32
33
34
|
# File 'lib/humpass.rb', line 32
def self.list_passwords
Humpass.data_structure.list_passwords
end
|
.remove_password(place) ⇒ Object
28
29
30
|
# File 'lib/humpass.rb', line 28
def self.remove_password(place)
Humpass.data_structure.remove_place(place)
end
|
.set_data_structure ⇒ Object
7
8
9
|
# File 'lib/humpass/data_structure.rb', line 7
def self.set_data_structure
self.data_structure = DataStructure.new
end
|
.set_database(file_path = nil) ⇒ Object
10
11
12
|
# File 'lib/humpass/database.rb', line 10
def self.set_database(file_path = nil)
self.database ||= Database.new(file_path)
end
|
.set_lock_words(lock_words) ⇒ Object
6
7
8
|
# File 'lib/humpass/lock_word.rb', line 6
def self.set_lock_words(lock_words)
self.lockwords = lock_words
end
|
.set_password(place, password) ⇒ Object
19
20
21
22
|
# File 'lib/humpass.rb', line 19
def self.set_password(place, password)
Humpass.data_structure.add_password(place, password)
password
end
|