rubyで macOS Finderのラベルの色を操作する

#!/usr/bin/env ruby

filename = "fileA.rb"
color = 7

=begin
0  No color
1  Orange
2  Red
3  Yellow
4  Blue
5  Purple
6  Green
7  Gray
=end

  `osascript -e '
    tell application \"Finder\" to set label index of (POSIX file \"#{File.expand_path(filename)}\" as alias) to #{color}
  '`