Sha256: 6429521817f19c65f2a0601dadc789edb9868475bc0b2a7927398b7de12b684b

Contents?: true

Size: 330 Bytes

Versions: 2

Compression:

Stored size: 330 Bytes

Contents

# frozen_string_literal: true

module Capistrano
  module Ops
    module Helper
      def gem_in_gemfile?(gem_name)
        return false unless File.exist?('Gemfile')

        regex = Regexp.new("^\s*gem\s+['\"]#{gem_name}['\"].*?(?=#|$)", Regexp::MULTILINE)
        File.read('Gemfile').match?(regex)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capistrano-ops-1.0.4 lib/capistrano/ops/helper.rb
capistrano-ops-1.0.3 lib/capistrano/ops/helper.rb