Module: FigTree::ClassMethods

Defined in:
lib/fig_tree.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#after_configure(&block) ⇒ Object

Pass a block to run after configuration is done.



245
246
247
248
249
# File 'lib/fig_tree.rb', line 245

def after_configure(&block)
  mod = self
  config.class.set_callback(:configure, :after,
                            proc { mod.instance_eval(&block) })
end

#configConfigStruct

Returns:



240
241
242
# File 'lib/fig_tree.rb', line 240

def config
  @config ||= ConfigStruct.new('config')
end

#configure(&block) ⇒ Object

Configure the settings with values.



226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/fig_tree.rb', line 226

def configure(&block)
  if defined?(Rake) && defined?(Rake.application)
    tasks = Rake.application.top_level_tasks
    if tasks.any? { |t| %w(assets webpacker yarn).include?(t.split(':').first) }
      puts 'Skipping Deimos configuration since we are in JS/CSS compilation'
      return
    end
  end
  config.run_callbacks(:configure) do
    config.instance_eval(&block)
  end
end

#define_settings(&block) ⇒ Object

Define and redefine settings.



221
222
223
# File 'lib/fig_tree.rb', line 221

def define_settings(&block)
  config.instance_eval(&block)
end