Sha256: 81ae8bec3101b021320ee3d704c9b5624ecef16c579fb17b8bd6bbef55ef79af
Contents?: true
Size: 520 Bytes
Versions: 16
Compression:
Stored size: 520 Bytes
Contents
module FileHelpers def append_to(path, contents) in_current_dir do File.open(path, "a") do |file| file.puts file.puts contents end end end def append_to_gemfile(contents) append_to('Gemfile', contents) end def comment_out_gem_in_gemfile(gemname) in_current_dir do gemfile = File.read("Gemfile") gemfile.sub!(/^(\s*)(gem\s*['"]#{gemname})/, "\\1# \\2") File.open("Gemfile", 'w'){ |file| file.write(gemfile) } end end end World(FileHelpers)
Version data entries
16 entries across 16 versions & 2 rubygems