Method: EtchExternalSource#initialize
- Defined in:
- lib/etch.rb
#initialize(file, original_file, facts, groups, local_requests, sourcebase, commandsbase, sitelibbase, dlogger) ⇒ EtchExternalSource
Returns a new instance of EtchExternalSource.
2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 |
# File 'lib/etch.rb', line 2006 def initialize(file, original_file, facts, groups, local_requests, sourcebase, commandsbase, sitelibbase, dlogger) # The external source is going to be processed within the same Ruby # instance as etch. We want to make it clear what variables we are # intentionally exposing to external sources, essentially this # defines the "API" for those external sources. @file = file @original_file = original_file @facts = facts @groups = groups # In the olden days all local requests were XML snippits that the etch client # smashed into a single XML document to send over the wire. This supports # scripts expecting the old interface. @local_requests = nil if local_requests @local_requests = "<requests>\n#{local_requests.join('')}\n</requests>" end # And this is a new interface where we just pass them as an array @local_requests_array = local_requests || [] @sourcebase = sourcebase @commandsbase = commandsbase @sitelibbase = sitelibbase @dlogger = dlogger end |