Sha256: 023bc97f3a6e904ff047359770fa38742fc0fb5ce768dd604c7120770e923ded
Contents?: true
Size: 904 Bytes
Versions: 3
Compression:
Stored size: 904 Bytes
Contents
module Gush class Configuration attr_accessor :concurrency, :namespace, :redis_url, :environment def self.from_json(json) new(Gush::JSON.decode(json, symbolize_keys: true)) end def initialize(hash = {}) self.concurrency = hash.fetch(:concurrency, 5) self.namespace = hash.fetch(:namespace, 'gush') self.redis_url = hash.fetch(:redis_url, 'redis://localhost:6379') self.gushfile = hash.fetch(:gushfile, 'Gushfile.rb') self.environment = hash.fetch(:environment, 'development') end def gushfile=(path) @gushfile = Pathname(path) end def gushfile @gushfile.realpath end def to_hash { concurrency: concurrency, namespace: namespace, redis_url: redis_url, environment: environment } end def to_json Gush::JSON.encode(to_hash) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
gush-0.4.1 | lib/gush/configuration.rb |
gush-0.3.3 | lib/gush/configuration.rb |
gush-0.4 | lib/gush/configuration.rb |