Sha256: 6ce1d7a79e1aec2c6fa92209d19b8dbcd29838c8d470bef130d0016fa2800103

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

require 'ventouse/filter_prefix'
require 'ventouse/module_declarations'
require 'ventouse/rescue_ext'

if defined? ActiveRecord
  require 'ventouse/ar_touch'
  require 'ventouse/fix_partial_updates'
  require 'ventouse/rename_type_column'
end

if defined? ActionController
  require 'ventouse/resource_as_root'
end

unless Gem.available? 'mysql' or Gem.available? 'mysqlplus' or Gem.available? 'activerecord-jdbc-adapter'
  require 'ventouse/mysql_compat'
  puts "Pure ruby mysql.rb driver used!"
end

class Ventouse
  def self.disable_rails_transactions
    require 'ventouse/disable_transactions'
  end

  #http://snippets.dzone.com/posts/show/2137
  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

  def self.ensure_dir_exists dir
    FileUtils.mkdir_p dir unless File.exist? dir and File.directory? dir
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
programmable-ventouse-0.1.1 lib/ventouse.rb