Module: Caviidae

Defined in:
lib/caviidae.rb,
lib/caviidae/config.rb,
lib/caviidae/version.rb,
lib/caviidae/rspec/helpers.rb

Defined Under Namespace

Modules: RSpec Classes: Configuration

Constant Summary collapse

VERSION =
"0.0.5"

Class Method Summary collapse

Class Method Details

.configurationObject



5
6
7
# File 'lib/caviidae/config.rb', line 5

def configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Pass in a block to configure

Yields:



10
11
12
# File 'lib/caviidae/config.rb', line 10

def configure
  yield configuration
end

.dbObject



15
16
17
18
19
20
21
22
# File 'lib/caviidae.rb', line 15

def db
  unless @client
    @client = Databasedotcom::Client.new :client_id => configuration.client_id, :client_secret => configuration.client_secret, :host => configuration.host
    @client.authenticate :username => configuration.username, :password => "#{CGI::escape(configuration.password)}#{configuration.security_token}"
  end

  @client
end

.materializeObject



9
10
11
12
13
# File 'lib/caviidae.rb', line 9

def materialize
  Caviidae.configuration.materialize.each do |sobject|
    db.materialize(sobject)
  end
end