Sha256: 6de2472857ac196e34230434077588ba47b075488b30a2db3ce17d1f927bd653

Contents?: true

Size: 393 Bytes

Versions: 13

Compression:

Stored size: 393 Bytes

Contents

# frozen_string_literal: true

module LunaPark
  module Tools
    # TODO: add descriptions
    class << self
      def if_gem_installed(name, *requirements)
        Gem::Specification.find_by_name name, *requirements
      rescue Gem::MissingSpecError
        false
      else
        yield if block_given?
        true
      end

      alias gem_installed? if_gem_installed
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
luna_park-0.13.2 lib/luna_park/tools.rb
luna_park-0.13.1 lib/luna_park/tools.rb
luna_park-0.13.0 lib/luna_park/tools.rb
luna_park-0.12.1 lib/luna_park/tools.rb
luna_park-0.12.0 lib/luna_park/tools.rb
luna_park-0.11.7 lib/luna_park/tools.rb
luna_park-0.11.6 lib/luna_park/tools.rb
luna_park-0.11.5 lib/luna_park/tools.rb
luna_park-0.11.4 lib/luna_park/tools.rb
luna_park-0.11.3 lib/luna_park/tools.rb
luna_park-0.11.2 lib/luna_park/tools.rb
luna_park-0.11.1 lib/luna_park/tools.rb
luna_park-0.11.0 lib/luna_park/tools.rb