Module: CopycopterClient
- Defined in:
- lib/copycopter_client.rb,
lib/copycopter_client/cache.rb,
lib/copycopter_client/rails.rb,
lib/copycopter_client/client.rb,
lib/copycopter_client/errors.rb,
lib/copycopter_client/poller.rb,
lib/copycopter_client/railtie.rb,
lib/copycopter_client/version.rb,
lib/copycopter_client/i18n_backend.rb,
lib/copycopter_client/request_sync.rb,
lib/copycopter_client/configuration.rb,
lib/copycopter_client/process_guard.rb,
lib/copycopter_client/prefixed_logger.rb
Overview
Top-level interface to the Copycopter client.
Most applications should only need to use the CopycopterClient.configure method, which will setup all the pieces and begin synchronization when appropriate.
Defined Under Namespace
Modules: Rails Classes: Cache, Client, Configuration, ConnectionError, I18nBackend, InvalidApiKey, Poller, PrefixedLogger, ProcessGuard, Railtie, RequestSync
Constant Summary collapse
- VERSION =
Client version
"1.1.2"
- API_VERSION =
API version being used to communicate with the server
"2.0".freeze
Class Attribute Summary collapse
-
.configuration ⇒ Configuration
Must act like a hash and return sensible values for all Copycopter configuration options.
-
.poller ⇒ Poller
This is set when CopycopterClient.configure is called.
Class Method Summary collapse
- .cache ⇒ Object
- .client ⇒ Object
-
.configure(apply = true) {|Configuration| ... } ⇒ Object
Call this method to modify defaults in your initializers.
-
.deploy ⇒ Object
Issues a new deploy, marking all draft blurbs as published.
-
.flush ⇒ Object
Flush queued changed synchronously.
-
.start_poller ⇒ Object
Starts the polling process.
Class Attribute Details
.configuration ⇒ Configuration
Must act like a hash and return sensible values for all Copycopter configuration options. Usually set when configure is called.
14 15 16 |
# File 'lib/copycopter_client.rb', line 14 def configuration @configuration end |
Class Method Details
.cache ⇒ Object
37 38 39 |
# File 'lib/copycopter_client.rb', line 37 def self.cache CopycopterClient.configuration.cache end |
.client ⇒ Object
41 42 43 |
# File 'lib/copycopter_client.rb', line 41 def self.client CopycopterClient.configuration.client end |
.configure(apply = true) {|Configuration| ... } ⇒ Object
Call this method to modify defaults in your initializers.
56 57 58 59 60 |
# File 'lib/copycopter_client.rb', line 56 def self.configure(apply = true) self.configuration ||= Configuration.new yield(configuration) configuration.apply if apply end |
.deploy ⇒ Object
Issues a new deploy, marking all draft blurbs as published. This is called when the copycopter:deploy rake task is invoked.
23 24 25 |
# File 'lib/copycopter_client.rb', line 23 def self.deploy client.deploy end |
.flush ⇒ Object
Flush queued changed synchronously
33 34 35 |
# File 'lib/copycopter_client.rb', line 33 def self.flush cache.flush end |
.start_poller ⇒ Object
Starts the polling process.
28 29 30 |
# File 'lib/copycopter_client.rb', line 28 def self.start_poller poller.start end |