| ofs | hex dump | ascii |
|---|
| 0000 | 56 69 6d 9f 55 6e 44 6f e5 00 03 95 28 cd 89 37 07 76 23 97 dc ea e9 76 c3 e0 88 c7 3f d5 ac 78 | Vim.UnDo....(..7.v#....v....?..x |
| 0020 | a1 ee 9f 98 a9 de a1 d2 de 19 58 00 00 01 92 00 00 00 0a 20 20 64 65 66 20 70 6c 75 67 00 00 01 | ..........X..........def.plug... |
| 0040 | 21 00 00 00 0a 00 00 00 01 00 00 00 08 00 00 00 00 00 00 00 08 00 00 00 08 00 00 00 08 00 00 00 | !............................... |
| 0060 | 00 6a 00 59 9f 04 01 00 00 00 05 00 5f d0 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 | .j.Y........_................... |
| 0080 | 00 01 00 00 00 01 00 00 00 00 00 00 00 00 ff ff ff ff 00 01 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 00a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 00c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 00e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0100 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0120 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0140 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0160 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0180 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 01a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 01c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 01e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6a 00 57 70 04 01 00 00 00 00 00 f5 18 00 00 00 | ................j.Wp............ |
| 0200 | 00 00 00 00 02 00 00 00 00 00 00 01 92 00 00 00 13 23 21 2f 75 73 72 2f 62 69 6e 2f 65 6e 76 20 | .................#!/usr/bin/env. |
| 0220 | 72 75 62 79 00 00 00 00 00 00 00 16 72 65 71 75 69 72 65 28 22 2e 2f 63 6f 6e 66 69 67 2e 72 62 | ruby........require("./config.rb |
| 0240 | 22 29 00 00 00 14 72 65 71 75 69 72 65 28 22 66 69 6c 65 75 74 69 6c 73 22 29 00 00 00 13 72 65 | ")....require("fileutils")....re |
| 0260 | 71 75 69 72 65 28 22 6f 70 74 70 61 72 73 65 22 29 00 00 00 0f 72 65 71 75 69 72 65 28 22 6a 73 | quire("optparse")....require("js |
| 0280 | 6f 6e 22 29 00 00 00 11 72 65 71 75 69 72 65 28 22 74 68 72 65 61 64 22 29 00 00 00 00 00 00 00 | on")....require("thread")....... |
| 02a0 | 13 63 6c 61 73 73 20 50 6c 75 67 69 6e 4d 61 6e 61 67 65 72 00 00 00 29 20 20 61 74 74 72 5f 72 | .class.PluginManager...)..attr_r |
| 02c0 | 65 61 64 65 72 20 3a 70 6c 75 67 69 6e 73 5f 64 69 72 2c 20 3a 70 6c 75 67 69 6e 73 5f 6c 69 73 | eader.:plugins_dir,.:plugins_lis |
| 02e0 | 74 00 00 00 00 00 00 00 18 20 20 64 65 66 20 69 6e 69 74 69 61 6c 69 7a 65 28 63 6f 6e 66 69 67 | t..........def.initialize(config |
| 0300 | 29 00 00 00 24 20 20 20 20 40 70 6c 75 67 69 6e 73 5f 6c 69 73 74 20 3d 20 43 4f 4e 46 49 47 5b | )...$....@plugins_list.=.CONFIG[ |
| 0320 | 3a 70 6c 75 67 69 6e 73 5d 00 00 00 36 20 20 20 20 40 72 75 6e 74 69 6d 65 5f 70 61 74 68 20 3d | :plugins]...6....@runtime_path.= |
| 0340 | 20 46 69 6c 65 2e 65 78 70 61 6e 64 5f 70 61 74 68 28 43 4f 4e 46 49 47 5b 3a 72 75 6e 74 69 6d | .File.expand_path(CONFIG[:runtim |
| 0360 | 65 5d 29 00 00 00 48 20 20 20 20 40 70 6c 75 67 69 6e 73 5f 64 69 72 20 3d 20 46 69 6c 65 2e 65 | e])...H....@plugins_dir.=.File.e |
| 0380 | 78 70 61 6e 64 5f 70 61 74 68 28 22 23 7b 40 72 75 6e 74 69 6d 65 5f 70 61 74 68 7d 2f 70 61 63 | xpand_path("#{@runtime_path}/pac |
| 03a0 | 6b 2f 73 63 69 6f 6e 2f 73 74 61 72 74 22 29 00 00 00 42 20 20 20 20 40 6f 70 74 5f 64 69 72 20 | k/scion/start")...B....@opt_dir. |
| 03c0 | 3d 20 46 69 6c 65 2e 65 78 70 61 6e 64 5f 70 61 74 68 28 22 23 7b 40 72 75 6e 74 69 6d 65 5f 70 | =.File.expand_path("#{@runtime_p |
| 03e0 | 61 74 68 7d 2f 70 61 63 6b 2f 73 63 69 6f 6e 2f 6f 70 74 22 29 00 00 00 47 20 20 20 20 40 73 74 | ath}/pack/scion/opt")...G....@st |
| 0400 | 61 74 65 5f 66 69 6c 65 20 3d 20 46 69 6c 65 2e 65 78 70 61 6e 64 5f 70 61 74 68 28 22 23 7b 40 | ate_file.=.File.expand_path("#{@ |
| 0420 | 72 75 6e 74 69 6d 65 5f 70 61 74 68 7d 2f 73 63 69 6f 6e 5f 73 74 61 74 65 2e 6a 73 6f 6e 22 29 | runtime_path}/scion_state.json") |
| 0440 | 00 00 00 1c 20 20 20 20 65 6e 73 75 72 65 5f 64 69 72 65 63 74 6f 72 69 65 73 5f 65 78 69 73 74 | ........ensure_directories_exist |
| 0460 | 00 00 00 0e 20 20 20 20 6c 6f 61 64 5f 73 74 61 74 65 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 | ........load_state......end..... |
| 0480 | 00 00 0e 20 20 64 65 66 20 73 65 6c 66 2e 72 75 6e 00 00 00 1f 20 20 20 20 6f 70 74 69 6f 6e 73 | .....def.self.run........options |
| 04a0 | 20 3d 20 70 61 72 73 65 5f 63 6c 69 5f 6f 70 74 69 6f 6e 73 00 00 00 19 20 20 20 20 6d 61 6e 61 | .=.parse_cli_options........mana |
| 04c0 | 67 65 72 20 3d 20 6e 65 77 28 43 4f 4e 46 49 47 29 00 00 00 00 00 00 00 1a 20 20 20 20 63 61 73 | ger.=.new(CONFIG)............cas |
| 04e0 | 65 20 6f 70 74 69 6f 6e 73 5b 3a 63 6f 6d 6d 61 6e 64 5d 00 00 00 0e 20 20 20 20 77 68 65 6e 20 | e.options[:command]........when. |
| 0500 | 3a 6c 69 73 74 00 00 00 29 20 20 20 20 20 20 6d 61 6e 61 67 65 72 2e 6c 69 73 74 5f 70 6c 75 67 | :list...)......manager.list_plug |
| 0520 | 69 6e 73 28 6f 70 74 69 6f 6e 73 5b 3a 61 6c 6c 5d 29 00 00 00 10 20 20 20 20 77 68 65 6e 20 3a | ins(options[:all])........when.: |
| 0540 | 73 74 61 74 75 73 00 00 00 19 20 20 20 20 20 20 6d 61 6e 61 67 65 72 2e 73 68 6f 77 5f 73 74 61 | status..........manager.show_sta |
| 0560 | 74 75 73 00 00 00 10 20 20 20 20 77 68 65 6e 20 3a 66 72 65 65 7a 65 00 00 00 20 20 20 20 20 20 | tus........when.:freeze......... |
| 0580 | 20 6d 61 6e 61 67 65 72 2e 63 72 65 61 74 65 5f 66 72 65 65 7a 65 5f 66 69 6c 65 00 00 00 11 20 | .manager.create_freeze_file..... |
| 05a0 | 20 20 20 77 68 65 6e 20 3a 72 65 73 74 6f 72 65 00 00 00 21 20 20 20 20 20 20 6d 61 6e 61 67 65 | ...when.:restore...!......manage |
| 05c0 | 72 2e 72 65 73 74 6f 72 65 5f 66 72 6f 6d 5f 66 72 65 65 7a 65 00 00 00 08 20 20 20 20 65 6c 73 | r.restore_from_freeze........els |
| 05e0 | 65 00 00 00 2d 20 20 20 20 20 20 6d 61 6e 61 67 65 72 2e 73 79 6e 63 5f 70 6c 75 67 69 6e 73 28 | e...-......manager.sync_plugins( |
| 0600 | 6f 70 74 69 6f 6e 73 5b 3a 64 72 79 5f 72 75 6e 5d 29 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 | options[:dry_run])........end... |
| 0620 | 05 20 20 65 6e 64 00 00 00 00 00 00 00 1c 20 20 64 65 66 20 73 65 6c 66 2e 70 61 72 73 65 5f 63 | ...end..........def.self.parse_c |
| 0640 | 6c 69 5f 6f 70 74 69 6f 6e 73 00 00 00 3c 20 20 20 20 6f 70 74 69 6f 6e 73 20 3d 20 7b 20 63 6f | li_options...<....options.=.{.co |
| 0660 | 6d 6d 61 6e 64 3a 20 3a 73 79 6e 63 2c 20 64 72 79 5f 72 75 6e 3a 20 66 61 6c 73 65 2c 20 61 6c | mmand:.:sync,.dry_run:.false,.al |
| 0680 | 6c 3a 20 66 61 6c 73 65 20 7d 00 00 00 00 00 00 00 1e 20 20 20 20 4f 70 74 69 6f 6e 50 61 72 73 | l:.false.}............OptionPars |
| 06a0 | 65 72 2e 6e 65 77 20 64 6f 20 7c 6f 70 74 73 7c 00 00 00 2c 20 20 20 20 20 20 6f 70 74 73 2e 62 | er.new.do.|opts|...,......opts.b |
| 06c0 | 61 6e 6e 65 72 20 3d 20 22 75 73 61 67 65 3a 20 23 7b 24 30 7d 20 5b 6f 70 74 69 6f 6e 73 5d 22 | anner.=."usage:.#{$0}.[options]" |
| 06e0 | 00 00 00 17 20 20 20 20 20 20 6f 70 74 73 2e 73 65 70 61 72 61 74 6f 72 20 22 22 00 00 00 20 20 | ..........opts.separator.""..... |
| 0700 | 20 20 20 20 20 6f 70 74 73 2e 73 65 70 61 72 61 74 6f 72 20 22 63 6f 6d 6d 61 6e 64 73 3a 22 00 | .....opts.separator."commands:". |
| 0720 | 00 00 00 00 00 00 3a 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e 28 22 2d 6c 22 2c 20 22 2d 2d 6c 69 | ......:......opts.on("-l",."--li |
| 0740 | 73 74 22 2c 20 22 6c 69 73 74 20 69 6e 73 74 61 6c 6c 65 64 20 70 6c 75 67 69 6e 73 22 29 20 64 | st",."list.installed.plugins").d |
| 0760 | 6f 00 00 00 21 20 20 20 20 20 20 20 20 6f 70 74 69 6f 6e 73 5b 3a 63 6f 6d 6d 61 6e 64 5d 20 3d | o...!........options[:command].= |
| 0780 | 20 3a 6c 69 73 74 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 38 20 20 20 20 20 | .:list..........end.......8..... |
| 07a0 | 20 6f 70 74 73 2e 6f 6e 28 22 2d 73 22 2c 20 22 2d 2d 73 74 61 74 75 73 22 2c 20 22 73 68 6f 77 | .opts.on("-s",."--status",."show |
| 07c0 | 20 70 6c 75 67 69 6e 20 73 74 61 74 75 73 22 29 20 64 6f 00 00 00 23 20 20 20 20 20 20 20 20 6f | .plugin.status").do...#........o |
| 07e0 | 70 74 69 6f 6e 73 5b 3a 63 6f 6d 6d 61 6e 64 5d 20 3d 20 3a 73 74 61 74 75 73 00 00 00 09 20 20 | ptions[:command].=.:status...... |
| 0800 | 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 50 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e 28 22 2d 66 | ....end.......P......opts.on("-f |
| 0820 | 22 2c 20 22 2d 2d 66 72 65 65 7a 65 22 2c 20 22 63 72 65 61 74 65 20 61 20 66 72 65 65 7a 65 20 | ",."--freeze",."create.a.freeze. |
| 0840 | 66 69 6c 65 20 77 69 74 68 20 63 75 72 72 65 6e 74 20 76 65 72 73 69 6f 6e 73 22 29 20 64 6f 00 | file.with.current.versions").do. |
| 0860 | 00 00 23 20 20 20 20 20 20 20 20 6f 70 74 69 6f 6e 73 5b 3a 63 6f 6d 6d 61 6e 64 5d 20 3d 20 3a | ..#........options[:command].=.: |
| 0880 | 66 72 65 65 7a 65 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 48 20 20 20 20 20 | freeze..........end.......H..... |
| 08a0 | 20 6f 70 74 73 2e 6f 6e 28 22 2d 72 22 2c 20 22 2d 2d 72 65 73 74 6f 72 65 22 2c 20 22 72 65 73 | .opts.on("-r",."--restore",."res |
| 08c0 | 74 6f 72 65 20 76 65 72 73 69 6f 6e 73 20 66 72 6f 6d 20 66 72 65 65 7a 65 20 66 69 6c 65 22 29 | tore.versions.from.freeze.file") |
| 08e0 | 20 64 6f 00 00 00 24 20 20 20 20 20 20 20 20 6f 70 74 69 6f 6e 73 5b 3a 63 6f 6d 6d 61 6e 64 5d | .do...$........options[:command] |
| 0900 | 20 3d 20 3a 72 65 73 74 6f 72 65 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 49 | .=.:restore..........end.......I |
| 0920 | 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e 28 22 2d 2d 64 72 79 2d 72 75 6e 22 2c 20 22 73 68 6f 77 | ......opts.on("--dry-run",."show |
| 0940 | 20 77 68 61 74 20 77 6f 75 6c 64 20 62 65 20 64 6f 6e 65 20 77 69 74 68 6f 75 74 20 64 6f 69 6e | .what.would.be.done.without.doin |
| 0960 | 67 20 69 74 22 29 20 64 6f 00 00 00 20 20 20 20 20 20 20 20 20 6f 70 74 69 6f 6e 73 5b 3a 64 72 | g.it").do............options[:dr |
| 0980 | 79 5f 72 75 6e 5d 20 3d 20 74 72 75 65 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 00 00 00 | y_run].=.true..........end...... |
| 09a0 | 00 4b 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e 28 22 2d 61 22 2c 20 22 2d 2d 61 6c 6c 22 2c 20 22 | .K......opts.on("-a",."--all",." |
| 09c0 | 73 68 6f 77 20 61 6c 6c 20 70 6c 75 67 69 6e 73 20 69 6e 63 6c 75 64 69 6e 67 20 63 6f 6d 6d 69 | show.all.plugins.including.commi |
| 09e0 | 74 20 68 61 73 68 65 73 22 29 20 64 6f 00 00 00 1c 20 20 20 20 20 20 20 20 6f 70 74 69 6f 6e 73 | t.hashes").do............options |
| 0a00 | 5b 3a 61 6c 6c 5d 20 3d 20 74 72 75 65 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 00 00 00 | [:all].=.true..........end...... |
| 0a20 | 00 3a 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e 28 22 2d 68 22 2c 20 22 2d 2d 68 65 6c 70 22 2c 20 | .:......opts.on("-h",."--help",. |
| 0a40 | 22 73 68 6f 77 20 74 68 69 73 20 68 65 6c 70 20 6d 65 73 73 61 67 65 22 29 20 64 6f 00 00 00 11 | "show.this.help.message").do.... |
| 0a60 | 20 20 20 20 20 20 20 20 70 75 74 73 20 6f 70 74 73 00 00 00 0c 20 20 20 20 20 20 20 20 65 78 69 | ........puts.opts............exi |
| 0a80 | 74 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 0e 20 20 20 20 65 6e 64 2e 70 61 72 73 65 21 | t..........end........end.parse! |
| 0aa0 | 00 00 00 00 00 00 00 0b 20 20 20 20 6f 70 74 69 6f 6e 73 00 00 00 05 20 20 65 6e 64 00 00 00 00 | ............options......end.... |
| 0ac0 | 00 00 00 23 20 20 64 65 66 20 73 79 6e 63 5f 70 6c 75 67 69 6e 73 28 64 72 79 5f 72 75 6e 20 3d | ...#..def.sync_plugins(dry_run.= |
| 0ae0 | 20 66 61 6c 73 65 29 00 00 00 44 20 20 20 20 77 61 6e 74 65 64 5f 6e 61 6d 65 73 20 3d 20 40 70 | .false)...D....wanted_names.=.@p |
| 0b00 | 6c 75 67 69 6e 73 5f 6c 69 73 74 2e 6d 61 70 20 7b 20 7c 70 7c 20 70 6c 75 67 69 6e 5f 6e 61 6d | lugins_list.map.{.|p|.plugin_nam |
| 0b20 | 65 5f 66 72 6f 6d 5f 75 72 6c 28 70 29 20 7d 00 00 00 30 20 20 20 20 69 6e 73 74 61 6c 6c 65 64 | e_from_url(p).}...0....installed |
| 0b40 | 5f 6e 61 6d 65 73 20 3d 20 44 69 72 2e 63 68 69 6c 64 72 65 6e 28 40 70 6c 75 67 69 6e 73 5f 64 | _names.=.Dir.children(@plugins_d |
| 0b60 | 69 72 29 00 00 00 04 20 20 20 20 00 00 00 5f 20 20 20 20 74 6f 5f 69 6e 73 74 61 6c 6c 20 3d 20 | ir)..........._....to_install.=. |
| 0b80 | 40 70 6c 75 67 69 6e 73 5f 6c 69 73 74 2e 72 65 6a 65 63 74 20 7b 20 7c 70 7c 20 69 6e 73 74 61 | @plugins_list.reject.{.|p|.insta |
| 0ba0 | 6c 6c 65 64 5f 6e 61 6d 65 73 2e 69 6e 63 6c 75 64 65 3f 28 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f | lled_names.include?(plugin_name_ |
| 0bc0 | 66 72 6f 6d 5f 75 72 6c 28 70 29 29 20 7d 00 00 00 30 20 20 20 20 74 6f 5f 75 70 64 61 74 65 20 | from_url(p)).}...0....to_update. |
| 0be0 | 3d 20 69 6e 73 74 61 6c 6c 65 64 5f 6e 61 6d 65 73 2e 73 65 6c 65 63 74 20 64 6f 20 7c 6e 61 6d | =.installed_names.select.do.|nam |
| 0c00 | 65 7c 00 00 00 5a 20 20 20 20 20 20 44 69 72 2e 65 78 69 73 74 3f 28 22 23 7b 40 70 6c 75 67 69 | e|...Z......Dir.exist?("#{@plugi |
| 0c20 | 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 29 20 26 26 20 46 69 6c 65 2e 65 78 69 73 74 3f | ns_dir}/#{name}").&&.File.exist? |
| 0c40 | 28 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 2f 2e 67 69 74 22 29 | ("#{@plugins_dir}/#{name}/.git") |
| 0c60 | 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 50 20 20 20 20 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 20 | ........end...P....to_uninstall. |
| 0c80 | 3d 20 69 6e 73 74 61 6c 6c 65 64 5f 6e 61 6d 65 73 2e 72 65 6a 65 63 74 20 7b 20 7c 6e 61 6d 65 | =.installed_names.reject.{.|name |
| 0ca0 | 7c 20 77 61 6e 74 65 64 5f 6e 61 6d 65 73 2e 69 6e 63 6c 75 64 65 3f 28 6e 61 6d 65 29 20 7d 00 | |.wanted_names.include?(name).}. |
| 0cc0 | 00 00 00 00 00 00 0e 20 20 20 20 69 66 20 64 72 79 5f 72 75 6e 00 00 00 2e 20 20 20 20 20 20 70 | ...........if.dry_run..........p |
| 0ce0 | 75 74 73 20 22 64 72 79 20 72 75 6e 20 2d 20 77 6f 75 6c 64 20 64 6f 20 74 68 65 20 66 6f 6c 6c | uts."dry.run.-.would.do.the.foll |
| 0d00 | 6f 77 69 6e 67 3a 22 00 00 00 67 20 20 20 20 20 20 70 75 74 73 20 22 20 20 69 6e 73 74 61 6c 6c | owing:"...g......puts."..install |
| 0d20 | 3a 20 23 7b 74 6f 5f 69 6e 73 74 61 6c 6c 2e 6d 61 70 20 7b 20 7c 70 7c 20 70 6c 75 67 69 6e 5f | :.#{to_install.map.{.|p|.plugin_ |
| 0d40 | 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 70 29 20 7d 2e 6a 6f 69 6e 28 27 2c 20 27 29 7d 22 20 | name_from_url(p).}.join(',.')}". |
| 0d60 | 69 66 20 74 6f 5f 69 6e 73 74 61 6c 6c 2e 61 6e 79 3f 00 00 00 40 20 20 20 20 20 20 70 75 74 73 | if.to_install.any?...@......puts |
| 0d80 | 20 22 20 20 75 70 64 61 74 65 3a 20 23 7b 74 6f 5f 75 70 64 61 74 65 2e 6a 6f 69 6e 28 27 2c 20 | ."..update:.#{to_update.join(',. |
| 0da0 | 27 29 7d 22 20 69 66 20 74 6f 5f 75 70 64 61 74 65 2e 61 6e 79 3f 00 00 00 49 20 20 20 20 20 20 | ')}".if.to_update.any?...I...... |
| 0dc0 | 70 75 74 73 20 22 20 20 75 6e 69 6e 73 74 61 6c 6c 3a 20 23 7b 74 6f 5f 75 6e 69 6e 73 74 61 6c | puts."..uninstall:.#{to_uninstal |
| 0de0 | 6c 2e 6a 6f 69 6e 28 27 2c 20 27 29 7d 22 20 69 66 20 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e 61 | l.join(',.')}".if.to_uninstall.a |
| 0e00 | 6e 79 3f 00 00 00 45 20 20 20 20 20 20 69 66 20 74 6f 5f 69 6e 73 74 61 6c 6c 2e 65 6d 70 74 79 | ny?...E......if.to_install.empty |
| 0e20 | 3f 20 26 26 20 74 6f 5f 75 70 64 61 74 65 2e 65 6d 70 74 79 3f 20 26 26 20 74 6f 5f 75 6e 69 6e | ?.&&.to_update.empty?.&&.to_unin |
| 0e40 | 73 74 61 6c 6c 2e 65 6d 70 74 79 3f 00 00 00 1e 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 | stall.empty?............puts.".. |
| 0e60 | 6e 6f 74 68 69 6e 67 20 74 6f 20 64 6f 22 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 0c 20 | nothing.to.do"..........end..... |
| 0e80 | 20 20 20 20 20 72 65 74 75 72 6e 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 18 20 20 | .....return........end.......... |
| 0ea0 | 20 20 69 66 20 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e 61 6e 79 3f 00 00 00 3b 20 20 20 20 20 20 | ..if.to_uninstall.any?...;...... |
| 0ec0 | 70 75 74 73 20 22 75 6e 69 6e 73 74 61 6c 6c 69 6e 67 20 23 7b 74 6f 5f 75 6e 69 6e 73 74 61 6c | puts."uninstalling.#{to_uninstal |
| 0ee0 | 6c 2e 73 69 7a 65 7d 20 70 6c 75 67 69 6e 28 73 29 2e 2e 2e 22 00 00 00 21 20 20 20 20 20 20 74 | l.size}.plugin(s)..."...!......t |
| 0f00 | 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e 65 61 63 68 20 64 6f 20 7c 6e 61 6d 65 7c 00 00 00 2e 20 20 | o_uninstall.each.do.|name|...... |
| 0f20 | 20 20 20 20 20 20 74 61 72 67 65 74 5f 64 69 72 20 3d 20 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 | ......target_dir.=."#{@plugins_d |
| 0f40 | 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 00 00 00 21 20 20 20 20 20 20 20 20 69 66 20 44 69 72 2e 65 | ir}/#{name}"...!........if.Dir.e |
| 0f60 | 78 69 73 74 3f 28 74 61 72 67 65 74 5f 64 69 72 29 00 00 00 25 20 20 20 20 20 20 20 20 20 20 46 | xist?(target_dir)...%..........F |
| 0f80 | 69 6c 65 55 74 69 6c 73 2e 72 6d 5f 72 66 28 74 61 72 67 65 74 5f 64 69 72 29 00 00 00 22 20 20 | ileUtils.rm_rf(target_dir)...".. |
| 0fa0 | 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 72 65 6d 6f 76 65 64 20 23 7b 6e 61 6d 65 7d 22 | ........puts."..removed.#{name}" |
| 0fc0 | 00 00 00 2a 20 20 20 20 20 20 20 20 20 20 40 73 74 61 74 65 5b 22 69 6e 73 74 61 6c 6c 65 64 22 | ...*..........@state["installed" |
| 0fe0 | 5d 2e 64 65 6c 65 74 65 28 6e 61 6d 65 29 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 | ].delete(name)............end... |
| 1000 | 09 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 16 20 20 20 | .......end........end........... |
| 1020 | 20 69 66 20 74 6f 5f 69 6e 73 74 61 6c 6c 2e 61 6e 79 3f 00 00 00 37 20 20 20 20 20 20 70 75 74 | .if.to_install.any?...7......put |
| 1040 | 73 20 22 69 6e 73 74 61 6c 6c 69 6e 67 20 23 7b 74 6f 5f 69 6e 73 74 61 6c 6c 2e 73 69 7a 65 7d | s."installing.#{to_install.size} |
| 1060 | 20 70 6c 75 67 69 6e 28 73 29 2e 2e 2e 22 00 00 00 22 20 20 20 20 20 20 69 6e 73 74 61 6c 6c 5f | .plugin(s)..."..."......install_ |
| 1080 | 70 61 72 61 6c 6c 65 6c 28 74 6f 5f 69 6e 73 74 61 6c 6c 29 00 00 00 07 20 20 20 20 65 6e 64 00 | parallel(to_install)........end. |
| 10a0 | 00 00 00 00 00 00 15 20 20 20 20 69 66 20 74 6f 5f 75 70 64 61 74 65 2e 61 6e 79 3f 00 00 00 34 | ...........if.to_update.any?...4 |
| 10c0 | 20 20 20 20 20 20 70 75 74 73 20 22 75 70 64 61 74 69 6e 67 20 23 7b 74 6f 5f 75 70 64 61 74 65 | ......puts."updating.#{to_update |
| 10e0 | 2e 73 69 7a 65 7d 20 70 6c 75 67 69 6e 28 73 29 2e 2e 2e 22 00 00 00 20 20 20 20 20 20 20 75 70 | .size}.plugin(s)..."..........up |
| 1100 | 64 61 74 65 5f 70 61 72 61 6c 6c 65 6c 28 74 6f 5f 75 70 64 61 74 65 29 00 00 00 07 20 20 20 20 | date_parallel(to_update)........ |
| 1120 | 65 6e 64 00 00 00 00 00 00 00 43 20 20 20 20 69 66 20 74 6f 5f 69 6e 73 74 61 6c 6c 2e 65 6d 70 | end.......C....if.to_install.emp |
| 1140 | 74 79 3f 20 26 26 20 74 6f 5f 75 70 64 61 74 65 2e 65 6d 70 74 79 3f 20 26 26 20 74 6f 5f 75 6e | ty?.&&.to_update.empty?.&&.to_un |
| 1160 | 69 6e 73 74 61 6c 6c 2e 65 6d 70 74 79 3f 00 00 00 23 20 20 20 20 20 20 70 75 74 73 20 22 61 6c | install.empty?...#......puts."al |
| 1180 | 6c 20 70 6c 75 67 69 6e 73 20 61 72 65 20 73 79 6e 63 65 64 22 00 00 00 07 20 20 20 20 65 6e 64 | l.plugins.are.synced"........end |
| 11a0 | 00 00 00 04 20 20 20 20 00 00 00 0e 20 20 20 20 73 61 76 65 5f 73 74 61 74 65 00 00 00 05 20 20 | ................save_state...... |
| 11c0 | 65 6e 64 00 00 00 00 00 00 00 24 20 20 64 65 66 20 6c 69 73 74 5f 70 6c 75 67 69 6e 73 28 73 68 | end.......$..def.list_plugins(sh |
| 11e0 | 6f 77 5f 61 6c 6c 20 3d 20 66 61 6c 73 65 29 00 00 00 2f 20 20 20 20 69 6e 73 74 61 6c 6c 65 64 | ow_all.=.false).../....installed |
| 1200 | 20 3d 20 44 69 72 2e 63 68 69 6c 64 72 65 6e 28 40 70 6c 75 67 69 6e 73 5f 64 69 72 29 2e 73 6f | .=.Dir.children(@plugins_dir).so |
| 1220 | 72 74 00 00 00 45 20 20 20 20 6f 70 74 5f 70 6c 75 67 69 6e 73 20 3d 20 44 69 72 2e 63 68 69 6c | rt...E....opt_plugins.=.Dir.chil |
| 1240 | 64 72 65 6e 28 40 6f 70 74 5f 64 69 72 29 2e 73 6f 72 74 20 69 66 20 44 69 72 2e 65 78 69 73 74 | dren(@opt_dir).sort.if.Dir.exist |
| 1260 | 3f 28 40 6f 70 74 5f 64 69 72 29 00 00 00 00 00 00 00 43 20 20 20 20 69 66 20 69 6e 73 74 61 6c | ?(@opt_dir).......C....if.instal |
| 1280 | 6c 65 64 2e 65 6d 70 74 79 3f 20 26 26 20 28 6f 70 74 5f 70 6c 75 67 69 6e 73 2e 6e 69 6c 3f 20 | led.empty?.&&.(opt_plugins.nil?. |
| 12a0 | 7c 7c 20 6f 70 74 5f 70 6c 75 67 69 6e 73 2e 65 6d 70 74 79 3f 29 00 00 00 21 20 20 20 20 20 20 | ||.opt_plugins.empty?)...!...... |
| 12c0 | 70 75 74 73 20 22 6e 6f 20 70 6c 75 67 69 6e 73 20 69 6e 73 74 61 6c 6c 65 64 22 00 00 00 08 20 | puts."no.plugins.installed"..... |
| 12e0 | 20 20 20 65 6c 73 65 00 00 00 30 20 20 20 20 20 20 70 75 74 73 20 22 73 74 61 72 74 20 70 6c 75 | ...else...0......puts."start.plu |
| 1300 | 67 69 6e 73 20 28 23 7b 69 6e 73 74 61 6c 6c 65 64 2e 63 6f 75 6e 74 7d 29 3a 22 00 00 00 20 20 | gins.(#{installed.count}):"..... |
| 1320 | 20 20 20 20 20 69 6e 73 74 61 6c 6c 65 64 2e 65 61 63 68 20 64 6f 20 7c 70 6c 75 67 69 6e 7c 00 | .....installed.each.do.|plugin|. |
| 1340 | 00 00 2d 20 20 20 20 20 20 20 20 64 69 73 70 6c 61 79 5f 70 6c 75 67 69 6e 5f 69 6e 66 6f 28 70 | ..-........display_plugin_info(p |
| 1360 | 6c 75 67 69 6e 2c 20 73 68 6f 77 5f 61 6c 6c 29 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 | lugin,.show_all)..........end... |
| 1380 | 00 00 00 00 2b 20 20 20 20 20 20 69 66 20 6f 70 74 5f 70 6c 75 67 69 6e 73 20 26 26 20 21 6f 70 | ....+......if.opt_plugins.&&.!op |
| 13a0 | 74 5f 70 6c 75 67 69 6e 73 2e 65 6d 70 74 79 3f 00 00 00 0f 20 20 20 20 20 20 20 20 70 75 74 73 | t_plugins.empty?............puts |
| 13c0 | 20 22 22 00 00 00 32 20 20 20 20 20 20 20 20 70 75 74 73 20 22 6f 70 74 20 70 6c 75 67 69 6e 73 | .""...2........puts."opt.plugins |
| 13e0 | 20 28 23 7b 6f 70 74 5f 70 6c 75 67 69 6e 73 2e 63 6f 75 6e 74 7d 29 3a 22 00 00 00 24 20 20 20 | .(#{opt_plugins.count}):"...$... |
| 1400 | 20 20 20 20 20 6f 70 74 5f 70 6c 75 67 69 6e 73 2e 65 61 63 68 20 64 6f 20 7c 70 6c 75 67 69 6e | .....opt_plugins.each.do.|plugin |
| 1420 | 7c 00 00 00 2f 20 20 20 20 20 20 20 20 20 20 64 69 73 70 6c 61 79 5f 70 6c 75 67 69 6e 5f 69 6e | |.../..........display_plugin_in |
| 1440 | 66 6f 28 70 6c 75 67 69 6e 2c 20 73 68 6f 77 5f 61 6c 6c 29 00 00 00 0b 20 20 20 20 20 20 20 20 | fo(plugin,.show_all)............ |
| 1460 | 65 6e 64 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 5c 20 20 20 20 20 20 75 6e | end..........end.......\......un |
| 1480 | 69 6e 73 74 61 6c 6c 65 64 20 3d 20 40 70 6c 75 67 69 6e 73 5f 6c 69 73 74 2e 72 65 6a 65 63 74 | installed.=.@plugins_list.reject |
| 14a0 | 20 7b 20 7c 70 7c 20 69 6e 73 74 61 6c 6c 65 64 2e 69 6e 63 6c 75 64 65 3f 28 70 6c 75 67 69 6e | .{.|p|.installed.include?(plugin |
| 14c0 | 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 70 29 29 20 7d 00 00 00 1f 20 20 20 20 20 20 75 6e | _name_from_url(p)).}..........un |
| 14e0 | 6c 65 73 73 20 75 6e 69 6e 73 74 61 6c 6c 65 64 2e 65 6d 70 74 79 3f 00 00 00 0f 20 20 20 20 20 | less.uninstalled.empty?......... |
| 1500 | 20 20 20 70 75 74 73 20 22 22 00 00 00 33 20 20 20 20 20 20 20 20 70 75 74 73 20 22 70 6c 75 67 | ...puts.""...3........puts."plug |
| 1520 | 69 6e 73 20 69 6e 20 63 6f 6e 66 69 67 20 62 75 74 20 6e 6f 74 20 69 6e 73 74 61 6c 6c 65 64 3a | ins.in.config.but.not.installed: |
| 1540 | 22 00 00 00 24 20 20 20 20 20 20 20 20 75 6e 69 6e 73 74 61 6c 6c 65 64 2e 65 61 63 68 20 64 6f | "...$........uninstalled.each.do |
| 1560 | 20 7c 70 6c 75 67 69 6e 7c 00 00 00 34 20 20 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 2d | .|plugin|...4..........puts."..- |
| 1580 | 20 23 7b 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 70 6c 75 67 69 6e 29 7d | .#{plugin_name_from_url(plugin)} |
| 15a0 | 22 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 | "............end..........end... |
| 15c0 | 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 11 20 20 64 65 66 20 73 | .....end......end..........def.s |
| 15e0 | 68 6f 77 5f 73 74 61 74 75 73 00 00 00 2f 20 20 20 20 69 6e 73 74 61 6c 6c 65 64 20 3d 20 44 69 | how_status.../....installed.=.Di |
| 1600 | 72 2e 63 68 69 6c 64 72 65 6e 28 40 70 6c 75 67 69 6e 73 5f 64 69 72 29 2e 73 6f 72 74 00 00 00 | r.children(@plugins_dir).sort... |
| 1620 | 00 00 00 00 19 20 20 20 20 70 75 74 73 20 22 70 6c 75 67 69 6e 20 73 74 61 74 75 73 3a 22 00 00 | .........puts."plugin.status:".. |
| 1640 | 00 0b 20 20 20 20 70 75 74 73 20 22 22 00 00 00 40 20 20 20 20 70 75 74 73 20 22 63 6f 6e 66 69 | ......puts.""...@....puts."confi |
| 1660 | 67 75 72 61 74 69 6f 6e 3a 20 23 7b 40 70 6c 75 67 69 6e 73 5f 6c 69 73 74 2e 63 6f 75 6e 74 7d | guration:.#{@plugins_list.count} |
| 1680 | 20 70 6c 75 67 69 6e 73 20 64 65 66 69 6e 65 64 22 00 00 00 30 20 20 20 20 70 75 74 73 20 22 69 | .plugins.defined"...0....puts."i |
| 16a0 | 6e 73 74 61 6c 6c 65 64 3a 20 23 7b 69 6e 73 74 61 6c 6c 65 64 2e 63 6f 75 6e 74 7d 20 70 6c 75 | nstalled:.#{installed.count}.plu |
| 16c0 | 67 69 6e 73 22 00 00 00 0b 20 20 20 20 70 75 74 73 20 22 22 00 00 00 00 00 00 00 11 20 20 20 20 | gins"........puts.""............ |
| 16e0 | 6f 75 74 64 61 74 65 64 20 3d 20 5b 5d 00 00 00 1c 20 20 20 20 69 6e 73 74 61 6c 6c 65 64 2e 65 | outdated.=.[]........installed.e |
| 1700 | 61 63 68 20 64 6f 20 7c 6e 61 6d 65 7c 00 00 00 26 20 20 20 20 20 20 70 61 74 68 20 3d 20 22 23 | ach.do.|name|...&......path.=."# |
| 1720 | 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 00 00 00 2d 20 20 20 20 20 | {@plugins_dir}/#{name}"...-..... |
| 1740 | 20 6e 65 78 74 20 75 6e 6c 65 73 73 20 46 69 6c 65 2e 65 78 69 73 74 3f 28 22 23 7b 70 61 74 68 | .next.unless.File.exist?("#{path |
| 1760 | 7d 2f 2e 67 69 74 22 29 00 00 00 00 00 00 00 18 20 20 20 20 20 20 44 69 72 2e 63 68 64 69 72 28 | }/.git")..............Dir.chdir( |
| 1780 | 70 61 74 68 29 20 64 6f 00 00 00 3d 20 20 20 20 20 20 20 20 63 75 72 72 65 6e 74 5f 68 61 73 68 | path).do...=........current_hash |
| 17a0 | 20 3d 20 60 67 69 74 20 72 65 76 2d 70 61 72 73 65 20 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 | .=.`git.rev-parse.HEAD.2>/dev/nu |
| 17c0 | 6c 6c 60 2e 73 74 72 69 70 00 00 00 4f 20 20 20 20 20 20 20 20 72 65 6d 6f 74 65 5f 68 61 73 68 | ll`.strip...O........remote_hash |
| 17e0 | 20 3d 20 60 67 69 74 20 6c 73 2d 72 65 6d 6f 74 65 20 6f 72 69 67 69 6e 20 48 45 41 44 20 32 3e | .=.`git.ls-remote.origin.HEAD.2> |
| 1800 | 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 2e 73 70 6c 69 74 2e 66 69 72 73 74 00 00 00 00 | /dev/null`.strip.split.first.... |
| 1820 | 00 00 00 35 20 20 20 20 20 20 20 20 69 66 20 72 65 6d 6f 74 65 5f 68 61 73 68 20 26 26 20 63 75 | ...5........if.remote_hash.&&.cu |
| 1840 | 72 72 65 6e 74 5f 68 61 73 68 20 21 3d 20 72 65 6d 6f 74 65 5f 68 61 73 68 00 00 00 1a 20 20 20 | rrent_hash.!=.remote_hash....... |
| 1860 | 20 20 20 20 20 20 20 6f 75 74 64 61 74 65 64 20 3c 3c 20 6e 61 6d 65 00 00 00 0b 20 20 20 20 20 | .......outdated.<<.name......... |
| 1880 | 20 20 20 65 6e 64 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 00 00 | ...end..........end........end.. |
| 18a0 | 00 00 00 00 00 1a 20 20 20 20 75 6e 6c 65 73 73 20 6f 75 74 64 61 74 65 64 2e 65 6d 70 74 79 3f | ..........unless.outdated.empty? |
| 18c0 | 00 00 00 1e 20 20 20 20 20 20 70 75 74 73 20 22 6f 75 74 64 61 74 65 64 20 70 6c 75 67 69 6e 73 | ..........puts."outdated.plugins |
| 18e0 | 3a 22 00 00 00 31 20 20 20 20 20 20 6f 75 74 64 61 74 65 64 2e 65 61 63 68 20 7b 20 7c 6e 61 6d | :"...1......outdated.each.{.|nam |
| 1900 | 65 7c 20 70 75 74 73 20 22 20 20 2d 20 23 7b 6e 61 6d 65 7d 22 20 7d 00 00 00 0d 20 20 20 20 20 | e|.puts."..-.#{name}".}......... |
| 1920 | 20 70 75 74 73 20 22 22 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 1c 20 20 20 20 69 | .puts.""........end............i |
| 1940 | 6e 73 74 61 6c 6c 65 64 2e 65 61 63 68 20 64 6f 20 7c 6e 61 6d 65 7c 00 00 00 26 20 20 20 20 20 | nstalled.each.do.|name|...&..... |
| 1960 | 20 70 61 74 68 20 3d 20 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d | .path.=."#{@plugins_dir}/#{name} |
| 1980 | 22 00 00 00 24 20 20 20 20 20 20 69 66 20 46 69 6c 65 2e 65 78 69 73 74 3f 28 22 23 7b 70 61 74 | "...$......if.File.exist?("#{pat |
| 19a0 | 68 7d 2f 2e 67 69 74 22 29 00 00 00 1a 20 20 20 20 20 20 20 20 44 69 72 2e 63 68 64 69 72 28 70 | h}/.git")............Dir.chdir(p |
| 19c0 | 61 74 68 29 20 64 6f 00 00 00 43 20 20 20 20 20 20 20 20 20 20 6c 61 73 74 5f 63 6f 6d 6d 69 74 | ath).do...C..........last_commit |
| 19e0 | 20 3d 20 60 67 69 74 20 6c 6f 67 20 2d 31 20 2d 2d 66 6f 72 6d 61 74 3d 25 63 72 20 32 3e 2f 64 | .=.`git.log.-1.--format=%cr.2>/d |
| 1a00 | 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 4e 20 20 20 20 20 20 20 20 20 20 63 75 72 72 | ev/null`.strip...N..........curr |
| 1a20 | 65 6e 74 5f 62 72 61 6e 63 68 20 3d 20 60 67 69 74 20 72 65 76 2d 70 61 72 73 65 20 2d 2d 61 62 | ent_branch.=.`git.rev-parse.--ab |
| 1a40 | 62 72 65 76 2d 72 65 66 20 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 | brev-ref.HEAD.2>/dev/null`.strip |
| 1a60 | 00 00 00 47 20 20 20 20 20 20 20 20 20 20 63 75 72 72 65 6e 74 5f 68 61 73 68 20 3d 20 60 67 69 | ...G..........current_hash.=.`gi |
| 1a80 | 74 20 72 65 76 2d 70 61 72 73 65 20 2d 2d 73 68 6f 72 74 20 48 45 41 44 20 32 3e 2f 64 65 76 2f | t.rev-parse.--short.HEAD.2>/dev/ |
| 1aa0 | 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 2a 20 20 20 20 20 20 20 20 20 20 70 75 74 73 20 22 23 | null`.strip...*..........puts."# |
| 1ac0 | 7b 6e 61 6d 65 7d 20 28 23 7b 63 75 72 72 65 6e 74 5f 68 61 73 68 7d 29 22 00 00 00 2c 20 20 20 | {name}.(#{current_hash})"...,... |
| 1ae0 | 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 62 72 61 6e 63 68 3a 20 23 7b 63 75 72 72 65 6e 74 | .......puts."..branch:.#{current |
| 1b00 | 5f 62 72 61 6e 63 68 7d 22 00 00 00 44 20 20 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 75 | _branch}"...D..........puts."..u |
| 1b20 | 70 64 61 74 65 64 3a 20 23 7b 6c 61 73 74 5f 63 6f 6d 6d 69 74 7d 22 20 75 6e 6c 65 73 73 20 6c | pdated:.#{last_commit}".unless.l |
| 1b40 | 61 73 74 5f 63 6f 6d 6d 69 74 2e 65 6d 70 74 79 3f 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 | ast_commit.empty?............end |
| 1b60 | 00 00 00 0a 20 20 20 20 20 20 65 6c 73 65 00 00 00 28 20 20 20 20 20 20 20 20 70 75 74 73 20 22 | ..........else...(........puts." |
| 1b80 | 23 7b 6e 61 6d 65 7d 20 28 6e 6f 74 20 67 69 74 2d 6d 61 6e 61 67 65 64 29 22 00 00 00 09 20 20 | #{name}.(not.git-managed)"...... |
| 1ba0 | 20 20 20 20 65 6e 64 00 00 00 0d 20 20 20 20 20 20 70 75 74 73 20 22 22 00 00 00 07 20 20 20 20 | ....end..........puts.""........ |
| 1bc0 | 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 18 20 20 64 65 66 20 63 72 65 61 74 65 | end......end..........def.create |
| 1be0 | 5f 66 72 65 65 7a 65 5f 66 69 6c 65 00 00 00 14 20 20 20 20 66 72 65 65 7a 65 5f 64 61 74 61 20 | _freeze_file........freeze_data. |
| 1c00 | 3d 20 7b 7d 00 00 00 00 00 00 00 2d 20 20 20 20 44 69 72 2e 63 68 69 6c 64 72 65 6e 28 40 70 6c | =.{}.......-....Dir.children(@pl |
| 1c20 | 75 67 69 6e 73 5f 64 69 72 29 2e 65 61 63 68 20 64 6f 20 7c 6e 61 6d 65 7c 00 00 00 26 20 20 20 | ugins_dir).each.do.|name|...&... |
| 1c40 | 20 20 20 70 61 74 68 20 3d 20 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d | ...path.=."#{@plugins_dir}/#{nam |
| 1c60 | 65 7d 22 00 00 00 2d 20 20 20 20 20 20 6e 65 78 74 20 75 6e 6c 65 73 73 20 46 69 6c 65 2e 65 78 | e}"...-......next.unless.File.ex |
| 1c80 | 69 73 74 3f 28 22 23 7b 70 61 74 68 7d 2f 2e 67 69 74 22 29 00 00 00 00 00 00 00 18 20 20 20 20 | ist?("#{path}/.git")............ |
| 1ca0 | 20 20 44 69 72 2e 63 68 64 69 72 28 70 61 74 68 29 20 64 6f 00 00 00 3c 20 20 20 20 20 20 20 20 | ..Dir.chdir(path).do...<........ |
| 1cc0 | 63 6f 6d 6d 69 74 5f 68 61 73 68 20 3d 20 60 67 69 74 20 72 65 76 2d 70 61 72 73 65 20 48 45 41 | commit_hash.=.`git.rev-parse.HEA |
| 1ce0 | 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 41 20 20 20 20 20 20 20 20 | D.2>/dev/null`.strip...A........ |
| 1d00 | 66 72 65 65 7a 65 5f 64 61 74 61 5b 6e 61 6d 65 5d 20 3d 20 63 6f 6d 6d 69 74 5f 68 61 73 68 20 | freeze_data[name].=.commit_hash. |
| 1d20 | 75 6e 6c 65 73 73 20 63 6f 6d 6d 69 74 5f 68 61 73 68 2e 65 6d 70 74 79 3f 00 00 00 09 20 20 20 | unless.commit_hash.empty?....... |
| 1d40 | 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 4b 20 20 20 20 66 72 65 | ...end........end.......K....fre |
| 1d60 | 65 7a 65 5f 66 69 6c 65 20 3d 20 22 73 63 69 6f 6e 5f 66 72 65 65 7a 65 5f 23 7b 54 69 6d 65 2e | eze_file.=."scion_freeze_#{Time. |
| 1d80 | 6e 6f 77 2e 73 74 72 66 74 69 6d 65 28 27 25 59 25 6d 25 64 5f 25 48 25 4d 25 53 27 29 7d 2e 6a | now.strftime('%Y%m%d_%H%M%S')}.j |
| 1da0 | 73 6f 6e 22 00 00 00 3e 20 20 20 20 46 69 6c 65 2e 77 72 69 74 65 28 66 72 65 65 7a 65 5f 66 69 | son"...>....File.write(freeze_fi |
| 1dc0 | 6c 65 2c 20 4a 53 4f 4e 2e 70 72 65 74 74 79 5f 67 65 6e 65 72 61 74 65 28 66 72 65 65 7a 65 5f | le,.JSON.pretty_generate(freeze_ |
| 1de0 | 64 61 74 61 29 29 00 00 00 2e 20 20 20 20 70 75 74 73 20 22 66 72 65 65 7a 65 20 66 69 6c 65 20 | data))........puts."freeze.file. |
| 1e00 | 63 72 65 61 74 65 64 3a 20 23 7b 66 72 65 65 7a 65 5f 66 69 6c 65 7d 22 00 00 00 05 20 20 65 6e | created:.#{freeze_file}"......en |
| 1e20 | 64 00 00 00 00 00 00 00 19 20 20 64 65 66 20 72 65 73 74 6f 72 65 5f 66 72 6f 6d 5f 66 72 65 65 | d..........def.restore_from_free |
| 1e40 | 7a 65 00 00 00 3f 20 20 20 20 66 72 65 65 7a 65 5f 66 69 6c 65 73 20 3d 20 44 69 72 2e 67 6c 6f | ze...?....freeze_files.=.Dir.glo |
| 1e60 | 62 28 22 73 63 69 6f 6e 5f 66 72 65 65 7a 65 5f 2a 2e 6a 73 6f 6e 22 29 2e 73 6f 72 74 2e 72 65 | b("scion_freeze_*.json").sort.re |
| 1e80 | 76 65 72 73 65 00 00 00 00 00 00 00 1a 20 20 20 20 69 66 20 66 72 65 65 7a 65 5f 66 69 6c 65 73 | verse............if.freeze_files |
| 1ea0 | 2e 65 6d 70 74 79 3f 00 00 00 22 20 20 20 20 20 20 70 75 74 73 20 22 6e 6f 20 66 72 65 65 7a 65 | .empty?..."......puts."no.freeze |
| 1ec0 | 20 66 69 6c 65 73 20 66 6f 75 6e 64 22 00 00 00 0c 20 20 20 20 20 20 72 65 74 75 72 6e 00 00 00 | .files.found"..........return... |
| 1ee0 | 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 22 20 20 20 20 70 75 74 73 20 22 61 76 61 69 6c 61 | .....end......."....puts."availa |
| 1f00 | 62 6c 65 20 66 72 65 65 7a 65 20 66 69 6c 65 73 3a 22 00 00 00 3f 20 20 20 20 66 72 65 65 7a 65 | ble.freeze.files:"...?....freeze |
| 1f20 | 5f 66 69 6c 65 73 2e 65 61 63 68 5f 77 69 74 68 5f 69 6e 64 65 78 20 7b 20 7c 66 2c 20 69 7c 20 | _files.each_with_index.{.|f,.i|. |
| 1f40 | 70 75 74 73 20 22 20 20 23 7b 69 7d 3a 20 23 7b 66 7d 22 20 7d 00 00 00 41 20 20 20 20 70 72 69 | puts."..#{i}:.#{f}".}...A....pri |
| 1f60 | 6e 74 20 22 73 65 6c 65 63 74 20 66 69 6c 65 20 74 6f 20 72 65 73 74 6f 72 65 20 28 30 2d 23 7b | nt."select.file.to.restore.(0-#{ |
| 1f80 | 66 72 65 65 7a 65 5f 66 69 6c 65 73 2e 73 69 7a 65 20 2d 20 31 7d 29 3a 20 22 00 00 00 1f 20 20 | freeze_files.size.-.1}):."...... |
| 1fa0 | 20 20 73 65 6c 65 63 74 69 6f 6e 20 3d 20 67 65 74 73 2e 63 68 6f 6d 70 2e 74 6f 5f 69 00 00 00 | ..selection.=.gets.chomp.to_i... |
| 1fc0 | 00 00 00 00 29 20 20 20 20 72 65 74 75 72 6e 20 75 6e 6c 65 73 73 20 66 72 65 65 7a 65 5f 66 69 | ....)....return.unless.freeze_fi |
| 1fe0 | 6c 65 73 5b 73 65 6c 65 63 74 69 6f 6e 5d 00 00 00 00 00 00 00 40 20 20 20 20 66 72 65 65 7a 65 | les[selection].......@....freeze |
| 2000 | 5f 64 61 74 61 20 3d 20 4a 53 4f 4e 2e 70 61 72 73 65 28 46 69 6c 65 2e 72 65 61 64 28 66 72 65 | _data.=.JSON.parse(File.read(fre |
| 2020 | 65 7a 65 5f 66 69 6c 65 73 5b 73 65 6c 65 63 74 69 6f 6e 5d 29 29 00 00 00 00 00 00 00 2b 20 20 | eze_files[selection])).......+.. |
| 2040 | 20 20 66 72 65 65 7a 65 5f 64 61 74 61 2e 65 61 63 68 20 64 6f 20 7c 6e 61 6d 65 2c 20 74 61 72 | ..freeze_data.each.do.|name,.tar |
| 2060 | 67 65 74 5f 68 61 73 68 7c 00 00 00 26 20 20 20 20 20 20 70 61 74 68 20 3d 20 22 23 7b 40 70 6c | get_hash|...&......path.=."#{@pl |
| 2080 | 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 00 00 00 38 20 20 20 20 20 20 69 66 20 | ugins_dir}/#{name}"...8......if. |
| 20a0 | 44 69 72 2e 65 78 69 73 74 3f 28 70 61 74 68 29 20 26 26 20 46 69 6c 65 2e 65 78 69 73 74 3f 28 | Dir.exist?(path).&&.File.exist?( |
| 20c0 | 22 23 7b 70 61 74 68 7d 2f 2e 67 69 74 22 29 00 00 00 1a 20 20 20 20 20 20 20 20 44 69 72 2e 63 | "#{path}/.git")............Dir.c |
| 20e0 | 68 64 69 72 28 70 61 74 68 29 20 64 6f 00 00 00 3f 20 20 20 20 20 20 20 20 20 20 63 75 72 72 65 | hdir(path).do...?..........curre |
| 2100 | 6e 74 5f 68 61 73 68 20 3d 20 60 67 69 74 20 72 65 76 2d 70 61 72 73 65 20 48 45 41 44 20 32 3e | nt_hash.=.`git.rev-parse.HEAD.2> |
| 2120 | 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 28 20 20 20 20 20 20 20 20 20 20 69 66 | /dev/null`.strip...(..........if |
| 2140 | 20 63 75 72 72 65 6e 74 5f 68 61 73 68 20 21 3d 20 74 61 72 67 65 74 5f 68 61 73 68 00 00 00 3f | .current_hash.!=.target_hash...? |
| 2160 | 20 20 20 20 20 20 20 20 20 20 20 20 70 75 74 73 20 22 72 65 73 74 6f 72 69 6e 67 20 23 7b 6e 61 | ............puts."restoring.#{na |
| 2180 | 6d 65 7d 20 74 6f 20 23 7b 74 61 72 67 65 74 5f 68 61 73 68 5b 30 2e 2e 37 5d 7d 2e 2e 2e 22 00 | me}.to.#{target_hash[0..7]}...". |
| 21a0 | 00 00 4b 20 20 20 20 20 20 20 20 20 20 20 20 73 79 73 74 65 6d 28 22 67 69 74 20 66 65 74 63 68 | ..K............system("git.fetch |
| 21c0 | 20 2d 2d 64 65 70 74 68 3d 31 20 6f 72 69 67 69 6e 20 23 7b 74 61 72 67 65 74 5f 68 61 73 68 7d | .--depth=1.origin.#{target_hash} |
| 21e0 | 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 22 29 00 00 00 3d 20 20 20 20 20 20 20 20 20 20 20 20 73 79 | .2>/dev/null")...=............sy |
| 2200 | 73 74 65 6d 28 22 67 69 74 20 63 68 65 63 6b 6f 75 74 20 23 7b 74 61 72 67 65 74 5f 68 61 73 68 | stem("git.checkout.#{target_hash |
| 2220 | 7d 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 22 29 00 00 00 0e 20 20 20 20 20 20 20 20 20 20 65 6c 73 | }.2>/dev/null")..............els |
| 2240 | 65 00 00 00 34 20 20 20 20 20 20 20 20 20 20 20 20 70 75 74 73 20 22 23 7b 6e 61 6d 65 7d 20 61 | e...4............puts."#{name}.a |
| 2260 | 6c 72 65 61 64 79 20 61 74 20 74 61 72 67 65 74 20 76 65 72 73 69 6f 6e 22 00 00 00 0d 20 20 20 | lready.at.target.version"....... |
| 2280 | 20 20 20 20 20 20 20 65 6e 64 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 0a 20 20 20 | .......end............end....... |
| 22a0 | 20 20 20 65 6c 73 65 00 00 00 37 20 20 20 20 20 20 20 20 70 75 74 73 20 22 77 61 72 6e 69 6e 67 | ...else...7........puts."warning |
| 22c0 | 3a 20 23 7b 6e 61 6d 65 7d 20 6e 6f 74 20 69 6e 73 74 61 6c 6c 65 64 2c 20 73 6b 69 70 70 69 6e | :.#{name}.not.installed,.skippin |
| 22e0 | 67 22 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 | g"..........end........end...... |
| 2300 | 65 6e 64 00 00 00 00 00 00 00 09 20 20 70 72 69 76 61 74 65 00 00 00 00 00 00 00 1e 20 20 64 65 | end..........private..........de |
| 2320 | 66 20 65 6e 73 75 72 65 5f 64 69 72 65 63 74 6f 72 69 65 73 5f 65 78 69 73 74 00 00 00 2a 20 20 | f.ensure_directories_exist...*.. |
| 2340 | 20 20 5b 40 70 6c 75 67 69 6e 73 5f 64 69 72 2c 20 40 6f 70 74 5f 64 69 72 5d 2e 65 61 63 68 20 | ..[@plugins_dir,.@opt_dir].each. |
| 2360 | 64 6f 20 7c 64 69 72 7c 00 00 00 33 20 20 20 20 20 20 46 69 6c 65 55 74 69 6c 73 2e 6d 6b 64 69 | do.|dir|...3......FileUtils.mkdi |
| 2380 | 72 5f 70 28 64 69 72 29 20 75 6e 6c 65 73 73 20 44 69 72 2e 65 78 69 73 74 3f 28 64 69 72 29 00 | r_p(dir).unless.Dir.exist?(dir). |
| 23a0 | 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 10 20 20 64 65 66 | .......end......end..........def |
| 23c0 | 20 6c 6f 61 64 5f 73 74 61 74 65 00 00 00 28 20 20 20 20 40 73 74 61 74 65 20 3d 20 69 66 20 46 | .load_state...(....@state.=.if.F |
| 23e0 | 69 6c 65 2e 65 78 69 73 74 3f 28 40 73 74 61 74 65 5f 66 69 6c 65 29 00 00 00 28 20 20 20 20 20 | ile.exist?(@state_file)...(..... |
| 2400 | 20 4a 53 4f 4e 2e 70 61 72 73 65 28 46 69 6c 65 2e 72 65 61 64 28 40 73 74 61 74 65 5f 66 69 6c | .JSON.parse(File.read(@state_fil |
| 2420 | 65 29 29 00 00 00 08 20 20 20 20 65 6c 73 65 00 00 00 31 20 20 20 20 20 20 7b 20 22 69 6e 73 74 | e))........else...1......{."inst |
| 2440 | 61 6c 6c 65 64 22 20 3d 3e 20 7b 7d 2c 20 22 6c 61 73 74 5f 75 70 64 61 74 65 22 20 3d 3e 20 6e | alled".=>.{},."last_update".=>.n |
| 2460 | 69 6c 20 7d 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 10 | il.}........end......end........ |
| 2480 | 20 20 64 65 66 20 73 61 76 65 5f 73 74 61 74 65 00 00 00 39 20 20 20 20 46 69 6c 65 2e 77 72 69 | ..def.save_state...9....File.wri |
| 24a0 | 74 65 28 40 73 74 61 74 65 5f 66 69 6c 65 2c 20 4a 53 4f 4e 2e 70 72 65 74 74 79 5f 67 65 6e 65 | te(@state_file,.JSON.pretty_gene |
| 24c0 | 72 61 74 65 28 40 73 74 61 74 65 29 29 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 1b 20 20 | rate(@state))......end.......... |
| 24e0 | 64 65 66 20 70 6c 75 67 69 6e 5f 74 6f 5f 75 72 6c 28 70 6c 75 67 69 6e 29 00 00 00 2b 20 20 20 | def.plugin_to_url(plugin)...+... |
| 2500 | 20 72 65 74 75 72 6e 20 70 6c 75 67 69 6e 20 69 66 20 70 6c 75 67 69 6e 2e 69 6e 63 6c 75 64 65 | .return.plugin.if.plugin.include |
| 2520 | 3f 28 22 3a 2f 2f 22 29 00 00 00 22 20 20 20 20 22 68 74 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e | ?("://")..."...."https://github. |
| 2540 | 63 6f 6d 2f 23 7b 70 6c 75 67 69 6e 7d 22 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 27 20 | com/#{plugin}"......end.......'. |
| 2560 | 20 64 65 66 20 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 75 72 6c 5f 6f 72 | .def.plugin_name_from_url(url_or |
| 2580 | 5f 73 70 65 63 29 00 00 00 24 20 20 20 20 75 72 6c 20 3d 20 70 6c 75 67 69 6e 5f 74 6f 5f 75 72 | _spec)...$....url.=.plugin_to_ur |
| 25a0 | 6c 28 75 72 6c 5f 6f 72 5f 73 70 65 63 29 00 00 00 1e 20 20 20 20 46 69 6c 65 2e 62 61 73 65 6e | l(url_or_spec)........File.basen |
| 25c0 | 61 6d 65 28 75 72 6c 2c 20 22 2e 67 69 74 22 29 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 | ame(url,.".git")......end....... |
| 25e0 | 21 20 20 64 65 66 20 66 69 6e 64 5f 70 6c 75 67 69 6e 5f 69 6e 5f 63 6f 6e 66 69 67 28 6e 61 6d | !..def.find_plugin_in_config(nam |
| 2600 | 65 29 00 00 00 22 20 20 20 20 40 70 6c 75 67 69 6e 73 5f 6c 69 73 74 2e 66 69 6e 64 20 64 6f 20 | e)..."....@plugins_list.find.do. |
| 2620 | 7c 70 6c 75 67 69 6e 7c 00 00 00 2a 20 20 20 20 20 20 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 | |plugin|...*......plugin_name_fr |
| 2640 | 6f 6d 5f 75 72 6c 28 70 6c 75 67 69 6e 29 20 3d 3d 20 6e 61 6d 65 00 00 00 07 20 20 20 20 65 6e | om_url(plugin).==.name........en |
| 2660 | 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 1d 20 20 64 65 66 20 70 6c 75 67 69 6e 5f 69 | d......end..........def.plugin_i |
| 2680 | 6e 5f 63 6f 6e 66 69 67 3f 28 6e 61 6d 65 29 00 00 00 25 20 20 20 20 21 66 69 6e 64 5f 70 6c 75 | n_config?(name)...%....!find_plu |
| 26a0 | 67 69 6e 5f 69 6e 5f 63 6f 6e 66 69 67 28 6e 61 6d 65 29 2e 6e 69 6c 3f 00 00 00 05 20 20 65 6e | gin_in_config(name).nil?......en |
| 26c0 | 64 00 00 00 00 00 00 00 23 20 20 64 65 66 20 69 6e 73 74 61 6c 6c 5f 73 69 6e 67 6c 65 5f 70 6c | d.......#..def.install_single_pl |
| 26e0 | 75 67 69 6e 28 70 6c 75 67 69 6e 29 00 00 00 1f 20 20 20 20 75 72 6c 20 3d 20 70 6c 75 67 69 6e | ugin(plugin)........url.=.plugin |
| 2700 | 5f 74 6f 5f 75 72 6c 28 70 6c 75 67 69 6e 29 00 00 00 27 20 20 20 20 6e 61 6d 65 20 3d 20 70 6c | _to_url(plugin)...'....name.=.pl |
| 2720 | 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 70 6c 75 67 69 6e 29 00 00 00 2b 20 20 | ugin_name_from_url(plugin)...+.. |
| 2740 | 20 20 74 61 72 67 65 74 5f 70 61 74 68 20 3d 20 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d | ..target_path.=."#{@plugins_dir} |
| 2760 | 2f 23 7b 6e 61 6d 65 7d 22 00 00 00 00 00 00 00 1e 20 20 20 20 69 66 20 44 69 72 2e 65 78 69 73 | /#{name}"............if.Dir.exis |
| 2780 | 74 3f 28 74 61 72 67 65 74 5f 70 61 74 68 29 00 00 00 12 20 20 20 20 20 20 72 65 74 75 72 6e 20 | t?(target_path)..........return. |
| 27a0 | 66 61 6c 73 65 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 4b 20 20 20 20 73 79 73 74 | false........end.......K....syst |
| 27c0 | 65 6d 28 22 67 69 74 20 63 6c 6f 6e 65 20 23 7b 75 72 6c 7d 20 23 7b 74 61 72 67 65 74 5f 70 61 | em("git.clone.#{url}.#{target_pa |
| 27e0 | 74 68 7d 20 2d 2d 64 65 70 74 68 3d 31 20 2d 2d 71 75 69 65 74 20 32 3e 2f 64 65 76 2f 6e 75 6c | th}.--depth=1.--quiet.2>/dev/nul |
| 2800 | 6c 22 29 00 00 00 00 00 00 00 1e 20 20 20 20 69 66 20 44 69 72 2e 65 78 69 73 74 3f 28 74 61 72 | l")............if.Dir.exist?(tar |
| 2820 | 67 65 74 5f 70 61 74 68 29 00 00 00 1f 20 20 20 20 20 20 44 69 72 2e 63 68 64 69 72 28 74 61 72 | get_path)..........Dir.chdir(tar |
| 2840 | 67 65 74 5f 70 61 74 68 29 20 64 6f 00 00 00 3c 20 20 20 20 20 20 20 20 63 6f 6d 6d 69 74 5f 68 | get_path).do...<........commit_h |
| 2860 | 61 73 68 20 3d 20 60 67 69 74 20 72 65 76 2d 70 61 72 73 65 20 48 45 41 44 20 32 3e 2f 64 65 76 | ash.=.`git.rev-parse.HEAD.2>/dev |
| 2880 | 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 2f 20 20 20 20 20 20 20 20 40 73 74 61 74 65 5b 22 | /null`.strip.../........@state[" |
| 28a0 | 69 6e 73 74 61 6c 6c 65 64 22 5d 5b 6e 61 6d 65 5d 20 3d 20 63 6f 6d 6d 69 74 5f 68 61 73 68 00 | installed"][name].=.commit_hash. |
| 28c0 | 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 69 6e | .........end..........puts."..in |
| 28e0 | 73 74 61 6c 6c 65 64 20 23 7b 6e 61 6d 65 7d 22 00 00 00 0a 20 20 20 20 20 20 74 72 75 65 00 00 | stalled.#{name}"..........true.. |
| 2900 | 00 08 20 20 20 20 65 6c 73 65 00 00 00 28 20 20 20 20 20 20 70 75 74 73 20 22 20 20 66 61 69 6c | ......else...(......puts."..fail |
| 2920 | 65 64 20 74 6f 20 69 6e 73 74 61 6c 6c 20 23 7b 6e 61 6d 65 7d 22 00 00 00 0b 20 20 20 20 20 20 | ed.to.install.#{name}".......... |
| 2940 | 66 61 6c 73 65 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 | false........end......end....... |
| 2960 | 1f 20 20 64 65 66 20 69 6e 73 74 61 6c 6c 5f 70 61 72 61 6c 6c 65 6c 28 70 6c 75 67 69 6e 73 29 | ...def.install_parallel(plugins) |
| 2980 | 00 00 00 15 20 20 20 20 71 75 65 75 65 20 3d 20 51 75 65 75 65 2e 6e 65 77 00 00 00 23 20 20 20 | ........queue.=.Queue.new...#... |
| 29a0 | 20 70 6c 75 67 69 6e 73 2e 65 61 63 68 20 7b 20 7c 70 7c 20 71 75 65 75 65 20 3c 3c 20 70 20 7d | .plugins.each.{.|p|.queue.<<.p.} |
| 29c0 | 00 00 00 04 20 20 20 20 00 00 00 3d 20 20 20 20 74 68 72 65 61 64 73 20 3d 20 28 31 2e 2e 5b 45 | ...........=....threads.=.(1..[E |
| 29e0 | 74 63 2e 6e 70 72 6f 63 65 73 73 6f 72 73 2c 20 70 6c 75 67 69 6e 73 2e 73 69 7a 65 5d 2e 6d 69 | tc.nprocessors,.plugins.size].mi |
| 2a00 | 6e 29 2e 6d 61 70 20 64 6f 00 00 00 13 20 20 20 20 20 20 54 68 72 65 61 64 2e 6e 65 77 20 64 6f | n).map.do..........Thread.new.do |
| 2a20 | 00 00 00 1b 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 21 71 75 65 75 65 2e 65 6d 70 74 79 3f 00 | ............while.!queue.empty?. |
| 2a40 | 00 00 2d 20 20 20 20 20 20 20 20 20 20 70 6c 75 67 69 6e 20 3d 20 71 75 65 75 65 2e 70 6f 70 28 | ..-..........plugin.=.queue.pop( |
| 2a60 | 74 72 75 65 29 20 72 65 73 63 75 65 20 6e 69 6c 00 00 00 31 20 20 20 20 20 20 20 20 20 20 69 6e | true).rescue.nil...1..........in |
| 2a80 | 73 74 61 6c 6c 5f 73 69 6e 67 6c 65 5f 70 6c 75 67 69 6e 28 70 6c 75 67 69 6e 29 20 69 66 20 70 | stall_single_plugin(plugin).if.p |
| 2aa0 | 6c 75 67 69 6e 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 09 20 20 20 20 20 20 65 6e | lugin............end..........en |
| 2ac0 | 64 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 04 20 20 20 20 00 00 00 18 20 20 20 20 74 68 72 65 | d........end................thre |
| 2ae0 | 61 64 73 2e 65 61 63 68 28 26 3a 6a 6f 69 6e 29 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 | ads.each(&:join)......end....... |
| 2b00 | 20 20 20 64 65 66 20 75 70 64 61 74 65 5f 73 69 6e 67 6c 65 5f 70 6c 75 67 69 6e 28 6e 61 6d 65 | ...def.update_single_plugin(name |
| 2b20 | 29 00 00 00 24 20 20 20 20 70 61 74 68 20 3d 20 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d | )...$....path.=."#{@plugins_dir} |
| 2b40 | 2f 23 7b 6e 61 6d 65 7d 22 00 00 00 04 20 20 20 20 00 00 00 16 20 20 20 20 44 69 72 2e 63 68 64 | /#{name}"................Dir.chd |
| 2b60 | 69 72 28 70 61 74 68 29 20 64 6f 00 00 00 3a 20 20 20 20 20 20 62 65 66 6f 72 65 5f 68 61 73 68 | ir(path).do...:......before_hash |
| 2b80 | 20 3d 20 60 67 69 74 20 72 65 76 2d 70 61 72 73 65 20 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 | .=.`git.rev-parse.HEAD.2>/dev/nu |
| 2ba0 | 6c 6c 60 2e 73 74 72 69 70 00 00 00 36 20 20 20 20 20 20 73 79 73 74 65 6d 28 22 67 69 74 20 70 | ll`.strip...6......system("git.p |
| 2bc0 | 75 6c 6c 20 2d 2d 64 65 70 74 68 3d 31 20 2d 2d 71 75 69 65 74 20 32 3e 2f 64 65 76 2f 6e 75 6c | ull.--depth=1.--quiet.2>/dev/nul |
| 2be0 | 6c 22 29 00 00 00 39 20 20 20 20 20 20 61 66 74 65 72 5f 68 61 73 68 20 3d 20 60 67 69 74 20 72 | l")...9......after_hash.=.`git.r |
| 2c00 | 65 76 2d 70 61 72 73 65 20 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 | ev-parse.HEAD.2>/dev/null`.strip |
| 2c20 | 00 00 00 06 20 20 20 20 20 20 00 00 00 22 20 20 20 20 20 20 69 66 20 62 65 66 6f 72 65 5f 68 61 | ............."......if.before_ha |
| 2c40 | 73 68 20 21 3d 20 61 66 74 65 72 5f 68 61 73 68 00 00 00 2e 20 20 20 20 20 20 20 20 40 73 74 61 | sh.!=.after_hash............@sta |
| 2c60 | 74 65 5b 22 69 6e 73 74 61 6c 6c 65 64 22 5d 5b 6e 61 6d 65 5d 20 3d 20 61 66 74 65 72 5f 68 61 | te["installed"][name].=.after_ha |
| 2c80 | 73 68 00 00 00 4e 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 75 70 64 61 74 65 64 20 23 7b | sh...N........puts."..updated.#{ |
| 2ca0 | 6e 61 6d 65 7d 20 28 23 7b 62 65 66 6f 72 65 5f 68 61 73 68 5b 30 2e 2e 37 5d 7d 20 2d 3e 20 23 | name}.(#{before_hash[0..7]}.->.# |
| 2cc0 | 7b 61 66 74 65 72 5f 68 61 73 68 5b 30 2e 2e 37 5d 7d 29 22 00 00 00 0a 20 20 20 20 20 20 65 6c | {after_hash[0..7]})"..........el |
| 2ce0 | 73 65 00 00 00 2b 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 23 7b 6e 61 6d 65 7d 20 61 6c | se...+........puts."..#{name}.al |
| 2d00 | 72 65 61 64 79 20 75 70 20 74 6f 20 64 61 74 65 22 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 | ready.up.to.date"..........end.. |
| 2d20 | 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 1e 20 20 64 65 66 20 | ......end......end..........def. |
| 2d40 | 75 70 64 61 74 65 5f 70 61 72 61 6c 6c 65 6c 28 70 6c 75 67 69 6e 73 29 00 00 00 15 20 20 20 20 | update_parallel(plugins)........ |
| 2d60 | 71 75 65 75 65 20 3d 20 51 75 65 75 65 2e 6e 65 77 00 00 00 23 20 20 20 20 70 6c 75 67 69 6e 73 | queue.=.Queue.new...#....plugins |
| 2d80 | 2e 65 61 63 68 20 7b 20 7c 70 7c 20 71 75 65 75 65 20 3c 3c 20 70 20 7d 00 00 00 04 20 20 20 20 | .each.{.|p|.queue.<<.p.}........ |
| 2da0 | 00 00 00 3d 20 20 20 20 74 68 72 65 61 64 73 20 3d 20 28 31 2e 2e 5b 45 74 63 2e 6e 70 72 6f 63 | ...=....threads.=.(1..[Etc.nproc |
| 2dc0 | 65 73 73 6f 72 73 2c 20 70 6c 75 67 69 6e 73 2e 73 69 7a 65 5d 2e 6d 69 6e 29 2e 6d 61 70 20 64 | essors,.plugins.size].min).map.d |
| 2de0 | 6f 00 00 00 13 20 20 20 20 20 20 54 68 72 65 61 64 2e 6e 65 77 20 64 6f 00 00 00 1b 20 20 20 20 | o..........Thread.new.do........ |
| 2e00 | 20 20 20 20 77 68 69 6c 65 20 21 71 75 65 75 65 2e 65 6d 70 74 79 3f 00 00 00 2d 20 20 20 20 20 | ....while.!queue.empty?...-..... |
| 2e20 | 20 20 20 20 20 70 6c 75 67 69 6e 20 3d 20 71 75 65 75 65 2e 70 6f 70 28 74 72 75 65 29 20 72 65 | .....plugin.=.queue.pop(true).re |
| 2e40 | 73 63 75 65 20 6e 69 6c 00 00 00 30 20 20 20 20 20 20 20 20 20 20 75 70 64 61 74 65 5f 73 69 6e | scue.nil...0..........update_sin |
| 2e60 | 67 6c 65 5f 70 6c 75 67 69 6e 28 70 6c 75 67 69 6e 29 20 69 66 20 70 6c 75 67 69 6e 00 00 00 0b | gle_plugin(plugin).if.plugin.... |
| 2e80 | 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 | ........end..........end........ |
| 2ea0 | 65 6e 64 00 00 00 04 20 20 20 20 00 00 00 18 20 20 20 20 74 68 72 65 61 64 73 2e 65 61 63 68 28 | end................threads.each( |
| 2ec0 | 26 3a 6a 6f 69 6e 29 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 2b 20 20 64 65 66 20 64 69 | &:join)......end.......+..def.di |
| 2ee0 | 73 70 6c 61 79 5f 70 6c 75 67 69 6e 5f 69 6e 66 6f 28 70 6c 75 67 69 6e 2c 20 73 68 6f 77 5f 61 | splay_plugin_info(plugin,.show_a |
| 2f00 | 6c 6c 29 00 00 00 29 20 20 20 20 69 6e 5f 63 6f 6e 66 69 67 20 3d 20 70 6c 75 67 69 6e 5f 69 6e | ll)...)....in_config.=.plugin_in |
| 2f20 | 5f 63 6f 6e 66 69 67 3f 28 70 6c 75 67 69 6e 29 00 00 00 22 20 20 20 20 73 74 61 74 75 73 20 3d | _config?(plugin)..."....status.= |
| 2f40 | 20 69 6e 5f 63 6f 6e 66 69 67 20 3f 20 22 2b 22 20 3a 20 22 2d 22 00 00 00 00 00 00 00 2e 20 20 | .in_config.?."+".:."-".......... |
| 2f60 | 20 20 69 66 20 73 68 6f 77 5f 61 6c 6c 20 26 26 20 40 73 74 61 74 65 5b 22 69 6e 73 74 61 6c 6c | ..if.show_all.&&.@state["install |
| 2f80 | 65 64 22 5d 5b 70 6c 75 67 69 6e 5d 00 00 00 2e 20 20 20 20 20 20 68 61 73 68 20 3d 20 40 73 74 | ed"][plugin]..........hash.=.@st |
| 2fa0 | 61 74 65 5b 22 69 6e 73 74 61 6c 6c 65 64 22 5d 5b 70 6c 75 67 69 6e 5d 5b 30 2e 2e 37 5d 00 00 | ate["installed"][plugin][0..7].. |
| 2fc0 | 00 2e 20 20 20 20 20 20 70 75 74 73 20 22 20 20 23 7b 73 74 61 74 75 73 7d 20 23 7b 70 6c 75 67 | ........puts."..#{status}.#{plug |
| 2fe0 | 69 6e 7d 20 28 40 20 23 7b 68 61 73 68 7d 29 22 00 00 00 08 20 20 20 20 65 6c 73 65 00 00 00 22 | in}.(@.#{hash})"........else..." |
| 3000 | 20 20 20 20 20 20 70 75 74 73 20 22 20 20 23 7b 73 74 61 74 75 73 7d 20 23 7b 70 6c 75 67 69 6e | ......puts."..#{status}.#{plugin |
| 3020 | 7d 22 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 03 65 6e 64 00 00 00 | }"........end......end....end... |
| 3040 | 00 00 00 00 11 69 66 20 5f 5f 46 49 4c 45 5f 5f 20 3d 3d 20 24 30 00 00 00 07 20 20 62 65 67 69 | .....if.__FILE__.==.$0......begi |
| 3060 | 6e 00 00 00 11 20 20 20 20 72 65 71 75 69 72 65 20 27 65 74 63 27 00 00 00 15 20 20 20 20 50 6c | n........require.'etc'........Pl |
| 3080 | 75 67 69 6e 4d 61 6e 61 67 65 72 2e 72 75 6e 00 00 00 12 20 20 72 65 73 63 75 65 20 49 6e 74 65 | uginManager.run......rescue.Inte |
| 30a0 | 72 72 75 70 74 00 00 00 0b 20 20 20 20 70 75 74 73 20 22 22 00 00 00 1e 20 20 20 20 70 75 74 73 | rrupt........puts.""........puts |
| 30c0 | 20 22 69 6e 74 65 72 72 75 70 74 65 64 20 62 79 20 75 73 65 72 22 00 00 00 0a 20 20 20 20 65 78 | ."interrupted.by.user"........ex |
| 30e0 | 69 74 20 31 00 00 00 0d 20 20 72 65 73 63 75 65 20 3d 3e 20 65 00 00 00 1e 20 20 20 20 70 75 74 | it.1......rescue.=>.e........put |
| 3100 | 73 20 22 65 72 72 6f 72 3a 20 23 7b 65 2e 6d 65 73 73 61 67 65 7d 22 00 00 00 0a 20 20 20 20 65 | s."error:.#{e.message}"........e |
| 3120 | 78 69 74 20 31 00 00 00 05 20 20 65 6e 64 00 00 00 03 65 6e 64 35 81 f5 18 00 00 00 00 00 00 00 | xit.1......end....end5.......... |
| 3140 | 00 00 00 00 00 92 01 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6e 2a 00 | .............................n*. |
| 3160 | 00 00 00 00 00 01 00 00 00 00 00 00 00 35 81 5f d0 00 00 00 01 00 00 00 03 00 00 00 00 00 00 00 | .............5._................ |
| 3180 | 00 00 00 00 02 00 00 00 01 00 00 00 00 00 00 00 00 ff ff ff ff 00 03 00 00 00 00 00 00 00 00 00 | ................................ |
| 31a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 31c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 31e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 3200 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 3220 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 3240 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 3260 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 3280 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 32a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 32c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 32e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6a 00 57 70 04 01 00 00 00 02 00 f5 18 | ...................j.Wp......... |
| 3300 | 00 00 01 1c 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 08 20 20 64 65 66 20 73 61 f5 18 00 00 | ......................def.sa.... |
| 3320 | 01 1d 00 00 00 00 00 00 00 00 00 00 00 00 f5 18 00 00 00 8e 00 00 00 00 00 00 00 00 00 00 00 01 | ................................ |
| 3340 | 00 00 00 0e 20 20 20 20 20 20 69 6e 73 74 61 6c 6c 65 f5 18 00 00 00 8f 00 00 00 00 00 00 00 00 | ..........installe.............. |
| 3360 | 00 00 00 00 f5 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 f5 18 00 00 00 01 | ................................ |
| 3380 | 00 00 00 00 00 00 00 00 00 00 00 00 35 81 f5 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ............5................... |
| 33a0 | 00 00 00 00 8e 00 00 00 0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f9 0f 00 00 | ................................ |
| 33c0 | 00 00 00 00 f5 18 00 00 00 00 8e 00 00 00 0e 00 00 00 00 00 00 00 00 00 00 00 8e 00 00 00 08 00 | ................................ |
| 33e0 | 00 00 f9 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff 0f 00 00 00 00 00 00 f5 18 00 00 00 00 | ................................ |
| 3400 | 1c 01 00 00 08 00 00 00 00 00 00 00 00 00 00 00 99 00 00 00 03 00 00 00 f8 1f 00 00 00 00 00 00 | ................................ |
| 3420 | 00 00 00 00 00 00 00 00 ee 0e 00 00 00 00 00 00 35 81 5f d0 00 00 00 02 00 00 00 04 00 00 00 00 | ................5._............. |
| 3440 | 00 00 00 00 00 00 00 03 00 00 00 01 00 00 00 00 00 00 00 00 ff ff ff ff 00 01 00 00 00 00 00 00 | ................................ |
| 3460 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 3480 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 34a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 34c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 34e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 3500 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 3520 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 3540 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 3560 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 3580 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 35a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6a 00 58 bf 04 01 00 00 00 00 | ......................j.X....... |
| 35c0 | 00 f5 18 00 00 00 00 00 00 00 02 00 00 00 00 00 00 01 b6 00 00 00 13 23 21 2f 75 73 72 2f 62 69 | .......................#!/usr/bi |
| 35e0 | 6e 2f 65 6e 76 20 72 75 62 79 00 00 00 00 00 00 00 16 72 65 71 75 69 72 65 28 22 2e 2f 63 6f 6e | n/env.ruby........require("./con |
| 3600 | 66 69 67 2e 72 62 22 29 00 00 00 14 72 65 71 75 69 72 65 28 22 66 69 6c 65 75 74 69 6c 73 22 29 | fig.rb")....require("fileutils") |
| 3620 | 00 00 00 13 72 65 71 75 69 72 65 28 22 6f 70 74 70 61 72 73 65 22 29 00 00 00 0f 72 65 71 75 69 | ....require("optparse")....requi |
| 3640 | 72 65 28 22 6a 73 6f 6e 22 29 00 00 00 11 72 65 71 75 69 72 65 28 22 74 68 72 65 61 64 22 29 00 | re("json")....require("thread"). |
| 3660 | 00 00 00 00 00 00 13 63 6c 61 73 73 20 50 6c 75 67 69 6e 4d 61 6e 61 67 65 72 00 00 00 29 20 20 | .......class.PluginManager...).. |
| 3680 | 61 74 74 72 5f 72 65 61 64 65 72 20 3a 70 6c 75 67 69 6e 73 5f 64 69 72 2c 20 3a 70 6c 75 67 69 | attr_reader.:plugins_dir,.:plugi |
| 36a0 | 6e 73 5f 6c 69 73 74 00 00 00 00 00 00 00 18 20 20 64 65 66 20 69 6e 69 74 69 61 6c 69 7a 65 28 | ns_list..........def.initialize( |
| 36c0 | 63 6f 6e 66 69 67 29 00 00 00 24 20 20 20 20 40 70 6c 75 67 69 6e 73 5f 6c 69 73 74 20 3d 20 43 | config)...$....@plugins_list.=.C |
| 36e0 | 4f 4e 46 49 47 5b 3a 70 6c 75 67 69 6e 73 5d 00 00 00 36 20 20 20 20 40 72 75 6e 74 69 6d 65 5f | ONFIG[:plugins]...6....@runtime_ |
| 3700 | 70 61 74 68 20 3d 20 46 69 6c 65 2e 65 78 70 61 6e 64 5f 70 61 74 68 28 43 4f 4e 46 49 47 5b 3a | path.=.File.expand_path(CONFIG[: |
| 3720 | 72 75 6e 74 69 6d 65 5d 29 00 00 00 48 20 20 20 20 40 70 6c 75 67 69 6e 73 5f 64 69 72 20 3d 20 | runtime])...H....@plugins_dir.=. |
| 3740 | 46 69 6c 65 2e 65 78 70 61 6e 64 5f 70 61 74 68 28 22 23 7b 40 72 75 6e 74 69 6d 65 5f 70 61 74 | File.expand_path("#{@runtime_pat |
| 3760 | 68 7d 2f 70 61 63 6b 2f 73 63 69 6f 6e 2f 73 74 61 72 74 22 29 00 00 00 42 20 20 20 20 40 6f 70 | h}/pack/scion/start")...B....@op |
| 3780 | 74 5f 64 69 72 20 3d 20 46 69 6c 65 2e 65 78 70 61 6e 64 5f 70 61 74 68 28 22 23 7b 40 72 75 6e | t_dir.=.File.expand_path("#{@run |
| 37a0 | 74 69 6d 65 5f 70 61 74 68 7d 2f 70 61 63 6b 2f 73 63 69 6f 6e 2f 6f 70 74 22 29 00 00 00 47 20 | time_path}/pack/scion/opt")...G. |
| 37c0 | 20 20 20 40 73 74 61 74 65 5f 66 69 6c 65 20 3d 20 46 69 6c 65 2e 65 78 70 61 6e 64 5f 70 61 74 | ...@state_file.=.File.expand_pat |
| 37e0 | 68 28 22 23 7b 40 72 75 6e 74 69 6d 65 5f 70 61 74 68 7d 2f 73 63 69 6f 6e 5f 73 74 61 74 65 2e | h("#{@runtime_path}/scion_state. |
| 3800 | 6a 73 6f 6e 22 29 00 00 00 1c 20 20 20 20 65 6e 73 75 72 65 5f 64 69 72 65 63 74 6f 72 69 65 73 | json")........ensure_directories |
| 3820 | 5f 65 78 69 73 74 00 00 00 0e 20 20 20 20 6c 6f 61 64 5f 73 74 61 74 65 00 00 00 05 20 20 65 6e | _exist........load_state......en |
| 3840 | 64 00 00 00 00 00 00 00 0e 20 20 64 65 66 20 73 65 6c 66 2e 72 75 6e 00 00 00 1f 20 20 20 20 6f | d..........def.self.run........o |
| 3860 | 70 74 69 6f 6e 73 20 3d 20 70 61 72 73 65 5f 63 6c 69 5f 6f 70 74 69 6f 6e 73 00 00 00 19 20 20 | ptions.=.parse_cli_options...... |
| 3880 | 20 20 6d 61 6e 61 67 65 72 20 3d 20 6e 65 77 28 43 4f 4e 46 49 47 29 00 00 00 00 00 00 00 1a 20 | ..manager.=.new(CONFIG)......... |
| 38a0 | 20 20 20 63 61 73 65 20 6f 70 74 69 6f 6e 73 5b 3a 63 6f 6d 6d 61 6e 64 5d 00 00 00 0e 20 20 20 | ...case.options[:command]....... |
| 38c0 | 20 77 68 65 6e 20 3a 6c 69 73 74 00 00 00 29 20 20 20 20 20 20 6d 61 6e 61 67 65 72 2e 6c 69 73 | .when.:list...)......manager.lis |
| 38e0 | 74 5f 70 6c 75 67 69 6e 73 28 6f 70 74 69 6f 6e 73 5b 3a 61 6c 6c 5d 29 00 00 00 10 20 20 20 20 | t_plugins(options[:all])........ |
| 3900 | 77 68 65 6e 20 3a 73 74 61 74 75 73 00 00 00 19 20 20 20 20 20 20 6d 61 6e 61 67 65 72 2e 73 68 | when.:status..........manager.sh |
| 3920 | 6f 77 5f 73 74 61 74 75 73 00 00 00 10 20 20 20 20 77 68 65 6e 20 3a 66 72 65 65 7a 65 00 00 00 | ow_status........when.:freeze... |
| 3940 | 20 20 20 20 20 20 20 6d 61 6e 61 67 65 72 2e 63 72 65 61 74 65 5f 66 72 65 65 7a 65 5f 66 69 6c | .......manager.create_freeze_fil |
| 3960 | 65 00 00 00 11 20 20 20 20 77 68 65 6e 20 3a 72 65 73 74 6f 72 65 00 00 00 21 20 20 20 20 20 20 | e........when.:restore...!...... |
| 3980 | 6d 61 6e 61 67 65 72 2e 72 65 73 74 6f 72 65 5f 66 72 6f 6d 5f 66 72 65 65 7a 65 00 00 00 08 20 | manager.restore_from_freeze..... |
| 39a0 | 20 20 20 65 6c 73 65 00 00 00 2d 20 20 20 20 20 20 6d 61 6e 61 67 65 72 2e 73 79 6e 63 5f 70 6c | ...else...-......manager.sync_pl |
| 39c0 | 75 67 69 6e 73 28 6f 70 74 69 6f 6e 73 5b 3a 64 72 79 5f 72 75 6e 5d 29 00 00 00 07 20 20 20 20 | ugins(options[:dry_run])........ |
| 39e0 | 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 1c 20 20 64 65 66 20 73 65 6c 66 2e 70 | end......end..........def.self.p |
| 3a00 | 61 72 73 65 5f 63 6c 69 5f 6f 70 74 69 6f 6e 73 00 00 00 3c 20 20 20 20 6f 70 74 69 6f 6e 73 20 | arse_cli_options...<....options. |
| 3a20 | 3d 20 7b 20 63 6f 6d 6d 61 6e 64 3a 20 3a 73 79 6e 63 2c 20 64 72 79 5f 72 75 6e 3a 20 66 61 6c | =.{.command:.:sync,.dry_run:.fal |
| 3a40 | 73 65 2c 20 61 6c 6c 3a 20 66 61 6c 73 65 20 7d 00 00 00 00 00 00 00 1e 20 20 20 20 4f 70 74 69 | se,.all:.false.}............Opti |
| 3a60 | 6f 6e 50 61 72 73 65 72 2e 6e 65 77 20 64 6f 20 7c 6f 70 74 73 7c 00 00 00 2c 20 20 20 20 20 20 | onParser.new.do.|opts|...,...... |
| 3a80 | 6f 70 74 73 2e 62 61 6e 6e 65 72 20 3d 20 22 75 73 61 67 65 3a 20 23 7b 24 30 7d 20 5b 6f 70 74 | opts.banner.=."usage:.#{$0}.[opt |
| 3aa0 | 69 6f 6e 73 5d 22 00 00 00 17 20 20 20 20 20 20 6f 70 74 73 2e 73 65 70 61 72 61 74 6f 72 20 22 | ions]"..........opts.separator." |
| 3ac0 | 22 00 00 00 20 20 20 20 20 20 20 6f 70 74 73 2e 73 65 70 61 72 61 74 6f 72 20 22 63 6f 6d 6d 61 | "..........opts.separator."comma |
| 3ae0 | 6e 64 73 3a 22 00 00 00 00 00 00 00 3a 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e 28 22 2d 6c 22 2c | nds:".......:......opts.on("-l", |
| 3b00 | 20 22 2d 2d 6c 69 73 74 22 2c 20 22 6c 69 73 74 20 69 6e 73 74 61 6c 6c 65 64 20 70 6c 75 67 69 | ."--list",."list.installed.plugi |
| 3b20 | 6e 73 22 29 20 64 6f 00 00 00 21 20 20 20 20 20 20 20 20 6f 70 74 69 6f 6e 73 5b 3a 63 6f 6d 6d | ns").do...!........options[:comm |
| 3b40 | 61 6e 64 5d 20 3d 20 3a 6c 69 73 74 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 | and].=.:list..........end....... |
| 3b60 | 38 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e 28 22 2d 73 22 2c 20 22 2d 2d 73 74 61 74 75 73 22 2c | 8......opts.on("-s",."--status", |
| 3b80 | 20 22 73 68 6f 77 20 70 6c 75 67 69 6e 20 73 74 61 74 75 73 22 29 20 64 6f 00 00 00 23 20 20 20 | ."show.plugin.status").do...#... |
| 3ba0 | 20 20 20 20 20 6f 70 74 69 6f 6e 73 5b 3a 63 6f 6d 6d 61 6e 64 5d 20 3d 20 3a 73 74 61 74 75 73 | .....options[:command].=.:status |
| 3bc0 | 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 50 20 20 20 20 20 20 6f 70 74 73 2e | ..........end.......P......opts. |
| 3be0 | 6f 6e 28 22 2d 66 22 2c 20 22 2d 2d 66 72 65 65 7a 65 22 2c 20 22 63 72 65 61 74 65 20 61 20 66 | on("-f",."--freeze",."create.a.f |
| 3c00 | 72 65 65 7a 65 20 66 69 6c 65 20 77 69 74 68 20 63 75 72 72 65 6e 74 20 76 65 72 73 69 6f 6e 73 | reeze.file.with.current.versions |
| 3c20 | 22 29 20 64 6f 00 00 00 23 20 20 20 20 20 20 20 20 6f 70 74 69 6f 6e 73 5b 3a 63 6f 6d 6d 61 6e | ").do...#........options[:comman |
| 3c40 | 64 5d 20 3d 20 3a 66 72 65 65 7a 65 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 | d].=.:freeze..........end....... |
| 3c60 | 48 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e 28 22 2d 72 22 2c 20 22 2d 2d 72 65 73 74 6f 72 65 22 | H......opts.on("-r",."--restore" |
| 3c80 | 2c 20 22 72 65 73 74 6f 72 65 20 76 65 72 73 69 6f 6e 73 20 66 72 6f 6d 20 66 72 65 65 7a 65 20 | ,."restore.versions.from.freeze. |
| 3ca0 | 66 69 6c 65 22 29 20 64 6f 00 00 00 24 20 20 20 20 20 20 20 20 6f 70 74 69 6f 6e 73 5b 3a 63 6f | file").do...$........options[:co |
| 3cc0 | 6d 6d 61 6e 64 5d 20 3d 20 3a 72 65 73 74 6f 72 65 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 | mmand].=.:restore..........end.. |
| 3ce0 | 00 00 00 00 00 49 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e 28 22 2d 2d 64 72 79 2d 72 75 6e 22 2c | .....I......opts.on("--dry-run", |
| 3d00 | 20 22 73 68 6f 77 20 77 68 61 74 20 77 6f 75 6c 64 20 62 65 20 64 6f 6e 65 20 77 69 74 68 6f 75 | ."show.what.would.be.done.withou |
| 3d20 | 74 20 64 6f 69 6e 67 20 69 74 22 29 20 64 6f 00 00 00 20 20 20 20 20 20 20 20 20 6f 70 74 69 6f | t.doing.it").do............optio |
| 3d40 | 6e 73 5b 3a 64 72 79 5f 72 75 6e 5d 20 3d 20 74 72 75 65 00 00 00 09 20 20 20 20 20 20 65 6e 64 | ns[:dry_run].=.true..........end |
| 3d60 | 00 00 00 00 00 00 00 4b 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e 28 22 2d 61 22 2c 20 22 2d 2d 61 | .......K......opts.on("-a",."--a |
| 3d80 | 6c 6c 22 2c 20 22 73 68 6f 77 20 61 6c 6c 20 70 6c 75 67 69 6e 73 20 69 6e 63 6c 75 64 69 6e 67 | ll",."show.all.plugins.including |
| 3da0 | 20 63 6f 6d 6d 69 74 20 68 61 73 68 65 73 22 29 20 64 6f 00 00 00 1c 20 20 20 20 20 20 20 20 6f | .commit.hashes").do............o |
| 3dc0 | 70 74 69 6f 6e 73 5b 3a 61 6c 6c 5d 20 3d 20 74 72 75 65 00 00 00 09 20 20 20 20 20 20 65 6e 64 | ptions[:all].=.true..........end |
| 3de0 | 00 00 00 00 00 00 00 4c 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e 28 22 2d 2d 74 73 2d 75 70 64 61 | .......L......opts.on("--ts-upda |
| 3e00 | 74 65 22 2c 20 22 72 75 6e 20 54 53 55 70 64 61 74 65 20 66 6f 72 20 74 72 65 65 73 69 74 74 65 | te",."run.TSUpdate.for.treesitte |
| 3e20 | 72 20 61 66 74 65 72 20 69 6e 73 74 61 6c 6c 22 29 20 64 6f 00 00 00 22 20 20 20 20 20 20 20 20 | r.after.install").do..."........ |
| 3e40 | 6f 70 74 69 6f 6e 73 5b 3a 74 73 5f 75 70 64 61 74 65 5d 20 3d 20 74 72 75 65 00 00 00 09 20 20 | options[:ts_update].=.true...... |
| 3e60 | 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 3a 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e 28 22 2d 68 | ....end.......:......opts.on("-h |
| 3e80 | 22 2c 20 22 2d 2d 68 65 6c 70 22 2c 20 22 73 68 6f 77 20 74 68 69 73 20 68 65 6c 70 20 6d 65 73 | ",."--help",."show.this.help.mes |
| 3ea0 | 73 61 67 65 22 29 20 64 6f 00 00 00 11 20 20 20 20 20 20 20 20 70 75 74 73 20 6f 70 74 73 00 00 | sage").do............puts.opts.. |
| 3ec0 | 00 0c 20 20 20 20 20 20 20 20 65 78 69 74 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 0e 20 | ..........exit..........end..... |
| 3ee0 | 20 20 20 65 6e 64 2e 70 61 72 73 65 21 00 00 00 00 00 00 00 0b 20 20 20 20 6f 70 74 69 6f 6e 73 | ...end.parse!............options |
| 3f00 | 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 23 20 20 64 65 66 20 73 79 6e 63 5f 70 6c 75 67 | ......end.......#..def.sync_plug |
| 3f20 | 69 6e 73 28 64 72 79 5f 72 75 6e 20 3d 20 66 61 6c 73 65 29 00 00 00 44 20 20 20 20 77 61 6e 74 | ins(dry_run.=.false)...D....want |
| 3f40 | 65 64 5f 6e 61 6d 65 73 20 3d 20 40 70 6c 75 67 69 6e 73 5f 6c 69 73 74 2e 6d 61 70 20 7b 20 7c | ed_names.=.@plugins_list.map.{.| |
| 3f60 | 70 7c 20 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 70 29 20 7d 00 00 00 30 | p|.plugin_name_from_url(p).}...0 |
| 3f80 | 20 20 20 20 69 6e 73 74 61 6c 6c 65 64 5f 6e 61 6d 65 73 20 3d 20 44 69 72 2e 63 68 69 6c 64 72 | ....installed_names.=.Dir.childr |
| 3fa0 | 65 6e 28 40 70 6c 75 67 69 6e 73 5f 64 69 72 29 00 00 00 04 20 20 20 20 00 00 00 5f 20 20 20 20 | en(@plugins_dir)..........._.... |
| 3fc0 | 74 6f 5f 69 6e 73 74 61 6c 6c 20 3d 20 40 70 6c 75 67 69 6e 73 5f 6c 69 73 74 2e 72 65 6a 65 63 | to_install.=.@plugins_list.rejec |
| 3fe0 | 74 20 7b 20 7c 70 7c 20 69 6e 73 74 61 6c 6c 65 64 5f 6e 61 6d 65 73 2e 69 6e 63 6c 75 64 65 3f | t.{.|p|.installed_names.include? |
| 4000 | 28 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 70 29 29 20 7d 00 00 00 30 20 | (plugin_name_from_url(p)).}...0. |
| 4020 | 20 20 20 74 6f 5f 75 70 64 61 74 65 20 3d 20 69 6e 73 74 61 6c 6c 65 64 5f 6e 61 6d 65 73 2e 73 | ...to_update.=.installed_names.s |
| 4040 | 65 6c 65 63 74 20 64 6f 20 7c 6e 61 6d 65 7c 00 00 00 5a 20 20 20 20 20 20 44 69 72 2e 65 78 69 | elect.do.|name|...Z......Dir.exi |
| 4060 | 73 74 3f 28 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 29 20 26 | st?("#{@plugins_dir}/#{name}").& |
| 4080 | 26 20 46 69 6c 65 2e 65 78 69 73 74 3f 28 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 | &.File.exist?("#{@plugins_dir}/# |
| 40a0 | 7b 6e 61 6d 65 7d 2f 2e 67 69 74 22 29 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 50 20 20 20 20 | {name}/.git")........end...P.... |
| 40c0 | 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 20 3d 20 69 6e 73 74 61 6c 6c 65 64 5f 6e 61 6d 65 73 2e 72 | to_uninstall.=.installed_names.r |
| 40e0 | 65 6a 65 63 74 20 7b 20 7c 6e 61 6d 65 7c 20 77 61 6e 74 65 64 5f 6e 61 6d 65 73 2e 69 6e 63 6c | eject.{.|name|.wanted_names.incl |
| 4100 | 75 64 65 3f 28 6e 61 6d 65 29 20 7d 00 00 00 00 00 00 00 0e 20 20 20 20 69 66 20 64 72 79 5f 72 | ude?(name).}............if.dry_r |
| 4120 | 75 6e 00 00 00 2e 20 20 20 20 20 20 70 75 74 73 20 22 64 72 79 20 72 75 6e 20 2d 20 77 6f 75 6c | un..........puts."dry.run.-.woul |
| 4140 | 64 20 64 6f 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 3a 22 00 00 00 67 20 20 20 20 20 20 70 75 | d.do.the.following:"...g......pu |
| 4160 | 74 73 20 22 20 20 69 6e 73 74 61 6c 6c 3a 20 23 7b 74 6f 5f 69 6e 73 74 61 6c 6c 2e 6d 61 70 20 | ts."..install:.#{to_install.map. |
| 4180 | 7b 20 7c 70 7c 20 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 70 29 20 7d 2e | {.|p|.plugin_name_from_url(p).}. |
| 41a0 | 6a 6f 69 6e 28 27 2c 20 27 29 7d 22 20 69 66 20 74 6f 5f 69 6e 73 74 61 6c 6c 2e 61 6e 79 3f 00 | join(',.')}".if.to_install.any?. |
| 41c0 | 00 00 40 20 20 20 20 20 20 70 75 74 73 20 22 20 20 75 70 64 61 74 65 3a 20 23 7b 74 6f 5f 75 70 | ..@......puts."..update:.#{to_up |
| 41e0 | 64 61 74 65 2e 6a 6f 69 6e 28 27 2c 20 27 29 7d 22 20 69 66 20 74 6f 5f 75 70 64 61 74 65 2e 61 | date.join(',.')}".if.to_update.a |
| 4200 | 6e 79 3f 00 00 00 49 20 20 20 20 20 20 70 75 74 73 20 22 20 20 75 6e 69 6e 73 74 61 6c 6c 3a 20 | ny?...I......puts."..uninstall:. |
| 4220 | 23 7b 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e 6a 6f 69 6e 28 27 2c 20 27 29 7d 22 20 69 66 20 74 | #{to_uninstall.join(',.')}".if.t |
| 4240 | 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e 61 6e 79 3f 00 00 00 45 20 20 20 20 20 20 69 66 20 74 6f 5f | o_uninstall.any?...E......if.to_ |
| 4260 | 69 6e 73 74 61 6c 6c 2e 65 6d 70 74 79 3f 20 26 26 20 74 6f 5f 75 70 64 61 74 65 2e 65 6d 70 74 | install.empty?.&&.to_update.empt |
| 4280 | 79 3f 20 26 26 20 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e 65 6d 70 74 79 3f 00 00 00 1e 20 20 20 | y?.&&.to_uninstall.empty?....... |
| 42a0 | 20 20 20 20 20 70 75 74 73 20 22 20 20 6e 6f 74 68 69 6e 67 20 74 6f 20 64 6f 22 00 00 00 09 20 | .....puts."..nothing.to.do"..... |
| 42c0 | 20 20 20 20 20 65 6e 64 00 00 00 0c 20 20 20 20 20 20 72 65 74 75 72 6e 00 00 00 07 20 20 20 20 | .....end..........return........ |
| 42e0 | 65 6e 64 00 00 00 00 00 00 00 18 20 20 20 20 69 66 20 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e 61 | end............if.to_uninstall.a |
| 4300 | 6e 79 3f 00 00 00 3b 20 20 20 20 20 20 70 75 74 73 20 22 75 6e 69 6e 73 74 61 6c 6c 69 6e 67 20 | ny?...;......puts."uninstalling. |
| 4320 | 23 7b 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e 73 69 7a 65 7d 20 70 6c 75 67 69 6e 28 73 29 2e 2e | #{to_uninstall.size}.plugin(s).. |
| 4340 | 2e 22 00 00 00 21 20 20 20 20 20 20 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e 65 61 63 68 20 64 6f | ."...!......to_uninstall.each.do |
| 4360 | 20 7c 6e 61 6d 65 7c 00 00 00 2e 20 20 20 20 20 20 20 20 74 61 72 67 65 74 5f 64 69 72 20 3d 20 | .|name|............target_dir.=. |
| 4380 | 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 00 00 00 21 20 20 20 | "#{@plugins_dir}/#{name}"...!... |
| 43a0 | 20 20 20 20 20 69 66 20 44 69 72 2e 65 78 69 73 74 3f 28 74 61 72 67 65 74 5f 64 69 72 29 00 00 | .....if.Dir.exist?(target_dir).. |
| 43c0 | 00 25 20 20 20 20 20 20 20 20 20 20 46 69 6c 65 55 74 69 6c 73 2e 72 6d 5f 72 66 28 74 61 72 67 | .%..........FileUtils.rm_rf(targ |
| 43e0 | 65 74 5f 64 69 72 29 00 00 00 22 20 20 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 72 65 6d | et_dir)..."..........puts."..rem |
| 4400 | 6f 76 65 64 20 23 7b 6e 61 6d 65 7d 22 00 00 00 2a 20 20 20 20 20 20 20 20 20 20 40 73 74 61 74 | oved.#{name}"...*..........@stat |
| 4420 | 65 5b 22 69 6e 73 74 61 6c 6c 65 64 22 5d 2e 64 65 6c 65 74 65 28 6e 61 6d 65 29 00 00 00 0b 20 | e["installed"].delete(name)..... |
| 4440 | 20 20 20 20 20 20 20 65 6e 64 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 | .......end..........end........e |
| 4460 | 6e 64 00 00 00 00 00 00 00 16 20 20 20 20 69 66 20 74 6f 5f 69 6e 73 74 61 6c 6c 2e 61 6e 79 3f | nd............if.to_install.any? |
| 4480 | 00 00 00 37 20 20 20 20 20 20 70 75 74 73 20 22 69 6e 73 74 61 6c 6c 69 6e 67 20 23 7b 74 6f 5f | ...7......puts."installing.#{to_ |
| 44a0 | 69 6e 73 74 61 6c 6c 2e 73 69 7a 65 7d 20 70 6c 75 67 69 6e 28 73 29 2e 2e 2e 22 00 00 00 22 20 | install.size}.plugin(s)..."...". |
| 44c0 | 20 20 20 20 20 69 6e 73 74 61 6c 6c 5f 70 61 72 61 6c 6c 65 6c 28 74 6f 5f 69 6e 73 74 61 6c 6c | .....install_parallel(to_install |
| 44e0 | 29 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 15 20 20 20 20 69 66 20 74 6f 5f 75 70 | )........end............if.to_up |
| 4500 | 64 61 74 65 2e 61 6e 79 3f 00 00 00 34 20 20 20 20 20 20 70 75 74 73 20 22 75 70 64 61 74 69 6e | date.any?...4......puts."updatin |
| 4520 | 67 20 23 7b 74 6f 5f 75 70 64 61 74 65 2e 73 69 7a 65 7d 20 70 6c 75 67 69 6e 28 73 29 2e 2e 2e | g.#{to_update.size}.plugin(s)... |
| 4540 | 22 00 00 00 20 20 20 20 20 20 20 75 70 64 61 74 65 5f 70 61 72 61 6c 6c 65 6c 28 74 6f 5f 75 70 | "..........update_parallel(to_up |
| 4560 | 64 61 74 65 29 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 43 20 20 20 20 69 66 20 74 | date)........end.......C....if.t |
| 4580 | 6f 5f 69 6e 73 74 61 6c 6c 2e 65 6d 70 74 79 3f 20 26 26 20 74 6f 5f 75 70 64 61 74 65 2e 65 6d | o_install.empty?.&&.to_update.em |
| 45a0 | 70 74 79 3f 20 26 26 20 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e 65 6d 70 74 79 3f 00 00 00 23 20 | pty?.&&.to_uninstall.empty?...#. |
| 45c0 | 20 20 20 20 20 70 75 74 73 20 22 61 6c 6c 20 70 6c 75 67 69 6e 73 20 61 72 65 20 73 79 6e 63 65 | .....puts."all.plugins.are.synce |
| 45e0 | 64 22 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 04 20 20 20 20 00 00 00 0e 20 20 20 20 73 61 76 | d"........end................sav |
| 4600 | 65 5f 73 74 61 74 65 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 24 20 20 64 65 66 20 6c 69 | e_state......end.......$..def.li |
| 4620 | 73 74 5f 70 6c 75 67 69 6e 73 28 73 68 6f 77 5f 61 6c 6c 20 3d 20 66 61 6c 73 65 29 00 00 00 2f | st_plugins(show_all.=.false).../ |
| 4640 | 20 20 20 20 69 6e 73 74 61 6c 6c 65 64 20 3d 20 44 69 72 2e 63 68 69 6c 64 72 65 6e 28 40 70 6c | ....installed.=.Dir.children(@pl |
| 4660 | 75 67 69 6e 73 5f 64 69 72 29 2e 73 6f 72 74 00 00 00 45 20 20 20 20 6f 70 74 5f 70 6c 75 67 69 | ugins_dir).sort...E....opt_plugi |
| 4680 | 6e 73 20 3d 20 44 69 72 2e 63 68 69 6c 64 72 65 6e 28 40 6f 70 74 5f 64 69 72 29 2e 73 6f 72 74 | ns.=.Dir.children(@opt_dir).sort |
| 46a0 | 20 69 66 20 44 69 72 2e 65 78 69 73 74 3f 28 40 6f 70 74 5f 64 69 72 29 00 00 00 00 00 00 00 43 | .if.Dir.exist?(@opt_dir).......C |
| 46c0 | 20 20 20 20 69 66 20 69 6e 73 74 61 6c 6c 65 64 2e 65 6d 70 74 79 3f 20 26 26 20 28 6f 70 74 5f | ....if.installed.empty?.&&.(opt_ |
| 46e0 | 70 6c 75 67 69 6e 73 2e 6e 69 6c 3f 20 7c 7c 20 6f 70 74 5f 70 6c 75 67 69 6e 73 2e 65 6d 70 74 | plugins.nil?.||.opt_plugins.empt |
| 4700 | 79 3f 29 00 00 00 21 20 20 20 20 20 20 70 75 74 73 20 22 6e 6f 20 70 6c 75 67 69 6e 73 20 69 6e | y?)...!......puts."no.plugins.in |
| 4720 | 73 74 61 6c 6c 65 64 22 00 00 00 08 20 20 20 20 65 6c 73 65 00 00 00 30 20 20 20 20 20 20 70 75 | stalled"........else...0......pu |
| 4740 | 74 73 20 22 73 74 61 72 74 20 70 6c 75 67 69 6e 73 20 28 23 7b 69 6e 73 74 61 6c 6c 65 64 2e 63 | ts."start.plugins.(#{installed.c |
| 4760 | 6f 75 6e 74 7d 29 3a 22 00 00 00 20 20 20 20 20 20 20 69 6e 73 74 61 6c 6c 65 64 2e 65 61 63 68 | ount}):"..........installed.each |
| 4780 | 20 64 6f 20 7c 70 6c 75 67 69 6e 7c 00 00 00 2d 20 20 20 20 20 20 20 20 64 69 73 70 6c 61 79 5f | .do.|plugin|...-........display_ |
| 47a0 | 70 6c 75 67 69 6e 5f 69 6e 66 6f 28 70 6c 75 67 69 6e 2c 20 73 68 6f 77 5f 61 6c 6c 29 00 00 00 | plugin_info(plugin,.show_all)... |
| 47c0 | 09 20 20 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 2b 20 20 20 20 20 20 69 66 20 6f 70 74 5f 70 | .......end.......+......if.opt_p |
| 47e0 | 6c 75 67 69 6e 73 20 26 26 20 21 6f 70 74 5f 70 6c 75 67 69 6e 73 2e 65 6d 70 74 79 3f 00 00 00 | lugins.&&.!opt_plugins.empty?... |
| 4800 | 0f 20 20 20 20 20 20 20 20 70 75 74 73 20 22 22 00 00 00 32 20 20 20 20 20 20 20 20 70 75 74 73 | .........puts.""...2........puts |
| 4820 | 20 22 6f 70 74 20 70 6c 75 67 69 6e 73 20 28 23 7b 6f 70 74 5f 70 6c 75 67 69 6e 73 2e 63 6f 75 | ."opt.plugins.(#{opt_plugins.cou |
| 4840 | 6e 74 7d 29 3a 22 00 00 00 24 20 20 20 20 20 20 20 20 6f 70 74 5f 70 6c 75 67 69 6e 73 2e 65 61 | nt}):"...$........opt_plugins.ea |
| 4860 | 63 68 20 64 6f 20 7c 70 6c 75 67 69 6e 7c 00 00 00 2f 20 20 20 20 20 20 20 20 20 20 64 69 73 70 | ch.do.|plugin|.../..........disp |
| 4880 | 6c 61 79 5f 70 6c 75 67 69 6e 5f 69 6e 66 6f 28 70 6c 75 67 69 6e 2c 20 73 68 6f 77 5f 61 6c 6c | lay_plugin_info(plugin,.show_all |
| 48a0 | 29 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 | )............end..........end... |
| 48c0 | 00 00 00 00 5c 20 20 20 20 20 20 75 6e 69 6e 73 74 61 6c 6c 65 64 20 3d 20 40 70 6c 75 67 69 6e | ....\......uninstalled.=.@plugin |
| 48e0 | 73 5f 6c 69 73 74 2e 72 65 6a 65 63 74 20 7b 20 7c 70 7c 20 69 6e 73 74 61 6c 6c 65 64 2e 69 6e | s_list.reject.{.|p|.installed.in |
| 4900 | 63 6c 75 64 65 3f 28 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 70 29 29 20 | clude?(plugin_name_from_url(p)). |
| 4920 | 7d 00 00 00 1f 20 20 20 20 20 20 75 6e 6c 65 73 73 20 75 6e 69 6e 73 74 61 6c 6c 65 64 2e 65 6d | }..........unless.uninstalled.em |
| 4940 | 70 74 79 3f 00 00 00 0f 20 20 20 20 20 20 20 20 70 75 74 73 20 22 22 00 00 00 33 20 20 20 20 20 | pty?............puts.""...3..... |
| 4960 | 20 20 20 70 75 74 73 20 22 70 6c 75 67 69 6e 73 20 69 6e 20 63 6f 6e 66 69 67 20 62 75 74 20 6e | ...puts."plugins.in.config.but.n |
| 4980 | 6f 74 20 69 6e 73 74 61 6c 6c 65 64 3a 22 00 00 00 24 20 20 20 20 20 20 20 20 75 6e 69 6e 73 74 | ot.installed:"...$........uninst |
| 49a0 | 61 6c 6c 65 64 2e 65 61 63 68 20 64 6f 20 7c 70 6c 75 67 69 6e 7c 00 00 00 34 20 20 20 20 20 20 | alled.each.do.|plugin|...4...... |
| 49c0 | 20 20 20 20 70 75 74 73 20 22 20 20 2d 20 23 7b 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d | ....puts."..-.#{plugin_name_from |
| 49e0 | 5f 75 72 6c 28 70 6c 75 67 69 6e 29 7d 22 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 | _url(plugin)}"............end... |
| 4a00 | 09 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 | .......end........end......end.. |
| 4a20 | 00 00 00 00 00 11 20 20 64 65 66 20 73 68 6f 77 5f 73 74 61 74 75 73 00 00 00 2f 20 20 20 20 69 | ........def.show_status.../....i |
| 4a40 | 6e 73 74 61 6c 6c 65 64 20 3d 20 44 69 72 2e 63 68 69 6c 64 72 65 6e 28 40 70 6c 75 67 69 6e 73 | nstalled.=.Dir.children(@plugins |
| 4a60 | 5f 64 69 72 29 2e 73 6f 72 74 00 00 00 00 00 00 00 19 20 20 20 20 70 75 74 73 20 22 70 6c 75 67 | _dir).sort............puts."plug |
| 4a80 | 69 6e 20 73 74 61 74 75 73 3a 22 00 00 00 0b 20 20 20 20 70 75 74 73 20 22 22 00 00 00 40 20 20 | in.status:"........puts.""...@.. |
| 4aa0 | 20 20 70 75 74 73 20 22 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 3a 20 23 7b 40 70 6c 75 67 69 6e | ..puts."configuration:.#{@plugin |
| 4ac0 | 73 5f 6c 69 73 74 2e 63 6f 75 6e 74 7d 20 70 6c 75 67 69 6e 73 20 64 65 66 69 6e 65 64 22 00 00 | s_list.count}.plugins.defined".. |
| 4ae0 | 00 30 20 20 20 20 70 75 74 73 20 22 69 6e 73 74 61 6c 6c 65 64 3a 20 23 7b 69 6e 73 74 61 6c 6c | .0....puts."installed:.#{install |
| 4b00 | 65 64 2e 63 6f 75 6e 74 7d 20 70 6c 75 67 69 6e 73 22 00 00 00 0b 20 20 20 20 70 75 74 73 20 22 | ed.count}.plugins"........puts." |
| 4b20 | 22 00 00 00 00 00 00 00 11 20 20 20 20 6f 75 74 64 61 74 65 64 20 3d 20 5b 5d 00 00 00 1c 20 20 | "............outdated.=.[]...... |
| 4b40 | 20 20 69 6e 73 74 61 6c 6c 65 64 2e 65 61 63 68 20 64 6f 20 7c 6e 61 6d 65 7c 00 00 00 26 20 20 | ..installed.each.do.|name|...&.. |
| 4b60 | 20 20 20 20 70 61 74 68 20 3d 20 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 | ....path.=."#{@plugins_dir}/#{na |
| 4b80 | 6d 65 7d 22 00 00 00 2d 20 20 20 20 20 20 6e 65 78 74 20 75 6e 6c 65 73 73 20 46 69 6c 65 2e 65 | me}"...-......next.unless.File.e |
| 4ba0 | 78 69 73 74 3f 28 22 23 7b 70 61 74 68 7d 2f 2e 67 69 74 22 29 00 00 00 00 00 00 00 18 20 20 20 | xist?("#{path}/.git")........... |
| 4bc0 | 20 20 20 44 69 72 2e 63 68 64 69 72 28 70 61 74 68 29 20 64 6f 00 00 00 3d 20 20 20 20 20 20 20 | ...Dir.chdir(path).do...=....... |
| 4be0 | 20 63 75 72 72 65 6e 74 5f 68 61 73 68 20 3d 20 60 67 69 74 20 72 65 76 2d 70 61 72 73 65 20 48 | .current_hash.=.`git.rev-parse.H |
| 4c00 | 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 4f 20 20 20 20 20 20 | EAD.2>/dev/null`.strip...O...... |
| 4c20 | 20 20 72 65 6d 6f 74 65 5f 68 61 73 68 20 3d 20 60 67 69 74 20 6c 73 2d 72 65 6d 6f 74 65 20 6f | ..remote_hash.=.`git.ls-remote.o |
| 4c40 | 72 69 67 69 6e 20 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 2e 73 70 | rigin.HEAD.2>/dev/null`.strip.sp |
| 4c60 | 6c 69 74 2e 66 69 72 73 74 00 00 00 00 00 00 00 35 20 20 20 20 20 20 20 20 69 66 20 72 65 6d 6f | lit.first.......5........if.remo |
| 4c80 | 74 65 5f 68 61 73 68 20 26 26 20 63 75 72 72 65 6e 74 5f 68 61 73 68 20 21 3d 20 72 65 6d 6f 74 | te_hash.&&.current_hash.!=.remot |
| 4ca0 | 65 5f 68 61 73 68 00 00 00 1a 20 20 20 20 20 20 20 20 20 20 6f 75 74 64 61 74 65 64 20 3c 3c 20 | e_hash..............outdated.<<. |
| 4cc0 | 6e 61 6d 65 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 09 20 20 20 20 20 20 65 6e 64 | name............end..........end |
| 4ce0 | 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 1a 20 20 20 20 75 6e 6c 65 73 73 20 6f 75 | ........end............unless.ou |
| 4d00 | 74 64 61 74 65 64 2e 65 6d 70 74 79 3f 00 00 00 1e 20 20 20 20 20 20 70 75 74 73 20 22 6f 75 74 | tdated.empty?..........puts."out |
| 4d20 | 64 61 74 65 64 20 70 6c 75 67 69 6e 73 3a 22 00 00 00 31 20 20 20 20 20 20 6f 75 74 64 61 74 65 | dated.plugins:"...1......outdate |
| 4d40 | 64 2e 65 61 63 68 20 7b 20 7c 6e 61 6d 65 7c 20 70 75 74 73 20 22 20 20 2d 20 23 7b 6e 61 6d 65 | d.each.{.|name|.puts."..-.#{name |
| 4d60 | 7d 22 20 7d 00 00 00 0d 20 20 20 20 20 20 70 75 74 73 20 22 22 00 00 00 07 20 20 20 20 65 6e 64 | }".}..........puts.""........end |
| 4d80 | 00 00 00 00 00 00 00 1c 20 20 20 20 69 6e 73 74 61 6c 6c 65 64 2e 65 61 63 68 20 64 6f 20 7c 6e | ............installed.each.do.|n |
| 4da0 | 61 6d 65 7c 00 00 00 26 20 20 20 20 20 20 70 61 74 68 20 3d 20 22 23 7b 40 70 6c 75 67 69 6e 73 | ame|...&......path.=."#{@plugins |
| 4dc0 | 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 00 00 00 24 20 20 20 20 20 20 69 66 20 46 69 6c 65 2e | _dir}/#{name}"...$......if.File. |
| 4de0 | 65 78 69 73 74 3f 28 22 23 7b 70 61 74 68 7d 2f 2e 67 69 74 22 29 00 00 00 1a 20 20 20 20 20 20 | exist?("#{path}/.git").......... |
| 4e00 | 20 20 44 69 72 2e 63 68 64 69 72 28 70 61 74 68 29 20 64 6f 00 00 00 43 20 20 20 20 20 20 20 20 | ..Dir.chdir(path).do...C........ |
| 4e20 | 20 20 6c 61 73 74 5f 63 6f 6d 6d 69 74 20 3d 20 60 67 69 74 20 6c 6f 67 20 2d 31 20 2d 2d 66 6f | ..last_commit.=.`git.log.-1.--fo |
| 4e40 | 72 6d 61 74 3d 25 63 72 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 4e 20 | rmat=%cr.2>/dev/null`.strip...N. |
| 4e60 | 20 20 20 20 20 20 20 20 20 63 75 72 72 65 6e 74 5f 62 72 61 6e 63 68 20 3d 20 60 67 69 74 20 72 | .........current_branch.=.`git.r |
| 4e80 | 65 76 2d 70 61 72 73 65 20 2d 2d 61 62 62 72 65 76 2d 72 65 66 20 48 45 41 44 20 32 3e 2f 64 65 | ev-parse.--abbrev-ref.HEAD.2>/de |
| 4ea0 | 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 47 20 20 20 20 20 20 20 20 20 20 63 75 72 72 65 | v/null`.strip...G..........curre |
| 4ec0 | 6e 74 5f 68 61 73 68 20 3d 20 60 67 69 74 20 72 65 76 2d 70 61 72 73 65 20 2d 2d 73 68 6f 72 74 | nt_hash.=.`git.rev-parse.--short |
| 4ee0 | 20 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 2a 20 20 20 20 | .HEAD.2>/dev/null`.strip...*.... |
| 4f00 | 20 20 20 20 20 20 70 75 74 73 20 22 23 7b 6e 61 6d 65 7d 20 28 23 7b 63 75 72 72 65 6e 74 5f 68 | ......puts."#{name}.(#{current_h |
| 4f20 | 61 73 68 7d 29 22 00 00 00 2c 20 20 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 62 72 61 6e | ash})"...,..........puts."..bran |
| 4f40 | 63 68 3a 20 23 7b 63 75 72 72 65 6e 74 5f 62 72 61 6e 63 68 7d 22 00 00 00 44 20 20 20 20 20 20 | ch:.#{current_branch}"...D...... |
| 4f60 | 20 20 20 20 70 75 74 73 20 22 20 20 75 70 64 61 74 65 64 3a 20 23 7b 6c 61 73 74 5f 63 6f 6d 6d | ....puts."..updated:.#{last_comm |
| 4f80 | 69 74 7d 22 20 75 6e 6c 65 73 73 20 6c 61 73 74 5f 63 6f 6d 6d 69 74 2e 65 6d 70 74 79 3f 00 00 | it}".unless.last_commit.empty?.. |
| 4fa0 | 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 0a 20 20 20 20 20 20 65 6c 73 65 00 00 00 28 20 | ..........end..........else...(. |
| 4fc0 | 20 20 20 20 20 20 20 70 75 74 73 20 22 23 7b 6e 61 6d 65 7d 20 28 6e 6f 74 20 67 69 74 2d 6d 61 | .......puts."#{name}.(not.git-ma |
| 4fe0 | 6e 61 67 65 64 29 22 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 0d 20 20 20 20 20 20 70 75 | naged)"..........end..........pu |
| 5000 | 74 73 20 22 22 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 | ts.""........end......end....... |
| 5020 | 18 20 20 64 65 66 20 63 72 65 61 74 65 5f 66 72 65 65 7a 65 5f 66 69 6c 65 00 00 00 14 20 20 20 | ...def.create_freeze_file....... |
| 5040 | 20 66 72 65 65 7a 65 5f 64 61 74 61 20 3d 20 7b 7d 00 00 00 00 00 00 00 2d 20 20 20 20 44 69 72 | .freeze_data.=.{}.......-....Dir |
| 5060 | 2e 63 68 69 6c 64 72 65 6e 28 40 70 6c 75 67 69 6e 73 5f 64 69 72 29 2e 65 61 63 68 20 64 6f 20 | .children(@plugins_dir).each.do. |
| 5080 | 7c 6e 61 6d 65 7c 00 00 00 26 20 20 20 20 20 20 70 61 74 68 20 3d 20 22 23 7b 40 70 6c 75 67 69 | |name|...&......path.=."#{@plugi |
| 50a0 | 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 00 00 00 2d 20 20 20 20 20 20 6e 65 78 74 20 75 | ns_dir}/#{name}"...-......next.u |
| 50c0 | 6e 6c 65 73 73 20 46 69 6c 65 2e 65 78 69 73 74 3f 28 22 23 7b 70 61 74 68 7d 2f 2e 67 69 74 22 | nless.File.exist?("#{path}/.git" |
| 50e0 | 29 00 00 00 00 00 00 00 18 20 20 20 20 20 20 44 69 72 2e 63 68 64 69 72 28 70 61 74 68 29 20 64 | )..............Dir.chdir(path).d |
| 5100 | 6f 00 00 00 3c 20 20 20 20 20 20 20 20 63 6f 6d 6d 69 74 5f 68 61 73 68 20 3d 20 60 67 69 74 20 | o...<........commit_hash.=.`git. |
| 5120 | 72 65 76 2d 70 61 72 73 65 20 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 | rev-parse.HEAD.2>/dev/null`.stri |
| 5140 | 70 00 00 00 41 20 20 20 20 20 20 20 20 66 72 65 65 7a 65 5f 64 61 74 61 5b 6e 61 6d 65 5d 20 3d | p...A........freeze_data[name].= |
| 5160 | 20 63 6f 6d 6d 69 74 5f 68 61 73 68 20 75 6e 6c 65 73 73 20 63 6f 6d 6d 69 74 5f 68 61 73 68 2e | .commit_hash.unless.commit_hash. |
| 5180 | 65 6d 70 74 79 3f 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 00 00 | empty?..........end........end.. |
| 51a0 | 00 00 00 00 00 4b 20 20 20 20 66 72 65 65 7a 65 5f 66 69 6c 65 20 3d 20 22 73 63 69 6f 6e 5f 66 | .....K....freeze_file.=."scion_f |
| 51c0 | 72 65 65 7a 65 5f 23 7b 54 69 6d 65 2e 6e 6f 77 2e 73 74 72 66 74 69 6d 65 28 27 25 59 25 6d 25 | reeze_#{Time.now.strftime('%Y%m% |
| 51e0 | 64 5f 25 48 25 4d 25 53 27 29 7d 2e 6a 73 6f 6e 22 00 00 00 3e 20 20 20 20 46 69 6c 65 2e 77 72 | d_%H%M%S')}.json"...>....File.wr |
| 5200 | 69 74 65 28 66 72 65 65 7a 65 5f 66 69 6c 65 2c 20 4a 53 4f 4e 2e 70 72 65 74 74 79 5f 67 65 6e | ite(freeze_file,.JSON.pretty_gen |
| 5220 | 65 72 61 74 65 28 66 72 65 65 7a 65 5f 64 61 74 61 29 29 00 00 00 2e 20 20 20 20 70 75 74 73 20 | erate(freeze_data))........puts. |
| 5240 | 22 66 72 65 65 7a 65 20 66 69 6c 65 20 63 72 65 61 74 65 64 3a 20 23 7b 66 72 65 65 7a 65 5f 66 | "freeze.file.created:.#{freeze_f |
| 5260 | 69 6c 65 7d 22 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 19 20 20 64 65 66 20 72 65 73 74 | ile}"......end..........def.rest |
| 5280 | 6f 72 65 5f 66 72 6f 6d 5f 66 72 65 65 7a 65 00 00 00 3f 20 20 20 20 66 72 65 65 7a 65 5f 66 69 | ore_from_freeze...?....freeze_fi |
| 52a0 | 6c 65 73 20 3d 20 44 69 72 2e 67 6c 6f 62 28 22 73 63 69 6f 6e 5f 66 72 65 65 7a 65 5f 2a 2e 6a | les.=.Dir.glob("scion_freeze_*.j |
| 52c0 | 73 6f 6e 22 29 2e 73 6f 72 74 2e 72 65 76 65 72 73 65 00 00 00 00 00 00 00 1a 20 20 20 20 69 66 | son").sort.reverse............if |
| 52e0 | 20 66 72 65 65 7a 65 5f 66 69 6c 65 73 2e 65 6d 70 74 79 3f 00 00 00 22 20 20 20 20 20 20 70 75 | .freeze_files.empty?..."......pu |
| 5300 | 74 73 20 22 6e 6f 20 66 72 65 65 7a 65 20 66 69 6c 65 73 20 66 6f 75 6e 64 22 00 00 00 0c 20 20 | ts."no.freeze.files.found"...... |
| 5320 | 20 20 20 20 72 65 74 75 72 6e 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 22 20 20 20 | ....return........end......."... |
| 5340 | 20 70 75 74 73 20 22 61 76 61 69 6c 61 62 6c 65 20 66 72 65 65 7a 65 20 66 69 6c 65 73 3a 22 00 | .puts."available.freeze.files:". |
| 5360 | 00 00 3f 20 20 20 20 66 72 65 65 7a 65 5f 66 69 6c 65 73 2e 65 61 63 68 5f 77 69 74 68 5f 69 6e | ..?....freeze_files.each_with_in |
| 5380 | 64 65 78 20 7b 20 7c 66 2c 20 69 7c 20 70 75 74 73 20 22 20 20 23 7b 69 7d 3a 20 23 7b 66 7d 22 | dex.{.|f,.i|.puts."..#{i}:.#{f}" |
| 53a0 | 20 7d 00 00 00 41 20 20 20 20 70 72 69 6e 74 20 22 73 65 6c 65 63 74 20 66 69 6c 65 20 74 6f 20 | .}...A....print."select.file.to. |
| 53c0 | 72 65 73 74 6f 72 65 20 28 30 2d 23 7b 66 72 65 65 7a 65 5f 66 69 6c 65 73 2e 73 69 7a 65 20 2d | restore.(0-#{freeze_files.size.- |
| 53e0 | 20 31 7d 29 3a 20 22 00 00 00 1f 20 20 20 20 73 65 6c 65 63 74 69 6f 6e 20 3d 20 67 65 74 73 2e | .1}):."........selection.=.gets. |
| 5400 | 63 68 6f 6d 70 2e 74 6f 5f 69 00 00 00 00 00 00 00 29 20 20 20 20 72 65 74 75 72 6e 20 75 6e 6c | chomp.to_i.......)....return.unl |
| 5420 | 65 73 73 20 66 72 65 65 7a 65 5f 66 69 6c 65 73 5b 73 65 6c 65 63 74 69 6f 6e 5d 00 00 00 00 00 | ess.freeze_files[selection]..... |
| 5440 | 00 00 40 20 20 20 20 66 72 65 65 7a 65 5f 64 61 74 61 20 3d 20 4a 53 4f 4e 2e 70 61 72 73 65 28 | ..@....freeze_data.=.JSON.parse( |
| 5460 | 46 69 6c 65 2e 72 65 61 64 28 66 72 65 65 7a 65 5f 66 69 6c 65 73 5b 73 65 6c 65 63 74 69 6f 6e | File.read(freeze_files[selection |
| 5480 | 5d 29 29 00 00 00 00 00 00 00 2b 20 20 20 20 66 72 65 65 7a 65 5f 64 61 74 61 2e 65 61 63 68 20 | ])).......+....freeze_data.each. |
| 54a0 | 64 6f 20 7c 6e 61 6d 65 2c 20 74 61 72 67 65 74 5f 68 61 73 68 7c 00 00 00 26 20 20 20 20 20 20 | do.|name,.target_hash|...&...... |
| 54c0 | 70 61 74 68 20 3d 20 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 | path.=."#{@plugins_dir}/#{name}" |
| 54e0 | 00 00 00 38 20 20 20 20 20 20 69 66 20 44 69 72 2e 65 78 69 73 74 3f 28 70 61 74 68 29 20 26 26 | ...8......if.Dir.exist?(path).&& |
| 5500 | 20 46 69 6c 65 2e 65 78 69 73 74 3f 28 22 23 7b 70 61 74 68 7d 2f 2e 67 69 74 22 29 00 00 00 1a | .File.exist?("#{path}/.git").... |
| 5520 | 20 20 20 20 20 20 20 20 44 69 72 2e 63 68 64 69 72 28 70 61 74 68 29 20 64 6f 00 00 00 3f 20 20 | ........Dir.chdir(path).do...?.. |
| 5540 | 20 20 20 20 20 20 20 20 63 75 72 72 65 6e 74 5f 68 61 73 68 20 3d 20 60 67 69 74 20 72 65 76 2d | ........current_hash.=.`git.rev- |
| 5560 | 70 61 72 73 65 20 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 | parse.HEAD.2>/dev/null`.strip... |
| 5580 | 28 20 20 20 20 20 20 20 20 20 20 69 66 20 63 75 72 72 65 6e 74 5f 68 61 73 68 20 21 3d 20 74 61 | (..........if.current_hash.!=.ta |
| 55a0 | 72 67 65 74 5f 68 61 73 68 00 00 00 3f 20 20 20 20 20 20 20 20 20 20 20 20 70 75 74 73 20 22 72 | rget_hash...?............puts."r |
| 55c0 | 65 73 74 6f 72 69 6e 67 20 23 7b 6e 61 6d 65 7d 20 74 6f 20 23 7b 74 61 72 67 65 74 5f 68 61 73 | estoring.#{name}.to.#{target_has |
| 55e0 | 68 5b 30 2e 2e 37 5d 7d 2e 2e 2e 22 00 00 00 4b 20 20 20 20 20 20 20 20 20 20 20 20 73 79 73 74 | h[0..7]}..."...K............syst |
| 5600 | 65 6d 28 22 67 69 74 20 66 65 74 63 68 20 2d 2d 64 65 70 74 68 3d 31 20 6f 72 69 67 69 6e 20 23 | em("git.fetch.--depth=1.origin.# |
| 5620 | 7b 74 61 72 67 65 74 5f 68 61 73 68 7d 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 22 29 00 00 00 3d 20 | {target_hash}.2>/dev/null")...=. |
| 5640 | 20 20 20 20 20 20 20 20 20 20 20 73 79 73 74 65 6d 28 22 67 69 74 20 63 68 65 63 6b 6f 75 74 20 | ...........system("git.checkout. |
| 5660 | 23 7b 74 61 72 67 65 74 5f 68 61 73 68 7d 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 22 29 00 00 00 4a | #{target_hash}.2>/dev/null")...J |
| 5680 | 20 20 20 20 20 20 20 20 20 20 20 20 72 75 6e 5f 74 72 65 65 73 69 74 74 65 72 5f 70 6f 73 74 5f | ............run_treesitter_post_ |
| 56a0 | 69 6e 73 74 61 6c 6c 28 6e 61 6d 65 29 20 69 66 20 6e 61 6d 65 20 3d 3d 20 22 6e 76 69 6d 2d 74 | install(name).if.name.==."nvim-t |
| 56c0 | 72 65 65 73 69 74 74 65 72 22 00 00 00 0e 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 00 00 00 34 | reesitter"..............else...4 |
| 56e0 | 20 20 20 20 20 20 20 20 20 20 20 20 70 75 74 73 20 22 23 7b 6e 61 6d 65 7d 20 61 6c 72 65 61 64 | ............puts."#{name}.alread |
| 5700 | 79 20 61 74 20 74 61 72 67 65 74 20 76 65 72 73 69 6f 6e 22 00 00 00 0d 20 20 20 20 20 20 20 20 | y.at.target.version"............ |
| 5720 | 20 20 65 6e 64 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 0a 20 20 20 20 20 20 65 6c | ..end............end..........el |
| 5740 | 73 65 00 00 00 37 20 20 20 20 20 20 20 20 70 75 74 73 20 22 77 61 72 6e 69 6e 67 3a 20 23 7b 6e | se...7........puts."warning:.#{n |
| 5760 | 61 6d 65 7d 20 6e 6f 74 20 69 6e 73 74 61 6c 6c 65 64 2c 20 73 6b 69 70 70 69 6e 67 22 00 00 00 | ame}.not.installed,.skipping"... |
| 5780 | 09 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 | .......end........end......end.. |
| 57a0 | 00 00 00 00 00 09 20 20 70 72 69 76 61 74 65 00 00 00 00 00 00 00 1e 20 20 64 65 66 20 65 6e 73 | ........private..........def.ens |
| 57c0 | 75 72 65 5f 64 69 72 65 63 74 6f 72 69 65 73 5f 65 78 69 73 74 00 00 00 2a 20 20 20 20 5b 40 70 | ure_directories_exist...*....[@p |
| 57e0 | 6c 75 67 69 6e 73 5f 64 69 72 2c 20 40 6f 70 74 5f 64 69 72 5d 2e 65 61 63 68 20 64 6f 20 7c 64 | lugins_dir,.@opt_dir].each.do.|d |
| 5800 | 69 72 7c 00 00 00 33 20 20 20 20 20 20 46 69 6c 65 55 74 69 6c 73 2e 6d 6b 64 69 72 5f 70 28 64 | ir|...3......FileUtils.mkdir_p(d |
| 5820 | 69 72 29 20 75 6e 6c 65 73 73 20 44 69 72 2e 65 78 69 73 74 3f 28 64 69 72 29 00 00 00 07 20 20 | ir).unless.Dir.exist?(dir)...... |
| 5840 | 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 10 20 20 64 65 66 20 6c 6f 61 64 | ..end......end..........def.load |
| 5860 | 5f 73 74 61 74 65 00 00 00 28 20 20 20 20 40 73 74 61 74 65 20 3d 20 69 66 20 46 69 6c 65 2e 65 | _state...(....@state.=.if.File.e |
| 5880 | 78 69 73 74 3f 28 40 73 74 61 74 65 5f 66 69 6c 65 29 00 00 00 28 20 20 20 20 20 20 4a 53 4f 4e | xist?(@state_file)...(......JSON |
| 58a0 | 2e 70 61 72 73 65 28 46 69 6c 65 2e 72 65 61 64 28 40 73 74 61 74 65 5f 66 69 6c 65 29 29 00 00 | .parse(File.read(@state_file)).. |
| 58c0 | 00 08 20 20 20 20 65 6c 73 65 00 00 00 31 20 20 20 20 20 20 7b 20 22 69 6e 73 74 61 6c 6c 65 64 | ......else...1......{."installed |
| 58e0 | 22 20 3d 3e 20 7b 7d 2c 20 22 6c 61 73 74 5f 75 70 64 61 74 65 22 20 3d 3e 20 6e 69 6c 20 7d 00 | ".=>.{},."last_update".=>.nil.}. |
| 5900 | 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 10 20 20 64 65 66 | .......end......end..........def |
| 5920 | 20 73 61 76 65 5f 73 74 61 74 65 00 00 00 39 20 20 20 20 46 69 6c 65 2e 77 72 69 74 65 28 40 73 | .save_state...9....File.write(@s |
| 5940 | 74 61 74 65 5f 66 69 6c 65 2c 20 4a 53 4f 4e 2e 70 72 65 74 74 79 5f 67 65 6e 65 72 61 74 65 28 | tate_file,.JSON.pretty_generate( |
| 5960 | 40 73 74 61 74 65 29 29 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 1b 20 20 64 65 66 20 70 | @state))......end..........def.p |
| 5980 | 6c 75 67 69 6e 5f 74 6f 5f 75 72 6c 28 70 6c 75 67 69 6e 29 00 00 00 2b 20 20 20 20 72 65 74 75 | lugin_to_url(plugin)...+....retu |
| 59a0 | 72 6e 20 70 6c 75 67 69 6e 20 69 66 20 70 6c 75 67 69 6e 2e 69 6e 63 6c 75 64 65 3f 28 22 3a 2f | rn.plugin.if.plugin.include?(":/ |
| 59c0 | 2f 22 29 00 00 00 22 20 20 20 20 22 68 74 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 23 | /")..."...."https://github.com/# |
| 59e0 | 7b 70 6c 75 67 69 6e 7d 22 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 27 20 20 64 65 66 20 | {plugin}"......end.......'..def. |
| 5a00 | 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 75 72 6c 5f 6f 72 5f 73 70 65 63 | plugin_name_from_url(url_or_spec |
| 5a20 | 29 00 00 00 24 20 20 20 20 75 72 6c 20 3d 20 70 6c 75 67 69 6e 5f 74 6f 5f 75 72 6c 28 75 72 6c | )...$....url.=.plugin_to_url(url |
| 5a40 | 5f 6f 72 5f 73 70 65 63 29 00 00 00 1e 20 20 20 20 46 69 6c 65 2e 62 61 73 65 6e 61 6d 65 28 75 | _or_spec)........File.basename(u |
| 5a60 | 72 6c 2c 20 22 2e 67 69 74 22 29 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 21 20 20 64 65 | rl,.".git")......end.......!..de |
| 5a80 | 66 20 66 69 6e 64 5f 70 6c 75 67 69 6e 5f 69 6e 5f 63 6f 6e 66 69 67 28 6e 61 6d 65 29 00 00 00 | f.find_plugin_in_config(name)... |
| 5aa0 | 22 20 20 20 20 40 70 6c 75 67 69 6e 73 5f 6c 69 73 74 2e 66 69 6e 64 20 64 6f 20 7c 70 6c 75 67 | "....@plugins_list.find.do.|plug |
| 5ac0 | 69 6e 7c 00 00 00 2a 20 20 20 20 20 20 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 | in|...*......plugin_name_from_ur |
| 5ae0 | 6c 28 70 6c 75 67 69 6e 29 20 3d 3d 20 6e 61 6d 65 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 | l(plugin).==.name........end.... |
| 5b00 | 20 20 65 6e 64 00 00 00 00 00 00 00 1d 20 20 64 65 66 20 70 6c 75 67 69 6e 5f 69 6e 5f 63 6f 6e | ..end..........def.plugin_in_con |
| 5b20 | 66 69 67 3f 28 6e 61 6d 65 29 00 00 00 25 20 20 20 20 21 66 69 6e 64 5f 70 6c 75 67 69 6e 5f 69 | fig?(name)...%....!find_plugin_i |
| 5b40 | 6e 5f 63 6f 6e 66 69 67 28 6e 61 6d 65 29 2e 6e 69 6c 3f 00 00 00 05 20 20 65 6e 64 00 00 00 00 | n_config(name).nil?......end.... |
| 5b60 | 00 00 00 21 20 20 64 65 66 20 69 73 5f 74 72 65 65 73 69 74 74 65 72 5f 70 6c 75 67 69 6e 3f 28 | ...!..def.is_treesitter_plugin?( |
| 5b80 | 6e 61 6d 65 29 00 00 00 1d 20 20 20 20 6e 61 6d 65 20 3d 3d 20 22 6e 76 69 6d 2d 74 72 65 65 73 | name)........name.==."nvim-trees |
| 5ba0 | 69 74 74 65 72 22 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 27 20 20 64 65 66 20 72 75 6e | itter"......end.......'..def.run |
| 5bc0 | 5f 74 72 65 65 73 69 74 74 65 72 5f 70 6f 73 74 5f 69 6e 73 74 61 6c 6c 28 6e 61 6d 65 29 00 00 | _treesitter_post_install(name).. |
| 5be0 | 00 2d 20 20 20 20 72 65 74 75 72 6e 20 75 6e 6c 65 73 73 20 69 73 5f 74 72 65 65 73 69 74 74 65 | .-....return.unless.is_treesitte |
| 5c00 | 72 5f 70 6c 75 67 69 6e 3f 28 6e 61 6d 65 29 00 00 00 04 20 20 20 20 00 00 00 24 20 20 20 20 6e | r_plugin?(name)...........$....n |
| 5c20 | 76 69 6d 5f 63 6d 64 20 3d 20 45 4e 56 5b 27 4e 56 49 4d 27 5d 20 7c 7c 20 27 6e 76 69 6d 27 00 | vim_cmd.=.ENV['NVIM'].||.'nvim'. |
| 5c40 | 00 00 46 20 20 20 20 74 73 5f 75 70 64 61 74 65 5f 63 6d 64 20 3d 20 22 23 7b 6e 76 69 6d 5f 63 | ..F....ts_update_cmd.=."#{nvim_c |
| 5c60 | 6d 64 7d 20 2d 2d 68 65 61 64 6c 65 73 73 20 2d 63 20 27 54 53 55 70 64 61 74 65 53 79 6e 63 27 | md}.--headless.-c.'TSUpdateSync' |
| 5c80 | 20 2d 63 20 27 71 61 27 22 00 00 00 04 20 20 20 20 00 00 00 33 20 20 20 20 70 75 74 73 20 22 20 | .-c.'qa'"...........3....puts.". |
| 5ca0 | 20 72 75 6e 6e 69 6e 67 20 54 53 55 70 64 61 74 65 53 79 6e 63 20 66 6f 72 20 74 72 65 65 73 69 | .running.TSUpdateSync.for.treesi |
| 5cc0 | 74 74 65 72 2e 2e 2e 22 00 00 00 19 20 20 20 20 73 79 73 74 65 6d 28 74 73 5f 75 70 64 61 74 65 | tter..."........system(ts_update |
| 5ce0 | 5f 63 6d 64 29 00 00 00 04 20 20 20 20 00 00 00 12 20 20 20 20 69 66 20 24 3f 2e 73 75 63 63 65 | _cmd)................if.$?.succe |
| 5d00 | 73 73 3f 00 00 00 38 20 20 20 20 20 20 70 75 74 73 20 22 20 20 74 72 65 65 73 69 74 74 65 72 20 | ss?...8......puts."..treesitter. |
| 5d20 | 70 61 72 73 65 72 73 20 69 6e 73 74 61 6c 6c 65 64 20 73 75 63 63 65 73 73 66 75 6c 6c 79 22 00 | parsers.installed.successfully". |
| 5d40 | 00 00 08 20 20 20 20 65 6c 73 65 00 00 00 55 20 20 20 20 20 20 70 75 74 73 20 22 20 20 77 61 72 | .......else...U......puts."..war |
| 5d60 | 6e 69 6e 67 3a 20 74 72 65 65 73 69 74 74 65 72 20 70 61 72 73 65 72 73 20 66 61 69 6c 65 64 20 | ning:.treesitter.parsers.failed. |
| 5d80 | 74 6f 20 69 6e 73 74 61 6c 6c 2c 20 72 75 6e 20 3a 54 53 49 6e 73 74 61 6c 6c 20 6d 61 6e 75 61 | to.install,.run.:TSInstall.manua |
| 5da0 | 6c 6c 79 22 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 23 | lly"........end......end.......# |
| 5dc0 | 20 20 64 65 66 20 69 6e 73 74 61 6c 6c 5f 73 69 6e 67 6c 65 5f 70 6c 75 67 69 6e 28 70 6c 75 67 | ..def.install_single_plugin(plug |
| 5de0 | 69 6e 29 00 00 00 1f 20 20 20 20 75 72 6c 20 3d 20 70 6c 75 67 69 6e 5f 74 6f 5f 75 72 6c 28 70 | in)........url.=.plugin_to_url(p |
| 5e00 | 6c 75 67 69 6e 29 00 00 00 27 20 20 20 20 6e 61 6d 65 20 3d 20 70 6c 75 67 69 6e 5f 6e 61 6d 65 | lugin)...'....name.=.plugin_name |
| 5e20 | 5f 66 72 6f 6d 5f 75 72 6c 28 70 6c 75 67 69 6e 29 00 00 00 2b 20 20 20 20 74 61 72 67 65 74 5f | _from_url(plugin)...+....target_ |
| 5e40 | 70 61 74 68 20 3d 20 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 | path.=."#{@plugins_dir}/#{name}" |
| 5e60 | 00 00 00 00 00 00 00 1e 20 20 20 20 69 66 20 44 69 72 2e 65 78 69 73 74 3f 28 74 61 72 67 65 74 | ............if.Dir.exist?(target |
| 5e80 | 5f 70 61 74 68 29 00 00 00 12 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 00 00 00 07 | _path)..........return.false.... |
| 5ea0 | 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 4b 20 20 20 20 73 79 73 74 65 6d 28 22 67 69 74 20 63 | ....end.......K....system("git.c |
| 5ec0 | 6c 6f 6e 65 20 23 7b 75 72 6c 7d 20 23 7b 74 61 72 67 65 74 5f 70 61 74 68 7d 20 2d 2d 64 65 70 | lone.#{url}.#{target_path}.--dep |
| 5ee0 | 74 68 3d 31 20 2d 2d 71 75 69 65 74 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 22 29 00 00 00 00 00 00 | th=1.--quiet.2>/dev/null")...... |
| 5f00 | 00 1e 20 20 20 20 69 66 20 44 69 72 2e 65 78 69 73 74 3f 28 74 61 72 67 65 74 5f 70 61 74 68 29 | ......if.Dir.exist?(target_path) |
| 5f20 | 00 00 00 1f 20 20 20 20 20 20 44 69 72 2e 63 68 64 69 72 28 74 61 72 67 65 74 5f 70 61 74 68 29 | ..........Dir.chdir(target_path) |
| 5f40 | 20 64 6f 00 00 00 3c 20 20 20 20 20 20 20 20 63 6f 6d 6d 69 74 5f 68 61 73 68 20 3d 20 60 67 69 | .do...<........commit_hash.=.`gi |
| 5f60 | 74 20 72 65 76 2d 70 61 72 73 65 20 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 | t.rev-parse.HEAD.2>/dev/null`.st |
| 5f80 | 72 69 70 00 00 00 2f 20 20 20 20 20 20 20 20 40 73 74 61 74 65 5b 22 69 6e 73 74 61 6c 6c 65 64 | rip.../........@state["installed |
| 5fa0 | 22 5d 5b 6e 61 6d 65 5d 20 3d 20 63 6f 6d 6d 69 74 5f 68 61 73 68 00 00 00 08 20 20 20 20 20 20 | "][name].=.commit_hash.......... |
| 5fc0 | 20 20 00 00 00 26 20 20 20 20 20 20 20 20 69 66 20 69 73 5f 74 72 65 65 73 69 74 74 65 72 5f 70 | .....&........if.is_treesitter_p |
| 5fe0 | 6c 75 67 69 6e 3f 28 6e 61 6d 65 29 00 00 00 2b 20 20 20 20 20 20 20 20 20 20 72 75 6e 5f 74 72 | lugin?(name)...+..........run_tr |
| 6000 | 65 65 73 69 74 74 65 72 5f 70 6f 73 74 5f 69 6e 73 74 61 6c 6c 28 6e 61 6d 65 29 00 00 00 0b 20 | eesitter_post_install(name)..... |
| 6020 | 20 20 20 20 20 20 20 65 6e 64 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 20 20 20 20 20 20 | .......end..........end......... |
| 6040 | 20 70 75 74 73 20 22 20 20 69 6e 73 74 61 6c 6c 65 64 20 23 7b 6e 61 6d 65 7d 22 00 00 00 0a 20 | .puts."..installed.#{name}"..... |
| 6060 | 20 20 20 20 20 74 72 75 65 00 00 00 08 20 20 20 20 65 6c 73 65 00 00 00 28 20 20 20 20 20 20 70 | .....true........else...(......p |
| 6080 | 75 74 73 20 22 20 20 66 61 69 6c 65 64 20 74 6f 20 69 6e 73 74 61 6c 6c 20 23 7b 6e 61 6d 65 7d | uts."..failed.to.install.#{name} |
| 60a0 | 22 00 00 00 0b 20 20 20 20 20 20 66 61 6c 73 65 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 | "..........false........end..... |
| 60c0 | 20 65 6e 64 00 00 00 00 00 00 00 1f 20 20 64 65 66 20 69 6e 73 74 61 6c 6c 5f 70 61 72 61 6c 6c | .end..........def.install_parall |
| 60e0 | 65 6c 28 70 6c 75 67 69 6e 73 29 00 00 00 15 20 20 20 20 71 75 65 75 65 20 3d 20 51 75 65 75 65 | el(plugins)........queue.=.Queue |
| 6100 | 2e 6e 65 77 00 00 00 23 20 20 20 20 70 6c 75 67 69 6e 73 2e 65 61 63 68 20 7b 20 7c 70 7c 20 71 | .new...#....plugins.each.{.|p|.q |
| 6120 | 75 65 75 65 20 3c 3c 20 70 20 7d 00 00 00 04 20 20 20 20 00 00 00 3d 20 20 20 20 74 68 72 65 61 | ueue.<<.p.}...........=....threa |
| 6140 | 64 73 20 3d 20 28 31 2e 2e 5b 45 74 63 2e 6e 70 72 6f 63 65 73 73 6f 72 73 2c 20 70 6c 75 67 69 | ds.=.(1..[Etc.nprocessors,.plugi |
| 6160 | 6e 73 2e 73 69 7a 65 5d 2e 6d 69 6e 29 2e 6d 61 70 20 64 6f 00 00 00 13 20 20 20 20 20 20 54 68 | ns.size].min).map.do..........Th |
| 6180 | 72 65 61 64 2e 6e 65 77 20 64 6f 00 00 00 1b 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 21 71 75 | read.new.do............while.!qu |
| 61a0 | 65 75 65 2e 65 6d 70 74 79 3f 00 00 00 2d 20 20 20 20 20 20 20 20 20 20 70 6c 75 67 69 6e 20 3d | eue.empty?...-..........plugin.= |
| 61c0 | 20 71 75 65 75 65 2e 70 6f 70 28 74 72 75 65 29 20 72 65 73 63 75 65 20 6e 69 6c 00 00 00 31 20 | .queue.pop(true).rescue.nil...1. |
| 61e0 | 20 20 20 20 20 20 20 20 20 69 6e 73 74 61 6c 6c 5f 73 69 6e 67 6c 65 5f 70 6c 75 67 69 6e 28 70 | .........install_single_plugin(p |
| 6200 | 6c 75 67 69 6e 29 20 69 66 20 70 6c 75 67 69 6e 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 | lugin).if.plugin............end. |
| 6220 | 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 04 20 20 20 20 00 | .........end........end......... |
| 6240 | 00 00 18 20 20 20 20 74 68 72 65 61 64 73 2e 65 61 63 68 28 26 3a 6a 6f 69 6e 29 00 00 00 05 20 | .......threads.each(&:join)..... |
| 6260 | 20 65 6e 64 00 00 00 00 00 00 00 20 20 20 64 65 66 20 75 70 64 61 74 65 5f 73 69 6e 67 6c 65 5f | .end..........def.update_single_ |
| 6280 | 70 6c 75 67 69 6e 28 6e 61 6d 65 29 00 00 00 24 20 20 20 20 70 61 74 68 20 3d 20 22 23 7b 40 70 | plugin(name)...$....path.=."#{@p |
| 62a0 | 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 00 00 00 04 20 20 20 20 00 00 00 16 | lugins_dir}/#{name}"............ |
| 62c0 | 20 20 20 20 44 69 72 2e 63 68 64 69 72 28 70 61 74 68 29 20 64 6f 00 00 00 3a 20 20 20 20 20 20 | ....Dir.chdir(path).do...:...... |
| 62e0 | 62 65 66 6f 72 65 5f 68 61 73 68 20 3d 20 60 67 69 74 20 72 65 76 2d 70 61 72 73 65 20 48 45 41 | before_hash.=.`git.rev-parse.HEA |
| 6300 | 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 36 20 20 20 20 20 20 73 79 | D.2>/dev/null`.strip...6......sy |
| 6320 | 73 74 65 6d 28 22 67 69 74 20 70 75 6c 6c 20 2d 2d 64 65 70 74 68 3d 31 20 2d 2d 71 75 69 65 74 | stem("git.pull.--depth=1.--quiet |
| 6340 | 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 22 29 00 00 00 39 20 20 20 20 20 20 61 66 74 65 72 5f 68 61 | .2>/dev/null")...9......after_ha |
| 6360 | 73 68 20 3d 20 60 67 69 74 20 72 65 76 2d 70 61 72 73 65 20 48 45 41 44 20 32 3e 2f 64 65 76 2f | sh.=.`git.rev-parse.HEAD.2>/dev/ |
| 6380 | 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 06 20 20 20 20 20 20 00 00 00 22 20 20 20 20 20 20 69 | null`.strip............."......i |
| 63a0 | 66 20 62 65 66 6f 72 65 5f 68 61 73 68 20 21 3d 20 61 66 74 65 72 5f 68 61 73 68 00 00 00 2e 20 | f.before_hash.!=.after_hash..... |
| 63c0 | 20 20 20 20 20 20 20 40 73 74 61 74 65 5b 22 69 6e 73 74 61 6c 6c 65 64 22 5d 5b 6e 61 6d 65 5d | .......@state["installed"][name] |
| 63e0 | 20 3d 20 61 66 74 65 72 5f 68 61 73 68 00 00 00 08 20 20 20 20 20 20 20 20 00 00 00 26 20 20 20 | .=.after_hash...............&... |
| 6400 | 20 20 20 20 20 69 66 20 69 73 5f 74 72 65 65 73 69 74 74 65 72 5f 70 6c 75 67 69 6e 3f 28 6e 61 | .....if.is_treesitter_plugin?(na |
| 6420 | 6d 65 29 00 00 00 2b 20 20 20 20 20 20 20 20 20 20 72 75 6e 5f 74 72 65 65 73 69 74 74 65 72 5f | me)...+..........run_treesitter_ |
| 6440 | 70 6f 73 74 5f 69 6e 73 74 61 6c 6c 28 6e 61 6d 65 29 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e | post_install(name)............en |
| 6460 | 64 00 00 00 08 20 20 20 20 20 20 20 20 00 00 00 4e 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 | d...............N........puts.". |
| 6480 | 20 75 70 64 61 74 65 64 20 23 7b 6e 61 6d 65 7d 20 28 23 7b 62 65 66 6f 72 65 5f 68 61 73 68 5b | .updated.#{name}.(#{before_hash[ |
| 64a0 | 30 2e 2e 37 5d 7d 20 2d 3e 20 23 7b 61 66 74 65 72 5f 68 61 73 68 5b 30 2e 2e 37 5d 7d 29 22 00 | 0..7]}.->.#{after_hash[0..7]})". |
| 64c0 | 00 00 0a 20 20 20 20 20 20 65 6c 73 65 00 00 00 2b 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 | .........else...+........puts.". |
| 64e0 | 20 23 7b 6e 61 6d 65 7d 20 61 6c 72 65 61 64 79 20 75 70 20 74 6f 20 64 61 74 65 22 00 00 00 09 | .#{name}.already.up.to.date".... |
| 6500 | 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 | ......end........end......end... |
| 6520 | 00 00 00 00 1e 20 20 64 65 66 20 75 70 64 61 74 65 5f 70 61 72 61 6c 6c 65 6c 28 70 6c 75 67 69 | .......def.update_parallel(plugi |
| 6540 | 6e 73 29 00 00 00 15 20 20 20 20 71 75 65 75 65 20 3d 20 51 75 65 75 65 2e 6e 65 77 00 00 00 23 | ns)........queue.=.Queue.new...# |
| 6560 | 20 20 20 20 70 6c 75 67 69 6e 73 2e 65 61 63 68 20 7b 20 7c 70 7c 20 71 75 65 75 65 20 3c 3c 20 | ....plugins.each.{.|p|.queue.<<. |
| 6580 | 70 20 7d 00 00 00 04 20 20 20 20 00 00 00 3d 20 20 20 20 74 68 72 65 61 64 73 20 3d 20 28 31 2e | p.}...........=....threads.=.(1. |
| 65a0 | 2e 5b 45 74 63 2e 6e 70 72 6f 63 65 73 73 6f 72 73 2c 20 70 6c 75 67 69 6e 73 2e 73 69 7a 65 5d | .[Etc.nprocessors,.plugins.size] |
| 65c0 | 2e 6d 69 6e 29 2e 6d 61 70 20 64 6f 00 00 00 13 20 20 20 20 20 20 54 68 72 65 61 64 2e 6e 65 77 | .min).map.do..........Thread.new |
| 65e0 | 20 64 6f 00 00 00 1b 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 21 71 75 65 75 65 2e 65 6d 70 74 | .do............while.!queue.empt |
| 6600 | 79 3f 00 00 00 2d 20 20 20 20 20 20 20 20 20 20 70 6c 75 67 69 6e 20 3d 20 71 75 65 75 65 2e 70 | y?...-..........plugin.=.queue.p |
| 6620 | 6f 70 28 74 72 75 65 29 20 72 65 73 63 75 65 20 6e 69 6c 00 00 00 30 20 20 20 20 20 20 20 20 20 | op(true).rescue.nil...0......... |
| 6640 | 20 75 70 64 61 74 65 5f 73 69 6e 67 6c 65 5f 70 6c 75 67 69 6e 28 70 6c 75 67 69 6e 29 20 69 66 | .update_single_plugin(plugin).if |
| 6660 | 20 70 6c 75 67 69 6e 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 09 20 20 20 20 20 20 | .plugin............end.......... |
| 6680 | 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 04 20 20 20 20 00 00 00 18 20 20 20 20 74 68 | end........end................th |
| 66a0 | 72 65 61 64 73 2e 65 61 63 68 28 26 3a 6a 6f 69 6e 29 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 | reads.each(&:join)......end..... |
| 66c0 | 00 00 2b 20 20 64 65 66 20 64 69 73 70 6c 61 79 5f 70 6c 75 67 69 6e 5f 69 6e 66 6f 28 70 6c 75 | ..+..def.display_plugin_info(plu |
| 66e0 | 67 69 6e 2c 20 73 68 6f 77 5f 61 6c 6c 29 00 00 00 29 20 20 20 20 69 6e 5f 63 6f 6e 66 69 67 20 | gin,.show_all)...)....in_config. |
| 6700 | 3d 20 70 6c 75 67 69 6e 5f 69 6e 5f 63 6f 6e 66 69 67 3f 28 70 6c 75 67 69 6e 29 00 00 00 22 20 | =.plugin_in_config?(plugin)...". |
| 6720 | 20 20 20 73 74 61 74 75 73 20 3d 20 69 6e 5f 63 6f 6e 66 69 67 20 3f 20 22 2b 22 20 3a 20 22 2d | ...status.=.in_config.?."+".:."- |
| 6740 | 22 00 00 00 00 00 00 00 2e 20 20 20 20 69 66 20 73 68 6f 77 5f 61 6c 6c 20 26 26 20 40 73 74 61 | "............if.show_all.&&.@sta |
| 6760 | 74 65 5b 22 69 6e 73 74 61 6c 6c 65 64 22 5d 5b 70 6c 75 67 69 6e 5d 00 00 00 2e 20 20 20 20 20 | te["installed"][plugin]......... |
| 6780 | 20 68 61 73 68 20 3d 20 40 73 74 61 74 65 5b 22 69 6e 73 74 61 6c 6c 65 64 22 5d 5b 70 6c 75 67 | .hash.=.@state["installed"][plug |
| 67a0 | 69 6e 5d 5b 30 2e 2e 37 5d 00 00 00 46 20 20 20 20 20 20 74 72 65 65 73 69 74 74 65 72 5f 6d 61 | in][0..7]...F......treesitter_ma |
| 67c0 | 72 6b 65 72 20 3d 20 69 73 5f 74 72 65 65 73 69 74 74 65 72 5f 70 6c 75 67 69 6e 3f 28 70 6c 75 | rker.=.is_treesitter_plugin?(plu |
| 67e0 | 67 69 6e 29 20 3f 20 22 20 f0 9f 8c b2 22 20 3a 20 22 22 00 00 00 42 20 20 20 20 20 20 70 75 74 | gin).?.".....".:.""...B......put |
| 6800 | 73 20 22 20 20 23 7b 73 74 61 74 75 73 7d 20 23 7b 70 6c 75 67 69 6e 7d 20 28 40 20 23 7b 68 61 | s."..#{status}.#{plugin}.(@.#{ha |
| 6820 | 73 68 7d 29 23 7b 74 72 65 65 73 69 74 74 65 72 5f 6d 61 72 6b 65 72 7d 22 00 00 00 08 20 20 20 | sh})#{treesitter_marker}"....... |
| 6840 | 20 65 6c 73 65 00 00 00 46 20 20 20 20 20 20 74 72 65 65 73 69 74 74 65 72 5f 6d 61 72 6b 65 72 | .else...F......treesitter_marker |
| 6860 | 20 3d 20 69 73 5f 74 72 65 65 73 69 74 74 65 72 5f 70 6c 75 67 69 6e 3f 28 70 6c 75 67 69 6e 29 | .=.is_treesitter_plugin?(plugin) |
| 6880 | 20 3f 20 22 20 f0 9f 8c b2 22 20 3a 20 22 22 00 00 00 36 20 20 20 20 20 20 70 75 74 73 20 22 20 | .?.".....".:.""...6......puts.". |
| 68a0 | 20 23 7b 73 74 61 74 75 73 7d 20 23 7b 70 6c 75 67 69 6e 7d 23 7b 74 72 65 65 73 69 74 74 65 72 | .#{status}.#{plugin}#{treesitter |
| 68c0 | 5f 6d 61 72 6b 65 72 7d 22 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 | _marker}"........end......end... |
| 68e0 | 03 65 6e 64 00 00 00 00 00 00 00 11 69 66 20 5f 5f 46 49 4c 45 5f 5f 20 3d 3d 20 24 30 00 00 00 | .end........if.__FILE__.==.$0... |
| 6900 | 07 20 20 62 65 67 69 6e 00 00 00 11 20 20 20 20 72 65 71 75 69 72 65 20 27 65 74 63 27 00 00 00 | ...begin........require.'etc'... |
| 6920 | 15 20 20 20 20 50 6c 75 67 69 6e 4d 61 6e 61 67 65 72 2e 72 75 6e 00 00 00 12 20 20 72 65 73 63 | .....PluginManager.run......resc |
| 6940 | 75 65 20 49 6e 74 65 72 72 75 70 74 00 00 00 0b 20 20 20 20 70 75 74 73 20 22 22 00 00 00 1e 20 | ue.Interrupt........puts.""..... |
| 6960 | 20 20 20 70 75 74 73 20 22 69 6e 74 65 72 72 75 70 74 65 64 20 62 79 20 75 73 65 72 22 00 00 00 | ...puts."interrupted.by.user"... |
| 6980 | 0a 20 20 20 20 65 78 69 74 20 31 00 00 00 0d 20 20 72 65 73 63 75 65 20 3d 3e 20 65 00 00 00 1e | .....exit.1......rescue.=>.e.... |
| 69a0 | 20 20 20 20 70 75 74 73 20 22 65 72 72 6f 72 3a 20 23 7b 65 2e 6d 65 73 73 61 67 65 7d 22 00 00 | ....puts."error:.#{e.message}".. |
| 69c0 | 00 0a 20 20 20 20 65 78 69 74 20 31 00 00 00 05 20 20 65 6e 64 00 00 00 03 65 6e 64 35 81 f5 18 | ......exit.1......end....end5... |
| 69e0 | 00 00 00 00 00 00 00 00 00 00 00 00 b6 01 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6a00 | 00 00 00 00 e3 2e 00 00 00 00 00 00 01 00 00 00 00 00 00 00 35 81 5f d0 00 00 00 03 00 00 00 05 | ....................5._......... |
| 6a20 | 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00 01 00 00 00 00 00 00 00 00 ff ff ff ff 00 03 00 00 | ................................ |
| 6a40 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6a60 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6a80 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6aa0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6ac0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6ae0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6b00 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6b20 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6b40 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6b60 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6b80 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6a 00 58 bf 04 01 | ..........................j.X... |
| 6ba0 | 00 00 00 03 00 f5 18 00 00 01 b6 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 2b 20 20 20 20 69 | ..........................+....i |
| 6bc0 | 66 20 73 68 6f 77 5f 61 6c 6c 20 26 26 20 40 73 74 61 74 65 5b 22 69 6e 73 74 61 6c 6c 65 64 22 | f.show_all.&&.@state["installed" |
| 6be0 | 5d 5b 70 6c 75 67 f5 18 00 00 01 b7 00 00 00 00 00 00 00 00 00 00 00 00 f5 18 00 00 01 1d 00 00 | ][plug.......................... |
| 6c00 | 00 00 00 00 00 00 00 00 00 01 00 00 00 15 20 20 20 20 72 65 74 75 72 6e 20 70 6c 75 67 69 6e 20 | ..................return.plugin. |
| 6c20 | 69 66 20 f5 18 00 00 01 1e 00 00 00 00 00 00 00 00 00 00 00 00 f5 18 00 00 00 8f 00 00 00 00 00 | if.............................. |
| 6c40 | 00 00 00 00 00 00 01 00 00 00 03 20 20 20 f5 18 00 00 00 90 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6c60 | f5 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 f5 18 00 00 00 01 00 00 00 00 | ................................ |
| 6c80 | 00 00 00 00 00 00 00 00 35 81 f5 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ........5....................... |
| 6ca0 | 8f 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f9 0f 00 00 00 00 00 00 | ................................ |
| 6cc0 | f5 18 00 00 00 00 8f 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 8e 00 00 00 15 00 00 00 f9 0f | ................................ |
| 6ce0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff 0f 00 00 00 00 00 00 f5 18 00 00 00 00 1d 01 00 00 | ................................ |
| 6d00 | 15 00 00 00 00 00 00 00 00 00 00 00 99 00 00 00 2b 00 00 00 f8 1f 00 00 00 00 00 00 00 00 00 00 | ................+............... |
| 6d20 | 00 00 00 00 ff 0f 00 00 00 00 00 00 f5 18 00 00 00 00 b6 01 00 00 2b 00 00 00 00 00 00 00 00 00 | ......................+......... |
| 6d40 | 00 00 15 00 00 00 03 00 00 00 f7 2f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6d 01 00 00 00 00 | .........../..............m..... |
| 6d60 | 00 00 35 81 5f d0 00 00 00 04 00 00 00 06 00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 01 00 00 | ..5._........................... |
| 6d80 | 00 00 00 00 00 00 ff ff ff ff 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6da0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6dc0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6de0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6e00 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6e20 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6e40 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6e60 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6e80 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6ea0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6ec0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 6ee0 | 00 00 00 00 00 00 00 00 6a 00 59 61 04 01 00 00 00 00 00 f5 18 00 00 00 00 00 00 00 02 00 00 00 | ........j.Ya.................... |
| 6f00 | 00 00 00 01 cc 00 00 00 13 23 21 2f 75 73 72 2f 62 69 6e 2f 65 6e 76 20 72 75 62 79 00 00 00 00 | .........#!/usr/bin/env.ruby.... |
| 6f20 | 00 00 00 16 72 65 71 75 69 72 65 28 22 2e 2f 63 6f 6e 66 69 67 2e 72 62 22 29 00 00 00 14 72 65 | ....require("./config.rb")....re |
| 6f40 | 71 75 69 72 65 28 22 66 69 6c 65 75 74 69 6c 73 22 29 00 00 00 13 72 65 71 75 69 72 65 28 22 6f | quire("fileutils")....require("o |
| 6f60 | 70 74 70 61 72 73 65 22 29 00 00 00 0f 72 65 71 75 69 72 65 28 22 6a 73 6f 6e 22 29 00 00 00 11 | ptparse")....require("json").... |
| 6f80 | 72 65 71 75 69 72 65 28 22 74 68 72 65 61 64 22 29 00 00 00 00 00 00 00 13 63 6c 61 73 73 20 50 | require("thread")........class.P |
| 6fa0 | 6c 75 67 69 6e 4d 61 6e 61 67 65 72 00 00 00 29 20 20 61 74 74 72 5f 72 65 61 64 65 72 20 3a 70 | luginManager...)..attr_reader.:p |
| 6fc0 | 6c 75 67 69 6e 73 5f 64 69 72 2c 20 3a 70 6c 75 67 69 6e 73 5f 6c 69 73 74 00 00 00 00 00 00 00 | lugins_dir,.:plugins_list....... |
| 6fe0 | 18 20 20 64 65 66 20 69 6e 69 74 69 61 6c 69 7a 65 28 63 6f 6e 66 69 67 29 00 00 00 24 20 20 20 | ...def.initialize(config)...$... |
| 7000 | 20 40 70 6c 75 67 69 6e 73 5f 6c 69 73 74 20 3d 20 43 4f 4e 46 49 47 5b 3a 70 6c 75 67 69 6e 73 | .@plugins_list.=.CONFIG[:plugins |
| 7020 | 5d 00 00 00 36 20 20 20 20 40 72 75 6e 74 69 6d 65 5f 70 61 74 68 20 3d 20 46 69 6c 65 2e 65 78 | ]...6....@runtime_path.=.File.ex |
| 7040 | 70 61 6e 64 5f 70 61 74 68 28 43 4f 4e 46 49 47 5b 3a 72 75 6e 74 69 6d 65 5d 29 00 00 00 48 20 | pand_path(CONFIG[:runtime])...H. |
| 7060 | 20 20 20 40 70 6c 75 67 69 6e 73 5f 64 69 72 20 3d 20 46 69 6c 65 2e 65 78 70 61 6e 64 5f 70 61 | ...@plugins_dir.=.File.expand_pa |
| 7080 | 74 68 28 22 23 7b 40 72 75 6e 74 69 6d 65 5f 70 61 74 68 7d 2f 70 61 63 6b 2f 73 63 69 6f 6e 2f | th("#{@runtime_path}/pack/scion/ |
| 70a0 | 73 74 61 72 74 22 29 00 00 00 42 20 20 20 20 40 6f 70 74 5f 64 69 72 20 3d 20 46 69 6c 65 2e 65 | start")...B....@opt_dir.=.File.e |
| 70c0 | 78 70 61 6e 64 5f 70 61 74 68 28 22 23 7b 40 72 75 6e 74 69 6d 65 5f 70 61 74 68 7d 2f 70 61 63 | xpand_path("#{@runtime_path}/pac |
| 70e0 | 6b 2f 73 63 69 6f 6e 2f 6f 70 74 22 29 00 00 00 47 20 20 20 20 40 73 74 61 74 65 5f 66 69 6c 65 | k/scion/opt")...G....@state_file |
| 7100 | 20 3d 20 46 69 6c 65 2e 65 78 70 61 6e 64 5f 70 61 74 68 28 22 23 7b 40 72 75 6e 74 69 6d 65 5f | .=.File.expand_path("#{@runtime_ |
| 7120 | 70 61 74 68 7d 2f 73 63 69 6f 6e 5f 73 74 61 74 65 2e 6a 73 6f 6e 22 29 00 00 00 1c 20 20 20 20 | path}/scion_state.json")........ |
| 7140 | 65 6e 73 75 72 65 5f 64 69 72 65 63 74 6f 72 69 65 73 5f 65 78 69 73 74 00 00 00 0e 20 20 20 20 | ensure_directories_exist........ |
| 7160 | 6c 6f 61 64 5f 73 74 61 74 65 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 0e 20 20 64 65 66 | load_state......end..........def |
| 7180 | 20 73 65 6c 66 2e 72 75 6e 00 00 00 1f 20 20 20 20 6f 70 74 69 6f 6e 73 20 3d 20 70 61 72 73 65 | .self.run........options.=.parse |
| 71a0 | 5f 63 6c 69 5f 6f 70 74 69 6f 6e 73 00 00 00 19 20 20 20 20 6d 61 6e 61 67 65 72 20 3d 20 6e 65 | _cli_options........manager.=.ne |
| 71c0 | 77 28 43 4f 4e 46 49 47 29 00 00 00 00 00 00 00 1a 20 20 20 20 63 61 73 65 20 6f 70 74 69 6f 6e | w(CONFIG)............case.option |
| 71e0 | 73 5b 3a 63 6f 6d 6d 61 6e 64 5d 00 00 00 0e 20 20 20 20 77 68 65 6e 20 3a 6c 69 73 74 00 00 00 | s[:command]........when.:list... |
| 7200 | 29 20 20 20 20 20 20 6d 61 6e 61 67 65 72 2e 6c 69 73 74 5f 70 6c 75 67 69 6e 73 28 6f 70 74 69 | )......manager.list_plugins(opti |
| 7220 | 6f 6e 73 5b 3a 61 6c 6c 5d 29 00 00 00 10 20 20 20 20 77 68 65 6e 20 3a 73 74 61 74 75 73 00 00 | ons[:all])........when.:status.. |
| 7240 | 00 19 20 20 20 20 20 20 6d 61 6e 61 67 65 72 2e 73 68 6f 77 5f 73 74 61 74 75 73 00 00 00 10 20 | ........manager.show_status..... |
| 7260 | 20 20 20 77 68 65 6e 20 3a 66 72 65 65 7a 65 00 00 00 20 20 20 20 20 20 20 6d 61 6e 61 67 65 72 | ...when.:freeze..........manager |
| 7280 | 2e 63 72 65 61 74 65 5f 66 72 65 65 7a 65 5f 66 69 6c 65 00 00 00 11 20 20 20 20 77 68 65 6e 20 | .create_freeze_file........when. |
| 72a0 | 3a 72 65 73 74 6f 72 65 00 00 00 21 20 20 20 20 20 20 6d 61 6e 61 67 65 72 2e 72 65 73 74 6f 72 | :restore...!......manager.restor |
| 72c0 | 65 5f 66 72 6f 6d 5f 66 72 65 65 7a 65 00 00 00 08 20 20 20 20 65 6c 73 65 00 00 00 2d 20 20 20 | e_from_freeze........else...-... |
| 72e0 | 20 20 20 6d 61 6e 61 67 65 72 2e 73 79 6e 63 5f 70 6c 75 67 69 6e 73 28 6f 70 74 69 6f 6e 73 5b | ...manager.sync_plugins(options[ |
| 7300 | 3a 64 72 79 5f 72 75 6e 5d 29 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 | :dry_run])........end......end.. |
| 7320 | 00 00 00 00 00 1c 20 20 64 65 66 20 73 65 6c 66 2e 70 61 72 73 65 5f 63 6c 69 5f 6f 70 74 69 6f | ........def.self.parse_cli_optio |
| 7340 | 6e 73 00 00 00 3c 20 20 20 20 6f 70 74 69 6f 6e 73 20 3d 20 7b 20 63 6f 6d 6d 61 6e 64 3a 20 3a | ns...<....options.=.{.command:.: |
| 7360 | 73 79 6e 63 2c 20 64 72 79 5f 72 75 6e 3a 20 66 61 6c 73 65 2c 20 61 6c 6c 3a 20 66 61 6c 73 65 | sync,.dry_run:.false,.all:.false |
| 7380 | 20 7d 00 00 00 00 00 00 00 1e 20 20 20 20 4f 70 74 69 6f 6e 50 61 72 73 65 72 2e 6e 65 77 20 64 | .}............OptionParser.new.d |
| 73a0 | 6f 20 7c 6f 70 74 73 7c 00 00 00 2c 20 20 20 20 20 20 6f 70 74 73 2e 62 61 6e 6e 65 72 20 3d 20 | o.|opts|...,......opts.banner.=. |
| 73c0 | 22 75 73 61 67 65 3a 20 23 7b 24 30 7d 20 5b 6f 70 74 69 6f 6e 73 5d 22 00 00 00 17 20 20 20 20 | "usage:.#{$0}.[options]"........ |
| 73e0 | 20 20 6f 70 74 73 2e 73 65 70 61 72 61 74 6f 72 20 22 22 00 00 00 20 20 20 20 20 20 20 6f 70 74 | ..opts.separator.""..........opt |
| 7400 | 73 2e 73 65 70 61 72 61 74 6f 72 20 22 63 6f 6d 6d 61 6e 64 73 3a 22 00 00 00 00 00 00 00 3a 20 | s.separator."commands:".......:. |
| 7420 | 20 20 20 20 20 6f 70 74 73 2e 6f 6e 28 22 2d 6c 22 2c 20 22 2d 2d 6c 69 73 74 22 2c 20 22 6c 69 | .....opts.on("-l",."--list",."li |
| 7440 | 73 74 20 69 6e 73 74 61 6c 6c 65 64 20 70 6c 75 67 69 6e 73 22 29 20 64 6f 00 00 00 21 20 20 20 | st.installed.plugins").do...!... |
| 7460 | 20 20 20 20 20 6f 70 74 69 6f 6e 73 5b 3a 63 6f 6d 6d 61 6e 64 5d 20 3d 20 3a 6c 69 73 74 00 00 | .....options[:command].=.:list.. |
| 7480 | 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 38 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e | ........end.......8......opts.on |
| 74a0 | 28 22 2d 73 22 2c 20 22 2d 2d 73 74 61 74 75 73 22 2c 20 22 73 68 6f 77 20 70 6c 75 67 69 6e 20 | ("-s",."--status",."show.plugin. |
| 74c0 | 73 74 61 74 75 73 22 29 20 64 6f 00 00 00 23 20 20 20 20 20 20 20 20 6f 70 74 69 6f 6e 73 5b 3a | status").do...#........options[: |
| 74e0 | 63 6f 6d 6d 61 6e 64 5d 20 3d 20 3a 73 74 61 74 75 73 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 | command].=.:status..........end. |
| 7500 | 00 00 00 00 00 00 50 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e 28 22 2d 66 22 2c 20 22 2d 2d 66 72 | ......P......opts.on("-f",."--fr |
| 7520 | 65 65 7a 65 22 2c 20 22 63 72 65 61 74 65 20 61 20 66 72 65 65 7a 65 20 66 69 6c 65 20 77 69 74 | eeze",."create.a.freeze.file.wit |
| 7540 | 68 20 63 75 72 72 65 6e 74 20 76 65 72 73 69 6f 6e 73 22 29 20 64 6f 00 00 00 23 20 20 20 20 20 | h.current.versions").do...#..... |
| 7560 | 20 20 20 6f 70 74 69 6f 6e 73 5b 3a 63 6f 6d 6d 61 6e 64 5d 20 3d 20 3a 66 72 65 65 7a 65 00 00 | ...options[:command].=.:freeze.. |
| 7580 | 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 48 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e | ........end.......H......opts.on |
| 75a0 | 28 22 2d 72 22 2c 20 22 2d 2d 72 65 73 74 6f 72 65 22 2c 20 22 72 65 73 74 6f 72 65 20 76 65 72 | ("-r",."--restore",."restore.ver |
| 75c0 | 73 69 6f 6e 73 20 66 72 6f 6d 20 66 72 65 65 7a 65 20 66 69 6c 65 22 29 20 64 6f 00 00 00 24 20 | sions.from.freeze.file").do...$. |
| 75e0 | 20 20 20 20 20 20 20 6f 70 74 69 6f 6e 73 5b 3a 63 6f 6d 6d 61 6e 64 5d 20 3d 20 3a 72 65 73 74 | .......options[:command].=.:rest |
| 7600 | 6f 72 65 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 49 20 20 20 20 20 20 6f 70 | ore..........end.......I......op |
| 7620 | 74 73 2e 6f 6e 28 22 2d 2d 64 72 79 2d 72 75 6e 22 2c 20 22 73 68 6f 77 20 77 68 61 74 20 77 6f | ts.on("--dry-run",."show.what.wo |
| 7640 | 75 6c 64 20 62 65 20 64 6f 6e 65 20 77 69 74 68 6f 75 74 20 64 6f 69 6e 67 20 69 74 22 29 20 64 | uld.be.done.without.doing.it").d |
| 7660 | 6f 00 00 00 20 20 20 20 20 20 20 20 20 6f 70 74 69 6f 6e 73 5b 3a 64 72 79 5f 72 75 6e 5d 20 3d | o............options[:dry_run].= |
| 7680 | 20 74 72 75 65 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 4b 20 20 20 20 20 20 | .true..........end.......K...... |
| 76a0 | 6f 70 74 73 2e 6f 6e 28 22 2d 61 22 2c 20 22 2d 2d 61 6c 6c 22 2c 20 22 73 68 6f 77 20 61 6c 6c | opts.on("-a",."--all",."show.all |
| 76c0 | 20 70 6c 75 67 69 6e 73 20 69 6e 63 6c 75 64 69 6e 67 20 63 6f 6d 6d 69 74 20 68 61 73 68 65 73 | .plugins.including.commit.hashes |
| 76e0 | 22 29 20 64 6f 00 00 00 1c 20 20 20 20 20 20 20 20 6f 70 74 69 6f 6e 73 5b 3a 61 6c 6c 5d 20 3d | ").do............options[:all].= |
| 7700 | 20 74 72 75 65 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 3a 20 20 20 20 20 20 | .true..........end.......:...... |
| 7720 | 6f 70 74 73 2e 6f 6e 28 22 2d 68 22 2c 20 22 2d 2d 68 65 6c 70 22 2c 20 22 73 68 6f 77 20 74 68 | opts.on("-h",."--help",."show.th |
| 7740 | 69 73 20 68 65 6c 70 20 6d 65 73 73 61 67 65 22 29 20 64 6f 00 00 00 11 20 20 20 20 20 20 20 20 | is.help.message").do............ |
| 7760 | 70 75 74 73 20 6f 70 74 73 00 00 00 0c 20 20 20 20 20 20 20 20 65 78 69 74 00 00 00 09 20 20 20 | puts.opts............exit....... |
| 7780 | 20 20 20 65 6e 64 00 00 00 0e 20 20 20 20 65 6e 64 2e 70 61 72 73 65 21 00 00 00 00 00 00 00 0b | ...end........end.parse!........ |
| 77a0 | 20 20 20 20 6f 70 74 69 6f 6e 73 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 23 20 20 64 65 | ....options......end.......#..de |
| 77c0 | 66 20 73 79 6e 63 5f 70 6c 75 67 69 6e 73 28 64 72 79 5f 72 75 6e 20 3d 20 66 61 6c 73 65 29 00 | f.sync_plugins(dry_run.=.false). |
| 77e0 | 00 00 44 20 20 20 20 77 61 6e 74 65 64 5f 6e 61 6d 65 73 20 3d 20 40 70 6c 75 67 69 6e 73 5f 6c | ..D....wanted_names.=.@plugins_l |
| 7800 | 69 73 74 2e 6d 61 70 20 7b 20 7c 70 7c 20 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 | ist.map.{.|p|.plugin_name_from_u |
| 7820 | 72 6c 28 70 29 20 7d 00 00 00 30 20 20 20 20 69 6e 73 74 61 6c 6c 65 64 5f 6e 61 6d 65 73 20 3d | rl(p).}...0....installed_names.= |
| 7840 | 20 44 69 72 2e 63 68 69 6c 64 72 65 6e 28 40 70 6c 75 67 69 6e 73 5f 64 69 72 29 00 00 00 04 20 | .Dir.children(@plugins_dir)..... |
| 7860 | 20 20 20 00 00 00 5f 20 20 20 20 74 6f 5f 69 6e 73 74 61 6c 6c 20 3d 20 40 70 6c 75 67 69 6e 73 | ......_....to_install.=.@plugins |
| 7880 | 5f 6c 69 73 74 2e 72 65 6a 65 63 74 20 7b 20 7c 70 7c 20 69 6e 73 74 61 6c 6c 65 64 5f 6e 61 6d | _list.reject.{.|p|.installed_nam |
| 78a0 | 65 73 2e 69 6e 63 6c 75 64 65 3f 28 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c | es.include?(plugin_name_from_url |
| 78c0 | 28 70 29 29 20 7d 00 00 00 30 20 20 20 20 74 6f 5f 75 70 64 61 74 65 20 3d 20 69 6e 73 74 61 6c | (p)).}...0....to_update.=.instal |
| 78e0 | 6c 65 64 5f 6e 61 6d 65 73 2e 73 65 6c 65 63 74 20 64 6f 20 7c 6e 61 6d 65 7c 00 00 00 5a 20 20 | led_names.select.do.|name|...Z.. |
| 7900 | 20 20 20 20 44 69 72 2e 65 78 69 73 74 3f 28 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f | ....Dir.exist?("#{@plugins_dir}/ |
| 7920 | 23 7b 6e 61 6d 65 7d 22 29 20 26 26 20 46 69 6c 65 2e 65 78 69 73 74 3f 28 22 23 7b 40 70 6c 75 | #{name}").&&.File.exist?("#{@plu |
| 7940 | 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 2f 2e 67 69 74 22 29 00 00 00 07 20 20 20 20 | gins_dir}/#{name}/.git")........ |
| 7960 | 65 6e 64 00 00 00 50 20 20 20 20 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 20 3d 20 69 6e 73 74 61 6c | end...P....to_uninstall.=.instal |
| 7980 | 6c 65 64 5f 6e 61 6d 65 73 2e 72 65 6a 65 63 74 20 7b 20 7c 6e 61 6d 65 7c 20 77 61 6e 74 65 64 | led_names.reject.{.|name|.wanted |
| 79a0 | 5f 6e 61 6d 65 73 2e 69 6e 63 6c 75 64 65 3f 28 6e 61 6d 65 29 20 7d 00 00 00 00 00 00 00 0e 20 | _names.include?(name).}......... |
| 79c0 | 20 20 20 69 66 20 64 72 79 5f 72 75 6e 00 00 00 2e 20 20 20 20 20 20 70 75 74 73 20 22 64 72 79 | ...if.dry_run..........puts."dry |
| 79e0 | 20 72 75 6e 20 2d 20 77 6f 75 6c 64 20 64 6f 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 3a 22 00 | .run.-.would.do.the.following:". |
| 7a00 | 00 00 67 20 20 20 20 20 20 70 75 74 73 20 22 20 20 69 6e 73 74 61 6c 6c 3a 20 23 7b 74 6f 5f 69 | ..g......puts."..install:.#{to_i |
| 7a20 | 6e 73 74 61 6c 6c 2e 6d 61 70 20 7b 20 7c 70 7c 20 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f | nstall.map.{.|p|.plugin_name_fro |
| 7a40 | 6d 5f 75 72 6c 28 70 29 20 7d 2e 6a 6f 69 6e 28 27 2c 20 27 29 7d 22 20 69 66 20 74 6f 5f 69 6e | m_url(p).}.join(',.')}".if.to_in |
| 7a60 | 73 74 61 6c 6c 2e 61 6e 79 3f 00 00 00 40 20 20 20 20 20 20 70 75 74 73 20 22 20 20 75 70 64 61 | stall.any?...@......puts."..upda |
| 7a80 | 74 65 3a 20 23 7b 74 6f 5f 75 70 64 61 74 65 2e 6a 6f 69 6e 28 27 2c 20 27 29 7d 22 20 69 66 20 | te:.#{to_update.join(',.')}".if. |
| 7aa0 | 74 6f 5f 75 70 64 61 74 65 2e 61 6e 79 3f 00 00 00 49 20 20 20 20 20 20 70 75 74 73 20 22 20 20 | to_update.any?...I......puts.".. |
| 7ac0 | 75 6e 69 6e 73 74 61 6c 6c 3a 20 23 7b 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e 6a 6f 69 6e 28 27 | uninstall:.#{to_uninstall.join(' |
| 7ae0 | 2c 20 27 29 7d 22 20 69 66 20 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e 61 6e 79 3f 00 00 00 45 20 | ,.')}".if.to_uninstall.any?...E. |
| 7b00 | 20 20 20 20 20 69 66 20 74 6f 5f 69 6e 73 74 61 6c 6c 2e 65 6d 70 74 79 3f 20 26 26 20 74 6f 5f | .....if.to_install.empty?.&&.to_ |
| 7b20 | 75 70 64 61 74 65 2e 65 6d 70 74 79 3f 20 26 26 20 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e 65 6d | update.empty?.&&.to_uninstall.em |
| 7b40 | 70 74 79 3f 00 00 00 1e 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 6e 6f 74 68 69 6e 67 20 | pty?............puts."..nothing. |
| 7b60 | 74 6f 20 64 6f 22 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 0c 20 20 20 20 20 20 72 65 74 | to.do"..........end..........ret |
| 7b80 | 75 72 6e 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 18 20 20 20 20 69 66 20 74 6f 5f | urn........end............if.to_ |
| 7ba0 | 75 6e 69 6e 73 74 61 6c 6c 2e 61 6e 79 3f 00 00 00 3b 20 20 20 20 20 20 70 75 74 73 20 22 75 6e | uninstall.any?...;......puts."un |
| 7bc0 | 69 6e 73 74 61 6c 6c 69 6e 67 20 23 7b 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e 73 69 7a 65 7d 20 | installing.#{to_uninstall.size}. |
| 7be0 | 70 6c 75 67 69 6e 28 73 29 2e 2e 2e 22 00 00 00 21 20 20 20 20 20 20 74 6f 5f 75 6e 69 6e 73 74 | plugin(s)..."...!......to_uninst |
| 7c00 | 61 6c 6c 2e 65 61 63 68 20 64 6f 20 7c 6e 61 6d 65 7c 00 00 00 2e 20 20 20 20 20 20 20 20 74 61 | all.each.do.|name|............ta |
| 7c20 | 72 67 65 74 5f 64 69 72 20 3d 20 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 | rget_dir.=."#{@plugins_dir}/#{na |
| 7c40 | 6d 65 7d 22 00 00 00 21 20 20 20 20 20 20 20 20 69 66 20 44 69 72 2e 65 78 69 73 74 3f 28 74 61 | me}"...!........if.Dir.exist?(ta |
| 7c60 | 72 67 65 74 5f 64 69 72 29 00 00 00 25 20 20 20 20 20 20 20 20 20 20 46 69 6c 65 55 74 69 6c 73 | rget_dir)...%..........FileUtils |
| 7c80 | 2e 72 6d 5f 72 66 28 74 61 72 67 65 74 5f 64 69 72 29 00 00 00 22 20 20 20 20 20 20 20 20 20 20 | .rm_rf(target_dir)...".......... |
| 7ca0 | 70 75 74 73 20 22 20 20 72 65 6d 6f 76 65 64 20 23 7b 6e 61 6d 65 7d 22 00 00 00 2a 20 20 20 20 | puts."..removed.#{name}"...*.... |
| 7cc0 | 20 20 20 20 20 20 40 73 74 61 74 65 5b 22 69 6e 73 74 61 6c 6c 65 64 22 5d 2e 64 65 6c 65 74 65 | ......@state["installed"].delete |
| 7ce0 | 28 6e 61 6d 65 29 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 09 20 20 20 20 20 20 65 | (name)............end..........e |
| 7d00 | 6e 64 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 16 20 20 20 20 69 66 20 74 6f 5f 69 | nd........end............if.to_i |
| 7d20 | 6e 73 74 61 6c 6c 2e 61 6e 79 3f 00 00 00 37 20 20 20 20 20 20 70 75 74 73 20 22 69 6e 73 74 61 | nstall.any?...7......puts."insta |
| 7d40 | 6c 6c 69 6e 67 20 23 7b 74 6f 5f 69 6e 73 74 61 6c 6c 2e 73 69 7a 65 7d 20 70 6c 75 67 69 6e 28 | lling.#{to_install.size}.plugin( |
| 7d60 | 73 29 2e 2e 2e 22 00 00 00 22 20 20 20 20 20 20 69 6e 73 74 61 6c 6c 5f 70 61 72 61 6c 6c 65 6c | s)..."..."......install_parallel |
| 7d80 | 28 74 6f 5f 69 6e 73 74 61 6c 6c 29 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 15 20 | (to_install)........end......... |
| 7da0 | 20 20 20 69 66 20 74 6f 5f 75 70 64 61 74 65 2e 61 6e 79 3f 00 00 00 34 20 20 20 20 20 20 70 75 | ...if.to_update.any?...4......pu |
| 7dc0 | 74 73 20 22 75 70 64 61 74 69 6e 67 20 23 7b 74 6f 5f 75 70 64 61 74 65 2e 73 69 7a 65 7d 20 70 | ts."updating.#{to_update.size}.p |
| 7de0 | 6c 75 67 69 6e 28 73 29 2e 2e 2e 22 00 00 00 20 20 20 20 20 20 20 75 70 64 61 74 65 5f 70 61 72 | lugin(s)..."..........update_par |
| 7e00 | 61 6c 6c 65 6c 28 74 6f 5f 75 70 64 61 74 65 29 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 | allel(to_update)........end..... |
| 7e20 | 00 00 43 20 20 20 20 69 66 20 74 6f 5f 69 6e 73 74 61 6c 6c 2e 65 6d 70 74 79 3f 20 26 26 20 74 | ..C....if.to_install.empty?.&&.t |
| 7e40 | 6f 5f 75 70 64 61 74 65 2e 65 6d 70 74 79 3f 20 26 26 20 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e | o_update.empty?.&&.to_uninstall. |
| 7e60 | 65 6d 70 74 79 3f 00 00 00 23 20 20 20 20 20 20 70 75 74 73 20 22 61 6c 6c 20 70 6c 75 67 69 6e | empty?...#......puts."all.plugin |
| 7e80 | 73 20 61 72 65 20 73 79 6e 63 65 64 22 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 04 20 20 20 20 | s.are.synced"........end........ |
| 7ea0 | 00 00 00 0e 20 20 20 20 73 61 76 65 5f 73 74 61 74 65 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 | ........save_state......end..... |
| 7ec0 | 00 00 24 20 20 64 65 66 20 6c 69 73 74 5f 70 6c 75 67 69 6e 73 28 73 68 6f 77 5f 61 6c 6c 20 3d | ..$..def.list_plugins(show_all.= |
| 7ee0 | 20 66 61 6c 73 65 29 00 00 00 2f 20 20 20 20 69 6e 73 74 61 6c 6c 65 64 20 3d 20 44 69 72 2e 63 | .false).../....installed.=.Dir.c |
| 7f00 | 68 69 6c 64 72 65 6e 28 40 70 6c 75 67 69 6e 73 5f 64 69 72 29 2e 73 6f 72 74 00 00 00 45 20 20 | hildren(@plugins_dir).sort...E.. |
| 7f20 | 20 20 6f 70 74 5f 70 6c 75 67 69 6e 73 20 3d 20 44 69 72 2e 63 68 69 6c 64 72 65 6e 28 40 6f 70 | ..opt_plugins.=.Dir.children(@op |
| 7f40 | 74 5f 64 69 72 29 2e 73 6f 72 74 20 69 66 20 44 69 72 2e 65 78 69 73 74 3f 28 40 6f 70 74 5f 64 | t_dir).sort.if.Dir.exist?(@opt_d |
| 7f60 | 69 72 29 00 00 00 00 00 00 00 43 20 20 20 20 69 66 20 69 6e 73 74 61 6c 6c 65 64 2e 65 6d 70 74 | ir).......C....if.installed.empt |
| 7f80 | 79 3f 20 26 26 20 28 6f 70 74 5f 70 6c 75 67 69 6e 73 2e 6e 69 6c 3f 20 7c 7c 20 6f 70 74 5f 70 | y?.&&.(opt_plugins.nil?.||.opt_p |
| 7fa0 | 6c 75 67 69 6e 73 2e 65 6d 70 74 79 3f 29 00 00 00 21 20 20 20 20 20 20 70 75 74 73 20 22 6e 6f | lugins.empty?)...!......puts."no |
| 7fc0 | 20 70 6c 75 67 69 6e 73 20 69 6e 73 74 61 6c 6c 65 64 22 00 00 00 08 20 20 20 20 65 6c 73 65 00 | .plugins.installed"........else. |
| 7fe0 | 00 00 30 20 20 20 20 20 20 70 75 74 73 20 22 73 74 61 72 74 20 70 6c 75 67 69 6e 73 20 28 23 7b | ..0......puts."start.plugins.(#{ |
| 8000 | 69 6e 73 74 61 6c 6c 65 64 2e 63 6f 75 6e 74 7d 29 3a 22 00 00 00 20 20 20 20 20 20 20 69 6e 73 | installed.count}):"..........ins |
| 8020 | 74 61 6c 6c 65 64 2e 65 61 63 68 20 64 6f 20 7c 70 6c 75 67 69 6e 7c 00 00 00 2d 20 20 20 20 20 | talled.each.do.|plugin|...-..... |
| 8040 | 20 20 20 64 69 73 70 6c 61 79 5f 70 6c 75 67 69 6e 5f 69 6e 66 6f 28 70 6c 75 67 69 6e 2c 20 73 | ...display_plugin_info(plugin,.s |
| 8060 | 68 6f 77 5f 61 6c 6c 29 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 2b 20 20 20 | how_all)..........end.......+... |
| 8080 | 20 20 20 69 66 20 6f 70 74 5f 70 6c 75 67 69 6e 73 20 26 26 20 21 6f 70 74 5f 70 6c 75 67 69 6e | ...if.opt_plugins.&&.!opt_plugin |
| 80a0 | 73 2e 65 6d 70 74 79 3f 00 00 00 0f 20 20 20 20 20 20 20 20 70 75 74 73 20 22 22 00 00 00 32 20 | s.empty?............puts.""...2. |
| 80c0 | 20 20 20 20 20 20 20 70 75 74 73 20 22 6f 70 74 20 70 6c 75 67 69 6e 73 20 28 23 7b 6f 70 74 5f | .......puts."opt.plugins.(#{opt_ |
| 80e0 | 70 6c 75 67 69 6e 73 2e 63 6f 75 6e 74 7d 29 3a 22 00 00 00 24 20 20 20 20 20 20 20 20 6f 70 74 | plugins.count}):"...$........opt |
| 8100 | 5f 70 6c 75 67 69 6e 73 2e 65 61 63 68 20 64 6f 20 7c 70 6c 75 67 69 6e 7c 00 00 00 2f 20 20 20 | _plugins.each.do.|plugin|.../... |
| 8120 | 20 20 20 20 20 20 20 64 69 73 70 6c 61 79 5f 70 6c 75 67 69 6e 5f 69 6e 66 6f 28 70 6c 75 67 69 | .......display_plugin_info(plugi |
| 8140 | 6e 2c 20 73 68 6f 77 5f 61 6c 6c 29 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 09 20 | n,.show_all)............end..... |
| 8160 | 20 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 5c 20 20 20 20 20 20 75 6e 69 6e 73 74 61 6c 6c 65 | .....end.......\......uninstalle |
| 8180 | 64 20 3d 20 40 70 6c 75 67 69 6e 73 5f 6c 69 73 74 2e 72 65 6a 65 63 74 20 7b 20 7c 70 7c 20 69 | d.=.@plugins_list.reject.{.|p|.i |
| 81a0 | 6e 73 74 61 6c 6c 65 64 2e 69 6e 63 6c 75 64 65 3f 28 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 | nstalled.include?(plugin_name_fr |
| 81c0 | 6f 6d 5f 75 72 6c 28 70 29 29 20 7d 00 00 00 1f 20 20 20 20 20 20 75 6e 6c 65 73 73 20 75 6e 69 | om_url(p)).}..........unless.uni |
| 81e0 | 6e 73 74 61 6c 6c 65 64 2e 65 6d 70 74 79 3f 00 00 00 0f 20 20 20 20 20 20 20 20 70 75 74 73 20 | nstalled.empty?............puts. |
| 8200 | 22 22 00 00 00 33 20 20 20 20 20 20 20 20 70 75 74 73 20 22 70 6c 75 67 69 6e 73 20 69 6e 20 63 | ""...3........puts."plugins.in.c |
| 8220 | 6f 6e 66 69 67 20 62 75 74 20 6e 6f 74 20 69 6e 73 74 61 6c 6c 65 64 3a 22 00 00 00 24 20 20 20 | onfig.but.not.installed:"...$... |
| 8240 | 20 20 20 20 20 75 6e 69 6e 73 74 61 6c 6c 65 64 2e 65 61 63 68 20 64 6f 20 7c 70 6c 75 67 69 6e | .....uninstalled.each.do.|plugin |
| 8260 | 7c 00 00 00 34 20 20 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 2d 20 23 7b 70 6c 75 67 69 | |...4..........puts."..-.#{plugi |
| 8280 | 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 70 6c 75 67 69 6e 29 7d 22 00 00 00 0b 20 20 20 | n_name_from_url(plugin)}"....... |
| 82a0 | 20 20 20 20 20 65 6e 64 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 | .....end..........end........end |
| 82c0 | 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 11 20 20 64 65 66 20 73 68 6f 77 5f 73 74 61 74 | ......end..........def.show_stat |
| 82e0 | 75 73 00 00 00 2f 20 20 20 20 69 6e 73 74 61 6c 6c 65 64 20 3d 20 44 69 72 2e 63 68 69 6c 64 72 | us.../....installed.=.Dir.childr |
| 8300 | 65 6e 28 40 70 6c 75 67 69 6e 73 5f 64 69 72 29 2e 73 6f 72 74 00 00 00 00 00 00 00 19 20 20 20 | en(@plugins_dir).sort........... |
| 8320 | 20 70 75 74 73 20 22 70 6c 75 67 69 6e 20 73 74 61 74 75 73 3a 22 00 00 00 0b 20 20 20 20 70 75 | .puts."plugin.status:"........pu |
| 8340 | 74 73 20 22 22 00 00 00 40 20 20 20 20 70 75 74 73 20 22 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e | ts.""...@....puts."configuration |
| 8360 | 3a 20 23 7b 40 70 6c 75 67 69 6e 73 5f 6c 69 73 74 2e 63 6f 75 6e 74 7d 20 70 6c 75 67 69 6e 73 | :.#{@plugins_list.count}.plugins |
| 8380 | 20 64 65 66 69 6e 65 64 22 00 00 00 30 20 20 20 20 70 75 74 73 20 22 69 6e 73 74 61 6c 6c 65 64 | .defined"...0....puts."installed |
| 83a0 | 3a 20 23 7b 69 6e 73 74 61 6c 6c 65 64 2e 63 6f 75 6e 74 7d 20 70 6c 75 67 69 6e 73 22 00 00 00 | :.#{installed.count}.plugins"... |
| 83c0 | 0b 20 20 20 20 70 75 74 73 20 22 22 00 00 00 00 00 00 00 11 20 20 20 20 6f 75 74 64 61 74 65 64 | .....puts.""............outdated |
| 83e0 | 20 3d 20 5b 5d 00 00 00 1c 20 20 20 20 69 6e 73 74 61 6c 6c 65 64 2e 65 61 63 68 20 64 6f 20 7c | .=.[]........installed.each.do.| |
| 8400 | 6e 61 6d 65 7c 00 00 00 26 20 20 20 20 20 20 70 61 74 68 20 3d 20 22 23 7b 40 70 6c 75 67 69 6e | name|...&......path.=."#{@plugin |
| 8420 | 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 00 00 00 2d 20 20 20 20 20 20 6e 65 78 74 20 75 6e | s_dir}/#{name}"...-......next.un |
| 8440 | 6c 65 73 73 20 46 69 6c 65 2e 65 78 69 73 74 3f 28 22 23 7b 70 61 74 68 7d 2f 2e 67 69 74 22 29 | less.File.exist?("#{path}/.git") |
| 8460 | 00 00 00 00 00 00 00 18 20 20 20 20 20 20 44 69 72 2e 63 68 64 69 72 28 70 61 74 68 29 20 64 6f | ..............Dir.chdir(path).do |
| 8480 | 00 00 00 3d 20 20 20 20 20 20 20 20 63 75 72 72 65 6e 74 5f 68 61 73 68 20 3d 20 60 67 69 74 20 | ...=........current_hash.=.`git. |
| 84a0 | 72 65 76 2d 70 61 72 73 65 20 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 | rev-parse.HEAD.2>/dev/null`.stri |
| 84c0 | 70 00 00 00 4f 20 20 20 20 20 20 20 20 72 65 6d 6f 74 65 5f 68 61 73 68 20 3d 20 60 67 69 74 20 | p...O........remote_hash.=.`git. |
| 84e0 | 6c 73 2d 72 65 6d 6f 74 65 20 6f 72 69 67 69 6e 20 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c | ls-remote.origin.HEAD.2>/dev/nul |
| 8500 | 6c 60 2e 73 74 72 69 70 2e 73 70 6c 69 74 2e 66 69 72 73 74 00 00 00 00 00 00 00 35 20 20 20 20 | l`.strip.split.first.......5.... |
| 8520 | 20 20 20 20 69 66 20 72 65 6d 6f 74 65 5f 68 61 73 68 20 26 26 20 63 75 72 72 65 6e 74 5f 68 61 | ....if.remote_hash.&&.current_ha |
| 8540 | 73 68 20 21 3d 20 72 65 6d 6f 74 65 5f 68 61 73 68 00 00 00 1a 20 20 20 20 20 20 20 20 20 20 6f | sh.!=.remote_hash..............o |
| 8560 | 75 74 64 61 74 65 64 20 3c 3c 20 6e 61 6d 65 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 | utdated.<<.name............end.. |
| 8580 | 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 1a 20 20 | ........end........end.......... |
| 85a0 | 20 20 75 6e 6c 65 73 73 20 6f 75 74 64 61 74 65 64 2e 65 6d 70 74 79 3f 00 00 00 1e 20 20 20 20 | ..unless.outdated.empty?........ |
| 85c0 | 20 20 70 75 74 73 20 22 6f 75 74 64 61 74 65 64 20 70 6c 75 67 69 6e 73 3a 22 00 00 00 31 20 20 | ..puts."outdated.plugins:"...1.. |
| 85e0 | 20 20 20 20 6f 75 74 64 61 74 65 64 2e 65 61 63 68 20 7b 20 7c 6e 61 6d 65 7c 20 70 75 74 73 20 | ....outdated.each.{.|name|.puts. |
| 8600 | 22 20 20 2d 20 23 7b 6e 61 6d 65 7d 22 20 7d 00 00 00 0d 20 20 20 20 20 20 70 75 74 73 20 22 22 | "..-.#{name}".}..........puts."" |
| 8620 | 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 1c 20 20 20 20 69 6e 73 74 61 6c 6c 65 64 | ........end............installed |
| 8640 | 2e 65 61 63 68 20 64 6f 20 7c 6e 61 6d 65 7c 00 00 00 26 20 20 20 20 20 20 70 61 74 68 20 3d 20 | .each.do.|name|...&......path.=. |
| 8660 | 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 00 00 00 24 20 20 20 | "#{@plugins_dir}/#{name}"...$... |
| 8680 | 20 20 20 69 66 20 46 69 6c 65 2e 65 78 69 73 74 3f 28 22 23 7b 70 61 74 68 7d 2f 2e 67 69 74 22 | ...if.File.exist?("#{path}/.git" |
| 86a0 | 29 00 00 00 1a 20 20 20 20 20 20 20 20 44 69 72 2e 63 68 64 69 72 28 70 61 74 68 29 20 64 6f 00 | )............Dir.chdir(path).do. |
| 86c0 | 00 00 43 20 20 20 20 20 20 20 20 20 20 6c 61 73 74 5f 63 6f 6d 6d 69 74 20 3d 20 60 67 69 74 20 | ..C..........last_commit.=.`git. |
| 86e0 | 6c 6f 67 20 2d 31 20 2d 2d 66 6f 72 6d 61 74 3d 25 63 72 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 | log.-1.--format=%cr.2>/dev/null` |
| 8700 | 2e 73 74 72 69 70 00 00 00 4e 20 20 20 20 20 20 20 20 20 20 63 75 72 72 65 6e 74 5f 62 72 61 6e | .strip...N..........current_bran |
| 8720 | 63 68 20 3d 20 60 67 69 74 20 72 65 76 2d 70 61 72 73 65 20 2d 2d 61 62 62 72 65 76 2d 72 65 66 | ch.=.`git.rev-parse.--abbrev-ref |
| 8740 | 20 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 47 20 20 20 20 | .HEAD.2>/dev/null`.strip...G.... |
| 8760 | 20 20 20 20 20 20 63 75 72 72 65 6e 74 5f 68 61 73 68 20 3d 20 60 67 69 74 20 72 65 76 2d 70 61 | ......current_hash.=.`git.rev-pa |
| 8780 | 72 73 65 20 2d 2d 73 68 6f 72 74 20 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 | rse.--short.HEAD.2>/dev/null`.st |
| 87a0 | 72 69 70 00 00 00 2a 20 20 20 20 20 20 20 20 20 20 70 75 74 73 20 22 23 7b 6e 61 6d 65 7d 20 28 | rip...*..........puts."#{name}.( |
| 87c0 | 23 7b 63 75 72 72 65 6e 74 5f 68 61 73 68 7d 29 22 00 00 00 2c 20 20 20 20 20 20 20 20 20 20 70 | #{current_hash})"...,..........p |
| 87e0 | 75 74 73 20 22 20 20 62 72 61 6e 63 68 3a 20 23 7b 63 75 72 72 65 6e 74 5f 62 72 61 6e 63 68 7d | uts."..branch:.#{current_branch} |
| 8800 | 22 00 00 00 44 20 20 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 75 70 64 61 74 65 64 3a 20 | "...D..........puts."..updated:. |
| 8820 | 23 7b 6c 61 73 74 5f 63 6f 6d 6d 69 74 7d 22 20 75 6e 6c 65 73 73 20 6c 61 73 74 5f 63 6f 6d 6d | #{last_commit}".unless.last_comm |
| 8840 | 69 74 2e 65 6d 70 74 79 3f 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 0a 20 20 20 20 | it.empty?............end........ |
| 8860 | 20 20 65 6c 73 65 00 00 00 28 20 20 20 20 20 20 20 20 70 75 74 73 20 22 23 7b 6e 61 6d 65 7d 20 | ..else...(........puts."#{name}. |
| 8880 | 28 6e 6f 74 20 67 69 74 2d 6d 61 6e 61 67 65 64 29 22 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 | (not.git-managed)"..........end. |
| 88a0 | 00 00 0d 20 20 20 20 20 20 70 75 74 73 20 22 22 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 | .........puts.""........end..... |
| 88c0 | 20 65 6e 64 00 00 00 00 00 00 00 18 20 20 64 65 66 20 63 72 65 61 74 65 5f 66 72 65 65 7a 65 5f | .end..........def.create_freeze_ |
| 88e0 | 66 69 6c 65 00 00 00 14 20 20 20 20 66 72 65 65 7a 65 5f 64 61 74 61 20 3d 20 7b 7d 00 00 00 00 | file........freeze_data.=.{}.... |
| 8900 | 00 00 00 2d 20 20 20 20 44 69 72 2e 63 68 69 6c 64 72 65 6e 28 40 70 6c 75 67 69 6e 73 5f 64 69 | ...-....Dir.children(@plugins_di |
| 8920 | 72 29 2e 65 61 63 68 20 64 6f 20 7c 6e 61 6d 65 7c 00 00 00 26 20 20 20 20 20 20 70 61 74 68 20 | r).each.do.|name|...&......path. |
| 8940 | 3d 20 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 00 00 00 2d 20 | =."#{@plugins_dir}/#{name}"...-. |
| 8960 | 20 20 20 20 20 6e 65 78 74 20 75 6e 6c 65 73 73 20 46 69 6c 65 2e 65 78 69 73 74 3f 28 22 23 7b | .....next.unless.File.exist?("#{ |
| 8980 | 70 61 74 68 7d 2f 2e 67 69 74 22 29 00 00 00 00 00 00 00 18 20 20 20 20 20 20 44 69 72 2e 63 68 | path}/.git")..............Dir.ch |
| 89a0 | 64 69 72 28 70 61 74 68 29 20 64 6f 00 00 00 3c 20 20 20 20 20 20 20 20 63 6f 6d 6d 69 74 5f 68 | dir(path).do...<........commit_h |
| 89c0 | 61 73 68 20 3d 20 60 67 69 74 20 72 65 76 2d 70 61 72 73 65 20 48 45 41 44 20 32 3e 2f 64 65 76 | ash.=.`git.rev-parse.HEAD.2>/dev |
| 89e0 | 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 41 20 20 20 20 20 20 20 20 66 72 65 65 7a 65 5f 64 | /null`.strip...A........freeze_d |
| 8a00 | 61 74 61 5b 6e 61 6d 65 5d 20 3d 20 63 6f 6d 6d 69 74 5f 68 61 73 68 20 75 6e 6c 65 73 73 20 63 | ata[name].=.commit_hash.unless.c |
| 8a20 | 6f 6d 6d 69 74 5f 68 61 73 68 2e 65 6d 70 74 79 3f 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 | ommit_hash.empty?..........end.. |
| 8a40 | 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 4b 20 20 20 20 66 72 65 65 7a 65 5f 66 69 6c 65 | ......end.......K....freeze_file |
| 8a60 | 20 3d 20 22 73 63 69 6f 6e 5f 66 72 65 65 7a 65 5f 23 7b 54 69 6d 65 2e 6e 6f 77 2e 73 74 72 66 | .=."scion_freeze_#{Time.now.strf |
| 8a80 | 74 69 6d 65 28 27 25 59 25 6d 25 64 5f 25 48 25 4d 25 53 27 29 7d 2e 6a 73 6f 6e 22 00 00 00 3e | time('%Y%m%d_%H%M%S')}.json"...> |
| 8aa0 | 20 20 20 20 46 69 6c 65 2e 77 72 69 74 65 28 66 72 65 65 7a 65 5f 66 69 6c 65 2c 20 4a 53 4f 4e | ....File.write(freeze_file,.JSON |
| 8ac0 | 2e 70 72 65 74 74 79 5f 67 65 6e 65 72 61 74 65 28 66 72 65 65 7a 65 5f 64 61 74 61 29 29 00 00 | .pretty_generate(freeze_data)).. |
| 8ae0 | 00 2e 20 20 20 20 70 75 74 73 20 22 66 72 65 65 7a 65 20 66 69 6c 65 20 63 72 65 61 74 65 64 3a | ......puts."freeze.file.created: |
| 8b00 | 20 23 7b 66 72 65 65 7a 65 5f 66 69 6c 65 7d 22 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 | .#{freeze_file}"......end....... |
| 8b20 | 19 20 20 64 65 66 20 72 65 73 74 6f 72 65 5f 66 72 6f 6d 5f 66 72 65 65 7a 65 00 00 00 3f 20 20 | ...def.restore_from_freeze...?.. |
| 8b40 | 20 20 66 72 65 65 7a 65 5f 66 69 6c 65 73 20 3d 20 44 69 72 2e 67 6c 6f 62 28 22 73 63 69 6f 6e | ..freeze_files.=.Dir.glob("scion |
| 8b60 | 5f 66 72 65 65 7a 65 5f 2a 2e 6a 73 6f 6e 22 29 2e 73 6f 72 74 2e 72 65 76 65 72 73 65 00 00 00 | _freeze_*.json").sort.reverse... |
| 8b80 | 00 00 00 00 1a 20 20 20 20 69 66 20 66 72 65 65 7a 65 5f 66 69 6c 65 73 2e 65 6d 70 74 79 3f 00 | .........if.freeze_files.empty?. |
| 8ba0 | 00 00 22 20 20 20 20 20 20 70 75 74 73 20 22 6e 6f 20 66 72 65 65 7a 65 20 66 69 6c 65 73 20 66 | .."......puts."no.freeze.files.f |
| 8bc0 | 6f 75 6e 64 22 00 00 00 0c 20 20 20 20 20 20 72 65 74 75 72 6e 00 00 00 07 20 20 20 20 65 6e 64 | ound"..........return........end |
| 8be0 | 00 00 00 00 00 00 00 22 20 20 20 20 70 75 74 73 20 22 61 76 61 69 6c 61 62 6c 65 20 66 72 65 65 | ......."....puts."available.free |
| 8c00 | 7a 65 20 66 69 6c 65 73 3a 22 00 00 00 3f 20 20 20 20 66 72 65 65 7a 65 5f 66 69 6c 65 73 2e 65 | ze.files:"...?....freeze_files.e |
| 8c20 | 61 63 68 5f 77 69 74 68 5f 69 6e 64 65 78 20 7b 20 7c 66 2c 20 69 7c 20 70 75 74 73 20 22 20 20 | ach_with_index.{.|f,.i|.puts.".. |
| 8c40 | 23 7b 69 7d 3a 20 23 7b 66 7d 22 20 7d 00 00 00 41 20 20 20 20 70 72 69 6e 74 20 22 73 65 6c 65 | #{i}:.#{f}".}...A....print."sele |
| 8c60 | 63 74 20 66 69 6c 65 20 74 6f 20 72 65 73 74 6f 72 65 20 28 30 2d 23 7b 66 72 65 65 7a 65 5f 66 | ct.file.to.restore.(0-#{freeze_f |
| 8c80 | 69 6c 65 73 2e 73 69 7a 65 20 2d 20 31 7d 29 3a 20 22 00 00 00 1f 20 20 20 20 73 65 6c 65 63 74 | iles.size.-.1}):."........select |
| 8ca0 | 69 6f 6e 20 3d 20 67 65 74 73 2e 63 68 6f 6d 70 2e 74 6f 5f 69 00 00 00 00 00 00 00 29 20 20 20 | ion.=.gets.chomp.to_i.......)... |
| 8cc0 | 20 72 65 74 75 72 6e 20 75 6e 6c 65 73 73 20 66 72 65 65 7a 65 5f 66 69 6c 65 73 5b 73 65 6c 65 | .return.unless.freeze_files[sele |
| 8ce0 | 63 74 69 6f 6e 5d 00 00 00 00 00 00 00 40 20 20 20 20 66 72 65 65 7a 65 5f 64 61 74 61 20 3d 20 | ction].......@....freeze_data.=. |
| 8d00 | 4a 53 4f 4e 2e 70 61 72 73 65 28 46 69 6c 65 2e 72 65 61 64 28 66 72 65 65 7a 65 5f 66 69 6c 65 | JSON.parse(File.read(freeze_file |
| 8d20 | 73 5b 73 65 6c 65 63 74 69 6f 6e 5d 29 29 00 00 00 00 00 00 00 2b 20 20 20 20 66 72 65 65 7a 65 | s[selection])).......+....freeze |
| 8d40 | 5f 64 61 74 61 2e 65 61 63 68 20 64 6f 20 7c 6e 61 6d 65 2c 20 74 61 72 67 65 74 5f 68 61 73 68 | _data.each.do.|name,.target_hash |
| 8d60 | 7c 00 00 00 26 20 20 20 20 20 20 70 61 74 68 20 3d 20 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 | |...&......path.=."#{@plugins_di |
| 8d80 | 72 7d 2f 23 7b 6e 61 6d 65 7d 22 00 00 00 38 20 20 20 20 20 20 69 66 20 44 69 72 2e 65 78 69 73 | r}/#{name}"...8......if.Dir.exis |
| 8da0 | 74 3f 28 70 61 74 68 29 20 26 26 20 46 69 6c 65 2e 65 78 69 73 74 3f 28 22 23 7b 70 61 74 68 7d | t?(path).&&.File.exist?("#{path} |
| 8dc0 | 2f 2e 67 69 74 22 29 00 00 00 1a 20 20 20 20 20 20 20 20 44 69 72 2e 63 68 64 69 72 28 70 61 74 | /.git")............Dir.chdir(pat |
| 8de0 | 68 29 20 64 6f 00 00 00 3f 20 20 20 20 20 20 20 20 20 20 63 75 72 72 65 6e 74 5f 68 61 73 68 20 | h).do...?..........current_hash. |
| 8e00 | 3d 20 60 67 69 74 20 72 65 76 2d 70 61 72 73 65 20 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c | =.`git.rev-parse.HEAD.2>/dev/nul |
| 8e20 | 6c 60 2e 73 74 72 69 70 00 00 00 28 20 20 20 20 20 20 20 20 20 20 69 66 20 63 75 72 72 65 6e 74 | l`.strip...(..........if.current |
| 8e40 | 5f 68 61 73 68 20 21 3d 20 74 61 72 67 65 74 5f 68 61 73 68 00 00 00 3f 20 20 20 20 20 20 20 20 | _hash.!=.target_hash...?........ |
| 8e60 | 20 20 20 20 70 75 74 73 20 22 72 65 73 74 6f 72 69 6e 67 20 23 7b 6e 61 6d 65 7d 20 74 6f 20 23 | ....puts."restoring.#{name}.to.# |
| 8e80 | 7b 74 61 72 67 65 74 5f 68 61 73 68 5b 30 2e 2e 37 5d 7d 2e 2e 2e 22 00 00 00 4b 20 20 20 20 20 | {target_hash[0..7]}..."...K..... |
| 8ea0 | 20 20 20 20 20 20 20 73 79 73 74 65 6d 28 22 67 69 74 20 66 65 74 63 68 20 2d 2d 64 65 70 74 68 | .......system("git.fetch.--depth |
| 8ec0 | 3d 31 20 6f 72 69 67 69 6e 20 23 7b 74 61 72 67 65 74 5f 68 61 73 68 7d 20 32 3e 2f 64 65 76 2f | =1.origin.#{target_hash}.2>/dev/ |
| 8ee0 | 6e 75 6c 6c 22 29 00 00 00 3d 20 20 20 20 20 20 20 20 20 20 20 20 73 79 73 74 65 6d 28 22 67 69 | null")...=............system("gi |
| 8f00 | 74 20 63 68 65 63 6b 6f 75 74 20 23 7b 74 61 72 67 65 74 5f 68 61 73 68 7d 20 32 3e 2f 64 65 76 | t.checkout.#{target_hash}.2>/dev |
| 8f20 | 2f 6e 75 6c 6c 22 29 00 00 00 4a 20 20 20 20 20 20 20 20 20 20 20 20 72 75 6e 5f 74 72 65 65 73 | /null")...J............run_trees |
| 8f40 | 69 74 74 65 72 5f 70 6f 73 74 5f 69 6e 73 74 61 6c 6c 28 6e 61 6d 65 29 20 69 66 20 6e 61 6d 65 | itter_post_install(name).if.name |
| 8f60 | 20 3d 3d 20 22 6e 76 69 6d 2d 74 72 65 65 73 69 74 74 65 72 22 00 00 00 0e 20 20 20 20 20 20 20 | .==."nvim-treesitter"........... |
| 8f80 | 20 20 20 65 6c 73 65 00 00 00 34 20 20 20 20 20 20 20 20 20 20 20 20 70 75 74 73 20 22 23 7b 6e | ...else...4............puts."#{n |
| 8fa0 | 61 6d 65 7d 20 61 6c 72 65 61 64 79 20 61 74 20 74 61 72 67 65 74 20 76 65 72 73 69 6f 6e 22 00 | ame}.already.at.target.version". |
| 8fc0 | 00 00 0d 20 20 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 | .............end............end. |
| 8fe0 | 00 00 0a 20 20 20 20 20 20 65 6c 73 65 00 00 00 37 20 20 20 20 20 20 20 20 70 75 74 73 20 22 77 | .........else...7........puts."w |
| 9000 | 61 72 6e 69 6e 67 3a 20 23 7b 6e 61 6d 65 7d 20 6e 6f 74 20 69 6e 73 74 61 6c 6c 65 64 2c 20 73 | arning:.#{name}.not.installed,.s |
| 9020 | 6b 69 70 70 69 6e 67 22 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 | kipping"..........end........end |
| 9040 | 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 09 20 20 70 72 69 76 61 74 65 00 00 00 00 00 00 | ......end..........private...... |
| 9060 | 00 1e 20 20 64 65 66 20 65 6e 73 75 72 65 5f 64 69 72 65 63 74 6f 72 69 65 73 5f 65 78 69 73 74 | ....def.ensure_directories_exist |
| 9080 | 00 00 00 2a 20 20 20 20 5b 40 70 6c 75 67 69 6e 73 5f 64 69 72 2c 20 40 6f 70 74 5f 64 69 72 5d | ...*....[@plugins_dir,.@opt_dir] |
| 90a0 | 2e 65 61 63 68 20 64 6f 20 7c 64 69 72 7c 00 00 00 33 20 20 20 20 20 20 46 69 6c 65 55 74 69 6c | .each.do.|dir|...3......FileUtil |
| 90c0 | 73 2e 6d 6b 64 69 72 5f 70 28 64 69 72 29 20 75 6e 6c 65 73 73 20 44 69 72 2e 65 78 69 73 74 3f | s.mkdir_p(dir).unless.Dir.exist? |
| 90e0 | 28 64 69 72 29 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 | (dir)........end......end....... |
| 9100 | 10 20 20 64 65 66 20 6c 6f 61 64 5f 73 74 61 74 65 00 00 00 28 20 20 20 20 40 73 74 61 74 65 20 | ...def.load_state...(....@state. |
| 9120 | 3d 20 69 66 20 46 69 6c 65 2e 65 78 69 73 74 3f 28 40 73 74 61 74 65 5f 66 69 6c 65 29 00 00 00 | =.if.File.exist?(@state_file)... |
| 9140 | 28 20 20 20 20 20 20 4a 53 4f 4e 2e 70 61 72 73 65 28 46 69 6c 65 2e 72 65 61 64 28 40 73 74 61 | (......JSON.parse(File.read(@sta |
| 9160 | 74 65 5f 66 69 6c 65 29 29 00 00 00 08 20 20 20 20 65 6c 73 65 00 00 00 31 20 20 20 20 20 20 7b | te_file))........else...1......{ |
| 9180 | 20 22 69 6e 73 74 61 6c 6c 65 64 22 20 3d 3e 20 7b 7d 2c 20 22 6c 61 73 74 5f 75 70 64 61 74 65 | ."installed".=>.{},."last_update |
| 91a0 | 22 20 3d 3e 20 6e 69 6c 20 7d 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 | ".=>.nil.}........end......end.. |
| 91c0 | 00 00 00 00 00 10 20 20 64 65 66 20 73 61 76 65 5f 73 74 61 74 65 00 00 00 39 20 20 20 20 46 69 | ........def.save_state...9....Fi |
| 91e0 | 6c 65 2e 77 72 69 74 65 28 40 73 74 61 74 65 5f 66 69 6c 65 2c 20 4a 53 4f 4e 2e 70 72 65 74 74 | le.write(@state_file,.JSON.prett |
| 9200 | 79 5f 67 65 6e 65 72 61 74 65 28 40 73 74 61 74 65 29 29 00 00 00 05 20 20 65 6e 64 00 00 00 00 | y_generate(@state))......end.... |
| 9220 | 00 00 00 1b 20 20 64 65 66 20 70 6c 75 67 69 6e 5f 74 6f 5f 75 72 6c 28 70 6c 75 67 69 6e 29 00 | ......def.plugin_to_url(plugin). |
| 9240 | 00 00 2b 20 20 20 20 72 65 74 75 72 6e 20 70 6c 75 67 69 6e 20 69 66 20 70 6c 75 67 69 6e 2e 69 | ..+....return.plugin.if.plugin.i |
| 9260 | 6e 63 6c 75 64 65 3f 28 22 3a 2f 2f 22 29 00 00 00 22 20 20 20 20 22 68 74 74 70 73 3a 2f 2f 67 | nclude?("://")..."...."https://g |
| 9280 | 69 74 68 75 62 2e 63 6f 6d 2f 23 7b 70 6c 75 67 69 6e 7d 22 00 00 00 05 20 20 65 6e 64 00 00 00 | ithub.com/#{plugin}"......end... |
| 92a0 | 00 00 00 00 27 20 20 64 65 66 20 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 | ....'..def.plugin_name_from_url( |
| 92c0 | 75 72 6c 5f 6f 72 5f 73 70 65 63 29 00 00 00 24 20 20 20 20 75 72 6c 20 3d 20 70 6c 75 67 69 6e | url_or_spec)...$....url.=.plugin |
| 92e0 | 5f 74 6f 5f 75 72 6c 28 75 72 6c 5f 6f 72 5f 73 70 65 63 29 00 00 00 1e 20 20 20 20 46 69 6c 65 | _to_url(url_or_spec)........File |
| 9300 | 2e 62 61 73 65 6e 61 6d 65 28 75 72 6c 2c 20 22 2e 67 69 74 22 29 00 00 00 05 20 20 65 6e 64 00 | .basename(url,.".git")......end. |
| 9320 | 00 00 00 00 00 00 21 20 20 64 65 66 20 66 69 6e 64 5f 70 6c 75 67 69 6e 5f 69 6e 5f 63 6f 6e 66 | ......!..def.find_plugin_in_conf |
| 9340 | 69 67 28 6e 61 6d 65 29 00 00 00 22 20 20 20 20 40 70 6c 75 67 69 6e 73 5f 6c 69 73 74 2e 66 69 | ig(name)..."....@plugins_list.fi |
| 9360 | 6e 64 20 64 6f 20 7c 70 6c 75 67 69 6e 7c 00 00 00 2a 20 20 20 20 20 20 70 6c 75 67 69 6e 5f 6e | nd.do.|plugin|...*......plugin_n |
| 9380 | 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 70 6c 75 67 69 6e 29 20 3d 3d 20 6e 61 6d 65 00 00 00 07 | ame_from_url(plugin).==.name.... |
| 93a0 | 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 1d 20 20 64 65 66 20 70 6c | ....end......end..........def.pl |
| 93c0 | 75 67 69 6e 5f 69 6e 5f 63 6f 6e 66 69 67 3f 28 6e 61 6d 65 29 00 00 00 25 20 20 20 20 21 66 69 | ugin_in_config?(name)...%....!fi |
| 93e0 | 6e 64 5f 70 6c 75 67 69 6e 5f 69 6e 5f 63 6f 6e 66 69 67 28 6e 61 6d 65 29 2e 6e 69 6c 3f 00 00 | nd_plugin_in_config(name).nil?.. |
| 9400 | 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 21 20 20 64 65 66 20 69 73 5f 74 72 65 65 73 69 74 74 | ....end.......!..def.is_treesitt |
| 9420 | 65 72 5f 70 6c 75 67 69 6e 3f 28 6e 61 6d 65 29 00 00 00 1d 20 20 20 20 6e 61 6d 65 20 3d 3d 20 | er_plugin?(name)........name.==. |
| 9440 | 22 6e 76 69 6d 2d 74 72 65 65 73 69 74 74 65 72 22 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 | "nvim-treesitter"......end...... |
| 9460 | 00 27 20 20 64 65 66 20 72 75 6e 5f 74 72 65 65 73 69 74 74 65 72 5f 70 6f 73 74 5f 69 6e 73 74 | .'..def.run_treesitter_post_inst |
| 9480 | 61 6c 6c 28 6e 61 6d 65 29 00 00 00 2d 20 20 20 20 72 65 74 75 72 6e 20 75 6e 6c 65 73 73 20 69 | all(name)...-....return.unless.i |
| 94a0 | 73 5f 74 72 65 65 73 69 74 74 65 72 5f 70 6c 75 67 69 6e 3f 28 6e 61 6d 65 29 00 00 00 04 20 20 | s_treesitter_plugin?(name)...... |
| 94c0 | 20 20 00 00 00 24 20 20 20 20 6e 76 69 6d 5f 63 6d 64 20 3d 20 45 4e 56 5b 27 4e 56 49 4d 27 5d | .....$....nvim_cmd.=.ENV['NVIM'] |
| 94e0 | 20 7c 7c 20 27 6e 76 69 6d 27 00 00 00 33 20 20 20 20 70 6c 75 67 69 6e 5f 70 61 74 68 20 3d 20 | .||.'nvim'...3....plugin_path.=. |
| 9500 | 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 6e 76 69 6d 2d 74 72 65 65 73 69 74 74 65 72 | "#{@plugins_dir}/nvim-treesitter |
| 9520 | 22 00 00 00 04 20 20 20 20 00 00 00 1e 20 20 20 20 69 66 20 44 69 72 2e 65 78 69 73 74 3f 28 70 | "................if.Dir.exist?(p |
| 9540 | 6c 75 67 69 6e 5f 70 61 74 68 29 00 00 00 45 20 20 20 20 20 20 6e 76 69 6d 5f 68 65 61 64 6c 65 | lugin_path)...E......nvim_headle |
| 9560 | 73 73 5f 63 6d 64 20 3d 20 22 23 7b 6e 76 69 6d 5f 63 6d 64 7d 20 2d 2d 68 65 61 64 6c 65 73 73 | ss_cmd.=."#{nvim_cmd}.--headless |
| 9580 | 20 2d 2d 6e 6f 70 6c 75 67 69 6e 20 2d 75 20 4e 4f 4e 45 22 00 00 00 47 20 20 20 20 20 20 6e 76 | .--noplugin.-u.NONE"...G......nv |
| 95a0 | 69 6d 5f 68 65 61 64 6c 65 73 73 5f 63 6d 64 20 3c 3c 20 22 20 2d 2d 63 6d 64 20 5c 22 73 65 74 | im_headless_cmd.<<.".--cmd.\"set |
| 95c0 | 20 72 75 6e 74 69 6d 65 70 61 74 68 2b 3d 23 7b 70 6c 75 67 69 6e 5f 70 61 74 68 7d 5c 22 22 00 | .runtimepath+=#{plugin_path}\"". |
| 95e0 | 00 00 4f 20 20 20 20 20 20 6e 76 69 6d 5f 68 65 61 64 6c 65 73 73 5f 63 6d 64 20 3c 3c 20 22 20 | ..O......nvim_headless_cmd.<<.". |
| 9600 | 2d 63 20 27 6c 75 61 66 69 6c 65 20 23 7b 70 6c 75 67 69 6e 5f 70 61 74 68 7d 2f 70 6c 75 67 69 | -c.'luafile.#{plugin_path}/plugi |
| 9620 | 6e 2f 74 72 65 65 73 69 74 74 65 72 2e 6c 75 61 27 22 00 00 00 37 20 20 20 20 20 20 6e 76 69 6d | n/treesitter.lua'"...7......nvim |
| 9640 | 5f 68 65 61 64 6c 65 73 73 5f 63 6d 64 20 3c 3c 20 22 20 2d 63 20 27 54 53 55 70 64 61 74 65 53 | _headless_cmd.<<.".-c.'TSUpdateS |
| 9660 | 79 6e 63 27 20 2d 63 20 27 71 61 27 22 00 00 00 06 20 20 20 20 20 20 00 00 00 35 20 20 20 20 20 | ync'.-c.'qa'".............5..... |
| 9680 | 20 70 75 74 73 20 22 20 20 72 75 6e 6e 69 6e 67 20 54 53 55 70 64 61 74 65 53 79 6e 63 20 66 6f | .puts."..running.TSUpdateSync.fo |
| 96a0 | 72 20 74 72 65 65 73 69 74 74 65 72 2e 2e 2e 22 00 00 00 1f 20 20 20 20 20 20 73 79 73 74 65 6d | r.treesitter..."..........system |
| 96c0 | 28 6e 76 69 6d 5f 68 65 61 64 6c 65 73 73 5f 63 6d 64 29 00 00 00 06 20 20 20 20 20 20 00 00 00 | (nvim_headless_cmd)............. |
| 96e0 | 14 20 20 20 20 20 20 69 66 20 24 3f 2e 73 75 63 63 65 73 73 3f 00 00 00 3a 20 20 20 20 20 20 20 | .......if.$?.success?...:....... |
| 9700 | 20 70 75 74 73 20 22 20 20 74 72 65 65 73 69 74 74 65 72 20 70 61 72 73 65 72 73 20 69 6e 73 74 | .puts."..treesitter.parsers.inst |
| 9720 | 61 6c 6c 65 64 20 73 75 63 63 65 73 73 66 75 6c 6c 79 22 00 00 00 0a 20 20 20 20 20 20 65 6c 73 | alled.successfully"..........els |
| 9740 | 65 00 00 00 3e 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 77 61 72 6e 69 6e 67 3a 20 74 72 | e...>........puts."..warning:.tr |
| 9760 | 65 65 73 69 74 74 65 72 20 70 61 72 73 65 72 73 20 66 61 69 6c 65 64 20 74 6f 20 69 6e 73 74 61 | eesitter.parsers.failed.to.insta |
| 9780 | 6c 6c 22 00 00 00 38 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 72 75 6e 20 3a 54 53 49 6e | ll"...8........puts."..run.:TSIn |
| 97a0 | 73 74 61 6c 6c 20 6d 61 6e 75 61 6c 6c 79 20 69 6e 20 4e 65 6f 76 69 6d 20 6c 61 74 65 72 22 00 | stall.manually.in.Neovim.later". |
| 97c0 | 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 08 20 20 20 20 65 6c 73 65 00 00 00 43 20 20 20 20 | .........end........else...C.... |
| 97e0 | 20 20 70 75 74 73 20 22 20 20 77 61 72 6e 69 6e 67 3a 20 6e 76 69 6d 2d 74 72 65 65 73 69 74 74 | ..puts."..warning:.nvim-treesitt |
| 9800 | 65 72 20 6e 6f 74 20 66 6f 75 6e 64 20 61 74 20 23 7b 70 6c 75 67 69 6e 5f 70 61 74 68 7d 22 00 | er.not.found.at.#{plugin_path}". |
| 9820 | 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 23 20 20 64 65 66 | .......end......end.......#..def |
| 9840 | 20 69 6e 73 74 61 6c 6c 5f 73 69 6e 67 6c 65 5f 70 6c 75 67 69 6e 28 70 6c 75 67 69 6e 29 00 00 | .install_single_plugin(plugin).. |
| 9860 | 00 1f 20 20 20 20 75 72 6c 20 3d 20 70 6c 75 67 69 6e 5f 74 6f 5f 75 72 6c 28 70 6c 75 67 69 6e | ......url.=.plugin_to_url(plugin |
| 9880 | 29 00 00 00 27 20 20 20 20 6e 61 6d 65 20 3d 20 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d | )...'....name.=.plugin_name_from |
| 98a0 | 5f 75 72 6c 28 70 6c 75 67 69 6e 29 00 00 00 2b 20 20 20 20 74 61 72 67 65 74 5f 70 61 74 68 20 | _url(plugin)...+....target_path. |
| 98c0 | 3d 20 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 00 00 00 00 00 | =."#{@plugins_dir}/#{name}"..... |
| 98e0 | 00 00 1e 20 20 20 20 69 66 20 44 69 72 2e 65 78 69 73 74 3f 28 74 61 72 67 65 74 5f 70 61 74 68 | .......if.Dir.exist?(target_path |
| 9900 | 29 00 00 00 12 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 00 00 00 07 20 20 20 20 65 | )..........return.false........e |
| 9920 | 6e 64 00 00 00 00 00 00 00 4b 20 20 20 20 73 79 73 74 65 6d 28 22 67 69 74 20 63 6c 6f 6e 65 20 | nd.......K....system("git.clone. |
| 9940 | 23 7b 75 72 6c 7d 20 23 7b 74 61 72 67 65 74 5f 70 61 74 68 7d 20 2d 2d 64 65 70 74 68 3d 31 20 | #{url}.#{target_path}.--depth=1. |
| 9960 | 2d 2d 71 75 69 65 74 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 22 29 00 00 00 00 00 00 00 1e 20 20 20 | --quiet.2>/dev/null")........... |
| 9980 | 20 69 66 20 44 69 72 2e 65 78 69 73 74 3f 28 74 61 72 67 65 74 5f 70 61 74 68 29 00 00 00 1f 20 | .if.Dir.exist?(target_path)..... |
| 99a0 | 20 20 20 20 20 44 69 72 2e 63 68 64 69 72 28 74 61 72 67 65 74 5f 70 61 74 68 29 20 64 6f 00 00 | .....Dir.chdir(target_path).do.. |
| 99c0 | 00 3c 20 20 20 20 20 20 20 20 63 6f 6d 6d 69 74 5f 68 61 73 68 20 3d 20 60 67 69 74 20 72 65 76 | .<........commit_hash.=.`git.rev |
| 99e0 | 2d 70 61 72 73 65 20 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 | -parse.HEAD.2>/dev/null`.strip.. |
| 9a00 | 00 2f 20 20 20 20 20 20 20 20 40 73 74 61 74 65 5b 22 69 6e 73 74 61 6c 6c 65 64 22 5d 5b 6e 61 | ./........@state["installed"][na |
| 9a20 | 6d 65 5d 20 3d 20 63 6f 6d 6d 69 74 5f 68 61 73 68 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 | me].=.commit_hash..........end.. |
| 9a40 | 00 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 69 6e 73 74 61 6c 6c 65 64 20 23 7b 6e 61 6d 65 | ........puts."..installed.#{name |
| 9a60 | 7d 22 00 00 00 06 20 20 20 20 20 20 00 00 00 24 20 20 20 20 20 20 69 66 20 69 73 5f 74 72 65 65 | }".............$......if.is_tree |
| 9a80 | 73 69 74 74 65 72 5f 70 6c 75 67 69 6e 3f 28 6e 61 6d 65 29 00 00 00 29 20 20 20 20 20 20 20 20 | sitter_plugin?(name)...)........ |
| 9aa0 | 72 75 6e 5f 74 72 65 65 73 69 74 74 65 72 5f 70 6f 73 74 5f 69 6e 73 74 61 6c 6c 28 6e 61 6d 65 | run_treesitter_post_install(name |
| 9ac0 | 29 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 0a 20 20 20 20 20 20 74 72 75 65 00 00 00 08 | )..........end..........true.... |
| 9ae0 | 20 20 20 20 65 6c 73 65 00 00 00 28 20 20 20 20 20 20 70 75 74 73 20 22 20 20 66 61 69 6c 65 64 | ....else...(......puts."..failed |
| 9b00 | 20 74 6f 20 69 6e 73 74 61 6c 6c 20 23 7b 6e 61 6d 65 7d 22 00 00 00 0b 20 20 20 20 20 20 66 61 | .to.install.#{name}"..........fa |
| 9b20 | 6c 73 65 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 1f 20 | lse........end......end......... |
| 9b40 | 20 64 65 66 20 69 6e 73 74 61 6c 6c 5f 70 61 72 61 6c 6c 65 6c 28 70 6c 75 67 69 6e 73 29 00 00 | .def.install_parallel(plugins).. |
| 9b60 | 00 59 20 20 20 20 74 72 65 65 73 69 74 74 65 72 5f 70 6c 75 67 69 6e 20 3d 20 70 6c 75 67 69 6e | .Y....treesitter_plugin.=.plugin |
| 9b80 | 73 2e 66 69 6e 64 20 7b 20 7c 70 7c 20 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 | s.find.{.|p|.plugin_name_from_ur |
| 9ba0 | 6c 28 70 29 20 3d 3d 20 22 6e 76 69 6d 2d 74 72 65 65 73 69 74 74 65 72 22 20 7d 00 00 00 57 20 | l(p).==."nvim-treesitter".}...W. |
| 9bc0 | 20 20 20 6f 74 68 65 72 5f 70 6c 75 67 69 6e 73 20 3d 20 70 6c 75 67 69 6e 73 2e 72 65 6a 65 63 | ...other_plugins.=.plugins.rejec |
| 9be0 | 74 20 7b 20 7c 70 7c 20 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 70 29 20 | t.{.|p|.plugin_name_from_url(p). |
| 9c00 | 3d 3d 20 22 6e 76 69 6d 2d 74 72 65 65 73 69 74 74 65 72 22 20 7d 00 00 00 04 20 20 20 20 00 00 | ==."nvim-treesitter".}.......... |
| 9c20 | 00 18 20 20 20 20 69 66 20 74 72 65 65 73 69 74 74 65 72 5f 70 6c 75 67 69 6e 00 00 00 2e 20 20 | ......if.treesitter_plugin...... |
| 9c40 | 20 20 20 20 69 6e 73 74 61 6c 6c 5f 73 69 6e 67 6c 65 5f 70 6c 75 67 69 6e 28 74 72 65 65 73 69 | ....install_single_plugin(treesi |
| 9c60 | 74 74 65 72 5f 70 6c 75 67 69 6e 29 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 04 20 20 20 20 00 | tter_plugin)........end......... |
| 9c80 | 00 00 19 20 20 20 20 69 66 20 6f 74 68 65 72 5f 70 6c 75 67 69 6e 73 2e 61 6e 79 3f 00 00 00 17 | .......if.other_plugins.any?.... |
| 9ca0 | 20 20 20 20 20 20 71 75 65 75 65 20 3d 20 51 75 65 75 65 2e 6e 65 77 00 00 00 2b 20 20 20 20 20 | ......queue.=.Queue.new...+..... |
| 9cc0 | 20 6f 74 68 65 72 5f 70 6c 75 67 69 6e 73 2e 65 61 63 68 20 7b 20 7c 70 7c 20 71 75 65 75 65 20 | .other_plugins.each.{.|p|.queue. |
| 9ce0 | 3c 3c 20 70 20 7d 00 00 00 06 20 20 20 20 20 20 00 00 00 45 20 20 20 20 20 20 74 68 72 65 61 64 | <<.p.}.............E......thread |
| 9d00 | 73 20 3d 20 28 31 2e 2e 5b 45 74 63 2e 6e 70 72 6f 63 65 73 73 6f 72 73 2c 20 6f 74 68 65 72 5f | s.=.(1..[Etc.nprocessors,.other_ |
| 9d20 | 70 6c 75 67 69 6e 73 2e 73 69 7a 65 5d 2e 6d 69 6e 29 2e 6d 61 70 20 64 6f 00 00 00 15 20 20 20 | plugins.size].min).map.do....... |
| 9d40 | 20 20 20 20 20 54 68 72 65 61 64 2e 6e 65 77 20 64 6f 00 00 00 1d 20 20 20 20 20 20 20 20 20 20 | .....Thread.new.do.............. |
| 9d60 | 77 68 69 6c 65 20 21 71 75 65 75 65 2e 65 6d 70 74 79 3f 00 00 00 2f 20 20 20 20 20 20 20 20 20 | while.!queue.empty?.../......... |
| 9d80 | 20 20 20 70 6c 75 67 69 6e 20 3d 20 71 75 65 75 65 2e 70 6f 70 28 74 72 75 65 29 20 72 65 73 63 | ...plugin.=.queue.pop(true).resc |
| 9da0 | 75 65 20 6e 69 6c 00 00 00 33 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 73 74 61 6c 6c 5f 73 69 | ue.nil...3............install_si |
| 9dc0 | 6e 67 6c 65 5f 70 6c 75 67 69 6e 28 70 6c 75 67 69 6e 29 20 69 66 20 70 6c 75 67 69 6e 00 00 00 | ngle_plugin(plugin).if.plugin... |
| 9de0 | 0d 20 20 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 | ...........end............end... |
| 9e00 | 09 20 20 20 20 20 20 65 6e 64 00 00 00 06 20 20 20 20 20 20 00 00 00 1a 20 20 20 20 20 20 74 68 | .......end....................th |
| 9e20 | 72 65 61 64 73 2e 65 61 63 68 28 26 3a 6a 6f 69 6e 29 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 | reads.each(&:join)........end... |
| 9e40 | 05 20 20 65 6e 64 00 00 00 00 00 00 00 20 20 20 64 65 66 20 75 70 64 61 74 65 5f 73 69 6e 67 6c | ...end..........def.update_singl |
| 9e60 | 65 5f 70 6c 75 67 69 6e 28 6e 61 6d 65 29 00 00 00 24 20 20 20 20 70 61 74 68 20 3d 20 22 23 7b | e_plugin(name)...$....path.=."#{ |
| 9e80 | 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 00 00 00 04 20 20 20 20 00 00 | @plugins_dir}/#{name}".......... |
| 9ea0 | 00 16 20 20 20 20 44 69 72 2e 63 68 64 69 72 28 70 61 74 68 29 20 64 6f 00 00 00 3a 20 20 20 20 | ......Dir.chdir(path).do...:.... |
| 9ec0 | 20 20 62 65 66 6f 72 65 5f 68 61 73 68 20 3d 20 60 67 69 74 20 72 65 76 2d 70 61 72 73 65 20 48 | ..before_hash.=.`git.rev-parse.H |
| 9ee0 | 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 36 20 20 20 20 20 20 | EAD.2>/dev/null`.strip...6...... |
| 9f00 | 73 79 73 74 65 6d 28 22 67 69 74 20 70 75 6c 6c 20 2d 2d 64 65 70 74 68 3d 31 20 2d 2d 71 75 69 | system("git.pull.--depth=1.--qui |
| 9f20 | 65 74 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 22 29 00 00 00 39 20 20 20 20 20 20 61 66 74 65 72 5f | et.2>/dev/null")...9......after_ |
| 9f40 | 68 61 73 68 20 3d 20 60 67 69 74 20 72 65 76 2d 70 61 72 73 65 20 48 45 41 44 20 32 3e 2f 64 65 | hash.=.`git.rev-parse.HEAD.2>/de |
| 9f60 | 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 06 20 20 20 20 20 20 00 00 00 22 20 20 20 20 20 | v/null`.strip............."..... |
| 9f80 | 20 69 66 20 62 65 66 6f 72 65 5f 68 61 73 68 20 21 3d 20 61 66 74 65 72 5f 68 61 73 68 00 00 00 | .if.before_hash.!=.after_hash... |
| 9fa0 | 2e 20 20 20 20 20 20 20 20 40 73 74 61 74 65 5b 22 69 6e 73 74 61 6c 6c 65 64 22 5d 5b 6e 61 6d | .........@state["installed"][nam |
| 9fc0 | 65 5d 20 3d 20 61 66 74 65 72 5f 68 61 73 68 00 00 00 4e 20 20 20 20 20 20 20 20 70 75 74 73 20 | e].=.after_hash...N........puts. |
| 9fe0 | 22 20 20 75 70 64 61 74 65 64 20 23 7b 6e 61 6d 65 7d 20 28 23 7b 62 65 66 6f 72 65 5f 68 61 73 | "..updated.#{name}.(#{before_has |
| a000 | 68 5b 30 2e 2e 37 5d 7d 20 2d 3e 20 23 7b 61 66 74 65 72 5f 68 61 73 68 5b 30 2e 2e 37 5d 7d 29 | h[0..7]}.->.#{after_hash[0..7]}) |
| a020 | 22 00 00 00 08 20 20 20 20 20 20 20 20 00 00 00 26 20 20 20 20 20 20 20 20 69 66 20 69 73 5f 74 | "...............&........if.is_t |
| a040 | 72 65 65 73 69 74 74 65 72 5f 70 6c 75 67 69 6e 3f 28 6e 61 6d 65 29 00 00 00 2b 20 20 20 20 20 | reesitter_plugin?(name)...+..... |
| a060 | 20 20 20 20 20 72 75 6e 5f 74 72 65 65 73 69 74 74 65 72 5f 70 6f 73 74 5f 69 6e 73 74 61 6c 6c | .....run_treesitter_post_install |
| a080 | 28 6e 61 6d 65 29 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 0a 20 20 20 20 20 20 65 | (name)............end..........e |
| a0a0 | 6c 73 65 00 00 00 2b 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 23 7b 6e 61 6d 65 7d 20 61 | lse...+........puts."..#{name}.a |
| a0c0 | 6c 72 65 61 64 79 20 75 70 20 74 6f 20 64 61 74 65 22 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 | lready.up.to.date"..........end. |
| a0e0 | 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 1e 20 20 64 65 66 | .......end......end..........def |
| a100 | 20 75 70 64 61 74 65 5f 70 61 72 61 6c 6c 65 6c 28 70 6c 75 67 69 6e 73 29 00 00 00 2c 20 20 20 | .update_parallel(plugins)...,... |
| a120 | 20 74 72 65 65 73 69 74 74 65 72 5f 66 69 72 73 74 20 3d 20 70 6c 75 67 69 6e 73 2e 73 6f 72 74 | .treesitter_first.=.plugins.sort |
| a140 | 20 64 6f 20 7c 61 2c 62 7c 00 00 00 1f 20 20 20 20 20 20 69 66 20 61 20 3d 3d 20 22 6e 76 69 6d | .do.|a,b|..........if.a.==."nvim |
| a160 | 2d 74 72 65 65 73 69 74 74 65 72 22 00 00 00 0a 20 20 20 20 20 20 20 20 2d 31 00 00 00 22 20 20 | -treesitter"............-1...".. |
| a180 | 20 20 20 20 65 6c 73 69 66 20 62 20 3d 3d 20 22 6e 76 69 6d 2d 74 72 65 65 73 69 74 74 65 72 22 | ....elsif.b.==."nvim-treesitter" |
| a1a0 | 00 00 00 09 20 20 20 20 20 20 20 20 31 00 00 00 0a 20 20 20 20 20 20 65 6c 73 65 00 00 00 09 20 | ............1..........else..... |
| a1c0 | 20 20 20 20 20 20 20 30 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 | .......0..........end........end |
| a1e0 | 00 00 00 04 20 20 20 20 00 00 00 15 20 20 20 20 71 75 65 75 65 20 3d 20 51 75 65 75 65 2e 6e 65 | ................queue.=.Queue.ne |
| a200 | 77 00 00 00 2c 20 20 20 20 74 72 65 65 73 69 74 74 65 72 5f 66 69 72 73 74 2e 65 61 63 68 20 7b | w...,....treesitter_first.each.{ |
| a220 | 20 7c 70 7c 20 71 75 65 75 65 20 3c 3c 20 70 20 7d 00 00 00 04 20 20 20 20 00 00 00 3d 20 20 20 | .|p|.queue.<<.p.}...........=... |
| a240 | 20 74 68 72 65 61 64 73 20 3d 20 28 31 2e 2e 5b 45 74 63 2e 6e 70 72 6f 63 65 73 73 6f 72 73 2c | .threads.=.(1..[Etc.nprocessors, |
| a260 | 20 70 6c 75 67 69 6e 73 2e 73 69 7a 65 5d 2e 6d 69 6e 29 2e 6d 61 70 20 64 6f 00 00 00 13 20 20 | .plugins.size].min).map.do...... |
| a280 | 20 20 20 20 54 68 72 65 61 64 2e 6e 65 77 20 64 6f 00 00 00 1b 20 20 20 20 20 20 20 20 77 68 69 | ....Thread.new.do............whi |
| a2a0 | 6c 65 20 21 71 75 65 75 65 2e 65 6d 70 74 79 3f 00 00 00 2d 20 20 20 20 20 20 20 20 20 20 70 6c | le.!queue.empty?...-..........pl |
| a2c0 | 75 67 69 6e 20 3d 20 71 75 65 75 65 2e 70 6f 70 28 74 72 75 65 29 20 72 65 73 63 75 65 20 6e 69 | ugin.=.queue.pop(true).rescue.ni |
| a2e0 | 6c 00 00 00 30 20 20 20 20 20 20 20 20 20 20 75 70 64 61 74 65 5f 73 69 6e 67 6c 65 5f 70 6c 75 | l...0..........update_single_plu |
| a300 | 67 69 6e 28 70 6c 75 67 69 6e 29 20 69 66 20 70 6c 75 67 69 6e 00 00 00 0b 20 20 20 20 20 20 20 | gin(plugin).if.plugin........... |
| a320 | 20 65 6e 64 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 04 | .end..........end........end.... |
| a340 | 20 20 20 20 00 00 00 18 20 20 20 20 74 68 72 65 61 64 73 2e 65 61 63 68 28 26 3a 6a 6f 69 6e 29 | ............threads.each(&:join) |
| a360 | 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 2b 20 20 64 65 66 20 64 69 73 70 6c 61 79 5f 70 | ......end.......+..def.display_p |
| a380 | 6c 75 67 69 6e 5f 69 6e 66 6f 28 70 6c 75 67 69 6e 2c 20 73 68 6f 77 5f 61 6c 6c 29 00 00 00 29 | lugin_info(plugin,.show_all)...) |
| a3a0 | 20 20 20 20 69 6e 5f 63 6f 6e 66 69 67 20 3d 20 70 6c 75 67 69 6e 5f 69 6e 5f 63 6f 6e 66 69 67 | ....in_config.=.plugin_in_config |
| a3c0 | 3f 28 70 6c 75 67 69 6e 29 00 00 00 22 20 20 20 20 73 74 61 74 75 73 20 3d 20 69 6e 5f 63 6f 6e | ?(plugin)..."....status.=.in_con |
| a3e0 | 66 69 67 20 3f 20 22 2b 22 20 3a 20 22 2d 22 00 00 00 00 00 00 00 2e 20 20 20 20 69 66 20 73 68 | fig.?."+".:."-"............if.sh |
| a400 | 6f 77 5f 61 6c 6c 20 26 26 20 40 73 74 61 74 65 5b 22 69 6e 73 74 61 6c 6c 65 64 22 5d 5b 70 6c | ow_all.&&.@state["installed"][pl |
| a420 | 75 67 69 6e 5d 00 00 00 2e 20 20 20 20 20 20 68 61 73 68 20 3d 20 40 73 74 61 74 65 5b 22 69 6e | ugin]..........hash.=.@state["in |
| a440 | 73 74 61 6c 6c 65 64 22 5d 5b 70 6c 75 67 69 6e 5d 5b 30 2e 2e 37 5d 00 00 00 2e 20 20 20 20 20 | stalled"][plugin][0..7]......... |
| a460 | 20 70 75 74 73 20 22 20 20 23 7b 73 74 61 74 75 73 7d 20 23 7b 70 6c 75 67 69 6e 7d 20 28 40 20 | .puts."..#{status}.#{plugin}.(@. |
| a480 | 23 7b 68 61 73 68 7d 29 22 00 00 00 08 20 20 20 20 65 6c 73 65 00 00 00 22 20 20 20 20 20 20 70 | #{hash})"........else..."......p |
| a4a0 | 75 74 73 20 22 20 20 23 7b 73 74 61 74 75 73 7d 20 23 7b 70 6c 75 67 69 6e 7d 22 00 00 00 07 20 | uts."..#{status}.#{plugin}"..... |
| a4c0 | 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 03 65 6e 64 00 00 00 00 00 00 00 11 69 66 | ...end......end....end........if |
| a4e0 | 20 5f 5f 46 49 4c 45 5f 5f 20 3d 3d 20 24 30 00 00 00 07 20 20 62 65 67 69 6e 00 00 00 11 20 20 | .__FILE__.==.$0......begin...... |
| a500 | 20 20 72 65 71 75 69 72 65 20 27 65 74 63 27 00 00 00 15 20 20 20 20 50 6c 75 67 69 6e 4d 61 6e | ..require.'etc'........PluginMan |
| a520 | 61 67 65 72 2e 72 75 6e 00 00 00 12 20 20 72 65 73 63 75 65 20 49 6e 74 65 72 72 75 70 74 00 00 | ager.run......rescue.Interrupt.. |
| a540 | 00 0b 20 20 20 20 70 75 74 73 20 22 22 00 00 00 1e 20 20 20 20 70 75 74 73 20 22 69 6e 74 65 72 | ......puts.""........puts."inter |
| a560 | 72 75 70 74 65 64 20 62 79 20 75 73 65 72 22 00 00 00 0a 20 20 20 20 65 78 69 74 20 31 00 00 00 | rupted.by.user"........exit.1... |
| a580 | 0d 20 20 72 65 73 63 75 65 20 3d 3e 20 65 00 00 00 1e 20 20 20 20 70 75 74 73 20 22 65 72 72 6f | ...rescue.=>.e........puts."erro |
| a5a0 | 72 3a 20 23 7b 65 2e 6d 65 73 73 61 67 65 7d 22 00 00 00 0a 20 20 20 20 65 78 69 74 20 31 00 00 | r:.#{e.message}"........exit.1.. |
| a5c0 | 00 05 20 20 65 6e 64 00 00 00 03 65 6e 64 35 81 f5 18 00 00 00 00 00 00 00 00 00 00 00 00 cc 01 | ....end....end5................. |
| a5e0 | 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 61 31 00 00 00 00 00 00 01 00 | ......................a1........ |
| a600 | 00 00 00 00 00 00 35 81 5f d0 00 00 00 05 00 00 00 07 00 00 00 00 00 00 00 00 00 00 00 06 00 00 | ......5._....................... |
| a620 | 00 01 00 00 00 00 00 00 00 00 ff ff ff ff 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| a640 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| a660 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| a680 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| a6a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| a6c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| a6e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| a700 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| a720 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| a740 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| a760 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| a780 | 00 00 00 00 00 00 00 00 00 00 00 00 6a 00 59 62 04 01 00 00 00 04 00 f5 18 00 00 01 b6 00 00 00 | ............j.Yb................ |
| a7a0 | 00 00 00 00 00 00 00 00 01 00 00 00 2c 20 20 20 20 69 66 20 73 68 6f 77 5f 61 6c 6c 20 26 26 20 | ............,....if.show_all.&&. |
| a7c0 | 40 73 74 61 74 65 5b 22 69 6e 73 74 61 6c 6c 65 64 22 5d 5b 70 6c 75 67 69 f5 18 00 00 01 b7 00 | @state["installed"][plugi....... |
| a7e0 | 00 00 00 00 00 00 00 00 00 00 00 f5 18 00 00 01 1d 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 | ................................ |
| a800 | 16 20 20 20 20 72 65 74 75 72 6e 20 70 6c 75 67 69 6e 20 69 66 20 70 f5 18 00 00 01 1e 00 00 00 | .....return.plugin.if.p......... |
| a820 | 00 00 00 00 00 00 00 00 00 f5 18 00 00 00 8f 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 03 20 | ................................ |
| a840 | 20 20 f5 18 00 00 00 90 00 00 00 00 00 00 00 00 00 00 00 00 f5 18 00 00 00 00 00 00 00 00 00 00 | ................................ |
| a860 | 00 00 00 00 00 01 00 00 00 00 f5 18 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 35 81 f5 18 | ............................5... |
| a880 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 8f 00 00 00 03 00 00 00 00 00 00 00 | ................................ |
| a8a0 | 00 00 00 00 00 00 00 00 00 00 00 00 f9 0f 00 00 00 00 00 00 f5 18 00 00 00 00 8f 00 00 00 03 00 | ................................ |
| a8c0 | 00 00 00 00 00 00 00 00 00 00 8e 00 00 00 16 00 00 00 f9 0f 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| a8e0 | 00 00 00 10 00 00 00 00 00 00 f5 18 00 00 00 00 1d 01 00 00 16 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| a900 | 99 00 00 00 2c 00 00 00 f9 1f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff 0f 00 00 00 00 00 00 | ....,........................... |
| a920 | f5 18 00 00 00 00 b6 01 00 00 2c 00 00 00 00 00 00 00 00 00 00 00 15 00 00 00 03 00 00 00 f8 2f | ..........,..................../ |
| a940 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6c 01 00 00 00 00 00 00 35 81 5f d0 00 00 00 06 00 00 | ..............l.......5._....... |
| a960 | 00 08 00 00 00 00 00 00 00 00 00 00 00 07 00 00 00 01 00 00 00 00 00 00 00 00 ff ff ff ff 00 01 | ................................ |
| a980 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| a9a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| a9c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| a9e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| aa00 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| aa20 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| aa40 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| aa60 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| aa80 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| aaa0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| aac0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6a 00 59 9d | ............................j.Y. |
| aae0 | 04 01 00 00 00 00 00 f5 18 00 00 00 00 00 00 00 02 00 00 00 00 00 00 01 cc 00 00 00 13 23 21 2f | .............................#!/ |
| ab00 | 75 73 72 2f 62 69 6e 2f 65 6e 76 20 72 75 62 79 00 00 00 00 00 00 00 16 72 65 71 75 69 72 65 28 | usr/bin/env.ruby........require( |
| ab20 | 22 2e 2f 63 6f 6e 66 69 67 2e 72 62 22 29 00 00 00 14 72 65 71 75 69 72 65 28 22 66 69 6c 65 75 | "./config.rb")....require("fileu |
| ab40 | 74 69 6c 73 22 29 00 00 00 13 72 65 71 75 69 72 65 28 22 6f 70 74 70 61 72 73 65 22 29 00 00 00 | tils")....require("optparse")... |
| ab60 | 0f 72 65 71 75 69 72 65 28 22 6a 73 6f 6e 22 29 00 00 00 11 72 65 71 75 69 72 65 28 22 74 68 72 | .require("json")....require("thr |
| ab80 | 65 61 64 22 29 00 00 00 00 00 00 00 13 63 6c 61 73 73 20 50 6c 75 67 69 6e 4d 61 6e 61 67 65 72 | ead")........class.PluginManager |
| aba0 | 00 00 00 29 20 20 61 74 74 72 5f 72 65 61 64 65 72 20 3a 70 6c 75 67 69 6e 73 5f 64 69 72 2c 20 | ...)..attr_reader.:plugins_dir,. |
| abc0 | 3a 70 6c 75 67 69 6e 73 5f 6c 69 73 74 00 00 00 00 00 00 00 18 20 20 64 65 66 20 69 6e 69 74 69 | :plugins_list..........def.initi |
| abe0 | 61 6c 69 7a 65 28 63 6f 6e 66 69 67 29 00 00 00 24 20 20 20 20 40 70 6c 75 67 69 6e 73 5f 6c 69 | alize(config)...$....@plugins_li |
| ac00 | 73 74 20 3d 20 43 4f 4e 46 49 47 5b 3a 70 6c 75 67 69 6e 73 5d 00 00 00 36 20 20 20 20 40 72 75 | st.=.CONFIG[:plugins]...6....@ru |
| ac20 | 6e 74 69 6d 65 5f 70 61 74 68 20 3d 20 46 69 6c 65 2e 65 78 70 61 6e 64 5f 70 61 74 68 28 43 4f | ntime_path.=.File.expand_path(CO |
| ac40 | 4e 46 49 47 5b 3a 72 75 6e 74 69 6d 65 5d 29 00 00 00 48 20 20 20 20 40 70 6c 75 67 69 6e 73 5f | NFIG[:runtime])...H....@plugins_ |
| ac60 | 64 69 72 20 3d 20 46 69 6c 65 2e 65 78 70 61 6e 64 5f 70 61 74 68 28 22 23 7b 40 72 75 6e 74 69 | dir.=.File.expand_path("#{@runti |
| ac80 | 6d 65 5f 70 61 74 68 7d 2f 70 61 63 6b 2f 73 63 69 6f 6e 2f 73 74 61 72 74 22 29 00 00 00 42 20 | me_path}/pack/scion/start")...B. |
| aca0 | 20 20 20 40 6f 70 74 5f 64 69 72 20 3d 20 46 69 6c 65 2e 65 78 70 61 6e 64 5f 70 61 74 68 28 22 | ...@opt_dir.=.File.expand_path(" |
| acc0 | 23 7b 40 72 75 6e 74 69 6d 65 5f 70 61 74 68 7d 2f 70 61 63 6b 2f 73 63 69 6f 6e 2f 6f 70 74 22 | #{@runtime_path}/pack/scion/opt" |
| ace0 | 29 00 00 00 47 20 20 20 20 40 73 74 61 74 65 5f 66 69 6c 65 20 3d 20 46 69 6c 65 2e 65 78 70 61 | )...G....@state_file.=.File.expa |
| ad00 | 6e 64 5f 70 61 74 68 28 22 23 7b 40 72 75 6e 74 69 6d 65 5f 70 61 74 68 7d 2f 73 63 69 6f 6e 5f | nd_path("#{@runtime_path}/scion_ |
| ad20 | 73 74 61 74 65 2e 6a 73 6f 6e 22 29 00 00 00 1c 20 20 20 20 65 6e 73 75 72 65 5f 64 69 72 65 63 | state.json")........ensure_direc |
| ad40 | 74 6f 72 69 65 73 5f 65 78 69 73 74 00 00 00 0e 20 20 20 20 6c 6f 61 64 5f 73 74 61 74 65 00 00 | tories_exist........load_state.. |
| ad60 | 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 0e 20 20 64 65 66 20 73 65 6c 66 2e 72 75 6e 00 00 00 | ....end..........def.self.run... |
| ad80 | 1f 20 20 20 20 6f 70 74 69 6f 6e 73 20 3d 20 70 61 72 73 65 5f 63 6c 69 5f 6f 70 74 69 6f 6e 73 | .....options.=.parse_cli_options |
| ada0 | 00 00 00 19 20 20 20 20 6d 61 6e 61 67 65 72 20 3d 20 6e 65 77 28 43 4f 4e 46 49 47 29 00 00 00 | ........manager.=.new(CONFIG)... |
| adc0 | 00 00 00 00 1a 20 20 20 20 63 61 73 65 20 6f 70 74 69 6f 6e 73 5b 3a 63 6f 6d 6d 61 6e 64 5d 00 | .........case.options[:command]. |
| ade0 | 00 00 0e 20 20 20 20 77 68 65 6e 20 3a 6c 69 73 74 00 00 00 29 20 20 20 20 20 20 6d 61 6e 61 67 | .......when.:list...)......manag |
| ae00 | 65 72 2e 6c 69 73 74 5f 70 6c 75 67 69 6e 73 28 6f 70 74 69 6f 6e 73 5b 3a 61 6c 6c 5d 29 00 00 | er.list_plugins(options[:all]).. |
| ae20 | 00 10 20 20 20 20 77 68 65 6e 20 3a 73 74 61 74 75 73 00 00 00 19 20 20 20 20 20 20 6d 61 6e 61 | ......when.:status..........mana |
| ae40 | 67 65 72 2e 73 68 6f 77 5f 73 74 61 74 75 73 00 00 00 10 20 20 20 20 77 68 65 6e 20 3a 66 72 65 | ger.show_status........when.:fre |
| ae60 | 65 7a 65 00 00 00 20 20 20 20 20 20 20 6d 61 6e 61 67 65 72 2e 63 72 65 61 74 65 5f 66 72 65 65 | eze..........manager.create_free |
| ae80 | 7a 65 5f 66 69 6c 65 00 00 00 11 20 20 20 20 77 68 65 6e 20 3a 72 65 73 74 6f 72 65 00 00 00 21 | ze_file........when.:restore...! |
| aea0 | 20 20 20 20 20 20 6d 61 6e 61 67 65 72 2e 72 65 73 74 6f 72 65 5f 66 72 6f 6d 5f 66 72 65 65 7a | ......manager.restore_from_freez |
| aec0 | 65 00 00 00 08 20 20 20 20 65 6c 73 65 00 00 00 2d 20 20 20 20 20 20 6d 61 6e 61 67 65 72 2e 73 | e........else...-......manager.s |
| aee0 | 79 6e 63 5f 70 6c 75 67 69 6e 73 28 6f 70 74 69 6f 6e 73 5b 3a 64 72 79 5f 72 75 6e 5d 29 00 00 | ync_plugins(options[:dry_run]).. |
| af00 | 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 1c 20 20 64 65 66 20 | ......end......end..........def. |
| af20 | 73 65 6c 66 2e 70 61 72 73 65 5f 63 6c 69 5f 6f 70 74 69 6f 6e 73 00 00 00 3c 20 20 20 20 6f 70 | self.parse_cli_options...<....op |
| af40 | 74 69 6f 6e 73 20 3d 20 7b 20 63 6f 6d 6d 61 6e 64 3a 20 3a 73 79 6e 63 2c 20 64 72 79 5f 72 75 | tions.=.{.command:.:sync,.dry_ru |
| af60 | 6e 3a 20 66 61 6c 73 65 2c 20 61 6c 6c 3a 20 66 61 6c 73 65 20 7d 00 00 00 00 00 00 00 1e 20 20 | n:.false,.all:.false.}.......... |
| af80 | 20 20 4f 70 74 69 6f 6e 50 61 72 73 65 72 2e 6e 65 77 20 64 6f 20 7c 6f 70 74 73 7c 00 00 00 2c | ..OptionParser.new.do.|opts|..., |
| afa0 | 20 20 20 20 20 20 6f 70 74 73 2e 62 61 6e 6e 65 72 20 3d 20 22 75 73 61 67 65 3a 20 23 7b 24 30 | ......opts.banner.=."usage:.#{$0 |
| afc0 | 7d 20 5b 6f 70 74 69 6f 6e 73 5d 22 00 00 00 17 20 20 20 20 20 20 6f 70 74 73 2e 73 65 70 61 72 | }.[options]"..........opts.separ |
| afe0 | 61 74 6f 72 20 22 22 00 00 00 20 20 20 20 20 20 20 6f 70 74 73 2e 73 65 70 61 72 61 74 6f 72 20 | ator.""..........opts.separator. |
| b000 | 22 63 6f 6d 6d 61 6e 64 73 3a 22 00 00 00 00 00 00 00 3a 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e | "commands:".......:......opts.on |
| b020 | 28 22 2d 6c 22 2c 20 22 2d 2d 6c 69 73 74 22 2c 20 22 6c 69 73 74 20 69 6e 73 74 61 6c 6c 65 64 | ("-l",."--list",."list.installed |
| b040 | 20 70 6c 75 67 69 6e 73 22 29 20 64 6f 00 00 00 21 20 20 20 20 20 20 20 20 6f 70 74 69 6f 6e 73 | .plugins").do...!........options |
| b060 | 5b 3a 63 6f 6d 6d 61 6e 64 5d 20 3d 20 3a 6c 69 73 74 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 | [:command].=.:list..........end. |
| b080 | 00 00 00 00 00 00 38 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e 28 22 2d 73 22 2c 20 22 2d 2d 73 74 | ......8......opts.on("-s",."--st |
| b0a0 | 61 74 75 73 22 2c 20 22 73 68 6f 77 20 70 6c 75 67 69 6e 20 73 74 61 74 75 73 22 29 20 64 6f 00 | atus",."show.plugin.status").do. |
| b0c0 | 00 00 23 20 20 20 20 20 20 20 20 6f 70 74 69 6f 6e 73 5b 3a 63 6f 6d 6d 61 6e 64 5d 20 3d 20 3a | ..#........options[:command].=.: |
| b0e0 | 73 74 61 74 75 73 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 50 20 20 20 20 20 | status..........end.......P..... |
| b100 | 20 6f 70 74 73 2e 6f 6e 28 22 2d 66 22 2c 20 22 2d 2d 66 72 65 65 7a 65 22 2c 20 22 63 72 65 61 | .opts.on("-f",."--freeze",."crea |
| b120 | 74 65 20 61 20 66 72 65 65 7a 65 20 66 69 6c 65 20 77 69 74 68 20 63 75 72 72 65 6e 74 20 76 65 | te.a.freeze.file.with.current.ve |
| b140 | 72 73 69 6f 6e 73 22 29 20 64 6f 00 00 00 23 20 20 20 20 20 20 20 20 6f 70 74 69 6f 6e 73 5b 3a | rsions").do...#........options[: |
| b160 | 63 6f 6d 6d 61 6e 64 5d 20 3d 20 3a 66 72 65 65 7a 65 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 | command].=.:freeze..........end. |
| b180 | 00 00 00 00 00 00 48 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e 28 22 2d 72 22 2c 20 22 2d 2d 72 65 | ......H......opts.on("-r",."--re |
| b1a0 | 73 74 6f 72 65 22 2c 20 22 72 65 73 74 6f 72 65 20 76 65 72 73 69 6f 6e 73 20 66 72 6f 6d 20 66 | store",."restore.versions.from.f |
| b1c0 | 72 65 65 7a 65 20 66 69 6c 65 22 29 20 64 6f 00 00 00 24 20 20 20 20 20 20 20 20 6f 70 74 69 6f | reeze.file").do...$........optio |
| b1e0 | 6e 73 5b 3a 63 6f 6d 6d 61 6e 64 5d 20 3d 20 3a 72 65 73 74 6f 72 65 00 00 00 09 20 20 20 20 20 | ns[:command].=.:restore......... |
| b200 | 20 65 6e 64 00 00 00 00 00 00 00 49 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e 28 22 2d 2d 64 72 79 | .end.......I......opts.on("--dry |
| b220 | 2d 72 75 6e 22 2c 20 22 73 68 6f 77 20 77 68 61 74 20 77 6f 75 6c 64 20 62 65 20 64 6f 6e 65 20 | -run",."show.what.would.be.done. |
| b240 | 77 69 74 68 6f 75 74 20 64 6f 69 6e 67 20 69 74 22 29 20 64 6f 00 00 00 20 20 20 20 20 20 20 20 | without.doing.it").do........... |
| b260 | 20 6f 70 74 69 6f 6e 73 5b 3a 64 72 79 5f 72 75 6e 5d 20 3d 20 74 72 75 65 00 00 00 09 20 20 20 | .options[:dry_run].=.true....... |
| b280 | 20 20 20 65 6e 64 00 00 00 00 00 00 00 4b 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e 28 22 2d 61 22 | ...end.......K......opts.on("-a" |
| b2a0 | 2c 20 22 2d 2d 61 6c 6c 22 2c 20 22 73 68 6f 77 20 61 6c 6c 20 70 6c 75 67 69 6e 73 20 69 6e 63 | ,."--all",."show.all.plugins.inc |
| b2c0 | 6c 75 64 69 6e 67 20 63 6f 6d 6d 69 74 20 68 61 73 68 65 73 22 29 20 64 6f 00 00 00 1c 20 20 20 | luding.commit.hashes").do....... |
| b2e0 | 20 20 20 20 20 6f 70 74 69 6f 6e 73 5b 3a 61 6c 6c 5d 20 3d 20 74 72 75 65 00 00 00 09 20 20 20 | .....options[:all].=.true....... |
| b300 | 20 20 20 65 6e 64 00 00 00 00 00 00 00 3a 20 20 20 20 20 20 6f 70 74 73 2e 6f 6e 28 22 2d 68 22 | ...end.......:......opts.on("-h" |
| b320 | 2c 20 22 2d 2d 68 65 6c 70 22 2c 20 22 73 68 6f 77 20 74 68 69 73 20 68 65 6c 70 20 6d 65 73 73 | ,."--help",."show.this.help.mess |
| b340 | 61 67 65 22 29 20 64 6f 00 00 00 11 20 20 20 20 20 20 20 20 70 75 74 73 20 6f 70 74 73 00 00 00 | age").do............puts.opts... |
| b360 | 0c 20 20 20 20 20 20 20 20 65 78 69 74 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 0e 20 20 | .........exit..........end...... |
| b380 | 20 20 65 6e 64 2e 70 61 72 73 65 21 00 00 00 00 00 00 00 0b 20 20 20 20 6f 70 74 69 6f 6e 73 00 | ..end.parse!............options. |
| b3a0 | 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 23 20 20 64 65 66 20 73 79 6e 63 5f 70 6c 75 67 69 | .....end.......#..def.sync_plugi |
| b3c0 | 6e 73 28 64 72 79 5f 72 75 6e 20 3d 20 66 61 6c 73 65 29 00 00 00 44 20 20 20 20 77 61 6e 74 65 | ns(dry_run.=.false)...D....wante |
| b3e0 | 64 5f 6e 61 6d 65 73 20 3d 20 40 70 6c 75 67 69 6e 73 5f 6c 69 73 74 2e 6d 61 70 20 7b 20 7c 70 | d_names.=.@plugins_list.map.{.|p |
| b400 | 7c 20 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 70 29 20 7d 00 00 00 30 20 | |.plugin_name_from_url(p).}...0. |
| b420 | 20 20 20 69 6e 73 74 61 6c 6c 65 64 5f 6e 61 6d 65 73 20 3d 20 44 69 72 2e 63 68 69 6c 64 72 65 | ...installed_names.=.Dir.childre |
| b440 | 6e 28 40 70 6c 75 67 69 6e 73 5f 64 69 72 29 00 00 00 04 20 20 20 20 00 00 00 5f 20 20 20 20 74 | n(@plugins_dir)..........._....t |
| b460 | 6f 5f 69 6e 73 74 61 6c 6c 20 3d 20 40 70 6c 75 67 69 6e 73 5f 6c 69 73 74 2e 72 65 6a 65 63 74 | o_install.=.@plugins_list.reject |
| b480 | 20 7b 20 7c 70 7c 20 69 6e 73 74 61 6c 6c 65 64 5f 6e 61 6d 65 73 2e 69 6e 63 6c 75 64 65 3f 28 | .{.|p|.installed_names.include?( |
| b4a0 | 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 70 29 29 20 7d 00 00 00 30 20 20 | plugin_name_from_url(p)).}...0.. |
| b4c0 | 20 20 74 6f 5f 75 70 64 61 74 65 20 3d 20 69 6e 73 74 61 6c 6c 65 64 5f 6e 61 6d 65 73 2e 73 65 | ..to_update.=.installed_names.se |
| b4e0 | 6c 65 63 74 20 64 6f 20 7c 6e 61 6d 65 7c 00 00 00 5a 20 20 20 20 20 20 44 69 72 2e 65 78 69 73 | lect.do.|name|...Z......Dir.exis |
| b500 | 74 3f 28 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 29 20 26 26 | t?("#{@plugins_dir}/#{name}").&& |
| b520 | 20 46 69 6c 65 2e 65 78 69 73 74 3f 28 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b | .File.exist?("#{@plugins_dir}/#{ |
| b540 | 6e 61 6d 65 7d 2f 2e 67 69 74 22 29 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 50 20 20 20 20 74 | name}/.git")........end...P....t |
| b560 | 6f 5f 75 6e 69 6e 73 74 61 6c 6c 20 3d 20 69 6e 73 74 61 6c 6c 65 64 5f 6e 61 6d 65 73 2e 72 65 | o_uninstall.=.installed_names.re |
| b580 | 6a 65 63 74 20 7b 20 7c 6e 61 6d 65 7c 20 77 61 6e 74 65 64 5f 6e 61 6d 65 73 2e 69 6e 63 6c 75 | ject.{.|name|.wanted_names.inclu |
| b5a0 | 64 65 3f 28 6e 61 6d 65 29 20 7d 00 00 00 00 00 00 00 0e 20 20 20 20 69 66 20 64 72 79 5f 72 75 | de?(name).}............if.dry_ru |
| b5c0 | 6e 00 00 00 2e 20 20 20 20 20 20 70 75 74 73 20 22 64 72 79 20 72 75 6e 20 2d 20 77 6f 75 6c 64 | n..........puts."dry.run.-.would |
| b5e0 | 20 64 6f 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 3a 22 00 00 00 67 20 20 20 20 20 20 70 75 74 | .do.the.following:"...g......put |
| b600 | 73 20 22 20 20 69 6e 73 74 61 6c 6c 3a 20 23 7b 74 6f 5f 69 6e 73 74 61 6c 6c 2e 6d 61 70 20 7b | s."..install:.#{to_install.map.{ |
| b620 | 20 7c 70 7c 20 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 70 29 20 7d 2e 6a | .|p|.plugin_name_from_url(p).}.j |
| b640 | 6f 69 6e 28 27 2c 20 27 29 7d 22 20 69 66 20 74 6f 5f 69 6e 73 74 61 6c 6c 2e 61 6e 79 3f 00 00 | oin(',.')}".if.to_install.any?.. |
| b660 | 00 40 20 20 20 20 20 20 70 75 74 73 20 22 20 20 75 70 64 61 74 65 3a 20 23 7b 74 6f 5f 75 70 64 | .@......puts."..update:.#{to_upd |
| b680 | 61 74 65 2e 6a 6f 69 6e 28 27 2c 20 27 29 7d 22 20 69 66 20 74 6f 5f 75 70 64 61 74 65 2e 61 6e | ate.join(',.')}".if.to_update.an |
| b6a0 | 79 3f 00 00 00 49 20 20 20 20 20 20 70 75 74 73 20 22 20 20 75 6e 69 6e 73 74 61 6c 6c 3a 20 23 | y?...I......puts."..uninstall:.# |
| b6c0 | 7b 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e 6a 6f 69 6e 28 27 2c 20 27 29 7d 22 20 69 66 20 74 6f | {to_uninstall.join(',.')}".if.to |
| b6e0 | 5f 75 6e 69 6e 73 74 61 6c 6c 2e 61 6e 79 3f 00 00 00 45 20 20 20 20 20 20 69 66 20 74 6f 5f 69 | _uninstall.any?...E......if.to_i |
| b700 | 6e 73 74 61 6c 6c 2e 65 6d 70 74 79 3f 20 26 26 20 74 6f 5f 75 70 64 61 74 65 2e 65 6d 70 74 79 | nstall.empty?.&&.to_update.empty |
| b720 | 3f 20 26 26 20 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e 65 6d 70 74 79 3f 00 00 00 1e 20 20 20 20 | ?.&&.to_uninstall.empty?........ |
| b740 | 20 20 20 20 70 75 74 73 20 22 20 20 6e 6f 74 68 69 6e 67 20 74 6f 20 64 6f 22 00 00 00 09 20 20 | ....puts."..nothing.to.do"...... |
| b760 | 20 20 20 20 65 6e 64 00 00 00 0c 20 20 20 20 20 20 72 65 74 75 72 6e 00 00 00 07 20 20 20 20 65 | ....end..........return........e |
| b780 | 6e 64 00 00 00 00 00 00 00 18 20 20 20 20 69 66 20 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e 61 6e | nd............if.to_uninstall.an |
| b7a0 | 79 3f 00 00 00 3b 20 20 20 20 20 20 70 75 74 73 20 22 75 6e 69 6e 73 74 61 6c 6c 69 6e 67 20 23 | y?...;......puts."uninstalling.# |
| b7c0 | 7b 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e 73 69 7a 65 7d 20 70 6c 75 67 69 6e 28 73 29 2e 2e 2e | {to_uninstall.size}.plugin(s)... |
| b7e0 | 22 00 00 00 21 20 20 20 20 20 20 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e 65 61 63 68 20 64 6f 20 | "...!......to_uninstall.each.do. |
| b800 | 7c 6e 61 6d 65 7c 00 00 00 2e 20 20 20 20 20 20 20 20 74 61 72 67 65 74 5f 64 69 72 20 3d 20 22 | |name|............target_dir.=." |
| b820 | 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 00 00 00 21 20 20 20 20 | #{@plugins_dir}/#{name}"...!.... |
| b840 | 20 20 20 20 69 66 20 44 69 72 2e 65 78 69 73 74 3f 28 74 61 72 67 65 74 5f 64 69 72 29 00 00 00 | ....if.Dir.exist?(target_dir)... |
| b860 | 25 20 20 20 20 20 20 20 20 20 20 46 69 6c 65 55 74 69 6c 73 2e 72 6d 5f 72 66 28 74 61 72 67 65 | %..........FileUtils.rm_rf(targe |
| b880 | 74 5f 64 69 72 29 00 00 00 22 20 20 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 72 65 6d 6f | t_dir)..."..........puts."..remo |
| b8a0 | 76 65 64 20 23 7b 6e 61 6d 65 7d 22 00 00 00 2a 20 20 20 20 20 20 20 20 20 20 40 73 74 61 74 65 | ved.#{name}"...*..........@state |
| b8c0 | 5b 22 69 6e 73 74 61 6c 6c 65 64 22 5d 2e 64 65 6c 65 74 65 28 6e 61 6d 65 29 00 00 00 0b 20 20 | ["installed"].delete(name)...... |
| b8e0 | 20 20 20 20 20 20 65 6e 64 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e | ......end..........end........en |
| b900 | 64 00 00 00 00 00 00 00 16 20 20 20 20 69 66 20 74 6f 5f 69 6e 73 74 61 6c 6c 2e 61 6e 79 3f 00 | d............if.to_install.any?. |
| b920 | 00 00 37 20 20 20 20 20 20 70 75 74 73 20 22 69 6e 73 74 61 6c 6c 69 6e 67 20 23 7b 74 6f 5f 69 | ..7......puts."installing.#{to_i |
| b940 | 6e 73 74 61 6c 6c 2e 73 69 7a 65 7d 20 70 6c 75 67 69 6e 28 73 29 2e 2e 2e 22 00 00 00 22 20 20 | nstall.size}.plugin(s)..."...".. |
| b960 | 20 20 20 20 69 6e 73 74 61 6c 6c 5f 70 61 72 61 6c 6c 65 6c 28 74 6f 5f 69 6e 73 74 61 6c 6c 29 | ....install_parallel(to_install) |
| b980 | 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 15 20 20 20 20 69 66 20 74 6f 5f 75 70 64 | ........end............if.to_upd |
| b9a0 | 61 74 65 2e 61 6e 79 3f 00 00 00 34 20 20 20 20 20 20 70 75 74 73 20 22 75 70 64 61 74 69 6e 67 | ate.any?...4......puts."updating |
| b9c0 | 20 23 7b 74 6f 5f 75 70 64 61 74 65 2e 73 69 7a 65 7d 20 70 6c 75 67 69 6e 28 73 29 2e 2e 2e 22 | .#{to_update.size}.plugin(s)..." |
| b9e0 | 00 00 00 20 20 20 20 20 20 20 75 70 64 61 74 65 5f 70 61 72 61 6c 6c 65 6c 28 74 6f 5f 75 70 64 | ..........update_parallel(to_upd |
| ba00 | 61 74 65 29 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 43 20 20 20 20 69 66 20 74 6f | ate)........end.......C....if.to |
| ba20 | 5f 69 6e 73 74 61 6c 6c 2e 65 6d 70 74 79 3f 20 26 26 20 74 6f 5f 75 70 64 61 74 65 2e 65 6d 70 | _install.empty?.&&.to_update.emp |
| ba40 | 74 79 3f 20 26 26 20 74 6f 5f 75 6e 69 6e 73 74 61 6c 6c 2e 65 6d 70 74 79 3f 00 00 00 23 20 20 | ty?.&&.to_uninstall.empty?...#.. |
| ba60 | 20 20 20 20 70 75 74 73 20 22 61 6c 6c 20 70 6c 75 67 69 6e 73 20 61 72 65 20 73 79 6e 63 65 64 | ....puts."all.plugins.are.synced |
| ba80 | 22 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 04 20 20 20 20 00 00 00 0e 20 20 20 20 73 61 76 65 | "........end................save |
| baa0 | 5f 73 74 61 74 65 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 24 20 20 64 65 66 20 6c 69 73 | _state......end.......$..def.lis |
| bac0 | 74 5f 70 6c 75 67 69 6e 73 28 73 68 6f 77 5f 61 6c 6c 20 3d 20 66 61 6c 73 65 29 00 00 00 2f 20 | t_plugins(show_all.=.false).../. |
| bae0 | 20 20 20 69 6e 73 74 61 6c 6c 65 64 20 3d 20 44 69 72 2e 63 68 69 6c 64 72 65 6e 28 40 70 6c 75 | ...installed.=.Dir.children(@plu |
| bb00 | 67 69 6e 73 5f 64 69 72 29 2e 73 6f 72 74 00 00 00 45 20 20 20 20 6f 70 74 5f 70 6c 75 67 69 6e | gins_dir).sort...E....opt_plugin |
| bb20 | 73 20 3d 20 44 69 72 2e 63 68 69 6c 64 72 65 6e 28 40 6f 70 74 5f 64 69 72 29 2e 73 6f 72 74 20 | s.=.Dir.children(@opt_dir).sort. |
| bb40 | 69 66 20 44 69 72 2e 65 78 69 73 74 3f 28 40 6f 70 74 5f 64 69 72 29 00 00 00 00 00 00 00 43 20 | if.Dir.exist?(@opt_dir).......C. |
| bb60 | 20 20 20 69 66 20 69 6e 73 74 61 6c 6c 65 64 2e 65 6d 70 74 79 3f 20 26 26 20 28 6f 70 74 5f 70 | ...if.installed.empty?.&&.(opt_p |
| bb80 | 6c 75 67 69 6e 73 2e 6e 69 6c 3f 20 7c 7c 20 6f 70 74 5f 70 6c 75 67 69 6e 73 2e 65 6d 70 74 79 | lugins.nil?.||.opt_plugins.empty |
| bba0 | 3f 29 00 00 00 21 20 20 20 20 20 20 70 75 74 73 20 22 6e 6f 20 70 6c 75 67 69 6e 73 20 69 6e 73 | ?)...!......puts."no.plugins.ins |
| bbc0 | 74 61 6c 6c 65 64 22 00 00 00 08 20 20 20 20 65 6c 73 65 00 00 00 30 20 20 20 20 20 20 70 75 74 | talled"........else...0......put |
| bbe0 | 73 20 22 73 74 61 72 74 20 70 6c 75 67 69 6e 73 20 28 23 7b 69 6e 73 74 61 6c 6c 65 64 2e 63 6f | s."start.plugins.(#{installed.co |
| bc00 | 75 6e 74 7d 29 3a 22 00 00 00 20 20 20 20 20 20 20 69 6e 73 74 61 6c 6c 65 64 2e 65 61 63 68 20 | unt}):"..........installed.each. |
| bc20 | 64 6f 20 7c 70 6c 75 67 69 6e 7c 00 00 00 2d 20 20 20 20 20 20 20 20 64 69 73 70 6c 61 79 5f 70 | do.|plugin|...-........display_p |
| bc40 | 6c 75 67 69 6e 5f 69 6e 66 6f 28 70 6c 75 67 69 6e 2c 20 73 68 6f 77 5f 61 6c 6c 29 00 00 00 09 | lugin_info(plugin,.show_all).... |
| bc60 | 20 20 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 2b 20 20 20 20 20 20 69 66 20 6f 70 74 5f 70 6c | ......end.......+......if.opt_pl |
| bc80 | 75 67 69 6e 73 20 26 26 20 21 6f 70 74 5f 70 6c 75 67 69 6e 73 2e 65 6d 70 74 79 3f 00 00 00 0f | ugins.&&.!opt_plugins.empty?.... |
| bca0 | 20 20 20 20 20 20 20 20 70 75 74 73 20 22 22 00 00 00 32 20 20 20 20 20 20 20 20 70 75 74 73 20 | ........puts.""...2........puts. |
| bcc0 | 22 6f 70 74 20 70 6c 75 67 69 6e 73 20 28 23 7b 6f 70 74 5f 70 6c 75 67 69 6e 73 2e 63 6f 75 6e | "opt.plugins.(#{opt_plugins.coun |
| bce0 | 74 7d 29 3a 22 00 00 00 24 20 20 20 20 20 20 20 20 6f 70 74 5f 70 6c 75 67 69 6e 73 2e 65 61 63 | t}):"...$........opt_plugins.eac |
| bd00 | 68 20 64 6f 20 7c 70 6c 75 67 69 6e 7c 00 00 00 2f 20 20 20 20 20 20 20 20 20 20 64 69 73 70 6c | h.do.|plugin|.../..........displ |
| bd20 | 61 79 5f 70 6c 75 67 69 6e 5f 69 6e 66 6f 28 70 6c 75 67 69 6e 2c 20 73 68 6f 77 5f 61 6c 6c 29 | ay_plugin_info(plugin,.show_all) |
| bd40 | 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 00 | ............end..........end.... |
| bd60 | 00 00 00 5c 20 20 20 20 20 20 75 6e 69 6e 73 74 61 6c 6c 65 64 20 3d 20 40 70 6c 75 67 69 6e 73 | ...\......uninstalled.=.@plugins |
| bd80 | 5f 6c 69 73 74 2e 72 65 6a 65 63 74 20 7b 20 7c 70 7c 20 69 6e 73 74 61 6c 6c 65 64 2e 69 6e 63 | _list.reject.{.|p|.installed.inc |
| bda0 | 6c 75 64 65 3f 28 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 70 29 29 20 7d | lude?(plugin_name_from_url(p)).} |
| bdc0 | 00 00 00 1f 20 20 20 20 20 20 75 6e 6c 65 73 73 20 75 6e 69 6e 73 74 61 6c 6c 65 64 2e 65 6d 70 | ..........unless.uninstalled.emp |
| bde0 | 74 79 3f 00 00 00 0f 20 20 20 20 20 20 20 20 70 75 74 73 20 22 22 00 00 00 33 20 20 20 20 20 20 | ty?............puts.""...3...... |
| be00 | 20 20 70 75 74 73 20 22 70 6c 75 67 69 6e 73 20 69 6e 20 63 6f 6e 66 69 67 20 62 75 74 20 6e 6f | ..puts."plugins.in.config.but.no |
| be20 | 74 20 69 6e 73 74 61 6c 6c 65 64 3a 22 00 00 00 24 20 20 20 20 20 20 20 20 75 6e 69 6e 73 74 61 | t.installed:"...$........uninsta |
| be40 | 6c 6c 65 64 2e 65 61 63 68 20 64 6f 20 7c 70 6c 75 67 69 6e 7c 00 00 00 34 20 20 20 20 20 20 20 | lled.each.do.|plugin|...4....... |
| be60 | 20 20 20 70 75 74 73 20 22 20 20 2d 20 23 7b 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f | ...puts."..-.#{plugin_name_from_ |
| be80 | 75 72 6c 28 70 6c 75 67 69 6e 29 7d 22 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 09 | url(plugin)}"............end.... |
| bea0 | 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 | ......end........end......end... |
| bec0 | 00 00 00 00 11 20 20 64 65 66 20 73 68 6f 77 5f 73 74 61 74 75 73 00 00 00 2f 20 20 20 20 69 6e | .......def.show_status.../....in |
| bee0 | 73 74 61 6c 6c 65 64 20 3d 20 44 69 72 2e 63 68 69 6c 64 72 65 6e 28 40 70 6c 75 67 69 6e 73 5f | stalled.=.Dir.children(@plugins_ |
| bf00 | 64 69 72 29 2e 73 6f 72 74 00 00 00 00 00 00 00 19 20 20 20 20 70 75 74 73 20 22 70 6c 75 67 69 | dir).sort............puts."plugi |
| bf20 | 6e 20 73 74 61 74 75 73 3a 22 00 00 00 0b 20 20 20 20 70 75 74 73 20 22 22 00 00 00 40 20 20 20 | n.status:"........puts.""...@... |
| bf40 | 20 70 75 74 73 20 22 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 3a 20 23 7b 40 70 6c 75 67 69 6e 73 | .puts."configuration:.#{@plugins |
| bf60 | 5f 6c 69 73 74 2e 63 6f 75 6e 74 7d 20 70 6c 75 67 69 6e 73 20 64 65 66 69 6e 65 64 22 00 00 00 | _list.count}.plugins.defined"... |
| bf80 | 30 20 20 20 20 70 75 74 73 20 22 69 6e 73 74 61 6c 6c 65 64 3a 20 23 7b 69 6e 73 74 61 6c 6c 65 | 0....puts."installed:.#{installe |
| bfa0 | 64 2e 63 6f 75 6e 74 7d 20 70 6c 75 67 69 6e 73 22 00 00 00 0b 20 20 20 20 70 75 74 73 20 22 22 | d.count}.plugins"........puts."" |
| bfc0 | 00 00 00 00 00 00 00 11 20 20 20 20 6f 75 74 64 61 74 65 64 20 3d 20 5b 5d 00 00 00 1c 20 20 20 | ............outdated.=.[]....... |
| bfe0 | 20 69 6e 73 74 61 6c 6c 65 64 2e 65 61 63 68 20 64 6f 20 7c 6e 61 6d 65 7c 00 00 00 26 20 20 20 | .installed.each.do.|name|...&... |
| c000 | 20 20 20 70 61 74 68 20 3d 20 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d | ...path.=."#{@plugins_dir}/#{nam |
| c020 | 65 7d 22 00 00 00 2d 20 20 20 20 20 20 6e 65 78 74 20 75 6e 6c 65 73 73 20 46 69 6c 65 2e 65 78 | e}"...-......next.unless.File.ex |
| c040 | 69 73 74 3f 28 22 23 7b 70 61 74 68 7d 2f 2e 67 69 74 22 29 00 00 00 00 00 00 00 18 20 20 20 20 | ist?("#{path}/.git")............ |
| c060 | 20 20 44 69 72 2e 63 68 64 69 72 28 70 61 74 68 29 20 64 6f 00 00 00 3d 20 20 20 20 20 20 20 20 | ..Dir.chdir(path).do...=........ |
| c080 | 63 75 72 72 65 6e 74 5f 68 61 73 68 20 3d 20 60 67 69 74 20 72 65 76 2d 70 61 72 73 65 20 48 45 | current_hash.=.`git.rev-parse.HE |
| c0a0 | 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 4f 20 20 20 20 20 20 20 | AD.2>/dev/null`.strip...O....... |
| c0c0 | 20 72 65 6d 6f 74 65 5f 68 61 73 68 20 3d 20 60 67 69 74 20 6c 73 2d 72 65 6d 6f 74 65 20 6f 72 | .remote_hash.=.`git.ls-remote.or |
| c0e0 | 69 67 69 6e 20 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 2e 73 70 6c | igin.HEAD.2>/dev/null`.strip.spl |
| c100 | 69 74 2e 66 69 72 73 74 00 00 00 00 00 00 00 35 20 20 20 20 20 20 20 20 69 66 20 72 65 6d 6f 74 | it.first.......5........if.remot |
| c120 | 65 5f 68 61 73 68 20 26 26 20 63 75 72 72 65 6e 74 5f 68 61 73 68 20 21 3d 20 72 65 6d 6f 74 65 | e_hash.&&.current_hash.!=.remote |
| c140 | 5f 68 61 73 68 00 00 00 1a 20 20 20 20 20 20 20 20 20 20 6f 75 74 64 61 74 65 64 20 3c 3c 20 6e | _hash..............outdated.<<.n |
| c160 | 61 6d 65 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 | ame............end..........end. |
| c180 | 00 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 1a 20 20 20 20 75 6e 6c 65 73 73 20 6f 75 74 | .......end............unless.out |
| c1a0 | 64 61 74 65 64 2e 65 6d 70 74 79 3f 00 00 00 1e 20 20 20 20 20 20 70 75 74 73 20 22 6f 75 74 64 | dated.empty?..........puts."outd |
| c1c0 | 61 74 65 64 20 70 6c 75 67 69 6e 73 3a 22 00 00 00 31 20 20 20 20 20 20 6f 75 74 64 61 74 65 64 | ated.plugins:"...1......outdated |
| c1e0 | 2e 65 61 63 68 20 7b 20 7c 6e 61 6d 65 7c 20 70 75 74 73 20 22 20 20 2d 20 23 7b 6e 61 6d 65 7d | .each.{.|name|.puts."..-.#{name} |
| c200 | 22 20 7d 00 00 00 0d 20 20 20 20 20 20 70 75 74 73 20 22 22 00 00 00 07 20 20 20 20 65 6e 64 00 | ".}..........puts.""........end. |
| c220 | 00 00 00 00 00 00 1c 20 20 20 20 69 6e 73 74 61 6c 6c 65 64 2e 65 61 63 68 20 64 6f 20 7c 6e 61 | ...........installed.each.do.|na |
| c240 | 6d 65 7c 00 00 00 26 20 20 20 20 20 20 70 61 74 68 20 3d 20 22 23 7b 40 70 6c 75 67 69 6e 73 5f | me|...&......path.=."#{@plugins_ |
| c260 | 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 00 00 00 24 20 20 20 20 20 20 69 66 20 46 69 6c 65 2e 65 | dir}/#{name}"...$......if.File.e |
| c280 | 78 69 73 74 3f 28 22 23 7b 70 61 74 68 7d 2f 2e 67 69 74 22 29 00 00 00 1a 20 20 20 20 20 20 20 | xist?("#{path}/.git")........... |
| c2a0 | 20 44 69 72 2e 63 68 64 69 72 28 70 61 74 68 29 20 64 6f 00 00 00 43 20 20 20 20 20 20 20 20 20 | .Dir.chdir(path).do...C......... |
| c2c0 | 20 6c 61 73 74 5f 63 6f 6d 6d 69 74 20 3d 20 60 67 69 74 20 6c 6f 67 20 2d 31 20 2d 2d 66 6f 72 | .last_commit.=.`git.log.-1.--for |
| c2e0 | 6d 61 74 3d 25 63 72 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 4e 20 20 | mat=%cr.2>/dev/null`.strip...N.. |
| c300 | 20 20 20 20 20 20 20 20 63 75 72 72 65 6e 74 5f 62 72 61 6e 63 68 20 3d 20 60 67 69 74 20 72 65 | ........current_branch.=.`git.re |
| c320 | 76 2d 70 61 72 73 65 20 2d 2d 61 62 62 72 65 76 2d 72 65 66 20 48 45 41 44 20 32 3e 2f 64 65 76 | v-parse.--abbrev-ref.HEAD.2>/dev |
| c340 | 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 47 20 20 20 20 20 20 20 20 20 20 63 75 72 72 65 6e | /null`.strip...G..........curren |
| c360 | 74 5f 68 61 73 68 20 3d 20 60 67 69 74 20 72 65 76 2d 70 61 72 73 65 20 2d 2d 73 68 6f 72 74 20 | t_hash.=.`git.rev-parse.--short. |
| c380 | 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 2a 20 20 20 20 20 | HEAD.2>/dev/null`.strip...*..... |
| c3a0 | 20 20 20 20 20 70 75 74 73 20 22 23 7b 6e 61 6d 65 7d 20 28 23 7b 63 75 72 72 65 6e 74 5f 68 61 | .....puts."#{name}.(#{current_ha |
| c3c0 | 73 68 7d 29 22 00 00 00 2c 20 20 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 62 72 61 6e 63 | sh})"...,..........puts."..branc |
| c3e0 | 68 3a 20 23 7b 63 75 72 72 65 6e 74 5f 62 72 61 6e 63 68 7d 22 00 00 00 44 20 20 20 20 20 20 20 | h:.#{current_branch}"...D....... |
| c400 | 20 20 20 70 75 74 73 20 22 20 20 75 70 64 61 74 65 64 3a 20 23 7b 6c 61 73 74 5f 63 6f 6d 6d 69 | ...puts."..updated:.#{last_commi |
| c420 | 74 7d 22 20 75 6e 6c 65 73 73 20 6c 61 73 74 5f 63 6f 6d 6d 69 74 2e 65 6d 70 74 79 3f 00 00 00 | t}".unless.last_commit.empty?... |
| c440 | 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 0a 20 20 20 20 20 20 65 6c 73 65 00 00 00 28 20 20 | .........end..........else...(.. |
| c460 | 20 20 20 20 20 20 70 75 74 73 20 22 23 7b 6e 61 6d 65 7d 20 28 6e 6f 74 20 67 69 74 2d 6d 61 6e | ......puts."#{name}.(not.git-man |
| c480 | 61 67 65 64 29 22 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 0d 20 20 20 20 20 20 70 75 74 | aged)"..........end..........put |
| c4a0 | 73 20 22 22 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 18 | s.""........end......end........ |
| c4c0 | 20 20 64 65 66 20 63 72 65 61 74 65 5f 66 72 65 65 7a 65 5f 66 69 6c 65 00 00 00 14 20 20 20 20 | ..def.create_freeze_file........ |
| c4e0 | 66 72 65 65 7a 65 5f 64 61 74 61 20 3d 20 7b 7d 00 00 00 00 00 00 00 2d 20 20 20 20 44 69 72 2e | freeze_data.=.{}.......-....Dir. |
| c500 | 63 68 69 6c 64 72 65 6e 28 40 70 6c 75 67 69 6e 73 5f 64 69 72 29 2e 65 61 63 68 20 64 6f 20 7c | children(@plugins_dir).each.do.| |
| c520 | 6e 61 6d 65 7c 00 00 00 26 20 20 20 20 20 20 70 61 74 68 20 3d 20 22 23 7b 40 70 6c 75 67 69 6e | name|...&......path.=."#{@plugin |
| c540 | 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 00 00 00 2d 20 20 20 20 20 20 6e 65 78 74 20 75 6e | s_dir}/#{name}"...-......next.un |
| c560 | 6c 65 73 73 20 46 69 6c 65 2e 65 78 69 73 74 3f 28 22 23 7b 70 61 74 68 7d 2f 2e 67 69 74 22 29 | less.File.exist?("#{path}/.git") |
| c580 | 00 00 00 00 00 00 00 18 20 20 20 20 20 20 44 69 72 2e 63 68 64 69 72 28 70 61 74 68 29 20 64 6f | ..............Dir.chdir(path).do |
| c5a0 | 00 00 00 3c 20 20 20 20 20 20 20 20 63 6f 6d 6d 69 74 5f 68 61 73 68 20 3d 20 60 67 69 74 20 72 | ...<........commit_hash.=.`git.r |
| c5c0 | 65 76 2d 70 61 72 73 65 20 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 | ev-parse.HEAD.2>/dev/null`.strip |
| c5e0 | 00 00 00 41 20 20 20 20 20 20 20 20 66 72 65 65 7a 65 5f 64 61 74 61 5b 6e 61 6d 65 5d 20 3d 20 | ...A........freeze_data[name].=. |
| c600 | 63 6f 6d 6d 69 74 5f 68 61 73 68 20 75 6e 6c 65 73 73 20 63 6f 6d 6d 69 74 5f 68 61 73 68 2e 65 | commit_hash.unless.commit_hash.e |
| c620 | 6d 70 74 79 3f 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 | mpty?..........end........end... |
| c640 | 00 00 00 00 4b 20 20 20 20 66 72 65 65 7a 65 5f 66 69 6c 65 20 3d 20 22 73 63 69 6f 6e 5f 66 72 | ....K....freeze_file.=."scion_fr |
| c660 | 65 65 7a 65 5f 23 7b 54 69 6d 65 2e 6e 6f 77 2e 73 74 72 66 74 69 6d 65 28 27 25 59 25 6d 25 64 | eeze_#{Time.now.strftime('%Y%m%d |
| c680 | 5f 25 48 25 4d 25 53 27 29 7d 2e 6a 73 6f 6e 22 00 00 00 3e 20 20 20 20 46 69 6c 65 2e 77 72 69 | _%H%M%S')}.json"...>....File.wri |
| c6a0 | 74 65 28 66 72 65 65 7a 65 5f 66 69 6c 65 2c 20 4a 53 4f 4e 2e 70 72 65 74 74 79 5f 67 65 6e 65 | te(freeze_file,.JSON.pretty_gene |
| c6c0 | 72 61 74 65 28 66 72 65 65 7a 65 5f 64 61 74 61 29 29 00 00 00 2e 20 20 20 20 70 75 74 73 20 22 | rate(freeze_data))........puts." |
| c6e0 | 66 72 65 65 7a 65 20 66 69 6c 65 20 63 72 65 61 74 65 64 3a 20 23 7b 66 72 65 65 7a 65 5f 66 69 | freeze.file.created:.#{freeze_fi |
| c700 | 6c 65 7d 22 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 19 20 20 64 65 66 20 72 65 73 74 6f | le}"......end..........def.resto |
| c720 | 72 65 5f 66 72 6f 6d 5f 66 72 65 65 7a 65 00 00 00 3f 20 20 20 20 66 72 65 65 7a 65 5f 66 69 6c | re_from_freeze...?....freeze_fil |
| c740 | 65 73 20 3d 20 44 69 72 2e 67 6c 6f 62 28 22 73 63 69 6f 6e 5f 66 72 65 65 7a 65 5f 2a 2e 6a 73 | es.=.Dir.glob("scion_freeze_*.js |
| c760 | 6f 6e 22 29 2e 73 6f 72 74 2e 72 65 76 65 72 73 65 00 00 00 00 00 00 00 1a 20 20 20 20 69 66 20 | on").sort.reverse............if. |
| c780 | 66 72 65 65 7a 65 5f 66 69 6c 65 73 2e 65 6d 70 74 79 3f 00 00 00 22 20 20 20 20 20 20 70 75 74 | freeze_files.empty?..."......put |
| c7a0 | 73 20 22 6e 6f 20 66 72 65 65 7a 65 20 66 69 6c 65 73 20 66 6f 75 6e 64 22 00 00 00 0c 20 20 20 | s."no.freeze.files.found"....... |
| c7c0 | 20 20 20 72 65 74 75 72 6e 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 22 20 20 20 20 | ...return........end.......".... |
| c7e0 | 70 75 74 73 20 22 61 76 61 69 6c 61 62 6c 65 20 66 72 65 65 7a 65 20 66 69 6c 65 73 3a 22 00 00 | puts."available.freeze.files:".. |
| c800 | 00 3f 20 20 20 20 66 72 65 65 7a 65 5f 66 69 6c 65 73 2e 65 61 63 68 5f 77 69 74 68 5f 69 6e 64 | .?....freeze_files.each_with_ind |
| c820 | 65 78 20 7b 20 7c 66 2c 20 69 7c 20 70 75 74 73 20 22 20 20 23 7b 69 7d 3a 20 23 7b 66 7d 22 20 | ex.{.|f,.i|.puts."..#{i}:.#{f}". |
| c840 | 7d 00 00 00 41 20 20 20 20 70 72 69 6e 74 20 22 73 65 6c 65 63 74 20 66 69 6c 65 20 74 6f 20 72 | }...A....print."select.file.to.r |
| c860 | 65 73 74 6f 72 65 20 28 30 2d 23 7b 66 72 65 65 7a 65 5f 66 69 6c 65 73 2e 73 69 7a 65 20 2d 20 | estore.(0-#{freeze_files.size.-. |
| c880 | 31 7d 29 3a 20 22 00 00 00 1f 20 20 20 20 73 65 6c 65 63 74 69 6f 6e 20 3d 20 67 65 74 73 2e 63 | 1}):."........selection.=.gets.c |
| c8a0 | 68 6f 6d 70 2e 74 6f 5f 69 00 00 00 00 00 00 00 29 20 20 20 20 72 65 74 75 72 6e 20 75 6e 6c 65 | homp.to_i.......)....return.unle |
| c8c0 | 73 73 20 66 72 65 65 7a 65 5f 66 69 6c 65 73 5b 73 65 6c 65 63 74 69 6f 6e 5d 00 00 00 00 00 00 | ss.freeze_files[selection]...... |
| c8e0 | 00 40 20 20 20 20 66 72 65 65 7a 65 5f 64 61 74 61 20 3d 20 4a 53 4f 4e 2e 70 61 72 73 65 28 46 | .@....freeze_data.=.JSON.parse(F |
| c900 | 69 6c 65 2e 72 65 61 64 28 66 72 65 65 7a 65 5f 66 69 6c 65 73 5b 73 65 6c 65 63 74 69 6f 6e 5d | ile.read(freeze_files[selection] |
| c920 | 29 29 00 00 00 00 00 00 00 2b 20 20 20 20 66 72 65 65 7a 65 5f 64 61 74 61 2e 65 61 63 68 20 64 | )).......+....freeze_data.each.d |
| c940 | 6f 20 7c 6e 61 6d 65 2c 20 74 61 72 67 65 74 5f 68 61 73 68 7c 00 00 00 26 20 20 20 20 20 20 70 | o.|name,.target_hash|...&......p |
| c960 | 61 74 68 20 3d 20 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 00 | ath.=."#{@plugins_dir}/#{name}". |
| c980 | 00 00 38 20 20 20 20 20 20 69 66 20 44 69 72 2e 65 78 69 73 74 3f 28 70 61 74 68 29 20 26 26 20 | ..8......if.Dir.exist?(path).&&. |
| c9a0 | 46 69 6c 65 2e 65 78 69 73 74 3f 28 22 23 7b 70 61 74 68 7d 2f 2e 67 69 74 22 29 00 00 00 1a 20 | File.exist?("#{path}/.git")..... |
| c9c0 | 20 20 20 20 20 20 20 44 69 72 2e 63 68 64 69 72 28 70 61 74 68 29 20 64 6f 00 00 00 3f 20 20 20 | .......Dir.chdir(path).do...?... |
| c9e0 | 20 20 20 20 20 20 20 63 75 72 72 65 6e 74 5f 68 61 73 68 20 3d 20 60 67 69 74 20 72 65 76 2d 70 | .......current_hash.=.`git.rev-p |
| ca00 | 61 72 73 65 20 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 28 | arse.HEAD.2>/dev/null`.strip...( |
| ca20 | 20 20 20 20 20 20 20 20 20 20 69 66 20 63 75 72 72 65 6e 74 5f 68 61 73 68 20 21 3d 20 74 61 72 | ..........if.current_hash.!=.tar |
| ca40 | 67 65 74 5f 68 61 73 68 00 00 00 3f 20 20 20 20 20 20 20 20 20 20 20 20 70 75 74 73 20 22 72 65 | get_hash...?............puts."re |
| ca60 | 73 74 6f 72 69 6e 67 20 23 7b 6e 61 6d 65 7d 20 74 6f 20 23 7b 74 61 72 67 65 74 5f 68 61 73 68 | storing.#{name}.to.#{target_hash |
| ca80 | 5b 30 2e 2e 37 5d 7d 2e 2e 2e 22 00 00 00 4b 20 20 20 20 20 20 20 20 20 20 20 20 73 79 73 74 65 | [0..7]}..."...K............syste |
| caa0 | 6d 28 22 67 69 74 20 66 65 74 63 68 20 2d 2d 64 65 70 74 68 3d 31 20 6f 72 69 67 69 6e 20 23 7b | m("git.fetch.--depth=1.origin.#{ |
| cac0 | 74 61 72 67 65 74 5f 68 61 73 68 7d 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 22 29 00 00 00 3d 20 20 | target_hash}.2>/dev/null")...=.. |
| cae0 | 20 20 20 20 20 20 20 20 20 20 73 79 73 74 65 6d 28 22 67 69 74 20 63 68 65 63 6b 6f 75 74 20 23 | ..........system("git.checkout.# |
| cb00 | 7b 74 61 72 67 65 74 5f 68 61 73 68 7d 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 22 29 00 00 00 4a 20 | {target_hash}.2>/dev/null")...J. |
| cb20 | 20 20 20 20 20 20 20 20 20 20 20 72 75 6e 5f 74 72 65 65 73 69 74 74 65 72 5f 70 6f 73 74 5f 69 | ...........run_treesitter_post_i |
| cb40 | 6e 73 74 61 6c 6c 28 6e 61 6d 65 29 20 69 66 20 6e 61 6d 65 20 3d 3d 20 22 6e 76 69 6d 2d 74 72 | nstall(name).if.name.==."nvim-tr |
| cb60 | 65 65 73 69 74 74 65 72 22 00 00 00 0e 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 00 00 00 34 20 | eesitter"..............else...4. |
| cb80 | 20 20 20 20 20 20 20 20 20 20 20 70 75 74 73 20 22 23 7b 6e 61 6d 65 7d 20 61 6c 72 65 61 64 79 | ...........puts."#{name}.already |
| cba0 | 20 61 74 20 74 61 72 67 65 74 20 76 65 72 73 69 6f 6e 22 00 00 00 0d 20 20 20 20 20 20 20 20 20 | .at.target.version"............. |
| cbc0 | 20 65 6e 64 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 0a 20 20 20 20 20 20 65 6c 73 | .end............end..........els |
| cbe0 | 65 00 00 00 37 20 20 20 20 20 20 20 20 70 75 74 73 20 22 77 61 72 6e 69 6e 67 3a 20 23 7b 6e 61 | e...7........puts."warning:.#{na |
| cc00 | 6d 65 7d 20 6e 6f 74 20 69 6e 73 74 61 6c 6c 65 64 2c 20 73 6b 69 70 70 69 6e 67 22 00 00 00 09 | me}.not.installed,.skipping".... |
| cc20 | 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 | ......end........end......end... |
| cc40 | 00 00 00 00 09 20 20 70 72 69 76 61 74 65 00 00 00 00 00 00 00 1e 20 20 64 65 66 20 65 6e 73 75 | .......private..........def.ensu |
| cc60 | 72 65 5f 64 69 72 65 63 74 6f 72 69 65 73 5f 65 78 69 73 74 00 00 00 2a 20 20 20 20 5b 40 70 6c | re_directories_exist...*....[@pl |
| cc80 | 75 67 69 6e 73 5f 64 69 72 2c 20 40 6f 70 74 5f 64 69 72 5d 2e 65 61 63 68 20 64 6f 20 7c 64 69 | ugins_dir,.@opt_dir].each.do.|di |
| cca0 | 72 7c 00 00 00 33 20 20 20 20 20 20 46 69 6c 65 55 74 69 6c 73 2e 6d 6b 64 69 72 5f 70 28 64 69 | r|...3......FileUtils.mkdir_p(di |
| ccc0 | 72 29 20 75 6e 6c 65 73 73 20 44 69 72 2e 65 78 69 73 74 3f 28 64 69 72 29 00 00 00 07 20 20 20 | r).unless.Dir.exist?(dir)....... |
| cce0 | 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 10 20 20 64 65 66 20 6c 6f 61 64 5f | .end......end..........def.load_ |
| cd00 | 73 74 61 74 65 00 00 00 28 20 20 20 20 40 73 74 61 74 65 20 3d 20 69 66 20 46 69 6c 65 2e 65 78 | state...(....@state.=.if.File.ex |
| cd20 | 69 73 74 3f 28 40 73 74 61 74 65 5f 66 69 6c 65 29 00 00 00 28 20 20 20 20 20 20 4a 53 4f 4e 2e | ist?(@state_file)...(......JSON. |
| cd40 | 70 61 72 73 65 28 46 69 6c 65 2e 72 65 61 64 28 40 73 74 61 74 65 5f 66 69 6c 65 29 29 00 00 00 | parse(File.read(@state_file))... |
| cd60 | 08 20 20 20 20 65 6c 73 65 00 00 00 31 20 20 20 20 20 20 7b 20 22 69 6e 73 74 61 6c 6c 65 64 22 | .....else...1......{."installed" |
| cd80 | 20 3d 3e 20 7b 7d 2c 20 22 6c 61 73 74 5f 75 70 64 61 74 65 22 20 3d 3e 20 6e 69 6c 20 7d 00 00 | .=>.{},."last_update".=>.nil.}.. |
| cda0 | 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 10 20 20 64 65 66 20 | ......end......end..........def. |
| cdc0 | 73 61 76 65 5f 73 74 61 74 65 00 00 00 39 20 20 20 20 46 69 6c 65 2e 77 72 69 74 65 28 40 73 74 | save_state...9....File.write(@st |
| cde0 | 61 74 65 5f 66 69 6c 65 2c 20 4a 53 4f 4e 2e 70 72 65 74 74 79 5f 67 65 6e 65 72 61 74 65 28 40 | ate_file,.JSON.pretty_generate(@ |
| ce00 | 73 74 61 74 65 29 29 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 1b 20 20 64 65 66 20 70 6c | state))......end..........def.pl |
| ce20 | 75 67 69 6e 5f 74 6f 5f 75 72 6c 28 70 6c 75 67 69 6e 29 00 00 00 2b 20 20 20 20 72 65 74 75 72 | ugin_to_url(plugin)...+....retur |
| ce40 | 6e 20 70 6c 75 67 69 6e 20 69 66 20 70 6c 75 67 69 6e 2e 69 6e 63 6c 75 64 65 3f 28 22 3a 2f 2f | n.plugin.if.plugin.include?(":// |
| ce60 | 22 29 00 00 00 22 20 20 20 20 22 68 74 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 23 7b | ")..."...."https://github.com/#{ |
| ce80 | 70 6c 75 67 69 6e 7d 22 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 27 20 20 64 65 66 20 70 | plugin}"......end.......'..def.p |
| cea0 | 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 75 72 6c 5f 6f 72 5f 73 70 65 63 29 | lugin_name_from_url(url_or_spec) |
| cec0 | 00 00 00 24 20 20 20 20 75 72 6c 20 3d 20 70 6c 75 67 69 6e 5f 74 6f 5f 75 72 6c 28 75 72 6c 5f | ...$....url.=.plugin_to_url(url_ |
| cee0 | 6f 72 5f 73 70 65 63 29 00 00 00 1e 20 20 20 20 46 69 6c 65 2e 62 61 73 65 6e 61 6d 65 28 75 72 | or_spec)........File.basename(ur |
| cf00 | 6c 2c 20 22 2e 67 69 74 22 29 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 21 20 20 64 65 66 | l,.".git")......end.......!..def |
| cf20 | 20 66 69 6e 64 5f 70 6c 75 67 69 6e 5f 69 6e 5f 63 6f 6e 66 69 67 28 6e 61 6d 65 29 00 00 00 22 | .find_plugin_in_config(name)..." |
| cf40 | 20 20 20 20 40 70 6c 75 67 69 6e 73 5f 6c 69 73 74 2e 66 69 6e 64 20 64 6f 20 7c 70 6c 75 67 69 | ....@plugins_list.find.do.|plugi |
| cf60 | 6e 7c 00 00 00 2a 20 20 20 20 20 20 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c | n|...*......plugin_name_from_url |
| cf80 | 28 70 6c 75 67 69 6e 29 20 3d 3d 20 6e 61 6d 65 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 | (plugin).==.name........end..... |
| cfa0 | 20 65 6e 64 00 00 00 00 00 00 00 1d 20 20 64 65 66 20 70 6c 75 67 69 6e 5f 69 6e 5f 63 6f 6e 66 | .end..........def.plugin_in_conf |
| cfc0 | 69 67 3f 28 6e 61 6d 65 29 00 00 00 25 20 20 20 20 21 66 69 6e 64 5f 70 6c 75 67 69 6e 5f 69 6e | ig?(name)...%....!find_plugin_in |
| cfe0 | 5f 63 6f 6e 66 69 67 28 6e 61 6d 65 29 2e 6e 69 6c 3f 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 | _config(name).nil?......end..... |
| d000 | 00 00 21 20 20 64 65 66 20 69 73 5f 74 72 65 65 73 69 74 74 65 72 5f 70 6c 75 67 69 6e 3f 28 6e | ..!..def.is_treesitter_plugin?(n |
| d020 | 61 6d 65 29 00 00 00 1d 20 20 20 20 6e 61 6d 65 20 3d 3d 20 22 6e 76 69 6d 2d 74 72 65 65 73 69 | ame)........name.==."nvim-treesi |
| d040 | 74 74 65 72 22 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 27 20 20 64 65 66 20 72 75 6e 5f | tter"......end.......'..def.run_ |
| d060 | 74 72 65 65 73 69 74 74 65 72 5f 70 6f 73 74 5f 69 6e 73 74 61 6c 6c 28 6e 61 6d 65 29 00 00 00 | treesitter_post_install(name)... |
| d080 | 2d 20 20 20 20 72 65 74 75 72 6e 20 75 6e 6c 65 73 73 20 69 73 5f 74 72 65 65 73 69 74 74 65 72 | -....return.unless.is_treesitter |
| d0a0 | 5f 70 6c 75 67 69 6e 3f 28 6e 61 6d 65 29 00 00 00 04 20 20 20 20 00 00 00 24 20 20 20 20 6e 76 | _plugin?(name)...........$....nv |
| d0c0 | 69 6d 5f 63 6d 64 20 3d 20 45 4e 56 5b 27 4e 56 49 4d 27 5d 20 7c 7c 20 27 6e 76 69 6d 27 00 00 | im_cmd.=.ENV['NVIM'].||.'nvim'.. |
| d0e0 | 00 33 20 20 20 20 70 6c 75 67 69 6e 5f 70 61 74 68 20 3d 20 22 23 7b 40 70 6c 75 67 69 6e 73 5f | .3....plugin_path.=."#{@plugins_ |
| d100 | 64 69 72 7d 2f 6e 76 69 6d 2d 74 72 65 65 73 69 74 74 65 72 22 00 00 00 04 20 20 20 20 00 00 00 | dir}/nvim-treesitter"........... |
| d120 | 1e 20 20 20 20 69 66 20 44 69 72 2e 65 78 69 73 74 3f 28 70 6c 75 67 69 6e 5f 70 61 74 68 29 00 | .....if.Dir.exist?(plugin_path). |
| d140 | 00 00 3a 20 20 20 20 20 20 6e 76 69 6d 5f 68 65 61 64 6c 65 73 73 5f 63 6d 64 20 3d 20 22 23 7b | ..:......nvim_headless_cmd.=."#{ |
| d160 | 6e 76 69 6d 5f 63 6d 64 7d 20 2d 2d 68 65 61 64 6c 65 73 73 20 2d 75 20 4e 4f 4e 45 22 00 00 00 | nvim_cmd}.--headless.-u.NONE"... |
| d180 | 47 20 20 20 20 20 20 6e 76 69 6d 5f 68 65 61 64 6c 65 73 73 5f 63 6d 64 20 3c 3c 20 22 20 2d 2d | G......nvim_headless_cmd.<<.".-- |
| d1a0 | 63 6d 64 20 5c 22 73 65 74 20 72 75 6e 74 69 6d 65 70 61 74 68 2b 3d 23 7b 70 6c 75 67 69 6e 5f | cmd.\"set.runtimepath+=#{plugin_ |
| d1c0 | 70 61 74 68 7d 5c 22 22 00 00 00 51 20 20 20 20 20 20 6e 76 69 6d 5f 68 65 61 64 6c 65 73 73 5f | path}\""...Q......nvim_headless_ |
| d1e0 | 63 6d 64 20 3c 3c 20 22 20 2d 63 20 27 6c 75 61 66 69 6c 65 20 23 7b 70 6c 75 67 69 6e 5f 70 61 | cmd.<<.".-c.'luafile.#{plugin_pa |
| d200 | 74 68 7d 2f 6c 75 61 2f 6e 76 69 6d 2d 74 72 65 65 73 69 74 74 65 72 2e 6c 75 61 27 22 00 00 00 | th}/lua/nvim-treesitter.lua'"... |
| d220 | 37 20 20 20 20 20 20 6e 76 69 6d 5f 68 65 61 64 6c 65 73 73 5f 63 6d 64 20 3c 3c 20 22 20 2d 63 | 7......nvim_headless_cmd.<<.".-c |
| d240 | 20 27 54 53 55 70 64 61 74 65 53 79 6e 63 27 20 2d 63 20 27 71 61 27 22 00 00 00 06 20 20 20 20 | .'TSUpdateSync'.-c.'qa'"........ |
| d260 | 20 20 00 00 00 35 20 20 20 20 20 20 70 75 74 73 20 22 20 20 72 75 6e 6e 69 6e 67 20 54 53 55 70 | .....5......puts."..running.TSUp |
| d280 | 64 61 74 65 53 79 6e 63 20 66 6f 72 20 74 72 65 65 73 69 74 74 65 72 2e 2e 2e 22 00 00 00 1f 20 | dateSync.for.treesitter..."..... |
| d2a0 | 20 20 20 20 20 73 79 73 74 65 6d 28 6e 76 69 6d 5f 68 65 61 64 6c 65 73 73 5f 63 6d 64 29 00 00 | .....system(nvim_headless_cmd).. |
| d2c0 | 00 06 20 20 20 20 20 20 00 00 00 14 20 20 20 20 20 20 69 66 20 24 3f 2e 73 75 63 63 65 73 73 3f | ..................if.$?.success? |
| d2e0 | 00 00 00 3a 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 74 72 65 65 73 69 74 74 65 72 20 70 | ...:........puts."..treesitter.p |
| d300 | 61 72 73 65 72 73 20 69 6e 73 74 61 6c 6c 65 64 20 73 75 63 63 65 73 73 66 75 6c 6c 79 22 00 00 | arsers.installed.successfully".. |
| d320 | 00 0a 20 20 20 20 20 20 65 6c 73 65 00 00 00 3e 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 | ........else...>........puts.".. |
| d340 | 77 61 72 6e 69 6e 67 3a 20 74 72 65 65 73 69 74 74 65 72 20 70 61 72 73 65 72 73 20 66 61 69 6c | warning:.treesitter.parsers.fail |
| d360 | 65 64 20 74 6f 20 69 6e 73 74 61 6c 6c 22 00 00 00 41 20 20 20 20 20 20 20 20 70 75 74 73 20 22 | ed.to.install"...A........puts." |
| d380 | 20 20 72 75 6e 20 3a 54 53 49 6e 73 74 61 6c 6c 53 79 6e 63 20 6f 72 20 3a 54 53 49 6e 73 74 61 | ..run.:TSInstallSync.or.:TSInsta |
| d3a0 | 6c 6c 20 69 6e 20 4e 65 6f 76 69 6d 20 6c 61 74 65 72 22 00 00 00 09 20 20 20 20 20 20 65 6e 64 | ll.in.Neovim.later"..........end |
| d3c0 | 00 00 00 08 20 20 20 20 65 6c 73 65 00 00 00 43 20 20 20 20 20 20 70 75 74 73 20 22 20 20 77 61 | ........else...C......puts."..wa |
| d3e0 | 72 6e 69 6e 67 3a 20 6e 76 69 6d 2d 74 72 65 65 73 69 74 74 65 72 20 6e 6f 74 20 66 6f 75 6e 64 | rning:.nvim-treesitter.not.found |
| d400 | 20 61 74 20 23 7b 70 6c 75 67 69 6e 5f 70 61 74 68 7d 22 00 00 00 07 20 20 20 20 65 6e 64 00 00 | .at.#{plugin_path}"........end.. |
| d420 | 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 23 20 20 64 65 66 20 69 6e 73 74 61 6c 6c 5f 73 69 6e | ....end.......#..def.install_sin |
| d440 | 67 6c 65 5f 70 6c 75 67 69 6e 28 70 6c 75 67 69 6e 29 00 00 00 1f 20 20 20 20 75 72 6c 20 3d 20 | gle_plugin(plugin)........url.=. |
| d460 | 70 6c 75 67 69 6e 5f 74 6f 5f 75 72 6c 28 70 6c 75 67 69 6e 29 00 00 00 27 20 20 20 20 6e 61 6d | plugin_to_url(plugin)...'....nam |
| d480 | 65 20 3d 20 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 70 6c 75 67 69 6e 29 | e.=.plugin_name_from_url(plugin) |
| d4a0 | 00 00 00 2b 20 20 20 20 74 61 72 67 65 74 5f 70 61 74 68 20 3d 20 22 23 7b 40 70 6c 75 67 69 6e | ...+....target_path.=."#{@plugin |
| d4c0 | 73 5f 64 69 72 7d 2f 23 7b 6e 61 6d 65 7d 22 00 00 00 00 00 00 00 1e 20 20 20 20 69 66 20 44 69 | s_dir}/#{name}"............if.Di |
| d4e0 | 72 2e 65 78 69 73 74 3f 28 74 61 72 67 65 74 5f 70 61 74 68 29 00 00 00 12 20 20 20 20 20 20 72 | r.exist?(target_path)..........r |
| d500 | 65 74 75 72 6e 20 66 61 6c 73 65 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 00 00 00 00 4b 20 20 | eturn.false........end.......K.. |
| d520 | 20 20 73 79 73 74 65 6d 28 22 67 69 74 20 63 6c 6f 6e 65 20 23 7b 75 72 6c 7d 20 23 7b 74 61 72 | ..system("git.clone.#{url}.#{tar |
| d540 | 67 65 74 5f 70 61 74 68 7d 20 2d 2d 64 65 70 74 68 3d 31 20 2d 2d 71 75 69 65 74 20 32 3e 2f 64 | get_path}.--depth=1.--quiet.2>/d |
| d560 | 65 76 2f 6e 75 6c 6c 22 29 00 00 00 00 00 00 00 1e 20 20 20 20 69 66 20 44 69 72 2e 65 78 69 73 | ev/null")............if.Dir.exis |
| d580 | 74 3f 28 74 61 72 67 65 74 5f 70 61 74 68 29 00 00 00 1f 20 20 20 20 20 20 44 69 72 2e 63 68 64 | t?(target_path)..........Dir.chd |
| d5a0 | 69 72 28 74 61 72 67 65 74 5f 70 61 74 68 29 20 64 6f 00 00 00 3c 20 20 20 20 20 20 20 20 63 6f | ir(target_path).do...<........co |
| d5c0 | 6d 6d 69 74 5f 68 61 73 68 20 3d 20 60 67 69 74 20 72 65 76 2d 70 61 72 73 65 20 48 45 41 44 20 | mmit_hash.=.`git.rev-parse.HEAD. |
| d5e0 | 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 2f 20 20 20 20 20 20 20 20 40 73 | 2>/dev/null`.strip.../........@s |
| d600 | 74 61 74 65 5b 22 69 6e 73 74 61 6c 6c 65 64 22 5d 5b 6e 61 6d 65 5d 20 3d 20 63 6f 6d 6d 69 74 | tate["installed"][name].=.commit |
| d620 | 5f 68 61 73 68 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 20 20 20 20 20 20 20 70 75 74 73 | _hash..........end..........puts |
| d640 | 20 22 20 20 69 6e 73 74 61 6c 6c 65 64 20 23 7b 6e 61 6d 65 7d 22 00 00 00 06 20 20 20 20 20 20 | ."..installed.#{name}".......... |
| d660 | 00 00 00 24 20 20 20 20 20 20 69 66 20 69 73 5f 74 72 65 65 73 69 74 74 65 72 5f 70 6c 75 67 69 | ...$......if.is_treesitter_plugi |
| d680 | 6e 3f 28 6e 61 6d 65 29 00 00 00 29 20 20 20 20 20 20 20 20 72 75 6e 5f 74 72 65 65 73 69 74 74 | n?(name)...)........run_treesitt |
| d6a0 | 65 72 5f 70 6f 73 74 5f 69 6e 73 74 61 6c 6c 28 6e 61 6d 65 29 00 00 00 09 20 20 20 20 20 20 65 | er_post_install(name)..........e |
| d6c0 | 6e 64 00 00 00 0a 20 20 20 20 20 20 74 72 75 65 00 00 00 08 20 20 20 20 65 6c 73 65 00 00 00 28 | nd..........true........else...( |
| d6e0 | 20 20 20 20 20 20 70 75 74 73 20 22 20 20 66 61 69 6c 65 64 20 74 6f 20 69 6e 73 74 61 6c 6c 20 | ......puts."..failed.to.install. |
| d700 | 23 7b 6e 61 6d 65 7d 22 00 00 00 0b 20 20 20 20 20 20 66 61 6c 73 65 00 00 00 07 20 20 20 20 65 | #{name}"..........false........e |
| d720 | 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 1f 20 20 64 65 66 20 69 6e 73 74 61 6c 6c | nd......end..........def.install |
| d740 | 5f 70 61 72 61 6c 6c 65 6c 28 70 6c 75 67 69 6e 73 29 00 00 00 59 20 20 20 20 74 72 65 65 73 69 | _parallel(plugins)...Y....treesi |
| d760 | 74 74 65 72 5f 70 6c 75 67 69 6e 20 3d 20 70 6c 75 67 69 6e 73 2e 66 69 6e 64 20 7b 20 7c 70 7c | tter_plugin.=.plugins.find.{.|p| |
| d780 | 20 70 6c 75 67 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 70 29 20 3d 3d 20 22 6e 76 69 | .plugin_name_from_url(p).==."nvi |
| d7a0 | 6d 2d 74 72 65 65 73 69 74 74 65 72 22 20 7d 00 00 00 57 20 20 20 20 6f 74 68 65 72 5f 70 6c 75 | m-treesitter".}...W....other_plu |
| d7c0 | 67 69 6e 73 20 3d 20 70 6c 75 67 69 6e 73 2e 72 65 6a 65 63 74 20 7b 20 7c 70 7c 20 70 6c 75 67 | gins.=.plugins.reject.{.|p|.plug |
| d7e0 | 69 6e 5f 6e 61 6d 65 5f 66 72 6f 6d 5f 75 72 6c 28 70 29 20 3d 3d 20 22 6e 76 69 6d 2d 74 72 65 | in_name_from_url(p).==."nvim-tre |
| d800 | 65 73 69 74 74 65 72 22 20 7d 00 00 00 04 20 20 20 20 00 00 00 18 20 20 20 20 69 66 20 74 72 65 | esitter".}................if.tre |
| d820 | 65 73 69 74 74 65 72 5f 70 6c 75 67 69 6e 00 00 00 2e 20 20 20 20 20 20 69 6e 73 74 61 6c 6c 5f | esitter_plugin..........install_ |
| d840 | 73 69 6e 67 6c 65 5f 70 6c 75 67 69 6e 28 74 72 65 65 73 69 74 74 65 72 5f 70 6c 75 67 69 6e 29 | single_plugin(treesitter_plugin) |
| d860 | 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 04 20 20 20 20 00 00 00 19 20 20 20 20 69 66 20 6f 74 | ........end................if.ot |
| d880 | 68 65 72 5f 70 6c 75 67 69 6e 73 2e 61 6e 79 3f 00 00 00 17 20 20 20 20 20 20 71 75 65 75 65 20 | her_plugins.any?..........queue. |
| d8a0 | 3d 20 51 75 65 75 65 2e 6e 65 77 00 00 00 2b 20 20 20 20 20 20 6f 74 68 65 72 5f 70 6c 75 67 69 | =.Queue.new...+......other_plugi |
| d8c0 | 6e 73 2e 65 61 63 68 20 7b 20 7c 70 7c 20 71 75 65 75 65 20 3c 3c 20 70 20 7d 00 00 00 06 20 20 | ns.each.{.|p|.queue.<<.p.}...... |
| d8e0 | 20 20 20 20 00 00 00 45 20 20 20 20 20 20 74 68 72 65 61 64 73 20 3d 20 28 31 2e 2e 5b 45 74 63 | .......E......threads.=.(1..[Etc |
| d900 | 2e 6e 70 72 6f 63 65 73 73 6f 72 73 2c 20 6f 74 68 65 72 5f 70 6c 75 67 69 6e 73 2e 73 69 7a 65 | .nprocessors,.other_plugins.size |
| d920 | 5d 2e 6d 69 6e 29 2e 6d 61 70 20 64 6f 00 00 00 15 20 20 20 20 20 20 20 20 54 68 72 65 61 64 2e | ].min).map.do............Thread. |
| d940 | 6e 65 77 20 64 6f 00 00 00 1d 20 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 21 71 75 65 75 65 | new.do..............while.!queue |
| d960 | 2e 65 6d 70 74 79 3f 00 00 00 2f 20 20 20 20 20 20 20 20 20 20 20 20 70 6c 75 67 69 6e 20 3d 20 | .empty?.../............plugin.=. |
| d980 | 71 75 65 75 65 2e 70 6f 70 28 74 72 75 65 29 20 72 65 73 63 75 65 20 6e 69 6c 00 00 00 33 20 20 | queue.pop(true).rescue.nil...3.. |
| d9a0 | 20 20 20 20 20 20 20 20 20 20 69 6e 73 74 61 6c 6c 5f 73 69 6e 67 6c 65 5f 70 6c 75 67 69 6e 28 | ..........install_single_plugin( |
| d9c0 | 70 6c 75 67 69 6e 29 20 69 66 20 70 6c 75 67 69 6e 00 00 00 0d 20 20 20 20 20 20 20 20 20 20 65 | plugin).if.plugin..............e |
| d9e0 | 6e 64 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 | nd............end..........end.. |
| da00 | 00 06 20 20 20 20 20 20 00 00 00 1a 20 20 20 20 20 20 74 68 72 65 61 64 73 2e 65 61 63 68 28 26 | ..................threads.each(& |
| da20 | 3a 6a 6f 69 6e 29 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 65 6e 64 00 00 00 00 00 00 | :join)........end......end...... |
| da40 | 00 20 20 20 64 65 66 20 75 70 64 61 74 65 5f 73 69 6e 67 6c 65 5f 70 6c 75 67 69 6e 28 6e 61 6d | ....def.update_single_plugin(nam |
| da60 | 65 29 00 00 00 24 20 20 20 20 70 61 74 68 20 3d 20 22 23 7b 40 70 6c 75 67 69 6e 73 5f 64 69 72 | e)...$....path.=."#{@plugins_dir |
| da80 | 7d 2f 23 7b 6e 61 6d 65 7d 22 00 00 00 04 20 20 20 20 00 00 00 16 20 20 20 20 44 69 72 2e 63 68 | }/#{name}"................Dir.ch |
| daa0 | 64 69 72 28 70 61 74 68 29 20 64 6f 00 00 00 3a 20 20 20 20 20 20 62 65 66 6f 72 65 5f 68 61 73 | dir(path).do...:......before_has |
| dac0 | 68 20 3d 20 60 67 69 74 20 72 65 76 2d 70 61 72 73 65 20 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e | h.=.`git.rev-parse.HEAD.2>/dev/n |
| dae0 | 75 6c 6c 60 2e 73 74 72 69 70 00 00 00 36 20 20 20 20 20 20 73 79 73 74 65 6d 28 22 67 69 74 20 | ull`.strip...6......system("git. |
| db00 | 70 75 6c 6c 20 2d 2d 64 65 70 74 68 3d 31 20 2d 2d 71 75 69 65 74 20 32 3e 2f 64 65 76 2f 6e 75 | pull.--depth=1.--quiet.2>/dev/nu |
| db20 | 6c 6c 22 29 00 00 00 39 20 20 20 20 20 20 61 66 74 65 72 5f 68 61 73 68 20 3d 20 60 67 69 74 20 | ll")...9......after_hash.=.`git. |
| db40 | 72 65 76 2d 70 61 72 73 65 20 48 45 41 44 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 2e 73 74 72 69 | rev-parse.HEAD.2>/dev/null`.stri |
| db60 | 70 00 00 00 06 20 20 20 20 20 20 00 00 00 22 20 20 20 20 20 20 69 66 20 62 65 66 6f 72 65 5f 68 | p............."......if.before_h |
| db80 | 61 73 68 20 21 3d 20 61 66 74 65 72 5f 68 61 73 68 00 00 00 2e 20 20 20 20 20 20 20 20 40 73 74 | ash.!=.after_hash............@st |
| dba0 | 61 74 65 5b 22 69 6e 73 74 61 6c 6c 65 64 22 5d 5b 6e 61 6d 65 5d 20 3d 20 61 66 74 65 72 5f 68 | ate["installed"][name].=.after_h |
| dbc0 | 61 73 68 00 00 00 4e 20 20 20 20 20 20 20 20 70 75 74 73 20 22 20 20 75 70 64 61 74 65 64 20 23 | ash...N........puts."..updated.# |
| dbe0 | 7b 6e 61 6d 65 7d 20 28 23 7b 62 65 66 6f 72 65 5f 68 61 73 68 5b 30 2e 2e 37 5d 7d 20 2d 3e 20 | {name}.(#{before_hash[0..7]}.->. |
| dc00 | 23 7b 61 66 74 65 72 5f 68 61 73 68 5b 30 2e 2e 37 5d 7d 29 22 00 00 00 08 20 20 20 20 20 20 20 | #{after_hash[0..7]})"........... |
| dc20 | 20 00 00 00 26 20 20 20 20 20 20 20 20 69 66 20 69 73 5f 74 72 65 65 73 69 74 74 65 72 5f 70 6c | ....&........if.is_treesitter_pl |
| dc40 | 75 67 69 6e 3f 28 6e 61 6d 65 29 00 00 00 2b 20 20 20 20 20 20 20 20 20 20 72 75 6e 5f 74 72 65 | ugin?(name)...+..........run_tre |
| dc60 | 65 73 69 74 74 65 72 5f 70 6f 73 74 5f 69 6e 73 74 61 6c 6c 28 6e 61 6d 65 29 00 00 00 0b 20 20 | esitter_post_install(name)...... |
| dc80 | 20 20 20 20 20 20 65 6e 64 00 00 00 0a 20 20 20 20 20 20 65 6c 73 65 00 00 00 2b 20 20 20 20 20 | ......end..........else...+..... |
| dca0 | 20 20 20 70 75 74 73 20 22 20 20 23 7b 6e 61 6d 65 7d 20 61 6c 72 65 61 64 79 20 75 70 20 74 6f | ...puts."..#{name}.already.up.to |
| dcc0 | 20 64 61 74 65 22 00 00 00 09 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 00 00 | .date"..........end........end.. |
| dce0 | 00 05 20 20 65 6e 64 00 00 00 00 00 00 00 1e 20 20 64 65 66 20 75 70 64 61 74 65 5f 70 61 72 61 | ....end..........def.update_para |
| dd00 | 6c 6c 65 6c 28 70 6c 75 67 69 6e 73 29 00 00 00 2c 20 20 20 20 74 72 65 65 73 69 74 74 65 72 5f | llel(plugins)...,....treesitter_ |
| dd20 | 66 69 72 73 74 20 3d 20 70 6c 75 67 69 6e 73 2e 73 6f 72 74 20 64 6f 20 7c 61 2c 62 7c 00 00 00 | first.=.plugins.sort.do.|a,b|... |
| dd40 | 1f 20 20 20 20 20 20 69 66 20 61 20 3d 3d 20 22 6e 76 69 6d 2d 74 72 65 65 73 69 74 74 65 72 22 | .......if.a.==."nvim-treesitter" |
| dd60 | 00 00 00 0a 20 20 20 20 20 20 20 20 2d 31 00 00 00 22 20 20 20 20 20 20 65 6c 73 69 66 20 62 20 | ............-1..."......elsif.b. |
| dd80 | 3d 3d 20 22 6e 76 69 6d 2d 74 72 65 65 73 69 74 74 65 72 22 00 00 00 09 20 20 20 20 20 20 20 20 | ==."nvim-treesitter"............ |
| dda0 | 31 00 00 00 0a 20 20 20 20 20 20 65 6c 73 65 00 00 00 09 20 20 20 20 20 20 20 20 30 00 00 00 09 | 1..........else............0.... |
| ddc0 | 20 20 20 20 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 04 20 20 20 20 00 00 00 15 | ......end........end............ |
| dde0 | 20 20 20 20 71 75 65 75 65 20 3d 20 51 75 65 75 65 2e 6e 65 77 00 00 00 2c 20 20 20 20 74 72 65 | ....queue.=.Queue.new...,....tre |
| de00 | 65 73 69 74 74 65 72 5f 66 69 72 73 74 2e 65 61 63 68 20 7b 20 7c 70 7c 20 71 75 65 75 65 20 3c | esitter_first.each.{.|p|.queue.< |
| de20 | 3c 20 70 20 7d 00 00 00 04 20 20 20 20 00 00 00 3d 20 20 20 20 74 68 72 65 61 64 73 20 3d 20 28 | <.p.}...........=....threads.=.( |
| de40 | 31 2e 2e 5b 45 74 63 2e 6e 70 72 6f 63 65 73 73 6f 72 73 2c 20 70 6c 75 67 69 6e 73 2e 73 69 7a | 1..[Etc.nprocessors,.plugins.siz |
| de60 | 65 5d 2e 6d 69 6e 29 2e 6d 61 70 20 64 6f 00 00 00 13 20 20 20 20 20 20 54 68 72 65 61 64 2e 6e | e].min).map.do..........Thread.n |
| de80 | 65 77 20 64 6f 00 00 00 1b 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 21 71 75 65 75 65 2e 65 6d | ew.do............while.!queue.em |
| dea0 | 70 74 79 3f 00 00 00 2d 20 20 20 20 20 20 20 20 20 20 70 6c 75 67 69 6e 20 3d 20 71 75 65 75 65 | pty?...-..........plugin.=.queue |
| dec0 | 2e 70 6f 70 28 74 72 75 65 29 20 72 65 73 63 75 65 20 6e 69 6c 00 00 00 30 20 20 20 20 20 20 20 | .pop(true).rescue.nil...0....... |
| dee0 | 20 20 20 75 70 64 61 74 65 5f 73 69 6e 67 6c 65 5f 70 6c 75 67 69 6e 28 70 6c 75 67 69 6e 29 20 | ...update_single_plugin(plugin). |
| df00 | 69 66 20 70 6c 75 67 69 6e 00 00 00 0b 20 20 20 20 20 20 20 20 65 6e 64 00 00 00 09 20 20 20 20 | if.plugin............end........ |
| df20 | 20 20 65 6e 64 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 04 20 20 20 20 00 00 00 18 20 20 20 20 | ..end........end................ |
| df40 | 74 68 72 65 61 64 73 2e 65 61 63 68 28 26 3a 6a 6f 69 6e 29 00 00 00 05 20 20 65 6e 64 00 00 00 | threads.each(&:join)......end... |
| df60 | 00 00 00 00 2b 20 20 64 65 66 20 64 69 73 70 6c 61 79 5f 70 6c 75 67 69 6e 5f 69 6e 66 6f 28 70 | ....+..def.display_plugin_info(p |
| df80 | 6c 75 67 69 6e 2c 20 73 68 6f 77 5f 61 6c 6c 29 00 00 00 29 20 20 20 20 69 6e 5f 63 6f 6e 66 69 | lugin,.show_all)...)....in_confi |
| dfa0 | 67 20 3d 20 70 6c 75 67 69 6e 5f 69 6e 5f 63 6f 6e 66 69 67 3f 28 70 6c 75 67 69 6e 29 00 00 00 | g.=.plugin_in_config?(plugin)... |
| dfc0 | 22 20 20 20 20 73 74 61 74 75 73 20 3d 20 69 6e 5f 63 6f 6e 66 69 67 20 3f 20 22 2b 22 20 3a 20 | "....status.=.in_config.?."+".:. |
| dfe0 | 22 2d 22 00 00 00 00 00 00 00 2e 20 20 20 20 69 66 20 73 68 6f 77 5f 61 6c 6c 20 26 26 20 40 73 | "-"............if.show_all.&&.@s |
| e000 | 74 61 74 65 5b 22 69 6e 73 74 61 6c 6c 65 64 22 5d 5b 70 6c 75 67 69 6e 5d 00 00 00 2e 20 20 20 | tate["installed"][plugin]....... |
| e020 | 20 20 20 68 61 73 68 20 3d 20 40 73 74 61 74 65 5b 22 69 6e 73 74 61 6c 6c 65 64 22 5d 5b 70 6c | ...hash.=.@state["installed"][pl |
| e040 | 75 67 69 6e 5d 5b 30 2e 2e 37 5d 00 00 00 2e 20 20 20 20 20 20 70 75 74 73 20 22 20 20 23 7b 73 | ugin][0..7]..........puts."..#{s |
| e060 | 74 61 74 75 73 7d 20 23 7b 70 6c 75 67 69 6e 7d 20 28 40 20 23 7b 68 61 73 68 7d 29 22 00 00 00 | tatus}.#{plugin}.(@.#{hash})"... |
| e080 | 08 20 20 20 20 65 6c 73 65 00 00 00 22 20 20 20 20 20 20 70 75 74 73 20 22 20 20 23 7b 73 74 61 | .....else..."......puts."..#{sta |
| e0a0 | 74 75 73 7d 20 23 7b 70 6c 75 67 69 6e 7d 22 00 00 00 07 20 20 20 20 65 6e 64 00 00 00 05 20 20 | tus}.#{plugin}"........end...... |
| e0c0 | 65 6e 64 00 00 00 03 65 6e 64 00 00 00 00 00 00 00 11 69 66 20 5f 5f 46 49 4c 45 5f 5f 20 3d 3d | end....end........if.__FILE__.== |
| e0e0 | 20 24 30 00 00 00 07 20 20 62 65 67 69 6e 00 00 00 11 20 20 20 20 72 65 71 75 69 72 65 20 27 65 | .$0......begin........require.'e |
| e100 | 74 63 27 00 00 00 15 20 20 20 20 50 6c 75 67 69 6e 4d 61 6e 61 67 65 72 2e 72 75 6e 00 00 00 12 | tc'........PluginManager.run.... |
| e120 | 20 20 72 65 73 63 75 65 20 49 6e 74 65 72 72 75 70 74 00 00 00 0b 20 20 20 20 70 75 74 73 20 22 | ..rescue.Interrupt........puts." |
| e140 | 22 00 00 00 1e 20 20 20 20 70 75 74 73 20 22 69 6e 74 65 72 72 75 70 74 65 64 20 62 79 20 75 73 | "........puts."interrupted.by.us |
| e160 | 65 72 22 00 00 00 0a 20 20 20 20 65 78 69 74 20 31 00 00 00 0d 20 20 72 65 73 63 75 65 20 3d 3e | er"........exit.1......rescue.=> |
| e180 | 20 65 00 00 00 1e 20 20 20 20 70 75 74 73 20 22 65 72 72 6f 72 3a 20 23 7b 65 2e 6d 65 73 73 61 | .e........puts."error:.#{e.messa |
| e1a0 | 67 65 7d 22 00 00 00 0a 20 20 20 20 65 78 69 74 20 31 00 00 00 05 20 20 65 6e 64 00 00 00 03 65 | ge}"........exit.1......end....e |
| e1c0 | 6e 64 35 81 f5 18 00 00 00 00 00 00 00 00 00 00 00 00 cc 01 00 00 00 00 00 00 01 00 00 00 00 00 | nd5............................. |
| e1e0 | 00 00 00 00 00 00 00 00 00 00 61 31 00 00 00 00 00 00 01 00 00 00 00 00 00 00 35 81 5f d0 00 00 | ..........a1..............5._... |
| e200 | 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 01 00 00 00 00 00 00 00 00 ff ff | ................................ |
| e220 | ff ff 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| e240 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| e260 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| e280 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| e2a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| e2c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| e2e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| e300 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| e320 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| e340 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| e360 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| e380 | 6a 00 59 9e 04 01 00 00 00 05 00 f5 18 00 00 01 20 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 | j.Y............................. |
| e3a0 | 0a 20 20 64 65 66 20 70 6c 75 67 f5 18 00 00 01 21 00 00 00 00 00 00 00 00 00 00 00 00 f5 18 00 | ...def.plug.....!............... |
| e3c0 | 00 00 8f 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 03 20 20 20 f5 18 00 00 00 90 00 00 00 00 | ................................ |
| e3e0 | 00 00 00 00 00 00 00 00 f5 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 f5 18 | ................................ |
| e400 | 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 35 81 f5 18 00 00 00 00 00 00 00 00 00 00 00 00 | ................5............... |
| e420 | 00 00 00 00 00 00 00 00 8f 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| e440 | f9 0f 00 00 00 00 00 00 f5 18 00 00 00 00 8f 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 91 00 | ................................ |
| e460 | 00 00 0a 00 00 00 f9 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff 0f 00 00 00 00 00 00 f5 18 | ................................ |
| e480 | 00 00 00 00 20 01 00 00 0a 00 00 00 00 00 00 00 00 00 00 00 71 00 00 00 03 00 00 00 f8 1f 00 00 | ....................q........... |
| e4a0 | 00 00 00 00 00 00 00 00 00 00 00 00 79 0a 00 00 00 00 00 00 35 81 e7 aa | ............y.......5... |