def current_plugin?
      if Origen.application_loaded?
        Origen.app.plugins.current == self
      else
        puts <<-END
current_plugin? cannot be used at this point in your code since the app is not loaded yet.

If you are calling this from config/application.rb then you can only use current_plugin? within a block:

# Not OK
if current_plugin?
  config.output_directory = "#{Origen.root}/output/dir1"
else
  config.output_directory = "#{Origen.root}/output/dir2"
end

# OK
config.output_directory do
  if current_plugin?
    "#{Origen.root}/output/dir1"
  else
    "#{Origen.root}/output/dir2"
  end
end

END
        exit 1
      end
    end
def current_plugin?
      if Origen.application_loaded?
        Origen.app.plugins.current == self
      else
        puts <<-END
current_plugin? cannot be used at this point in your code since the app is not loaded yet.

If you are calling this from config/application.rb then you can only use current_plugin? within a block:

# Not OK
if current_plugin?
  config.output_directory = "#{Origen.root}/output/dir1"
else
  config.output_directory = "#{Origen.root}/output/dir2"
end

# OK
config.output_directory do
  if current_plugin?
    "#{Origen.root}/output/dir1"
  else
    "#{Origen.root}/output/dir2"
  end
end

END
        exit 1
      end
    end
Returns true if the given application instance is
 the current plugin