Skip to content

Instantly share code, notes, and snippets.

@cnruby
Created April 9, 2011 08:20
Show Gist options
  • Select an option

  • Save cnruby/911240 to your computer and use it in GitHub Desktop.

Select an option

Save cnruby/911240 to your computer and use it in GitHub Desktop.
块代码与文件创建
local_filename = "create_file_name.rb"
doc =<<'FILE'
# This is a text for the file #{local_filename}.
FILE
File.open(local_filename, 'w+') {|f| f.write(doc) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment