Skip to content

eachscape/online

Repository files navigation

This gem will contain an extracted version of EachScape’s OnlineStorage and OnlineQueue classes, renamed to Online::Storage and Online::Queue, respectively, but otherwise maintaining the existing API.

The goal of this gem is to make it easy for external contractors to build an EachScape-compatible development environment, and to make it easier to decouple various worker daemons.

The following sources of information are automatically used to configure this gem:

ENV['AWS_ACCESS_KEY_ID']

Amazon credentials (required).

ENV['AWS_SECRET_ACCESS_KEY']

Amazon credentials (required).

ENV['ONLINE_BUCKET_PREFIX']

By default, bucket names will begin with this prefix. You will typically want to set it to something like ‘com.example’.

ENV['USER']

This will be appended to certain bucket names in the development environment.

Rails.env

If present, this will be used to determine the environment name. If absent, it defaults to ‘development’.

You can also override the bucket prefix or the environment using Ruby code:

Online.env = 'production'Online.bucket_prefix = 'com.example'

If you’re writing unit tests, and you want to use a mock implementation of the Online gem, you can call:

Online.mock_storage_directory = Rails.configuration.storage_rootOnline.mock!

This will allow you to run unit tests without touching S3. To run this once before loading any unit tests, put it in test/support/mock_online.rb (at least on newer versions of Rails).

Note that this will mock both Online::Storage and Online::Queue, unlike previous versions of OnlineQueue, which always used S3 when running unit tests.

To turn off mocking, call:

Online.mock!(false) 

You may turn mocking off and on as often as you’d like.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages