Sha256: fc718805c73e64857b31e8007d51b52628aef36dcd01f2cd137505a578f41c96

Contents?: true

Size: 349 Bytes

Versions: 9

Compression:

Stored size: 349 Bytes

Contents

require 'sugar-high/file'
pattern = Regexp.escape('::Application.initialize!')
puts pattern
file = File.new('sandbox/test.txt')
puts "BEFORE"
puts file.read
puts file.insert 'hello', :after => /\w+#{pattern}/

puts file.path

File.insert_into file.path, :after => /\w+#{pattern}/ do
  'hello'
end

puts "AFTER"
puts File.new('sandbox/test.txt').read

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rails_assist-0.5.3 sandbox/test.rb
rails_assist-0.5.2 sandbox/test.rb
rails_assist-0.5.1 sandbox/test.rb
rails_assist-0.5.0 sandbox/test.rb
rails_assist-0.4.4 sandbox/test.rb
rails_assist-0.4.3 sandbox/test.rb
rails_assist-0.4.2 sandbox/test.rb
rails_assist-0.4.1 sandbox/test.rb
rails_assist-0.4.0 sandbox/test.rb