kanrisuru 0.13.0 → 0.16.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (282) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/README.md +5 -5
  4. data/kanrisuru.gemspec +7 -3
  5. data/lib/kanrisuru/command.rb +15 -1
  6. data/lib/kanrisuru/core/apt/commands/autoclean.rb +13 -0
  7. data/lib/kanrisuru/core/apt/commands/autoremove.rb +15 -0
  8. data/lib/kanrisuru/core/apt/commands/clean.rb +13 -0
  9. data/lib/kanrisuru/core/apt/commands/full_upgrade.rb +14 -0
  10. data/lib/kanrisuru/core/apt/commands/install.rb +22 -0
  11. data/lib/kanrisuru/core/apt/commands/list.rb +21 -0
  12. data/lib/kanrisuru/core/apt/commands/purge.rb +18 -0
  13. data/lib/kanrisuru/core/apt/commands/remove.rb +18 -0
  14. data/lib/kanrisuru/core/apt/commands/search.rb +18 -0
  15. data/lib/kanrisuru/core/apt/commands/show.rb +21 -0
  16. data/lib/kanrisuru/core/apt/commands/update.rb +14 -0
  17. data/lib/kanrisuru/core/apt/commands/upgrade.rb +14 -0
  18. data/lib/kanrisuru/core/apt/commands.rb +14 -0
  19. data/lib/kanrisuru/core/apt/parser.rb +6 -0
  20. data/lib/kanrisuru/core/apt/parsers/base.rb +51 -0
  21. data/lib/kanrisuru/core/apt/parsers/list.rb +28 -0
  22. data/lib/kanrisuru/core/apt/parsers/search.rb +32 -0
  23. data/lib/kanrisuru/core/apt/parsers/show.rb +90 -0
  24. data/lib/kanrisuru/core/apt/types.rb +36 -0
  25. data/lib/kanrisuru/core/apt.rb +4 -284
  26. data/lib/kanrisuru/core/archive/commands/tar.rb +126 -0
  27. data/lib/kanrisuru/core/archive/commands.rb +3 -0
  28. data/lib/kanrisuru/core/archive/types.rb +9 -0
  29. data/lib/kanrisuru/core/archive.rb +3 -121
  30. data/lib/kanrisuru/core/disk/commands/blkid.rb +35 -0
  31. data/lib/kanrisuru/core/disk/commands/df.rb +26 -0
  32. data/lib/kanrisuru/core/disk/commands/du.rb +24 -0
  33. data/lib/kanrisuru/core/disk/commands/lsblk.rb +49 -0
  34. data/lib/kanrisuru/core/disk/commands.rb +6 -0
  35. data/lib/kanrisuru/core/disk/constants.rb +9 -0
  36. data/lib/kanrisuru/core/disk/parser.rb +7 -0
  37. data/lib/kanrisuru/core/disk/parsers/blkid.rb +72 -0
  38. data/lib/kanrisuru/core/disk/parsers/df.rb +33 -0
  39. data/lib/kanrisuru/core/disk/parsers/du.rb +25 -0
  40. data/lib/kanrisuru/core/disk/parsers/lsblk.rb +96 -0
  41. data/lib/kanrisuru/core/disk/parsers/lsblk_version.rb +21 -0
  42. data/lib/kanrisuru/core/disk/types.rb +21 -0
  43. data/lib/kanrisuru/core/disk.rb +6 -290
  44. data/lib/kanrisuru/core/dmi/commands/dmi.rb +42 -0
  45. data/lib/kanrisuru/core/dmi/commands.rb +3 -0
  46. data/lib/kanrisuru/core/dmi/parser.rb +3 -0
  47. data/lib/kanrisuru/core/dmi/parsers/dmi.rb +149 -0
  48. data/lib/kanrisuru/core/dmi/types.rb +361 -0
  49. data/lib/kanrisuru/core/dmi.rb +4 -522
  50. data/lib/kanrisuru/core/file/commands/chmod.rb +29 -0
  51. data/lib/kanrisuru/core/file/commands/chown.rb +35 -0
  52. data/lib/kanrisuru/core/file/commands/copy.rb +54 -0
  53. data/lib/kanrisuru/core/file/commands/link.rb +25 -0
  54. data/lib/kanrisuru/core/file/commands/mkdir.rb +42 -0
  55. data/lib/kanrisuru/core/file/commands/move.rb +48 -0
  56. data/lib/kanrisuru/core/file/commands/rm.rb +41 -0
  57. data/lib/kanrisuru/core/file/commands/symlink.rb +46 -0
  58. data/lib/kanrisuru/core/file/commands/touch.rb +34 -0
  59. data/lib/kanrisuru/core/file/commands/unlink.rb +13 -0
  60. data/lib/kanrisuru/core/file/commands/wc.rb +16 -0
  61. data/lib/kanrisuru/core/file/commands.rb +29 -0
  62. data/lib/kanrisuru/core/file/parser.rb +3 -0
  63. data/lib/kanrisuru/core/file/parsers/wc.rb +16 -0
  64. data/lib/kanrisuru/core/file/types.rb +9 -0
  65. data/lib/kanrisuru/core/file.rb +4 -312
  66. data/lib/kanrisuru/core/find/commands/find.rb +97 -0
  67. data/lib/kanrisuru/core/find/commands.rb +3 -0
  68. data/lib/kanrisuru/core/find/constants.rb +9 -0
  69. data/lib/kanrisuru/core/find/parser.rb +3 -0
  70. data/lib/kanrisuru/core/find/parsers/find.rb +18 -0
  71. data/lib/kanrisuru/core/find/types.rb +9 -0
  72. data/lib/kanrisuru/core/find.rb +5 -97
  73. data/lib/kanrisuru/core/group/commands/create_group.rb +21 -0
  74. data/lib/kanrisuru/core/group/commands/delete_group.rb +16 -0
  75. data/lib/kanrisuru/core/group/commands/get_gid.rb +17 -0
  76. data/lib/kanrisuru/core/group/commands/get_group.rb +29 -0
  77. data/lib/kanrisuru/core/group/commands/is_group.rb +14 -0
  78. data/lib/kanrisuru/core/group/commands/update_group.rb +23 -0
  79. data/lib/kanrisuru/core/group/commands.rb +8 -0
  80. data/lib/kanrisuru/core/group/parser.rb +4 -0
  81. data/lib/kanrisuru/core/group/parsers/gid.rb +15 -0
  82. data/lib/kanrisuru/core/group/parsers/group.rb +15 -0
  83. data/lib/kanrisuru/core/group/types.rb +10 -0
  84. data/lib/kanrisuru/core/group.rb +4 -81
  85. data/lib/kanrisuru/core/ip/commands/address.rb +86 -0
  86. data/lib/kanrisuru/core/ip/commands/address_label.rb +54 -0
  87. data/lib/kanrisuru/core/ip/commands/link.rb +116 -0
  88. data/lib/kanrisuru/core/ip/commands/link_set_opts.rb +61 -0
  89. data/lib/kanrisuru/core/ip/commands/link_type_opts.rb +313 -0
  90. data/lib/kanrisuru/core/ip/commands/maddress.rb +42 -0
  91. data/lib/kanrisuru/core/ip/commands/neighbour.rb +72 -0
  92. data/lib/kanrisuru/core/ip/commands/route.rb +152 -0
  93. data/lib/kanrisuru/core/ip/commands/rule.rb +57 -0
  94. data/lib/kanrisuru/core/ip/commands.rb +26 -0
  95. data/lib/kanrisuru/core/ip/constants.rb +25 -0
  96. data/lib/kanrisuru/core/ip/parser.rb +11 -0
  97. data/lib/kanrisuru/core/ip/parsers/address.rb +104 -0
  98. data/lib/kanrisuru/core/ip/parsers/address_label.rb +27 -0
  99. data/lib/kanrisuru/core/ip/parsers/base.rb +166 -0
  100. data/lib/kanrisuru/core/ip/parsers/link.rb +86 -0
  101. data/lib/kanrisuru/core/ip/parsers/maddress.rb +85 -0
  102. data/lib/kanrisuru/core/ip/parsers/neighbour.rb +89 -0
  103. data/lib/kanrisuru/core/ip/parsers/route.rb +76 -0
  104. data/lib/kanrisuru/core/ip/parsers/rule.rb +60 -0
  105. data/lib/kanrisuru/core/ip/parsers/version.rb +15 -0
  106. data/lib/kanrisuru/core/ip/types.rb +46 -0
  107. data/lib/kanrisuru/core/ip.rb +15 -1002
  108. data/lib/kanrisuru/core/mount/commands/mount.rb +65 -0
  109. data/lib/kanrisuru/core/mount/commands/umount.rb +35 -0
  110. data/lib/kanrisuru/core/mount/commands.rb +49 -0
  111. data/lib/kanrisuru/core/mount.rb +2 -125
  112. data/lib/kanrisuru/core/path/commands/ls.rb +26 -0
  113. data/lib/kanrisuru/core/path/commands/pwd.rb +16 -0
  114. data/lib/kanrisuru/core/path/commands/readlink.rb +22 -0
  115. data/lib/kanrisuru/core/path/commands/realpath.rb +18 -0
  116. data/lib/kanrisuru/core/path/commands/which.rb +19 -0
  117. data/lib/kanrisuru/core/path/commands/whoami.rb +16 -0
  118. data/lib/kanrisuru/core/path/commands.rb +8 -0
  119. data/lib/kanrisuru/core/path/parser.rb +4 -0
  120. data/lib/kanrisuru/core/path/parsers/ls.rb +53 -0
  121. data/lib/kanrisuru/core/path/parsers/which.rb +18 -0
  122. data/lib/kanrisuru/core/path/types.rb +12 -0
  123. data/lib/kanrisuru/core/path.rb +4 -121
  124. data/lib/kanrisuru/core/socket/commands/ss.rb +44 -0
  125. data/lib/kanrisuru/core/socket/commands.rb +3 -0
  126. data/lib/kanrisuru/core/socket/constants.rb +29 -0
  127. data/lib/kanrisuru/core/socket/parser.rb +3 -0
  128. data/lib/kanrisuru/core/socket/parsers/ss.rb +109 -0
  129. data/lib/kanrisuru/core/socket/types.rb +18 -0
  130. data/lib/kanrisuru/core/socket.rb +5 -164
  131. data/lib/kanrisuru/core/stat/commands/stat.rb +62 -0
  132. data/lib/kanrisuru/core/stat/commands.rb +3 -0
  133. data/lib/kanrisuru/core/stat/parser.rb +3 -0
  134. data/lib/kanrisuru/core/stat/parsers/stat.rb +34 -0
  135. data/lib/kanrisuru/core/stat/types.rb +14 -0
  136. data/lib/kanrisuru/core/stat.rb +4 -81
  137. data/lib/kanrisuru/core/stream/commands/cat.rb +25 -0
  138. data/lib/kanrisuru/core/stream/commands/echo.rb +20 -0
  139. data/lib/kanrisuru/core/stream/commands/head.rb +18 -0
  140. data/lib/kanrisuru/core/stream/commands/read_file_chunk.rb +21 -0
  141. data/lib/kanrisuru/core/stream/commands/sed.rb +23 -0
  142. data/lib/kanrisuru/core/stream/commands/tail.rb +18 -0
  143. data/lib/kanrisuru/core/stream/commands.rb +27 -0
  144. data/lib/kanrisuru/core/stream/parser.rb +4 -0
  145. data/lib/kanrisuru/core/stream/parsers/echo.rb +17 -0
  146. data/lib/kanrisuru/core/stream/parsers/sed.rb +17 -0
  147. data/lib/kanrisuru/core/stream.rb +3 -104
  148. data/lib/kanrisuru/core/system/commands/cpu_info.rb +32 -0
  149. data/lib/kanrisuru/core/system/commands/free.rb +25 -0
  150. data/lib/kanrisuru/core/system/commands/kernel_statistics.rb +21 -0
  151. data/lib/kanrisuru/core/system/commands/kill.rb +22 -0
  152. data/lib/kanrisuru/core/system/commands/last.rb +31 -0
  153. data/lib/kanrisuru/core/system/commands/load_average.rb +16 -0
  154. data/lib/kanrisuru/core/system/commands/load_env.rb +16 -0
  155. data/lib/kanrisuru/core/system/commands/lscpu.rb +17 -0
  156. data/lib/kanrisuru/core/system/commands/lsof.rb +16 -0
  157. data/lib/kanrisuru/core/system/commands/poweroff.rb +42 -0
  158. data/lib/kanrisuru/core/system/commands/ps.rb +35 -0
  159. data/lib/kanrisuru/core/system/commands/reboot.rb +42 -0
  160. data/lib/kanrisuru/core/system/commands/uptime.rb +18 -0
  161. data/lib/kanrisuru/core/system/commands/w.rb +24 -0
  162. data/lib/kanrisuru/core/system/commands.rb +34 -0
  163. data/lib/kanrisuru/core/system/parser.rb +11 -0
  164. data/lib/kanrisuru/core/system/parsers/kernel_statistics.rb +56 -0
  165. data/lib/kanrisuru/core/system/parsers/last.rb +64 -0
  166. data/lib/kanrisuru/core/system/parsers/load_average.rb +15 -0
  167. data/lib/kanrisuru/core/system/parsers/load_env.rb +24 -0
  168. data/lib/kanrisuru/core/system/parsers/lscpu.rb +90 -0
  169. data/lib/kanrisuru/core/system/parsers/lsof.rb +62 -0
  170. data/lib/kanrisuru/core/system/parsers/ps.rb +71 -0
  171. data/lib/kanrisuru/core/system/parsers/uptime.rb +38 -0
  172. data/lib/kanrisuru/core/system/parsers/w.rb +30 -0
  173. data/lib/kanrisuru/core/system/types.rb +108 -0
  174. data/lib/kanrisuru/core/system.rb +4 -687
  175. data/lib/kanrisuru/core/transfer/commands/download.rb +26 -0
  176. data/lib/kanrisuru/core/transfer/commands/upload.rb +23 -0
  177. data/lib/kanrisuru/core/transfer/commands/wget.rb +168 -0
  178. data/lib/kanrisuru/core/transfer/commands.rb +5 -0
  179. data/lib/kanrisuru/core/transfer/constants.rb +10 -0
  180. data/lib/kanrisuru/core/transfer.rb +3 -199
  181. data/lib/kanrisuru/core/user/commands/create_user.rb +49 -0
  182. data/lib/kanrisuru/core/user/commands/delete_user.rb +20 -0
  183. data/lib/kanrisuru/core/user/commands/get_uid.rb +15 -0
  184. data/lib/kanrisuru/core/user/commands/get_user.rb +48 -0
  185. data/lib/kanrisuru/core/user/commands/is_user.rb +14 -0
  186. data/lib/kanrisuru/core/user/commands/update_user.rb +54 -0
  187. data/lib/kanrisuru/core/user/commands.rb +8 -0
  188. data/lib/kanrisuru/core/user/parser.rb +4 -0
  189. data/lib/kanrisuru/core/user/parsers/getent.rb +17 -0
  190. data/lib/kanrisuru/core/user/parsers/groups.rb +17 -0
  191. data/lib/kanrisuru/core/user/types.rb +11 -0
  192. data/lib/kanrisuru/core/user.rb +4 -182
  193. data/lib/kanrisuru/core/yum/commands/autoremove.rb +14 -0
  194. data/lib/kanrisuru/core/yum/commands/clean.rb +23 -0
  195. data/lib/kanrisuru/core/yum/commands/erase.rb +20 -0
  196. data/lib/kanrisuru/core/yum/commands/info.rb +21 -0
  197. data/lib/kanrisuru/core/yum/commands/install.rb +18 -0
  198. data/lib/kanrisuru/core/yum/commands/list.rb +30 -0
  199. data/lib/kanrisuru/core/yum/commands/localinstall.rb +22 -0
  200. data/lib/kanrisuru/core/yum/commands/remove.rb +20 -0
  201. data/lib/kanrisuru/core/yum/commands/repolist.rb +20 -0
  202. data/lib/kanrisuru/core/yum/commands/search.rb +21 -0
  203. data/lib/kanrisuru/core/yum/commands/update.rb +14 -0
  204. data/lib/kanrisuru/core/yum/commands/upgrade.rb +14 -0
  205. data/lib/kanrisuru/core/yum/commands.rb +39 -0
  206. data/lib/kanrisuru/core/yum/parser.rb +7 -0
  207. data/lib/kanrisuru/core/yum/parsers/base.rb +31 -0
  208. data/lib/kanrisuru/core/yum/parsers/info.rb +69 -0
  209. data/lib/kanrisuru/core/yum/parsers/list.rb +24 -0
  210. data/lib/kanrisuru/core/yum/parsers/repolist.rb +60 -0
  211. data/lib/kanrisuru/core/yum/parsers/search.rb +30 -0
  212. data/lib/kanrisuru/core/yum/types.rb +41 -0
  213. data/lib/kanrisuru/core/yum.rb +4 -347
  214. data/lib/kanrisuru/core/zypper/commands/add_lock.rb +22 -0
  215. data/lib/kanrisuru/core/zypper/commands/add_repo.rb +38 -0
  216. data/lib/kanrisuru/core/zypper/commands/add_service.rb +26 -0
  217. data/lib/kanrisuru/core/zypper/commands/clean_cache.rb +22 -0
  218. data/lib/kanrisuru/core/zypper/commands/clean_locks.rb +17 -0
  219. data/lib/kanrisuru/core/zypper/commands/dist_upgrade.rb +25 -0
  220. data/lib/kanrisuru/core/zypper/commands/info.rb +25 -0
  221. data/lib/kanrisuru/core/zypper/commands/install.rb +39 -0
  222. data/lib/kanrisuru/core/zypper/commands/install_new_recommends.rb +23 -0
  223. data/lib/kanrisuru/core/zypper/commands/list_locks.rb +22 -0
  224. data/lib/kanrisuru/core/zypper/commands/list_patches.rb +34 -0
  225. data/lib/kanrisuru/core/zypper/commands/list_repos.rb +21 -0
  226. data/lib/kanrisuru/core/zypper/commands/list_services.rb +21 -0
  227. data/lib/kanrisuru/core/zypper/commands/list_updates.rb +30 -0
  228. data/lib/kanrisuru/core/zypper/commands/modify_repo.rb +48 -0
  229. data/lib/kanrisuru/core/zypper/commands/modify_service.rb +40 -0
  230. data/lib/kanrisuru/core/zypper/commands/patch.rb +40 -0
  231. data/lib/kanrisuru/core/zypper/commands/patch_check.rb +29 -0
  232. data/lib/kanrisuru/core/zypper/commands/purge_kernels.rb +18 -0
  233. data/lib/kanrisuru/core/zypper/commands/refresh_repos.rb +24 -0
  234. data/lib/kanrisuru/core/zypper/commands/refresh_services.rb +21 -0
  235. data/lib/kanrisuru/core/zypper/commands/remove.rb +26 -0
  236. data/lib/kanrisuru/core/zypper/commands/remove_lock.rb +22 -0
  237. data/lib/kanrisuru/core/zypper/commands/remove_repo.rb +32 -0
  238. data/lib/kanrisuru/core/zypper/commands/remove_service.rb +21 -0
  239. data/lib/kanrisuru/core/zypper/commands/rename_repo.rb +20 -0
  240. data/lib/kanrisuru/core/zypper/commands/search.rb +52 -0
  241. data/lib/kanrisuru/core/zypper/commands/source_install.rb +22 -0
  242. data/lib/kanrisuru/core/zypper/commands/update.rb +27 -0
  243. data/lib/kanrisuru/core/zypper/commands/verify.rb +23 -0
  244. data/lib/kanrisuru/core/zypper/commands.rb +109 -0
  245. data/lib/kanrisuru/core/zypper/constants.rb +19 -0
  246. data/lib/kanrisuru/core/zypper/parser.rb +11 -0
  247. data/lib/kanrisuru/core/zypper/parsers/base.rb +18 -0
  248. data/lib/kanrisuru/core/zypper/parsers/info.rb +77 -0
  249. data/lib/kanrisuru/core/zypper/parsers/list_locks.rb +36 -0
  250. data/lib/kanrisuru/core/zypper/parsers/list_patches.rb +40 -0
  251. data/lib/kanrisuru/core/zypper/parsers/list_repos.rb +37 -0
  252. data/lib/kanrisuru/core/zypper/parsers/list_services.rb +36 -0
  253. data/lib/kanrisuru/core/zypper/parsers/list_updates.rb +32 -0
  254. data/lib/kanrisuru/core/zypper/parsers/patch_check.rb +34 -0
  255. data/lib/kanrisuru/core/zypper/parsers/search.rb +37 -0
  256. data/lib/kanrisuru/core/zypper/types.rb +88 -0
  257. data/lib/kanrisuru/core/zypper.rb +5 -998
  258. data/lib/kanrisuru/os_package.rb +2 -0
  259. data/lib/kanrisuru/result.rb +15 -0
  260. data/lib/kanrisuru/version.rb +1 -1
  261. data/spec/functional/core/archive_spec.rb +1 -1
  262. data/spec/functional/core/disk_spec.rb +77 -0
  263. data/spec/functional/core/dmi_spec.rb +78 -0
  264. data/spec/functional/core/file_spec.rb +284 -0
  265. data/spec/functional/core/group_spec.rb +62 -0
  266. data/spec/functional/core/ip/ip_address_label_spec.rb +81 -0
  267. data/spec/functional/core/ip/ip_address_spec.rb +95 -0
  268. data/spec/functional/core/ip/ip_link_spec.rb +814 -0
  269. data/spec/functional/core/ip/ip_maddress_spec.rb +78 -0
  270. data/spec/functional/core/ip/ip_neighbour_spec.rb +119 -0
  271. data/spec/functional/core/ip/ip_route_spec.rb +174 -0
  272. data/spec/functional/core/ip/ip_rule_spec.rb +75 -0
  273. data/spec/functional/core/ip/ip_spec.rb +27 -0
  274. data/spec/functional/core/system_spec.rb +135 -0
  275. data/spec/functional/core/user_spec.rb +97 -0
  276. data/spec/functional/result_spec.rb +91 -44
  277. data/spec/helper/stub_network.rb +6 -2
  278. data/spec/support/shared_examples/integration/core/transfer.rb +1 -1
  279. data/spec/unit/command_spec.rb +2 -0
  280. data/spec/unit/core/ip_spec.rb +12 -0
  281. data/spec/unit/util_spec.rb +16 -0
  282. metadata +253 -4
@@ -0,0 +1,97 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe Kanrisuru::Core::User do
6
+ before(:all) do
7
+ StubNetwork.stub!
8
+ end
9
+
10
+ after(:all) do
11
+ StubNetwork.unstub!
12
+ end
13
+
14
+ let(:host) do
15
+ Kanrisuru::Remote::Host.new(
16
+ host: 'localhost',
17
+ username: 'ubuntu',
18
+ keys: ['id_rsa']
19
+ )
20
+ end
21
+
22
+ it 'prepares create_user command' do
23
+ expect_command(host.create_user('bob'), 'useradd bob -s /bin/false')
24
+ expect_command(host.create_user('bob', uid: 5555), 'useradd bob -u 5555 -s /bin/false')
25
+ expect_command(host.create_user('bob', uid: 5555, non_unique: true), 'useradd bob -u 5555 -o -s /bin/false')
26
+ expect_command(host.create_user('bob', system: true), 'useradd bob -r -s /bin/false')
27
+ expect_command(host.create_user('bob', shell: '/bin/bash'), 'useradd bob -s /bin/bash')
28
+ expect_command(host.create_user('bob', home: '/home/bob1'), 'useradd bob -s /bin/false -d /home/bob1')
29
+ expect_command(host.create_user('bob', home: '/home/bob1', createhome: true),
30
+ 'useradd bob -s /bin/false -d /home/bob1 -m')
31
+ expect_command(host.create_user('bob', home: '/home/bob1', createhome: true, skeleton: '/home/bob1skele'),
32
+ 'useradd bob -s /bin/false -d /home/bob1 -m -k /home/bob1skele')
33
+ expect_command(host.create_user('bob', createhome: false), 'useradd bob -s /bin/false -M')
34
+ expect_command(host.create_user('bob', password: '12345678'), 'useradd bob -s /bin/false -p 12345678')
35
+ expect_command(host.create_user('bob', expires: '2021-12-31'), 'useradd bob -s /bin/false -e 2021-12-31')
36
+
37
+ expect_command(host.create_user('bob', groups: %w[www-data sudo admin]),
38
+ 'useradd bob -s /bin/false -G www-data,sudo,admin')
39
+
40
+ StubNetwork.stub_command!(:group?, { return_value: true })
41
+ expect_command(host.create_user('bob', group: 'www-data'), 'useradd bob -s /bin/false -g www-data')
42
+ expect_command(host.create_user('bob'), 'useradd bob -s /bin/false -N')
43
+ StubNetwork.unstub_command!(:group?)
44
+ end
45
+
46
+ it 'prepares delete_user command' do
47
+ StubNetwork.stub_command!(:get_uid) { 1000 }
48
+ expect_command(host.delete_user('ubuntu'), 'userdel ubuntu')
49
+ expect_command(host.delete_user('ubuntu', force: true), 'userdel ubuntu -f')
50
+ StubNetwork.unstub_command!(:get_uid)
51
+
52
+ StubNetwork.stub_command!(:get_uid, { status: 1 })
53
+ expect(host.delete_user('ubuntu')).to be_falsey
54
+ StubNetwork.unstub_command!(:get_uid)
55
+ end
56
+
57
+ it 'prepares get_uid command' do
58
+ expect_command(host.get_uid('ubuntu'), 'id -u ubuntu')
59
+ end
60
+
61
+ it 'prepares get_user command' do
62
+ expect_command(host.get_user('ubuntu'), 'id ubuntu')
63
+ end
64
+
65
+ it 'prepares user? command' do
66
+ StubNetwork.stub_command!(:get_uid) { 1000 }
67
+ expect(host).to be_user('ubuntu')
68
+ StubNetwork.unstub_command!(:get_uid)
69
+
70
+ StubNetwork.stub_command!(:get_uid, { status: 1 })
71
+ expect(host).not_to be_group('ubuntu')
72
+ StubNetwork.unstub_command!(:get_uid)
73
+ end
74
+
75
+ it 'prepares update_user command' do
76
+ expect_command(host.update_user('bob', home: '/home/bob'), 'usermod bob -d /home/bob')
77
+ expect_command(host.update_user('bob', home: '/home/bob', move_home: true), 'usermod bob -d /home/bob -m')
78
+ expect_command(host.update_user('bob', home: '/home/bob', move_home: true), 'usermod bob -d /home/bob -m')
79
+ expect_command(host.update_user('bob', shell: '/bin/zsh'), 'usermod bob -s /bin/zsh')
80
+ expect_command(host.update_user('bob', uid: 6431), 'usermod bob -u 6431')
81
+ expect_command(host.update_user('bob', uid: 1000, non_unique: true), 'usermod bob -u 1000 -o')
82
+
83
+ StubNetwork.stub_command!(:group?, { return_value: true })
84
+ expect_command(host.update_user('bob', group: 'backup'), 'usermod bob -g backup')
85
+ StubNetwork.unstub_command!(:group?)
86
+
87
+ expect_command(host.update_user('bob', groups: 'backup'), 'usermod bob -G backup')
88
+ expect_command(host.update_user('bob', groups: %w[backup mail]), 'usermod bob -G backup,mail')
89
+ expect_command(host.update_user('bob', groups: %w[backup mail], append: true), 'usermod bob -G backup,mail -a')
90
+
91
+ expect_command(host.update_user('bob', locked: true), 'usermod bob -L -e 1')
92
+ expect_command(host.update_user('bob', locked: false), 'usermod bob -U -e 99999')
93
+ expect_command(host.update_user('bob', locked: false, password: '123456'), 'usermod bob -U -e 99999')
94
+ expect_command(host.update_user('bob', password: '123456'), 'usermod bob -p 123456')
95
+ expect_command(host.update_user('bob', expires: '2022-01-01'), 'usermod bob -e 2022-01-01')
96
+ end
97
+ end
@@ -57,72 +57,119 @@ RSpec.describe Kanrisuru::Result do
57
57
  expect(result.to_s).to eq('output')
58
58
  end
59
59
 
60
- it 'returns to_a on array result' do
61
- command.handle_status(0)
62
- result = described_class.new(command) do |_cmd|
63
- [0, 1, 2, 3]
60
+ context 'with to_a' do
61
+ it 'returns to_a on array result' do
62
+ command.handle_status(0)
63
+ result = described_class.new(command) do |_cmd|
64
+ [0, 1, 2, 3]
65
+ end
66
+
67
+ expect(result.to_a).to eq([0, 1, 2, 3])
64
68
  end
65
69
 
66
- expect(result.to_a).to eq([0, 1, 2, 3])
67
- end
70
+ it 'returns to_a on non-array result' do
71
+ command.handle_status(0)
72
+ result = described_class.new(command) do |_cmd|
73
+ 'output'
74
+ end
68
75
 
69
- it 'returns to_a on non-array result' do
70
- command.handle_status(0)
71
- result = described_class.new(command) do |_cmd|
72
- 'output'
76
+ expect(result.to_a).to eq(['output'])
73
77
  end
74
78
 
75
- expect(result.to_a).to eq(['output'])
76
- end
79
+ it 'returns to_i on integer return value' do
80
+ command.handle_status(0)
81
+ result = described_class.new(command) do |_cmd|
82
+ 55
83
+ end
77
84
 
78
- it 'returns to_i on integer return value' do
79
- command.handle_status(0)
80
- result = described_class.new(command) do |_cmd|
81
- 55
85
+ expect(result.to_i).to eq(55)
82
86
  end
83
-
84
- expect(result.to_i).to eq(55)
85
87
  end
86
88
 
87
- it 'returns to_i on non-integer return value' do
88
- command.handle_status(0)
89
- result = described_class.new(command) do |_cmd|
90
- '100'
91
- end
89
+ context 'with to_i' do
90
+ it 'returns to_i on non-integer return value' do
91
+ command.handle_status(0)
92
+ result = described_class.new(command) do |_cmd|
93
+ '100'
94
+ end
92
95
 
93
- expect(result.to_i).to eq(100)
96
+ expect(result.to_i).to eq(100)
94
97
 
95
- result = described_class.new(command) do |_cmd|
96
- 'hello'
97
- end
98
+ result = described_class.new(command) do |_cmd|
99
+ 'hello'
100
+ end
98
101
 
99
- expect(result.to_i).to eq(0)
102
+ expect(result.to_i).to eq(0)
100
103
 
101
- result = described_class.new(command) do |_cmd|
102
- [0, 1, 2, 3]
103
- end
104
+ result = described_class.new(command) do |_cmd|
105
+ [0, 1, 2, 3]
106
+ end
104
107
 
105
- expect(result.to_i).to eq([0, 1, 2, 3])
108
+ expect(result.to_i).to eq([0, 1, 2, 3])
106
109
 
107
- result = described_class.new(command) do |_cmd|
108
- %w[0 1 2 3]
110
+ result = described_class.new(command) do |_cmd|
111
+ %w[0 1 2 3]
112
+ end
113
+
114
+ expect(result.to_i).to eq([0, 1, 2, 3])
115
+
116
+ result = described_class.new(command)
117
+ expect(result.to_i).to be_nil
109
118
  end
110
119
 
111
- expect(result.to_i).to eq([0, 1, 2, 3])
120
+ it 'raises error on to_i for invalid data type' do
121
+ command.handle_status(0)
122
+ result = described_class.new(command) do |_cmd|
123
+ { 'hello' => 'world' }
124
+ end
112
125
 
113
- result = described_class.new(command)
114
- expect(result.to_i).to be_nil
126
+ expect do
127
+ result.to_i
128
+ end.to raise_error(NoMethodError)
129
+ end
115
130
  end
116
131
 
117
- it 'raises error on to_i for invalid data type' do
118
- command.handle_status(0)
119
- result = described_class.new(command) do |_cmd|
120
- { 'hello' => 'world' }
132
+ context 'with to_f' do
133
+ it 'returns to_f on non-integer return value' do
134
+ command.handle_status(0)
135
+ result = described_class.new(command) do |_cmd|
136
+ '100.5'
137
+ end
138
+
139
+ expect(result.to_f).to eq(100.5)
140
+
141
+ result = described_class.new(command) do |_cmd|
142
+ 'hello'
143
+ end
144
+
145
+ expect(result.to_f).to eq(0)
146
+
147
+ result = described_class.new(command) do |_cmd|
148
+ [0.1, 1.2, 2.3, 3.4]
149
+ end
150
+
151
+ expect(result.to_f).to eq([0.1, 1.2, 2.3, 3.4])
152
+
153
+ result = described_class.new(command) do |_cmd|
154
+ %w[0.1 1.2 2.3 3.4]
155
+ end
156
+
157
+ expect(result.to_f).to eq([0.1, 1.2, 2.3, 3.4])
158
+
159
+ result = described_class.new(command)
160
+ expect(result.to_f).to be_nil
121
161
  end
122
162
 
123
- expect do
124
- result.to_i
125
- end.to raise_error(NoMethodError)
163
+ it 'raises error on to_f for invalid data type' do
164
+ command.handle_status(0)
165
+ result = described_class.new(command) do |_cmd|
166
+ { 'hello' => 'world' }
167
+ end
168
+
169
+ expect do
170
+ result.to_f
171
+ end.to raise_error(NoMethodError)
172
+ end
126
173
  end
127
174
 
128
175
  it 'returns success string variant on inspect' do
@@ -69,8 +69,12 @@ class StubNetwork
69
69
  status = opts[:status] || 0
70
70
  command.handle_status(status)
71
71
 
72
- Kanrisuru::Result.new(command, true) do |_cmd|
73
- block.call(args)
72
+ if opts[:return_value].nil?
73
+ Kanrisuru::Result.new(command, true) do |_cmd|
74
+ block.call(args)
75
+ end
76
+ else
77
+ opts[:return_value]
74
78
  end
75
79
  end
76
80
  end
@@ -76,7 +76,7 @@ RSpec.shared_examples 'transfer' do |os_name, host_json, spec_dir|
76
76
  end
77
77
 
78
78
  it 'downloads a file to local fs' do
79
- path = '../hosts-file'
79
+ path = "../hosts-file.#{os_name}.txt"
80
80
  src_path = '/etc/hosts'
81
81
 
82
82
  result = host.download(src_path, path)
@@ -11,6 +11,7 @@ RSpec.describe Kanrisuru::Command do
11
11
  expect(command).to respond_to(:success?)
12
12
  expect(command).to respond_to(:failure?)
13
13
  expect(command).to respond_to(:to_i)
14
+ expect(command).to respond_to(:to_f)
14
15
  expect(command).to respond_to(:to_s)
15
16
  expect(command).to respond_to(:to_a)
16
17
  expect(command).to respond_to(:to_json)
@@ -26,6 +27,7 @@ RSpec.describe Kanrisuru::Command do
26
27
  expect(command).to respond_to(:append_value)
27
28
  expect(command).to respond_to(:append_arg)
28
29
  expect(command).to respond_to(:append_flag)
30
+ expect(command).to respond_to(:append_flag_no)
29
31
  expect(command).to respond_to(:append_valid_exit_code)
30
32
  end
31
33
 
@@ -35,6 +35,18 @@ RSpec.describe Kanrisuru::Core::IP do
35
35
  ])
36
36
  )
37
37
 
38
+ expect(Kanrisuru::Core::IP::IP_FAMILIES).to(eq(%w[inet inet6 link]))
39
+ expect(Kanrisuru::Core::IP::IP_SCOPES).to(eq(%w[global site link host]))
40
+ expect(Kanrisuru::Core::IP::IP_LINK_TYPES).to(
41
+ eq(%w[
42
+ vlan veth vcan vxcan dummy ifb macvlan macvtap
43
+ bridge bond team ipoib ip6tnl ipip sit vxlan
44
+ gre gretap erspan ip6gre ip6gretap ip6erspan
45
+ vti nlmon team_slave bond_slave bridge_slave
46
+ ipvlan ipvtap geneve vrf macsec netdevsim rmnet
47
+ xfrm bareudp hsr
48
+ ])
49
+ )
38
50
  expect(Kanrisuru::Core::IP::IPLinkProperty.new).to respond_to(
39
51
  :index, :name, :flags, :mtu,
40
52
  :qdisc, :state, :group, :qlen,
@@ -15,6 +15,22 @@ RSpec.describe Kanrisuru::Util do
15
15
  expect(described_class.present?(nil)).to eq(false)
16
16
  end
17
17
 
18
+ it 'joins strings into array' do
19
+ expect(described_class.array_join_string(%w[opt1 opt2 opt3])).to eq('opt1,opt2,opt3')
20
+ expect(described_class.array_join_string(%w[opt1 opt2 opt3], ' | ')).to eq('opt1 | opt2 | opt3')
21
+ expect(described_class.array_join_string('opt1, opt2, opt3')).to eq('opt1, opt2, opt3')
22
+ end
23
+
24
+ it 'still joins string with depecrated method' do
25
+ allow(Kanrisuru.logger).to receive(:info)
26
+ expect(Kanrisuru.logger).to receive(:info) do |&block|
27
+ expect(block.call).to eq('DEPRECATION WARNING: string_join_array will be removed in the upcoming major release. Use array_join_string instead.')
28
+ end
29
+
30
+ expect(described_class.string_join_array('a')).to eq('a')
31
+ expect(described_class.string_join_array(%w[a b c])).to eq('a,b,c')
32
+ end
33
+
18
34
  it 'camelizes strings' do
19
35
  expect(described_class.camelize('hello_world')).to eq('HelloWorld')
20
36
  expect(described_class.camelize('helloworld')).to eq('Helloworld')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kanrisuru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Mammina
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-07 00:00:00.000000000 Z
11
+ date: 2021-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel_tests
@@ -136,8 +136,8 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: '6.1'
139
- description: Kanrisuru helps manage remote servers with objected oriented ruby. Results
140
- come back as structured data, parsed, prepared and ready.
139
+ description: " Kanrisuru helps manage remote servers with objected oriented ruby.
140
+ \n Results come back as structured data, parsed, prepared and ready.\n"
141
141
  email: ryan@avamia.com
142
142
  executables: []
143
143
  extensions: []
@@ -164,23 +164,257 @@ files:
164
164
  - lib/kanrisuru/command.rb
165
165
  - lib/kanrisuru/core.rb
166
166
  - lib/kanrisuru/core/apt.rb
167
+ - lib/kanrisuru/core/apt/commands.rb
168
+ - lib/kanrisuru/core/apt/commands/autoclean.rb
169
+ - lib/kanrisuru/core/apt/commands/autoremove.rb
170
+ - lib/kanrisuru/core/apt/commands/clean.rb
171
+ - lib/kanrisuru/core/apt/commands/full_upgrade.rb
172
+ - lib/kanrisuru/core/apt/commands/install.rb
173
+ - lib/kanrisuru/core/apt/commands/list.rb
174
+ - lib/kanrisuru/core/apt/commands/purge.rb
175
+ - lib/kanrisuru/core/apt/commands/remove.rb
176
+ - lib/kanrisuru/core/apt/commands/search.rb
177
+ - lib/kanrisuru/core/apt/commands/show.rb
178
+ - lib/kanrisuru/core/apt/commands/update.rb
179
+ - lib/kanrisuru/core/apt/commands/upgrade.rb
180
+ - lib/kanrisuru/core/apt/parser.rb
181
+ - lib/kanrisuru/core/apt/parsers/base.rb
182
+ - lib/kanrisuru/core/apt/parsers/list.rb
183
+ - lib/kanrisuru/core/apt/parsers/search.rb
184
+ - lib/kanrisuru/core/apt/parsers/show.rb
185
+ - lib/kanrisuru/core/apt/types.rb
167
186
  - lib/kanrisuru/core/archive.rb
187
+ - lib/kanrisuru/core/archive/commands.rb
188
+ - lib/kanrisuru/core/archive/commands/tar.rb
189
+ - lib/kanrisuru/core/archive/types.rb
168
190
  - lib/kanrisuru/core/disk.rb
191
+ - lib/kanrisuru/core/disk/commands.rb
192
+ - lib/kanrisuru/core/disk/commands/blkid.rb
193
+ - lib/kanrisuru/core/disk/commands/df.rb
194
+ - lib/kanrisuru/core/disk/commands/du.rb
195
+ - lib/kanrisuru/core/disk/commands/lsblk.rb
196
+ - lib/kanrisuru/core/disk/constants.rb
197
+ - lib/kanrisuru/core/disk/parser.rb
198
+ - lib/kanrisuru/core/disk/parsers/blkid.rb
199
+ - lib/kanrisuru/core/disk/parsers/df.rb
200
+ - lib/kanrisuru/core/disk/parsers/du.rb
201
+ - lib/kanrisuru/core/disk/parsers/lsblk.rb
202
+ - lib/kanrisuru/core/disk/parsers/lsblk_version.rb
203
+ - lib/kanrisuru/core/disk/types.rb
169
204
  - lib/kanrisuru/core/dmi.rb
205
+ - lib/kanrisuru/core/dmi/commands.rb
206
+ - lib/kanrisuru/core/dmi/commands/dmi.rb
207
+ - lib/kanrisuru/core/dmi/parser.rb
208
+ - lib/kanrisuru/core/dmi/parsers/dmi.rb
209
+ - lib/kanrisuru/core/dmi/types.rb
170
210
  - lib/kanrisuru/core/file.rb
211
+ - lib/kanrisuru/core/file/commands.rb
212
+ - lib/kanrisuru/core/file/commands/chmod.rb
213
+ - lib/kanrisuru/core/file/commands/chown.rb
214
+ - lib/kanrisuru/core/file/commands/copy.rb
215
+ - lib/kanrisuru/core/file/commands/link.rb
216
+ - lib/kanrisuru/core/file/commands/mkdir.rb
217
+ - lib/kanrisuru/core/file/commands/move.rb
218
+ - lib/kanrisuru/core/file/commands/rm.rb
219
+ - lib/kanrisuru/core/file/commands/symlink.rb
220
+ - lib/kanrisuru/core/file/commands/touch.rb
221
+ - lib/kanrisuru/core/file/commands/unlink.rb
222
+ - lib/kanrisuru/core/file/commands/wc.rb
223
+ - lib/kanrisuru/core/file/parser.rb
224
+ - lib/kanrisuru/core/file/parsers/wc.rb
225
+ - lib/kanrisuru/core/file/types.rb
171
226
  - lib/kanrisuru/core/find.rb
227
+ - lib/kanrisuru/core/find/commands.rb
228
+ - lib/kanrisuru/core/find/commands/find.rb
229
+ - lib/kanrisuru/core/find/constants.rb
230
+ - lib/kanrisuru/core/find/parser.rb
231
+ - lib/kanrisuru/core/find/parsers/find.rb
232
+ - lib/kanrisuru/core/find/types.rb
172
233
  - lib/kanrisuru/core/group.rb
234
+ - lib/kanrisuru/core/group/commands.rb
235
+ - lib/kanrisuru/core/group/commands/create_group.rb
236
+ - lib/kanrisuru/core/group/commands/delete_group.rb
237
+ - lib/kanrisuru/core/group/commands/get_gid.rb
238
+ - lib/kanrisuru/core/group/commands/get_group.rb
239
+ - lib/kanrisuru/core/group/commands/is_group.rb
240
+ - lib/kanrisuru/core/group/commands/update_group.rb
241
+ - lib/kanrisuru/core/group/parser.rb
242
+ - lib/kanrisuru/core/group/parsers/gid.rb
243
+ - lib/kanrisuru/core/group/parsers/group.rb
244
+ - lib/kanrisuru/core/group/types.rb
173
245
  - lib/kanrisuru/core/ip.rb
246
+ - lib/kanrisuru/core/ip/commands.rb
247
+ - lib/kanrisuru/core/ip/commands/address.rb
248
+ - lib/kanrisuru/core/ip/commands/address_label.rb
249
+ - lib/kanrisuru/core/ip/commands/link.rb
250
+ - lib/kanrisuru/core/ip/commands/link_set_opts.rb
251
+ - lib/kanrisuru/core/ip/commands/link_type_opts.rb
252
+ - lib/kanrisuru/core/ip/commands/maddress.rb
253
+ - lib/kanrisuru/core/ip/commands/neighbour.rb
254
+ - lib/kanrisuru/core/ip/commands/route.rb
255
+ - lib/kanrisuru/core/ip/commands/rule.rb
256
+ - lib/kanrisuru/core/ip/constants.rb
257
+ - lib/kanrisuru/core/ip/parser.rb
258
+ - lib/kanrisuru/core/ip/parsers/address.rb
259
+ - lib/kanrisuru/core/ip/parsers/address_label.rb
260
+ - lib/kanrisuru/core/ip/parsers/base.rb
261
+ - lib/kanrisuru/core/ip/parsers/link.rb
262
+ - lib/kanrisuru/core/ip/parsers/maddress.rb
263
+ - lib/kanrisuru/core/ip/parsers/neighbour.rb
264
+ - lib/kanrisuru/core/ip/parsers/route.rb
265
+ - lib/kanrisuru/core/ip/parsers/rule.rb
266
+ - lib/kanrisuru/core/ip/parsers/version.rb
267
+ - lib/kanrisuru/core/ip/types.rb
174
268
  - lib/kanrisuru/core/mount.rb
269
+ - lib/kanrisuru/core/mount/commands.rb
270
+ - lib/kanrisuru/core/mount/commands/mount.rb
271
+ - lib/kanrisuru/core/mount/commands/umount.rb
175
272
  - lib/kanrisuru/core/path.rb
273
+ - lib/kanrisuru/core/path/commands.rb
274
+ - lib/kanrisuru/core/path/commands/ls.rb
275
+ - lib/kanrisuru/core/path/commands/pwd.rb
276
+ - lib/kanrisuru/core/path/commands/readlink.rb
277
+ - lib/kanrisuru/core/path/commands/realpath.rb
278
+ - lib/kanrisuru/core/path/commands/which.rb
279
+ - lib/kanrisuru/core/path/commands/whoami.rb
280
+ - lib/kanrisuru/core/path/parser.rb
281
+ - lib/kanrisuru/core/path/parsers/ls.rb
282
+ - lib/kanrisuru/core/path/parsers/which.rb
283
+ - lib/kanrisuru/core/path/types.rb
176
284
  - lib/kanrisuru/core/socket.rb
285
+ - lib/kanrisuru/core/socket/commands.rb
286
+ - lib/kanrisuru/core/socket/commands/ss.rb
287
+ - lib/kanrisuru/core/socket/constants.rb
288
+ - lib/kanrisuru/core/socket/parser.rb
289
+ - lib/kanrisuru/core/socket/parsers/ss.rb
290
+ - lib/kanrisuru/core/socket/types.rb
177
291
  - lib/kanrisuru/core/stat.rb
292
+ - lib/kanrisuru/core/stat/commands.rb
293
+ - lib/kanrisuru/core/stat/commands/stat.rb
294
+ - lib/kanrisuru/core/stat/parser.rb
295
+ - lib/kanrisuru/core/stat/parsers/stat.rb
296
+ - lib/kanrisuru/core/stat/types.rb
178
297
  - lib/kanrisuru/core/stream.rb
298
+ - lib/kanrisuru/core/stream/commands.rb
299
+ - lib/kanrisuru/core/stream/commands/cat.rb
300
+ - lib/kanrisuru/core/stream/commands/echo.rb
301
+ - lib/kanrisuru/core/stream/commands/head.rb
302
+ - lib/kanrisuru/core/stream/commands/read_file_chunk.rb
303
+ - lib/kanrisuru/core/stream/commands/sed.rb
304
+ - lib/kanrisuru/core/stream/commands/tail.rb
305
+ - lib/kanrisuru/core/stream/parser.rb
306
+ - lib/kanrisuru/core/stream/parsers/echo.rb
307
+ - lib/kanrisuru/core/stream/parsers/sed.rb
179
308
  - lib/kanrisuru/core/system.rb
309
+ - lib/kanrisuru/core/system/commands.rb
310
+ - lib/kanrisuru/core/system/commands/cpu_info.rb
311
+ - lib/kanrisuru/core/system/commands/free.rb
312
+ - lib/kanrisuru/core/system/commands/kernel_statistics.rb
313
+ - lib/kanrisuru/core/system/commands/kill.rb
314
+ - lib/kanrisuru/core/system/commands/last.rb
315
+ - lib/kanrisuru/core/system/commands/load_average.rb
316
+ - lib/kanrisuru/core/system/commands/load_env.rb
317
+ - lib/kanrisuru/core/system/commands/lscpu.rb
318
+ - lib/kanrisuru/core/system/commands/lsof.rb
319
+ - lib/kanrisuru/core/system/commands/poweroff.rb
320
+ - lib/kanrisuru/core/system/commands/ps.rb
321
+ - lib/kanrisuru/core/system/commands/reboot.rb
322
+ - lib/kanrisuru/core/system/commands/uptime.rb
323
+ - lib/kanrisuru/core/system/commands/w.rb
324
+ - lib/kanrisuru/core/system/parser.rb
325
+ - lib/kanrisuru/core/system/parsers/kernel_statistics.rb
326
+ - lib/kanrisuru/core/system/parsers/last.rb
327
+ - lib/kanrisuru/core/system/parsers/load_average.rb
328
+ - lib/kanrisuru/core/system/parsers/load_env.rb
329
+ - lib/kanrisuru/core/system/parsers/lscpu.rb
330
+ - lib/kanrisuru/core/system/parsers/lsof.rb
331
+ - lib/kanrisuru/core/system/parsers/ps.rb
332
+ - lib/kanrisuru/core/system/parsers/uptime.rb
333
+ - lib/kanrisuru/core/system/parsers/w.rb
334
+ - lib/kanrisuru/core/system/types.rb
180
335
  - lib/kanrisuru/core/transfer.rb
336
+ - lib/kanrisuru/core/transfer/commands.rb
337
+ - lib/kanrisuru/core/transfer/commands/download.rb
338
+ - lib/kanrisuru/core/transfer/commands/upload.rb
339
+ - lib/kanrisuru/core/transfer/commands/wget.rb
340
+ - lib/kanrisuru/core/transfer/constants.rb
181
341
  - lib/kanrisuru/core/user.rb
342
+ - lib/kanrisuru/core/user/commands.rb
343
+ - lib/kanrisuru/core/user/commands/create_user.rb
344
+ - lib/kanrisuru/core/user/commands/delete_user.rb
345
+ - lib/kanrisuru/core/user/commands/get_uid.rb
346
+ - lib/kanrisuru/core/user/commands/get_user.rb
347
+ - lib/kanrisuru/core/user/commands/is_user.rb
348
+ - lib/kanrisuru/core/user/commands/update_user.rb
349
+ - lib/kanrisuru/core/user/parser.rb
350
+ - lib/kanrisuru/core/user/parsers/getent.rb
351
+ - lib/kanrisuru/core/user/parsers/groups.rb
352
+ - lib/kanrisuru/core/user/types.rb
182
353
  - lib/kanrisuru/core/yum.rb
354
+ - lib/kanrisuru/core/yum/commands.rb
355
+ - lib/kanrisuru/core/yum/commands/autoremove.rb
356
+ - lib/kanrisuru/core/yum/commands/clean.rb
357
+ - lib/kanrisuru/core/yum/commands/erase.rb
358
+ - lib/kanrisuru/core/yum/commands/info.rb
359
+ - lib/kanrisuru/core/yum/commands/install.rb
360
+ - lib/kanrisuru/core/yum/commands/list.rb
361
+ - lib/kanrisuru/core/yum/commands/localinstall.rb
362
+ - lib/kanrisuru/core/yum/commands/remove.rb
363
+ - lib/kanrisuru/core/yum/commands/repolist.rb
364
+ - lib/kanrisuru/core/yum/commands/search.rb
365
+ - lib/kanrisuru/core/yum/commands/update.rb
366
+ - lib/kanrisuru/core/yum/commands/upgrade.rb
367
+ - lib/kanrisuru/core/yum/parser.rb
368
+ - lib/kanrisuru/core/yum/parsers/base.rb
369
+ - lib/kanrisuru/core/yum/parsers/info.rb
370
+ - lib/kanrisuru/core/yum/parsers/list.rb
371
+ - lib/kanrisuru/core/yum/parsers/repolist.rb
372
+ - lib/kanrisuru/core/yum/parsers/search.rb
373
+ - lib/kanrisuru/core/yum/types.rb
183
374
  - lib/kanrisuru/core/zypper.rb
375
+ - lib/kanrisuru/core/zypper/commands.rb
376
+ - lib/kanrisuru/core/zypper/commands/add_lock.rb
377
+ - lib/kanrisuru/core/zypper/commands/add_repo.rb
378
+ - lib/kanrisuru/core/zypper/commands/add_service.rb
379
+ - lib/kanrisuru/core/zypper/commands/clean_cache.rb
380
+ - lib/kanrisuru/core/zypper/commands/clean_locks.rb
381
+ - lib/kanrisuru/core/zypper/commands/dist_upgrade.rb
382
+ - lib/kanrisuru/core/zypper/commands/info.rb
383
+ - lib/kanrisuru/core/zypper/commands/install.rb
384
+ - lib/kanrisuru/core/zypper/commands/install_new_recommends.rb
385
+ - lib/kanrisuru/core/zypper/commands/list_locks.rb
386
+ - lib/kanrisuru/core/zypper/commands/list_patches.rb
387
+ - lib/kanrisuru/core/zypper/commands/list_repos.rb
388
+ - lib/kanrisuru/core/zypper/commands/list_services.rb
389
+ - lib/kanrisuru/core/zypper/commands/list_updates.rb
390
+ - lib/kanrisuru/core/zypper/commands/modify_repo.rb
391
+ - lib/kanrisuru/core/zypper/commands/modify_service.rb
392
+ - lib/kanrisuru/core/zypper/commands/patch.rb
393
+ - lib/kanrisuru/core/zypper/commands/patch_check.rb
394
+ - lib/kanrisuru/core/zypper/commands/purge_kernels.rb
395
+ - lib/kanrisuru/core/zypper/commands/refresh_repos.rb
396
+ - lib/kanrisuru/core/zypper/commands/refresh_services.rb
397
+ - lib/kanrisuru/core/zypper/commands/remove.rb
398
+ - lib/kanrisuru/core/zypper/commands/remove_lock.rb
399
+ - lib/kanrisuru/core/zypper/commands/remove_repo.rb
400
+ - lib/kanrisuru/core/zypper/commands/remove_service.rb
401
+ - lib/kanrisuru/core/zypper/commands/rename_repo.rb
402
+ - lib/kanrisuru/core/zypper/commands/search.rb
403
+ - lib/kanrisuru/core/zypper/commands/source_install.rb
404
+ - lib/kanrisuru/core/zypper/commands/update.rb
405
+ - lib/kanrisuru/core/zypper/commands/verify.rb
406
+ - lib/kanrisuru/core/zypper/constants.rb
407
+ - lib/kanrisuru/core/zypper/parser.rb
408
+ - lib/kanrisuru/core/zypper/parsers/base.rb
409
+ - lib/kanrisuru/core/zypper/parsers/info.rb
410
+ - lib/kanrisuru/core/zypper/parsers/list_locks.rb
411
+ - lib/kanrisuru/core/zypper/parsers/list_patches.rb
412
+ - lib/kanrisuru/core/zypper/parsers/list_repos.rb
413
+ - lib/kanrisuru/core/zypper/parsers/list_services.rb
414
+ - lib/kanrisuru/core/zypper/parsers/list_updates.rb
415
+ - lib/kanrisuru/core/zypper/parsers/patch_check.rb
416
+ - lib/kanrisuru/core/zypper/parsers/search.rb
417
+ - lib/kanrisuru/core/zypper/types.rb
184
418
  - lib/kanrisuru/logger.rb
185
419
  - lib/kanrisuru/mode.rb
186
420
  - lib/kanrisuru/os_package.rb
@@ -207,13 +441,27 @@ files:
207
441
  - lib/kanrisuru/version.rb
208
442
  - spec/functional/core/apt_spec.rb
209
443
  - spec/functional/core/archive_spec.rb
444
+ - spec/functional/core/disk_spec.rb
445
+ - spec/functional/core/dmi_spec.rb
446
+ - spec/functional/core/file_spec.rb
210
447
  - spec/functional/core/find_spec.rb
448
+ - spec/functional/core/group_spec.rb
449
+ - spec/functional/core/ip/ip_address_label_spec.rb
450
+ - spec/functional/core/ip/ip_address_spec.rb
451
+ - spec/functional/core/ip/ip_link_spec.rb
452
+ - spec/functional/core/ip/ip_maddress_spec.rb
453
+ - spec/functional/core/ip/ip_neighbour_spec.rb
454
+ - spec/functional/core/ip/ip_route_spec.rb
455
+ - spec/functional/core/ip/ip_rule_spec.rb
456
+ - spec/functional/core/ip/ip_spec.rb
211
457
  - spec/functional/core/mount_spec.rb
212
458
  - spec/functional/core/path_spec.rb
213
459
  - spec/functional/core/socket_spec.rb
214
460
  - spec/functional/core/stat_spec.rb
215
461
  - spec/functional/core/stream_spec.rb
462
+ - spec/functional/core/system_spec.rb
216
463
  - spec/functional/core/transfer_spec.rb
464
+ - spec/functional/core/user_spec.rb
217
465
  - spec/functional/core/yum_spec.rb
218
466
  - spec/functional/remote/cluster_spec.rb
219
467
  - spec/functional/remote/cpu_spec.rb
@@ -437,6 +685,7 @@ licenses:
437
685
  metadata:
438
686
  source_code_uri: https://github.com/avamia/kanrisuru/
439
687
  changelog_uri: https://github.com/avamia/kanrisuru/blob/main/CHANGELOG.md
688
+ rubygems_mfa_required: 'true'
440
689
  post_install_message:
441
690
  rdoc_options: []
442
691
  require_paths: