Sha256: 5b64e9f6aceeae1c6788e4e7858f75ede2ab0d1fb0e4af2671b1271aad1524aa

Contents?: true

Size: 1.36 KB

Versions: 17

Compression:

Stored size: 1.36 KB

Contents

if config['use_heroku']
  
  header = <<-YAML
<% if ENV['MONGOHQ_URL'] %>
<% mongohq = URI.parse(ENV['MONGOHQ_URL']) %>
mongohq:
  host: <%= mongohq.host %>
  port: <%= mongohq.port %>
  database: <%= mongohq.path.sub '/', '' %>
  username: <%= mongohq.user %>
  password: <%= mongohq.password %>
<% end %>
YAML

  after_everything do
    say_wizard 'Adding mongohq:free addon (you can always upgrade later)'  
    system 'heroku addons:add mongohq:free'
  end
else
  mongohq = URI.parse(config['uri'])
  
  header = <<-YAML
mongohq:
  host: #{mongohq.host}
  port: #{mongohq.port}
  database: #{mongohq.path.sub '/',''}
  username: #{mongohq.user}
  password: #{mongohq.password}
YAML
end

after_bundler do
  mongo_yml = "config/mongo#{'id' if scroll?('mongoid')}.yml"

  prepend_file mongo_yml, header
  inject_into_file mongo_yml, "  <<: *mongohq\n", :after => "production:\n  <<: *defaults\n"
end

__END__

name: MongoHQ
description: "Utilize MongoHQ as the production data host for your application."
author: mbleigh

requires_any: [mongo_mapper, mongoid]
run_after: [mongo_mapper, mongoid, heroku]
exclusive: mongodb_host
category: services
tags: [mongodb]

config:
  - use_heroku:
      type: boolean
      prompt: "Use the MongoHQ Heroku addon?"
      if_scroll: heroku
  - uri:
      type: string
      prompt: "Enter your MongoHQ URI:"
      unless: use_heroku

# TODO eycloud partners

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
appscrolls-0.11.2 scrolls/untested/mongohq.rb
appscrolls-0.11.1 scrolls/untested/mongohq.rb
appscrolls-0.11.0 scrolls/untested/mongohq.rb
appscrolls-0.10.1 scrolls/untested/mongohq.rb
appscrolls-0.10.0 scrolls/untested/mongohq.rb
appscrolls-0.9.0 scrolls/untested/mongohq.rb
appscrolls-0.8.4 scrolls/zzz/mongohq.rb
appscrolls-0.8.3 scrolls/zzz/mongohq.rb
appscrolls-0.8.2 scrolls/zzz/mongohq.rb
appscrolls-0.8.1 scrolls/zzz/mongohq.rb
appscrolls-0.8.0 scrolls/zzz/mongohq.rb
appscrolls-0.7.1 scrolls/zzz/mongohq.rb
appscrolls-0.7.0 scrolls/zzz/mongohq.rb
eldarscrolls-0.7.0 scrolls/zzz/mongohq.rb
ey_rails_wizard-0.6.0 scrolls/zzz/mongohq.rb
ey_rails_wizard-0.5.0 scrolls/mongohq.rb
ey_rails_wizard-0.4.0 scrolls/mongohq.rb