lib/mixlib/install/generator/base.rb in mixlib-install-3.12.1 vs lib/mixlib/install/generator/base.rb in mixlib-install-3.12.3
- old
+ new
@@ -13,12 +13,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
-require "erb"
-require "ostruct"
+require "erb" unless defined?(Erb)
+require "ostruct" unless defined?(OpenStruct)
require_relative "../util"
require_relative "../dist"
module Mixlib
class Install
@@ -43,10 +43,10 @@
#
def self.get_script(name, context = {})
script_path = File.join(script_base_path, name)
# If there is an erb template we render it, otherwise we just read
- # and returnt the contents of the script
+ # and return the contents of the script
if File.exist? "#{script_path}.erb"
# Default values to use incase they are not set in the context
context[:project_name] ||= Mixlib::Install::Dist::PROJECT_NAME.freeze
context[:base_url] ||= Mixlib::Install::Dist::OMNITRUCK_ENDPOINT.freeze
context[:default_product] ||= Mixlib::Install::Dist::DEFAULT_PRODUCT.freeze