<commit_before>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
-----

Example YAML configuration file:

	services:
	  parameters:
	    foo: bar

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

Example JSON configuration file:<commit_msg>Updated documentation to describe how to insert database configuration details from Paasmaker's interface.<commit_after>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:
{'fraction_non_alphanumeric': 0.1485905398948877, 'fraction_numerical': 0.0009555661729574773, 'mean_word_length': 3.8472222222222223, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '157952', 'n_tokens_mistral': 569, 'n_tokens_neox': 517, 'n_words': 203}