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.rc7 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc6 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc5 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc3 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-1.6.1 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc2 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-2.0.0.rc1 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-1.6.0 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-1.6.0.rc6 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-1.6.0.rc5 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-1.6.0.rc4 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-1.6.0.rc3 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-1.6.0.rc2 lib/fanforce/plugin_factory.rb
fanforce-plugin-factory-1.6.0.rc1 lib/fanforce/plugin_factory.rb