Module: StateSync
- Defined in:
- lib/state_sync.rb,
lib/state_sync/version.rb
Defined Under Namespace
Classes: Configuration, ConfigurationError, Error, FetchError, GithubFetcher, GitlabFetcher, Store
Constant Summary collapse
- VERSION =
"0.1.2"
Class Method Summary collapse
- .configuration ⇒ Object
- .configure {|configuration| ... } ⇒ Object
-
.load(path) ⇒ Object
Loads a YAML file from the configured provider (GitHub or GitLab) and returns a Store.
Class Method Details
.configuration ⇒ Object
14 15 16 |
# File 'lib/state_sync.rb', line 14 def configuration @configuration ||= Configuration.new end |
.configure {|configuration| ... } ⇒ Object
9 10 11 12 |
# File 'lib/state_sync.rb', line 9 def configure yield configuration configuration.validate! end |
.load(path) ⇒ Object
Loads a YAML file from the configured provider (GitHub or GitLab) and returns a Store. The file is fetched immediately on this call.
Example:
customers = StateSync.load("config/customers.yml")
customers["allowed_ids"] # => [1, 2, 3]
24 25 26 |
# File 'lib/state_sync.rb', line 24 def load(path) Store.new(path) end |