Created
April 3, 2019 00:40
-
-
Save freqn/13c6b8f4f5a2453f675c12b4b343183b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data = [] | |
File.open("Gemfile").each do |line| | |
data << line if line.size > 1 unless line.include?("#") | |
end | |
File.delete("Gemfile") | |
File.open("Gemfile", 'w') do |file| | |
data.unshift("# frozen_string_literal: true \n\n") | |
data.each do |line| | |
file.write("\n") if line.include?("group :") | |
file.write(line) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment