Sha256: 57071a012eeffe5da3acb6a08bbee5c16ef83c579620c0ec3026483673800c39

Contents?: true

Size: 602 Bytes

Versions: 155

Compression:

Stored size: 602 Bytes

Contents

# TODO: We overwrite/edit/create files a lot in Bullet Train,
# so I feel like this and a lot of similar content could go inside its own gem.
module BulletTrain
  module Themes
    module Light
      module FileReplacer
        def self.files_have_same_content?(first_file_name, second_file_name)
          File.open(first_file_name).readlines == File.open(second_file_name).readlines
        end

        # Replaces the old content with a brand new file.
        def self.replace_content(old:, new:)
          File.write(old, File.open(new).readlines.join(""))
        end
      end
    end
  end
end

Version data entries

155 entries across 155 versions & 1 rubygems

Version Path
bullet_train-themes-light-1.17.1 lib/bullet_train/themes/light/file_replacer.rb
bullet_train-themes-light-1.17.0 lib/bullet_train/themes/light/file_replacer.rb
bullet_train-themes-light-1.16.0 lib/bullet_train/themes/light/file_replacer.rb
bullet_train-themes-light-1.15.0 lib/bullet_train/themes/light/file_replacer.rb
bullet_train-themes-light-1.14.2 lib/bullet_train/themes/light/file_replacer.rb
bullet_train-themes-light-1.14.1 lib/bullet_train/themes/light/file_replacer.rb
bullet_train-themes-light-1.14.0 lib/bullet_train/themes/light/file_replacer.rb
bullet_train-themes-light-1.13.0 lib/bullet_train/themes/light/file_replacer.rb
bullet_train-themes-light-1.12.3 lib/bullet_train/themes/light/file_replacer.rb
bullet_train-themes-light-1.12.2 lib/bullet_train/themes/light/file_replacer.rb
bullet_train-themes-light-1.12.1 lib/bullet_train/themes/light/file_replacer.rb
bullet_train-themes-light-1.12.0 lib/bullet_train/themes/light/file_replacer.rb
bullet_train-themes-light-1.11.0 lib/bullet_train/themes/light/file_replacer.rb
bullet_train-themes-light-1.10.0 lib/bullet_train/themes/light/file_replacer.rb
bullet_train-themes-light-1.9.0 lib/bullet_train/themes/light/file_replacer.rb
bullet_train-themes-light-1.8.5 lib/bullet_train/themes/light/file_replacer.rb
bullet_train-themes-light-1.8.4 lib/bullet_train/themes/light/file_replacer.rb
bullet_train-themes-light-1.8.3 lib/bullet_train/themes/light/file_replacer.rb
bullet_train-themes-light-1.8.2 lib/bullet_train/themes/light/file_replacer.rb
bullet_train-themes-light-1.8.1 lib/bullet_train/themes/light/file_replacer.rb