Sha256: 90cdbb3390ed7bbaa6c4efc4f64e298214856d987ac23e9708e652c26b30a4da

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 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
    dir.tap { FileUtils.mkdir_p(dir) unless File.exist? dir and File.directory? dir }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
programmable-ventouse-0.1.2 lib/ventouse.rb
programmable-ventouse-0.1.3 lib/ventouse.rb