Sha256: 0e228de7c37dd29c3973769fc67739938822674d0727429c7ab0df5be9008398

Contents?: true

Size: 944 Bytes

Versions: 34

Compression:

Stored size: 944 Bytes

Contents

require_relative 'plugin_factory/version'
require_relative 'plugin_factory/load'

########################################################################################################################

class Fanforce::PluginFactory

  def self.generate(plugin_base_dir)
    require_relative 'plugin_factory/plugin'
    require_relative 'plugin_factory/load_sprockets' if ENV['RACK_ENV'] == 'development'

    Fanforce::Plugin.load(plugin_base_dir)
  end
end

########################################################################################################################

# The following is run if file is required from config.ru or Rakefile
if caller[0].split(':')[0] =~ /^(.+)\/(config\.ru|Rakefile)$/
  plugin_base_dir = $1
  loader_filename = $2
  ENV['RACK_ENV'] ||= 'development'

  Fanforce::PluginFactory.generate(plugin_base_dir)
  load "#{Fanforce::Plugin.config.factory_dir}/Rakefile" if loader_filename == 'Rakefile'
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
fanforce-plugin-factory-2.0.0.rc29 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc28 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc27 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc26 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc25 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc24 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc23 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc22 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc21 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc19 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc18 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc17 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc16 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc15 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc13 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc12 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc11 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc10 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc9 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc8 lib/fanforce/plugin_factory.rb