mac.rb 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. module RimeDeploy
  2. module Mac
  3. class InstallRimeJob < Job
  4. def call
  5. puts intro
  6. system("brew install --cask squirrel")
  7. return :next
  8. end
  9. end
  10. class BackupRimeConfigJob < Job
  11. def call
  12. puts "Job: BackupRimeConfigJob".blue
  13. system("mv ~/Library/Rime ~/Library/Rime.#{Time.now.to_i}.old")
  14. return :next
  15. end
  16. end
  17. class CloneConfigJob < Job
  18. def call
  19. puts intro
  20. system("git clone https://github.com/iDvel/rime-ice.git ~/Library/Rime")
  21. return :next
  22. end
  23. end
  24. class CopyCustomConfigJob < Job
  25. def call
  26. puts intro
  27. system("cp ./custom/default.custom.yaml ~/Library/Rime/")
  28. system("cp ./custom/squirrel.custom.yaml ~/Library/Rime/")
  29. return :next
  30. end
  31. end
  32. class FinishedJob < Job
  33. def call
  34. puts "Please restart system then open Rime Setting and click DEPLOY."
  35. return :next
  36. end
  37. end
  38. Jobs = [
  39. InstallRimeJob,
  40. BackupRimeConfigJob,
  41. CloneConfigJob,
  42. CopyCustomConfigJob
  43. ]
  44. end
  45. end