Set Rails configuration parameters using environment variables
Deprecatable is a library to help you, as a developer, deprecate your API and be proactive about helping people who use your library find where they need to update. When using Deprecatable, you mark methods as 'deperecated' and then the users of your API will receive a helpful alert showing the exact line of code where they called the deprecated API, and what they need to do to fix it (although you need to supply this piece of information). Users will receive, by default, a single alert for each unique location a deprecated API method is invoked. They will also receive a final report detailing all the locations where deprecated APIs were invoked. The "noisiness" of the alerting and the final report is all configurable, via both code, and environment variables. See Deprecatable::Options.
A ripl plugin to provide an interactive shell for creating page objects to build an automated testing infrastructure for a site. Set environment variable RIPL_WATIR_RELOAD to force reloading of pages each time they are used (this is only useful during development).
Computes timezones using the system TZ environment variable.
A plugin for RubyGems which lets you pass in version strings via a environment variable.
Set parameters acquired from AWS EC2 Parameter Store as environment variables.
S3Config adopts Heroku-style config management for any Rails application using AWS S3 to store, and Rack middleware to inject environment variables.
A simple gem to control logging at runtime with an environment variable
Class helper for example files. Usualy it's the alternative to environment variables (and `.env` files). You can have git-controlled example files and git-ignored real files. For example, configuration, especially with sensitive data.
Use this client to retrieve your configuration from a Config Server. The required parameters can either be supplied to the constructor, or they will be pulled from environment variables. An ArgumentError will be raised if the parameters are not available from either source. Parameters supplied to the constructor will take precedence over environment variables.
Environment-variable compatible application configuration.
Automatically loads heroku config variables into your environment for development
:title: The Ruby API :section: PYAPNS::Client There's python in my ruby! This is a class used to send notifications, provision applications and retrieve feedback using the Apple Push Notification Service. PYAPNS is a multi-application APS provider, meaning it is possible to send notifications to any number of different applications from the same application and same server. It is also possible to scale the client to any number of processes and servers, simply balanced behind a simple web proxy. It may seem like overkill for such a bare interface - after all, the APS service is rather simplistic. However, PYAPNS takes no shortcuts when it comes to completeness/compliance with the APNS protocol and allows the user many optimization and scaling vectors not possible with other libraries. No bandwidth is wasted, connections are persistent and the server is asynchronous therefore notifications are delivered immediately. PYAPNS takes after the design of 3rd party push notification service that charge a fee each time you push a notification, and charge extra for so-called 'premium' service which supposedly gives you quicker access to the APS servers. However, PYAPNS is free, as in beer and offers more scaling opportunities without the financial draw. :section: Provisioning To add your app to the PYAPNS server, it must be `provisioned` at least once. Normally this is done once upon the start-up of your application, be it a web service, desktop application or whatever... It must be done at least once to the server you're connecting to. Multiple instances of PYAPNS will have to have their applications provisioned individually. To provision an application manually use the `PYAPNS::Client#provision` method. require 'pyapns' client = PYAPNS::Client.configure client.provision :app_id => 'cf', :cert => '/home/ss/cert.pem', :env => 'sandbox', :timeout => 15 This basically says "add an app reference named 'cf' to the server and start a connection using the certification, and if it can't within 15 seconds, raise a `PYAPNS::TimeoutException` That's all it takes to get started. Of course, this can be done automatically by using PYAPNS::ClientConfiguration middleware. `PYAPNS::Client` is a singleton class that is configured using the class method `PYAPNS::Client#configure`. It is sensibly configured by default, but can be customized by specifying a hash See the docs on `PYAPNS::ClientConfiguration` for a list of available configuration parameters (some of these are important, and you can specify initial applications) to be configured by default. :section: Sending Notifications Once your client is configured, and application provisioned (again, these should be taken care of before you write notification code) you can begin sending notifications to users. If you're wondering how to acquire a notification token, you've come to the wrong place... I recommend using google. However, if you want to send hundreds of millions of notifications to users, here's how it's done, one at a time... The `PYAPNS::Client#notify` is a sort of polymorphic method which can notify any number of devices at a time. It's basic form is as follows: client.notify 'cf', 'long ass app token', {:aps=> {:alert => 'hello?'}} However, as stated before, it is sort of polymorphic: client.notify 'cf', ['token', 'token2', 'token3'], [alert, alert2, alert3] client.notify :app_id => 'cf', :tokens => 'mah token', :notifications => alertHash client.notify 'cf', 'token', PYAPNS::Notification('hello tits!') As you can see, the method accepts paralell arrays of tokens and notifications meaning any number of notifications can be sent at once. Hashes will be automatically converted to `PYAPNS::Notification` objects so they can be optimized for the wire (nil values removed, etc...), and you can pass `PYAPNS::Notification` objects directly if you wish. :section: Retrieving Feedback The APS service offers a feedback functionality that allows application servers to retrieve a list of device tokens it deems to be no longer in use, and the time it thinks they stopped being useful (the user uninstalled your app, better luck next time...) Sounds pretty straight forward, and it is. Apple recommends you do this at least once an hour. PYAPNS will return a list of 2-element lists with the date and the token: feedbacks = client.feedback 'cf' :section: Asynchronous Calls PYAPNS::Client will, by default, perform no funny stuff and operate entirely within the calling thread. This means that certain applications may hang when, say, sending a notification, if only for a fraction of a second. Obviously not a desirable trait, all `provision`, `feedback` and `notify` methods also take a block, which indicates to the method you want to call PYAPNS asynchronously, and it will be done so handily in another thread, calling back your block with a single argument when finished. Note that `notify` and `provision` return absolutely nothing (nil, for you rub--wait you are ruby developers!). It is probably wise to always use this form of operation so your calling thread is never blocked (especially important in UI-driven apps and asynchronous servers) Just pass a block to provision/notify/feedback like so: PYAPNS::Client.instance.feedback do |feedbacks| feedbacks.each { |f| trim_token f } end :section: PYAPNS::ClientConfiguration A middleware class to make `PYAPNS::Client` easy to use in web contexts Automates configuration of the client in Rack environments using a simple confiuration middleware. To use `PYAPNS::Client` in Rack environments with the least code possible `use PYAPNS::ClientConfiguration` (no, really, in some cases, that's all you need!) middleware with an optional hash specifying the client variables. Options are as follows: use PYAPNS::ClientConfiguration( :host => 'http://localhost/' :port => 7077, :initial => [{ :app_id => 'myapp', :cert => '/home/myuser/apps/myapp/cert.pem', :env => 'sandbox', :timeout => 15 }]) Where the configuration variables are defined: :host String the host where the server can be found :port Number the port to which the client should connect :initial Array OPTIONAL - an array of INITIAL hashes INITIAL HASHES: :app_id String the id used to send messages with this certification can be a totally arbitrary value :cert String a path to the certification or the certification file as a string :env String the environment to connect to apple with, always either 'sandbox' or 'production' :timoeut Number The timeout for the server to use when connecting to the apple servers :section: PYAPNS::Notification An APNS Notification You can construct notification objects ahead of time by using this class. However unnecessary, it allows you to programmatically generate a Notification like so: note = PYAPNS::Notification.new 'alert text', 9, 'flynn.caf', {:extra => 'guid'} -- or -- note = PYAPNS::Notification.new 'alert text' These can be passed to `PYAPNS::Client#notify` the same as hashes
A gem for managing feature flags either with environment variables or config files
http://www.engineyard.com/blog/2010/extending-rails-3-with-railties/ http://www.igvita.com/2010/08/04/rails-3-internals-railtie-creating-plugins/ h1. Morning Glory Morning Glory is comprised of a rake task and helper methods that manages the deployment of static assets into an Amazon CloudFront CDN's S3 Bucket, improving the performance of static assets on your Rails web applications. _NOTE: You will require an Amazon Web Services (AWS) account in order to use this gem. Specially: S3 for storing the files you wish to distribute, and CloudFront for CDN distribution of those files._ This version of Morning Glory works with Rails 3.x and Ruby 1.9.x h2. What does it do? Morning Glory provides an easy way to deploy Ruby on Rails application assets to the Amazon CloudFront CDN. It solves a number of common issues with S3/CloudFront. For instance, CloudFront won't automatically expire old assets stored on edge nodes when you redeploy new assets (the Cloudfront expiry time is 24 hours minimum). To fix this Morning Glory will automatically namespace asset releases for you, then update all references to those renamed assets within your stylesheets ensuring there are no broken asset links. It also provides a helper method to rewrite all standard Rails asset helper generated URLs to your CloudFront CDN distributions, as well as handling switching between HTTP and HTTPS. Morning Glory was also built with SASS (Syntactically Awesome Stylesheets) in mind. If you use Sass for your stylesheets they will automatically be built before deployment to the CDN. See http://sass-lang.com/ for more information on Sass.s h2. What it doesn't do Morning Glory cannot configure your CloudFront distributions for you automatically. You will manually have to login to your AWS Management Console account, "https://console.aws.amazon.com/cloudfront/home":https://console.aws.amazon.com/cloudfront/home, and set up a distribution pointing to an S3 Bucket. h2. Installation <pre> gem 'morning_glory' </pre> h2. Usage Morning Glory provides it's functionality via rake tasks. You'll need to specify the target rails environment configuration you want to deploy for by using the @RAILS_ENV={env}@ parameter (for example, @RAILS_ENV=production@). <pre> rake morning_glory:cloudfront:deploy RAILS_ENV={YOUR_TARGET_ENVIRONMENT} </pre> h2. Configuration h3. The Morning Glory configuration file, @config/morning_glory.yml@ You can specify a configuration section for every rails environment (production, staging, testing, development). This section can have the following properties defined: <pre> --- production: enabled: true # Is MorningGlory enabled for this environment? bucket: cdn.production.foo.com # The bucket to deploy your assets into s3_logging_enabled: true # Log the deployment to S3 revision: "20100317134627" # The revision prefix. This timestamp automatically generateed on deployment delete_prev_rev: true # Delete the previous asset release (save on S3 storage space) </pre> h3. The Amazon S3 authentication keys configuration file, @config/s3.yml@ This file provides the access credentials for your Amazon AWS S3 account. You can configure keys for all your environments (production, staging, testing, development). <pre> --- production: access_key_id: YOUR_ACCESS_KEY secret_access_key: YOUR_SECRET_ACCESS_KEY </pre> Note: If you are deploying your system to Heroku, you can configure your Amazon AWS S3 information with the environment variables S3_KEY and S3_SECRET instead of using a configuration file. h3. Set up an asset_host For each environment that you'd like to utilise the CloudFront CDN for you'll need to define the asset_host within the @config/environments/{ENVIRONMENT}.rb@ configuration file. As of June 2010 AWS supports HTTPS requests on the CloudFront CDN, so you no longer have to worry about switching servers. (Yay!) h4. Example config/environments/production.rb @asset_host@ snippet: Here we're targeting a CNAME domain with HTTP support. <pre> ActionController::Base.asset_host = Proc.new { |source, request| if request.ssl? "#{request.protocol}#{request.host_with_port}" else "#{request.protocol}assets.example.com" end } </pre> h3. Why do we have to use a revision-number/namespace/timestamp? Once an asset has been deployed to the Amazon Cloudfront edge servers it cannot be modified - the version exists until it expires (minimum of 24 hours). To get around this we need to prefix the asset path with a revision of some sort - in MorningGlory's case we use a timestamp. That way you can deploy many times during a 24 hour period and always have your latest revision available on your web site. h2. Dependencies h3. AWS S3 Required for uploading the assets to the Amazon Web Services S3 buckets. See "http://amazon.rubyforge.org/":http://amazon.rubyforge.org/ for more documentation on installation. h2. About the name Perhaps not what you'd expect; a "Morning Glory":http://en.wikipedia.org/wiki/Morning_Glory_cloud is a rare cloud formation observed by glider pilots in Australia (see my side project, "YourFlightLog.com for flight-logging software for paraglider and hang-glider pilots":http://www.yourflightlog.com, from which the Morning Glory plugin was originally extracted). Copyright (c) 2010 "@AdamBurmister":http://twitter.com/adamburmister/, released under the MIT license
Load environment variables from various sources within the Rails initialization process
A simple CLI to manage environment variables on your local machine. Perform basic CRUD for your environment variables all in the command line.
Make zero downtime deployments easier allowing developers to promote environment variables
Loads AWS credentials as environment variables from `.env`.
It is said to be good practice when you configure your app with a .env file. This library will (1) scan your source code looking for requests for environment variables, (2) parse a .env file and the variables defined on the machine, and (3) generate source code file to compile into app.
Reusable default application settings, environment variables, and deployment tasks.
# holepunch [![Gem Version](https://badge.fury.io/rb/holepunch.svg)](http://badge.fury.io/rb/holepunch) [![Build Status](https://travis-ci.org/undeadlabs/holepunch.svg?branch=master)](https://travis-ci.org/undeadlabs/holepunch) Holepunch manages AWS EC2 security groups in a declarative way through a DSL. ## Requirements - Ruby 1.9.3 or newer. ## Installation ```bash gem install holepunch ``` or in your Gemfile ```ruby gem 'holepunch' ``` ## Basic Configuration You need to provide your AWS security credentials and a region. These can be provided via the command-line options, or you can use the standard AWS environment variables: ```bash export AWS_ACCESS_KEY_ID='...' export AWS_SECRET_ACCESS_KEY='...' export AWS_REGION='us-west-2' ``` ## The SecurityGroups file Specify your security groups in a `SecurityGroups` file in your project's root. Declare security groups that you need and the ingresses you want to expose. You can add ingresses using `tcp`, `udp`, and `ping`. For each ingress you can list allowed hosts using group names or CIDR notation. ```ruby group 'web' do desc 'Web servers' tcp 80 end group 'db' do desc 'database servers' tcp 5432, 'web' end group 'log' do desc 'log server' tcp 9999, 'web', 'db', '10.1.0.0/16' end ``` An environment can be specified which is available through the `env` variable. This allows you to have custom security groups per server environment. ```ruby group "#{env}-web" group "#{env}-db" do tcp 5432, "#{env}-web" end ``` Your application may depend on security groups defined by other services. Ensure they exist using the `depends` method. ```ruby depends 'my-other-service' group 'my-service' do udp 9999, 'my-other-service' end ``` You may specify port ranges for `tcp` and `udp` using the range operator. ```ruby group 'my-service' do udp 5000..9999, '0.0.0.0/0' end ``` You can specify ping/icmp rules with `icmp` (alias: `ping`). ```ruby group 'my-service' do ping '10.0.0.0/16' end ``` It can be useful to describe groups of security groups you plan to launch instances with by using the `service` declaration. ```ruby service "#{env}-web" do groups %W( admin #{env}-log-producer #{env}-web ) end ``` ## Usage Simply navigate to the directory containing your `SecurityGroups` file and run `holepunch`. ``` $ holepunch ``` If you need to specify an environment: ``` $ holepunch -e live ``` You can get a list of security groups for a service using the `service` subcommand. ``` $ holepunch service -e prod prod-web admin,prod-log-producer,prod-web ``` You can also get a list of all defined services. ``` $ holepunch service --list ``` ## Testing You can run the unit tests by simply running rspec. ``` $ rspec ``` By default the integration tests with EC2 are not run. You may run them with: ``` $ rspec -t integration ``` ## Authors - Ben Scott (gamepoet@gmail.com) - Pat Wyatt (pat@codeofhonor.com) ## License Copyright 2014 Undead Labs, LLC. Licensed under the MIT License: http://opensource.org/licenses/MIT
Allows Net:SSH to use an external program to prompt for passwords, via the SSH_ASKPASS environment variable.
Simple configuration management with environment variables
Simple and flexible approach to loading environment variables.
Ruby gem for tying feature flags to environment variables
Encrypts and decrypts environment variables
Takes advantage of method_missing to give you fast access to environment variables.
test_selector can be used to find specific elements in your tests without adding css variables or other html elements to your production environment
Custom YAML tag for referring environment variables in YAML files
Compare ENV variables across Heroku environments
Encrypt secret information environment variables by yaml.
Middleware for blocking requests to rake apps based on user agent, remote IP, and other environment variables.
Store your secret environment variables with GPGME, and inject them into your current shell when needed.
Manages defining optional (and default) values, environment specific values and required values. There is a focus on 12 Factor principle and definining most variables outside of the environment in production but making it easy for developers to get started with development environment specific variables and sensible defaults.
Install this gem directly on an Elastic Beanstalk instance that is running Amazon Linux and Docker. The environment variables you set for the default instance are used to start the new container. Useful for running rake tasks in your production environment.
ec2 instance tag apply environment variables.
Parse a version from the content type string and then use it in the environment variable. For example: 'Content-type:text/html;vnd.example-com.foo+json; version=1.1' will be parsed into 1.1
FlexConf is a simple configuration utility that does its job and gets out of your way. It reads settings from a hash or YAML file ('config.yml' by default) but allows overrides from a '*_local.yml' file and from environment variables. Settings can be read as indifferent hash values (config['foo'] or config[:foo]) or method calls (config.foo) with recursive nesting (config.foo.bar). The code is lightweight and fast with no additional dependencies.
I'm tired of the complications that tools like bundler and rvm inject into my system and my workflow. I don't want 4 billion gems installed globally. I don't want to have `rake` slow down for no good reason. I don't want rvm to regress on undefined variables over and over and over (and I don't want to report it anymore when it does). I want as much simplicity as I can afford and still be able to get my job done. I've found pretty good balance using rbenv (only when needed) and by using this 45 line shell function `ohmygems` (aliased to `omg`, of course). I still have my system-level gems as my previous GEM_HOME gets moved into GEM_PATH so things like minitest and autotest are always available. But now I have private gems that are incredibly easy to switch around and only rely on simple environment variables to manage. To go back to normal, simply run `omg reset`.
Rack middleware to fake some environment variables that make it seem like mod_pubcookie is being used. Useful for dev environments.
A simple DynamoDB client module that allows you to override the endpoint using an environment variable.
Keep your project's environment variables in snyc across your team.
A simple ruby class that searchers for place holders and inserts environment variable values in their place.
Configure local environment based on Heroku config variables
Store environment variables in redis
Parser for environment variables in .travis.yml
Fetch environment variables from Doppler and inject them into your Rails application.
Load environment variables from .env
Library which allows you to check and sanitize you environment variables, raising exception if required variables are not configured, type-casting non-string variables and exposing them using an idiomatic API.