Method: Collab.config

Defined in:
lib/collab/config.rb

.configObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/collab/config.rb', line 4

def self.config
  if block_given?
    @config_mutex.synchronize do
      @config ||= ::Collab::Config.new
      raise "[Collab] Tried to configure gem after first use" if @config.frozen?
      yield @config
    end
  else
    raise "[Collab] Missing configuration - Have you run `rails g collab:install` yet?" unless @config
    @config.freeze # really weird stuff could happen if the config changes after first use, so freeze config
  end
end