class Crackin::Config
Attributes
source[R]
Public Class Methods
defaults()
click to toggle source
# File lib/crackin/config.rb, line 27 def defaults { name: '<app>', scm: 'git', changelog: 'CHANGELOG.md', branch: { production: 'master', development: 'develop' }, status: { verbose: true }, version: 'lib/<app>/version.rb', build: { command: 'rake build', # gem build :name.gemspec && mkdir -p pkg && mv :name.gem pkg after: [] } }.deep_stringify_keys end
instance()
click to toggle source
# File lib/crackin/config.rb, line 23 def instance @config || load end
load(file="./.crackin.yml")
click to toggle source
# File lib/crackin/config.rb, line 19 def load(file="./.crackin.yml") @config = Crackin::Config.new(file) end
new(file="./.crackin.yml")
click to toggle source
# File lib/crackin/config.rb, line 8 def initialize(file="./.crackin.yml") yaml = YAML.load_file(file) @config = self.class.defaults.deep_merge(yaml['crackin']||{}) @source = Crackin::Scm.open(@config) end
Public Instance Methods
[](key)
click to toggle source
# File lib/crackin/config.rb, line 14 def [](key) @config[key] end