mac.rb 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 ""
  35. puts "Tips: When finished all jobs. You need to do follow:".yellow
  36. puts "1) Restart system."
  37. puts "2) open Rime input method setting pane and click " + "DEPLOY".yellow + " button."
  38. puts "Enjoy~ 🍻"
  39. puts "more info:".yellow
  40. puts "Config path: ~/Library/Rime/"
  41. return :next
  42. end
  43. end
  44. Jobs = [
  45. InstallRimeJob,
  46. BackupRimeConfigJob,
  47. CloneConfigJob,
  48. CopyCustomConfigJob
  49. ]
  50. FinishedHook = [FinishedJob]
  51. end
  52. end