Sha256: 7fc153b85746e945744f46c4baac8b9cda98837728cd7cb23e64a0afb8ebcb7b

Contents?: true

Size: 963 Bytes

Versions: 10

Compression:

Stored size: 963 Bytes

Contents

# encoding: utf-8
module Mutx
  module Platforms
    class Ruby
      def self.is_there_gemfile_lock?
        begin
          IO.read("#{Dir.pwd}/Gemfile.lock")
        rescue
          false
        end
      end

      def self.using_gemfile?
        begin
          IO.read("#{Dir.pwd}/Gemfile")
        rescue
          false
        end
      end

      def self.gemfile_or_gemspec_changed?
        changed_files = Mutx::Support::Git.changed_files_on_last_commit.map do |file_path|
          file_path.split("/").last
        end
        return true if changed_files.delete("Gemfile")
        changed_files.map{|filename| filename.split(".").last}.include? "gemspec"
      end

      def self.using_bundler?
        if self.using_gemfile?
          self.delete_gemfile_lock and true
        end
      end

      def self.delete_gemfile_lock
        begin
          File.delete("#{Dir.pwd}/Gemfile.lock")
        rescue
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
mutx-0.2.9 lib/mutx/platforms/ruby.rb
mutx-0.2.8 lib/mutx/platforms/ruby.rb
mutx-0.2.7 lib/mutx/platforms/ruby.rb
mutx-0.2.6 lib/mutx/platforms/ruby.rb
mutx-0.2.5 lib/mutx/platforms/ruby.rb
mutx-0.2.4 lib/mutx/platforms/ruby.rb
mutx-0.2.3 lib/mutx/platforms/ruby.rb
mutx-0.2.2 lib/mutx/platforms/ruby.rb
mutx-0.2.1 lib/mutx/platforms/ruby.rb
mutx-0.2.0 lib/mutx/platforms/ruby.rb