lib/liberty_buildpack/util/cache/internet_availability.rb
# Returns whether or not the internet is deemed to be available.
#
# @return [Boolean] +true+ if and only if the internet is deemed to be available
Returns whether or not the internet is deemed to be available.
Returns whether or not the internet is deemed to be available .
def use_internet?
        @@monitor.synchronize do
          if !@@internet_checked
            remote_downloads_configuration = LibertyBuildpack::Util::ConfigurationUtils.load('cache')['remote_downloads']
            if remote_downloads_configuration == 'disabled'
              store_internet_availability false
              false
            elsif remote_downloads_configuration == 'enabled'
              true
            else
              fail "Invalid remote_downloads configuration: #{remote_downloads_configuration}"
            end
          else
            @@internet_up
          end
        end
      end
def use_internet? @@monitor . synchronize do if ! @@internet_checked remote_downloads_configuration = LibertyBuildpack :: Util :: ConfigurationUtils . load ( 'cache' ) [ 'remote_downloads' ] if remote_downloads_configuration == 'disabled' store_internet_availability false false elsif remote_downloads_configuration == 'enabled' true else fail "Invalid remote_downloads configuration: #{remote_downloads_configuration}" end else @@internet_up end end end
Returns whether or not the internet is deemed to be available.
Returns whether or not the internet is deemed to be available .
+true+ if and only if the internet is deemed to be available
+ true + if and only if the internet is deemed to be available
Boolean