为什么给我的程序一个意外的令牌:$ end错误?

时间:2019-03-27 01:52:11

标签: ruby

这是我未完成的代码:

#When convert button is pressed
File.rename("*.osz", "*.zip$")

dialog.directory(

    def extract_zip(file, destination) FileUtils.mkdir_p(destination)

    file_path = "./convert_temp/*.zip"
    destination = "./convert_temp/osz/"

    extract_zip(file_path, destination)

until File.exists?( ".osu$" ) == false do
  File.rename("./convert_temp/osz/*.osu$", "*.txt$")
  File.foreach(filename) do |file|

  file_string = File.read('./convert_temp/osz/*.txt$')

  if file_string.include?('Mode: 1')
    puts 'Yes'
  else
    puts 'No'
  end
end
end

Robocop给出以下语法错误:

unexpected token $end (Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)

0 个答案:

没有答案