Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function to pluginHelper #17

Merged

Conversation

achambers
Copy link
Member

@achambers achambers commented Nov 21, 2016

This PR will add a readConfig function to the pluginHelper object that is passed to plugin functions.

This function would be used by plugin authors and users that would like to access the config for the current plugin. An example of this is as follows:

host: 'localhost',
port: 1234,
redisDeployClient: function(context, pluginHelper) {
  var redisLib = context._redisLib;
  var options: {
    host: pluginHelper.readConfig('host'),
    port: pluginHelper.readConfig('port'),
  };

  return new Redis(options, redisLib);
},

This is instead of doing the old way:

host: 'localhost',
port: 1234,
redisDeployClient: function(context) {
  var redisLib = context._redisLib;
  var options: {
    host: this.readConfig('host'),
    port: this.readConfig('port'),
  };

  return new Redis(options, redisLib);
},

which no longer works since ember-cli-deploy/ember-cli-deploy-plugin#15 was introduced.

@lukemelia lukemelia merged commit 8b121af into ember-cli-deploy:master Nov 21, 2016
@achambers achambers deleted the add-read-config-to-plugin-helper branch November 21, 2016 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants