machinery-tool 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/NEWS +18 -0
  3. data/html/assets/machinery.css +20 -1
  4. data/html/assets/machinery.js +53 -26
  5. data/html/index.html.haml +69 -46
  6. data/lib/analyze_config_file_diffs_task.rb +1 -1
  7. data/lib/array.rb +36 -14
  8. data/lib/cli.rb +45 -50
  9. data/lib/compare_task.rb +1 -1
  10. data/lib/config.rb +8 -2
  11. data/lib/config_base.rb +14 -1
  12. data/lib/element_filter.rb +48 -11
  13. data/lib/exceptions.rb +5 -0
  14. data/lib/filter.rb +63 -14
  15. data/lib/filter_option_parser.rb +83 -0
  16. data/lib/generate_html_task.rb +3 -1
  17. data/lib/hint.rb +36 -18
  18. data/lib/html.rb +1 -0
  19. data/lib/inspect_task.rb +12 -21
  20. data/lib/inspector.rb +13 -6
  21. data/lib/kiwi_config.rb +17 -14
  22. data/lib/list_task.rb +5 -1
  23. data/lib/local_system.rb +3 -4
  24. data/lib/logged_cheetah.rb +3 -1
  25. data/lib/machinery.rb +1 -0
  26. data/lib/object.rb +24 -19
  27. data/lib/scope_file_store.rb +3 -1
  28. data/lib/show_task.rb +5 -7
  29. data/lib/system_description.rb +11 -12
  30. data/lib/system_description_store.rb +1 -1
  31. data/lib/ui.rb +44 -36
  32. data/lib/upgrade_format_task.rb +4 -1
  33. data/lib/version.rb +1 -1
  34. data/man/generated/machinery.1.gz +0 -0
  35. data/man/generated/machinery.1.html +7 -2
  36. data/plugins/inspect/changed_managed_files_inspector.rb +13 -6
  37. data/plugins/inspect/config_files_inspector.rb +27 -20
  38. data/plugins/inspect/groups_inspector.rb +12 -4
  39. data/plugins/inspect/os_inspector.rb +29 -22
  40. data/plugins/inspect/packages_inspector.rb +13 -5
  41. data/plugins/inspect/patterns_inspector.rb +24 -10
  42. data/plugins/inspect/repositories_inspector.rb +19 -15
  43. data/plugins/inspect/services_inspector.rb +28 -22
  44. data/plugins/inspect/unmanaged_files_inspector.rb +42 -33
  45. data/plugins/inspect/users_inspector.rb +13 -5
  46. data/plugins/model/os_model.rb +1 -1
  47. metadata +3 -2
@@ -16,14 +16,22 @@
16
16
  # you may find current contact information at www.suse.com
17
17
 
18
18
  class UsersInspector < Inspector
19
- def inspect(system, description, _filter, _options = {})
20
- passwd = system.read_file("/etc/passwd")
21
- shadow = system.read_file("/etc/shadow")
19
+ def initialize(system, description)
20
+ @system = system
21
+ @description = description
22
+ end
23
+
24
+ def inspect(_filter, _options = {})
25
+ passwd = @system.read_file("/etc/passwd")
26
+ shadow = @system.read_file("/etc/shadow")
22
27
 
23
28
  users = passwd ? parse_users(passwd, shadow) : []
24
29
 
25
- description.users = UsersScope.new(users.sort_by(&:name))
26
- "Found #{users.size} users."
30
+ @description.users = UsersScope.new(users.sort_by(&:name))
31
+ end
32
+
33
+ def summary
34
+ "Found #{@description.users.size} users."
27
35
  end
28
36
 
29
37
  private
@@ -39,7 +39,7 @@ class Os < Machinery::Object
39
39
 
40
40
  def self.from_json(json)
41
41
  scope_object = self.for(json["name"])
42
- scope_object.set_attributes(object_hash_from_json(json))
42
+ scope_object.set_attributes(json)
43
43
  scope_object
44
44
  end
45
45
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: machinery-tool
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SUSE
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-13 00:00:00.000000000 Z
11
+ date: 2015-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cheetah
@@ -255,6 +255,7 @@ files:
255
255
  - lib/exporter.rb
256
256
  - lib/file_validator.rb
257
257
  - lib/filter.rb
258
+ - lib/filter_option_parser.rb
258
259
  - lib/generate_html_task.rb
259
260
  - lib/helper.rb
260
261
  - lib/hint.rb