Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

paasmaker-interface

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

paasmaker-interface

  • 0.9.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Paasmaker Ruby Interface Library

This is a simple Ruby library that is designed to read in the Paasmaker configuration, falling back to a custom configuration file in development.

Usage - Rails

If you want to use this with your Rails project, do the following steps:

  • Add paasmaker-interface to your Gemfile:
gem 'paasmaker-interface'
  • Update your database.yml file to look like the following:
<% require 'paasmaker' %>
<% interface = Paasmaker::Interface.new(['../project-configuration.yml']) %>
<% database = interface.get_service('postgres') %>

production:
  adapter: postgresql
  database: "<%= database['database'] %>"
  host: "<%= database['hostname'] %>"
  username: "<%= database['username'] %>"
  password: "<%= database['password'] %>"
  port: "<%= database['port'] %>"

And update your adapter as appropriate for your application.

Usage - Other applications

To read in the configuration details in other applications, you can instantiate the Interface class directly and work with it.

require 'paasmaker'

interface = Paasmaker::Interface.new(['../project-configuration.yml'])

interface.is_on_paasmaker?()

service = interface.get_service('service')

Example Configuration Overrides

Example YAML configuration file:

services:
  parameters:
    foo: bar

application:
  name: test
  version: 1
  workspace: Test
  workspace_stub: test

Example JSON configuration file:

{
	"services": {
		"parameters": {
			"foo": "bar"
		}
	},
	"application": {
		"name": "test",
		"version": 1,
		"workspace": "Test",
		"workspace_stub": "test"
	}
}

Testing

To run the unit tests for the interface, just execute test.rb in the root of the project.

FAQs

Package last updated on 20 Mar 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc