Class: Ventouse
- Inherits:
-
Object
- Object
- Ventouse
- Defined in:
- lib/ventouse.rb
Class Method Summary collapse
- .disable_rails_transactions ⇒ Object
- .ensure_dir_exists(dir) ⇒ Object
- .random_pronouncable_password(size = 6) ⇒ Object
Class Method Details
.disable_rails_transactions ⇒ Object
22 23 24 |
# File 'lib/ventouse.rb', line 22 def self.disable_rails_transactions require 'ventouse/disable_transactions' end |
.ensure_dir_exists(dir) ⇒ Object
38 39 40 |
# File 'lib/ventouse.rb', line 38 def self.ensure_dir_exists dir dir.tap { FileUtils.mkdir_p(dir) unless File.exist? dir and File.directory? dir } end |
.random_pronouncable_password(size = 6) ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/ventouse.rb', line 27 def self.random_pronouncable_password(size = 6) c = %w(b c d f g h j k l m n p qu r s t v w x z ch cr fr nd ng nk nt ph pr rd sh sl sp st th tr) v = %w(a e i o u y) f, r = true, '' (size * 2).times do r << (f ? c[rand * c.size] : v[rand * v.size]) f = !f end r end |