wright 0.4.4 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +10 -3
  3. data/NEWS.md +8 -0
  4. data/README.md +9 -16
  5. data/lib/wright/cli.rb +25 -24
  6. data/lib/wright/config.rb +5 -3
  7. data/lib/wright/dsl.rb +52 -9
  8. data/lib/wright/logger.rb +1 -1
  9. data/lib/wright/provider.rb +8 -5
  10. data/lib/wright/provider/directory.rb +2 -2
  11. data/lib/wright/provider/file.rb +4 -4
  12. data/lib/wright/provider/group.rb +4 -4
  13. data/lib/wright/provider/package.rb +3 -3
  14. data/lib/wright/provider/package/apt.rb +1 -1
  15. data/lib/wright/provider/package/yum.rb +1 -1
  16. data/lib/wright/provider/symlink.rb +2 -2
  17. data/lib/wright/provider/user.rb +8 -8
  18. data/lib/wright/resource.rb +21 -19
  19. data/lib/wright/resource/directory.rb +21 -10
  20. data/lib/wright/resource/file.rb +25 -14
  21. data/lib/wright/resource/group.rb +16 -9
  22. data/lib/wright/resource/package.rb +14 -9
  23. data/lib/wright/resource/symlink.rb +10 -8
  24. data/lib/wright/resource/user.rb +30 -9
  25. data/lib/wright/util.rb +14 -2
  26. data/lib/wright/util/erb_renderer.rb +29 -0
  27. data/lib/wright/util/file.rb +1 -1
  28. data/lib/wright/util/file_owner.rb +8 -3
  29. data/lib/wright/util/file_permissions.rb +14 -12
  30. data/lib/wright/util/file_renderer.rb +50 -0
  31. data/lib/wright/util/mustache_renderer.rb +41 -0
  32. data/lib/wright/util/pencil_mustache.rb +58 -0
  33. data/lib/wright/version.rb +1 -1
  34. data/man/wright.1 +10 -11
  35. data/spec/dsl_spec.rb +72 -7
  36. data/spec/provider/package/apt/{apt-get_--purge_remove_-qy_abcde.return → apt-get_-qy_--purge_remove_abcde.return} +0 -0
  37. data/spec/provider/package/apt/{apt-get_--purge_remove_-qy_abcde.stderr → apt-get_-qy_--purge_remove_abcde.stderr} +0 -0
  38. data/spec/provider/package/apt/{apt-get_--purge_remove_-qy_abcde.stdout → apt-get_-qy_--purge_remove_abcde.stdout} +0 -0
  39. data/spec/provider/package/apt/{apt-get_install_-qy_abcde=2.5.4-1.return → apt-get_-qy_install_abcde=2.5.4-1.return} +0 -0
  40. data/spec/provider/package/apt/{apt-get_install_-qy_abcde=2.5.4-1.stderr → apt-get_-qy_install_abcde=2.5.4-1.stderr} +0 -0
  41. data/spec/provider/package/apt/{apt-get_install_-qy_abcde=2.5.4-1.stdout → apt-get_-qy_install_abcde=2.5.4-1.stdout} +0 -0
  42. data/spec/provider/package/apt/{apt-get_install_-qy_htop.return → apt-get_-qy_install_htop.return} +0 -0
  43. data/spec/provider/package/apt/{apt-get_install_-qy_htop.stderr → apt-get_-qy_install_htop.stderr} +0 -0
  44. data/spec/provider/package/apt/{apt-get_install_-qy_htop.stdout → apt-get_-qy_install_htop.stdout} +0 -0
  45. data/spec/provider/package/apt/{apt-get_install_-qy_not-a-real-package.return → apt-get_-qy_install_not-a-real-package.return} +0 -0
  46. data/spec/provider/package/apt/{apt-get_install_-qy_not-a-real-package.stderr → apt-get_-qy_install_not-a-real-package.stderr} +0 -0
  47. data/spec/provider/package/apt/{apt-get_install_-qy_not-a-real-package.stdout → apt-get_-qy_install_not-a-real-package.stdout} +0 -0
  48. data/spec/provider/package/apt/{apt-get_remove_-qy_abcde.return → apt-get_-qy_remove_abcde.return} +0 -0
  49. data/spec/provider/package/apt/{apt-get_remove_-qy_abcde.stderr → apt-get_-qy_remove_abcde.stderr} +0 -0
  50. data/spec/provider/package/apt/{apt-get_remove_-qy_abcde.stdout → apt-get_-qy_remove_abcde.stdout} +0 -0
  51. data/spec/provider/package/apt_spec.rb +2 -2
  52. data/spec/provider/package/yum/{yum_install_-y_mc-4.8.7-8.el7.return → yum_-y_install_mc-4.8.7-8.el7.return} +0 -0
  53. data/spec/provider/package/yum/{yum_install_-y_mc-4.8.7-8.el7.stderr → yum_-y_install_mc-4.8.7-8.el7.stderr} +0 -0
  54. data/spec/provider/package/yum/{yum_install_-y_mc-4.8.7-8.el7.stdout → yum_-y_install_mc-4.8.7-8.el7.stdout} +0 -0
  55. data/spec/provider/package/yum/{yum_install_-y_nano.return → yum_-y_install_nano.return} +0 -0
  56. data/spec/provider/package/yum/{yum_install_-y_nano.stderr → yum_-y_install_nano.stderr} +0 -0
  57. data/spec/provider/package/yum/{yum_install_-y_nano.stdout → yum_-y_install_nano.stdout} +0 -0
  58. data/spec/provider/package/yum/{yum_install_-y_not-a-real-package.return → yum_-y_install_not-a-real-package.return} +0 -0
  59. data/spec/provider/package/yum/{yum_install_-y_not-a-real-package.stderr → yum_-y_install_not-a-real-package.stderr} +0 -0
  60. data/spec/provider/package/yum/{yum_install_-y_not-a-real-package.stdout → yum_-y_install_not-a-real-package.stdout} +0 -0
  61. data/spec/provider/package/yum/{yum_remove_-y_screen.return → yum_-y_remove_screen.return} +0 -0
  62. data/spec/provider/package/yum/{yum_remove_-y_screen.stderr → yum_-y_remove_screen.stderr} +0 -0
  63. data/spec/provider/package/yum/{yum_remove_-y_screen.stdout → yum_-y_remove_screen.stdout} +0 -0
  64. data/spec/provider/package/yum_spec.rb +1 -1
  65. data/spec/resource/directory_spec.rb +15 -0
  66. data/spec/resource/file_spec.rb +17 -0
  67. data/spec/resource/group_spec.rb +15 -0
  68. data/spec/resource/package_spec.rb +13 -0
  69. data/spec/resource/symlink_spec.rb +11 -0
  70. data/spec/resource/user_spec.rb +32 -0
  71. data/spec/resource_spec.rb +18 -10
  72. data/spec/spec_helper.rb +1 -0
  73. data/spec/spec_helpers/fake_capture3.rb +1 -1
  74. data/spec/util/erb_renderer_spec.rb +23 -0
  75. data/spec/util/file_owner_spec.rb +19 -0
  76. data/spec/util/file_renderer_spec.rb +28 -0
  77. data/spec/util/mustache_renderer_spec.rb +57 -0
  78. data/spec/util/pencil_mustache_spec.rb +15 -0
  79. data/spec/util_spec.rb +17 -3
  80. metadata +90 -64
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ff506ba7676ffd4953acf95f89567d8f67a88c3
4
- data.tar.gz: 15f2d5ee585dcaf17acdd7b1e189f7aca4c0e695
3
+ metadata.gz: a9d5eb3fb564f26c7d3c7e2dbc90aa4086e74fbb
4
+ data.tar.gz: f742866f8bfe1e1c8c40a61bf919b052ebe2744c
5
5
  SHA512:
6
- metadata.gz: 17805205d6096faceb9db3b7432b10da5243a399d4874bc7705e30890b8f2810511871abdcf05b88f0d4c0111d264ff8034bb221b710d0c912ccdbddb4ae73f6
7
- data.tar.gz: c7d5668cdc7ea3488614742ab697f72b04d597a8abac48a66ab16982509e6156f7ce17aba953828ba89d8d7144e7a1a37b39457fd791fb29d51625f54fbc5d72
6
+ metadata.gz: e84a4542c49ef1d19c1f04bfa645d7d5308dfbdce16cc7804f927e0a4ec24f2a451f9b09b8395b3085c68190234f21c2ca7ec5ee4a2c9db71e334b2a3f4b58b7
7
+ data.tar.gz: e3a4531204757348c7a5d139f8196443d8ac542e6225d4fd2032a7cb2a5760f75b6139b64ed82621fb9de8c69256386ca6381e1e7a0c4c106bae6714d48ed530
@@ -1,12 +1,10 @@
1
1
  Contributing
2
2
  ============
3
-
4
3
  Contributions to wright are greatly appreciated. Here's how you can
5
4
  help.
6
5
 
7
6
  Reporting issues
8
7
  ----------------
9
-
10
8
  If you encounter any problems with wright, please take the time to
11
9
  report them via the [issue tracker][github-issues].
12
10
 
@@ -19,7 +17,6 @@ report them via the [issue tracker][github-issues].
19
17
 
20
18
  Submitting pull requests
21
19
  ------------------------
22
-
23
20
  - Fork the project.
24
21
  - Open a new feature branch (`git checkout -b hackety-hack`).
25
22
  - Write [proper commit messages][commit-messages].
@@ -32,3 +29,13 @@ Submitting pull requests
32
29
 
33
30
  [commit-messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
34
31
  [pull-requests]: https://help.github.com/articles/using-pull-requests/
32
+
33
+ Running the tests
34
+ -----------------
35
+ To start hacking on wright, simply install the development
36
+ dependencies via bundler and run the tests:
37
+
38
+ - `bundle install --path .bundle`
39
+ - `bundle exec rake test`
40
+
41
+ All tests should pass.
data/NEWS.md CHANGED
@@ -1,4 +1,12 @@
1
1
  # wright NEWS
2
+ ## 0.5.0 (2015-09-21)
3
+ - Add attribute hash support to DSL and resources
4
+ - Add template helpers
5
+ - Add util.render_erb to DSL
6
+ - Add util.render_mustache to DSL
7
+ - Add util.render_file to DSL
8
+ - Add support for Fedora
9
+
2
10
  ## 0.4.4 (2015-08-06)
3
11
  - Fix update status for file provider if content attribute is nil and
4
12
  file already has content (#16)
data/README.md CHANGED
@@ -17,21 +17,20 @@ Performing simple administrative tasks with wright is easy.
17
17
 
18
18
  package 'sudo'
19
19
 
20
- file '/etc/sudoers.d/env_keep-editor' do |f|
21
- f.content = "Defaults env_keep += EDITOR\n"
22
- f.owner = 'root:root'
23
- f.mode = '440'
24
- end
20
+ file '/etc/sudoers.d/env_keep-editor',
21
+ content: "Defaults env_keep += EDITOR\n",
22
+ owner: 'root:root',
23
+ mode: '440'
25
24
  ```
26
25
 
27
26
  Scripts can also be run directly from the shell.
28
27
 
29
- wright -e "package('tmux')"
28
+ wright -e "package 'tmux'"
30
29
 
31
30
  If you would rather see the effects of running a wright script first,
32
31
  use the dry-run option:
33
32
 
34
- wright --dry-run -e "package('tmux')"
33
+ wright --dry-run -e "package 'tmux'"
35
34
 
36
35
  For a list of command-line parameters, see
37
36
  [the manpage][wright-manpage]. For a more in-depth list of tasks you
@@ -68,10 +67,11 @@ interest to you:
68
67
  - [wright manpage][wright-manpage]
69
68
  - [list of wright resources][wright-resources]
70
69
  - [wright is just Ruby][wright-is-ruby]
70
+ - [list of supported platforms][wright-platforms]
71
71
 
72
72
  As a wright developer, you might also be interested in the
73
73
  [wright developer docs](http://www.rubydoc.info/gems/wright/) which
74
- can also be generated via `bundle exec yard`.
74
+ can be generated via `bundle exec yard`.
75
75
 
76
76
  Contributing
77
77
  ------------
@@ -79,14 +79,6 @@ Contributions to wright are greatly appreciated. If you would like to
79
79
  contribute to wright, please have a look at the
80
80
  [contribution guidelines](CONTRIBUTING.md).
81
81
 
82
- To start hacking on wright, simply install the development
83
- dependencies via bundler:
84
-
85
- - `bundle install --path .bundle`
86
- - `bundle exec rake test`
87
-
88
- All tests should pass.
89
-
90
82
  Copyright
91
83
  ---------
92
84
  Copyright (c) 2012-2015 Sebastian Boehm. See [LICENSE](LICENSE) for
@@ -100,3 +92,4 @@ details.
100
92
  [wright-manpage]: http://wright.sometimesfood.org/man/wright.1.html
101
93
  [wright-resources]: http://wright.sometimesfood.org/doc/resources.html
102
94
  [wright-is-ruby]: http://wright.sometimesfood.org/doc/wright-is-ruby.html
95
+ [wright-platforms]: http://wright.sometimesfood.org/doc/supported-platforms.html
@@ -16,38 +16,39 @@ module Wright
16
16
  # @param argv [Array<String>] the arguments passed to bin/wright
17
17
  def run(argv)
18
18
  arguments = parse(argv)
19
- return if @quit
19
+ return if quit
20
20
 
21
- Wright.activate_dry_run if @dry_run
22
- Wright.log.level = @log_level if @log_level
23
- @main.extend Wright::DSL
24
- @requires.each { |r| require r }
21
+ Wright.activate_dry_run if dry_run
22
+ Wright.log.level = log_level if log_level
23
+ main.extend Wright::DSL
24
+ requires.each { |r| require r }
25
25
 
26
26
  run_script(arguments)
27
27
  end
28
28
 
29
29
  private
30
30
 
31
- attr_reader :commands, :requires, :dry_run, :log_level
31
+ attr_accessor :parser, :quit, :log_level, :dry_run
32
+ attr_reader :commands, :requires, :main
32
33
 
33
34
  def parse(argv)
34
35
  # use OptionParser#order! instead of #parse! so CLI#run does not
35
36
  # consume --arguments passed to wright scripts
36
- @parser.order!(argv)
37
+ parser.order!(argv)
37
38
  end
38
39
 
39
40
  def run_script(arguments)
40
- if @commands.empty? && arguments.any?
41
+ if commands.empty? && arguments.any?
41
42
  script = File.expand_path(arguments.shift)
42
43
  load script
43
44
  else
44
- commands = @commands.empty? ? $stdin.read : @commands.join("\n")
45
- @main.instance_eval(commands, '<main>', 1)
45
+ cmds = commands.empty? ? $stdin.read : commands.join("\n")
46
+ main.instance_eval(cmds, '<main>', 1)
46
47
  end
47
48
  end
48
49
 
49
50
  def set_up_parser
50
- @parser = OptionParser.new
51
+ self.parser = OptionParser.new
51
52
  set_up_command_option
52
53
  set_up_require_option
53
54
  set_up_dry_run_option
@@ -56,38 +57,38 @@ module Wright
56
57
  end
57
58
 
58
59
  def set_up_command_option
59
- @parser.on('-e COMMAND', 'Run COMMAND') do |e|
60
- @commands << e
60
+ parser.on('-e COMMAND', 'Run COMMAND') do |e|
61
+ commands << e
61
62
  end
62
63
  end
63
64
 
64
65
  def set_up_require_option
65
- @parser.on('-r LIBRARY',
66
- 'Require LIBRARY before running the script') do |r|
67
- @requires << r
66
+ parser.on('-r LIBRARY',
67
+ 'Require LIBRARY before running the script') do |r|
68
+ requires << r
68
69
  end
69
70
  end
70
71
 
71
72
  def set_up_dry_run_option
72
- @parser.on('-n', '--dry-run', 'Enable dry-run mode') do
73
- @dry_run = true
73
+ parser.on('-n', '--dry-run', 'Enable dry-run mode') do
74
+ self.dry_run = true
74
75
  end
75
76
  end
76
77
 
77
78
  def set_up_verbosity_options
78
- @parser.on('-v', '--verbose', 'Increase verbosity') do
79
- @log_level = Wright::Logger::DEBUG
79
+ parser.on('-v', '--verbose', 'Increase verbosity') do
80
+ self.log_level = Wright::Logger::DEBUG
80
81
  end
81
82
 
82
- @parser.on('-q', '--quiet', 'Decrease verbosity') do
83
- @log_level = Wright::Logger::ERROR
83
+ parser.on('-q', '--quiet', 'Decrease verbosity') do
84
+ self.log_level = Wright::Logger::ERROR
84
85
  end
85
86
  end
86
87
 
87
88
  def set_up_version_option
88
- @parser.on_tail('--version', 'Show wright version') do
89
+ parser.on_tail('--version', 'Show wright version') do
89
90
  puts "wright version #{Wright::VERSION}"
90
- @quit = true
91
+ self.quit = true
91
92
  end
92
93
  end
93
94
  end
@@ -14,7 +14,9 @@ module Wright
14
14
  @config_hash = {}
15
15
  class << self
16
16
  extend Forwardable
17
- def_delegators :@config_hash, :[], :[]=, :size
17
+ def_delegators :config_hash, :[], :[]=, :size
18
+ attr_reader :config_hash
19
+ private :config_hash
18
20
  end
19
21
  private_class_method :new
20
22
 
@@ -34,7 +36,7 @@ module Wright
34
36
  # otherwise.
35
37
  def self.nested_key?(*path)
36
38
  last_key = path.pop
37
- last_hash = path.reduce(@config_hash) do |hash, key|
39
+ last_hash = path.reduce(config_hash) do |hash, key|
38
40
  return false unless hash.respond_to?(:fetch)
39
41
  hash.fetch(key, {})
40
42
  end
@@ -55,7 +57,7 @@ module Wright
55
57
  #
56
58
  # @return the configuration value or nil if the value is not set
57
59
  def self.nested_value(*path)
58
- nested_key?(*path) ? path.reduce(@config_hash) { |a, e| a[e] } : nil
60
+ nested_key?(*path) ? path.reduce(config_hash) { |a, e| a[e] } : nil
59
61
  end
60
62
  end
61
63
  end
@@ -1,4 +1,7 @@
1
1
  require 'wright/util'
2
+ require 'wright/util/erb_renderer'
3
+ require 'wright/util/mustache_renderer'
4
+ require 'wright/util/file_renderer'
2
5
 
3
6
  module Wright
4
7
  # Includable Wright script DSL.
@@ -27,22 +30,58 @@ module Wright
27
30
  # a_sink_to_remember.class
28
31
  # # => KitchenSink
29
32
  module DSL
33
+ # DSL helper class.
34
+ class Util
35
+ # Renders an ERB template using the supplied hash.
36
+ # @param template [String] the template
37
+ # @param hash [Hash] the hash
38
+ # @return [String] the rendered template
39
+ def render_erb(template, hash)
40
+ Wright::Util::ErbRenderer.new(hash).render(template)
41
+ end
42
+
43
+ # Renders a mustache template using the supplied hash.
44
+ # @param template [String] the template
45
+ # @param hash [Hash] the hash
46
+ # @return [String] the rendered template
47
+ def render_mustache(template, hash)
48
+ Wright::Util::MustacheRenderer.new(hash).render(template)
49
+ end
50
+
51
+ # Renders a template file according to the file's extension
52
+ # using the supplied hash. Currently supports ERB (+.erb+) and
53
+ # Mustache (+.mustache+).
54
+ #
55
+ # @param filename [String] the filename of the template file
56
+ # @param hash [Hash] the hash
57
+ # @return [String] the rendered template
58
+ def render_file(filename, hash)
59
+ Wright::Util::FileRenderer.new(hash).render(filename)
60
+ end
61
+ end
62
+
63
+ # Supplies access to various useful helper methods.
64
+ # @return [Wright::DSL::Util] a utility helper
65
+ def util
66
+ Wright::DSL::Util.new
67
+ end
68
+
30
69
  # Registers a class as a resource.
31
70
  #
32
71
  # Creates a resource method in the DSL module. Uses the
33
72
  # snake-cased class name as method name.
34
73
  #
35
- # Typically resource_class is a subclass of {Resource}. It is
36
- # initialized with the resource's name as an argument.
37
- #
38
- # @param resource_class the resource class
74
+ # Typically +resource_class+ is a subclass of {Resource}. It is
75
+ # initialized with the resource's name and the attribute hash as
76
+ # arguments.
39
77
  #
78
+ # @param resource_class [Class] the resource class
40
79
  # @return [void]
41
80
  def self.register_resource(resource_class)
42
- method_name = Util.class_to_resource_name(resource_class)
81
+ method_name = Wright::Util.class_to_resource_name(resource_class)
43
82
  this_module = self
44
- define_method(method_name) do |name, &block|
45
- this_module.yield_resource(resource_class, name, &block)
83
+ define_method(method_name) do |name, args = {}, &block|
84
+ this_module.yield_resource(resource_class, name, args, &block)
46
85
  end
47
86
  end
48
87
 
@@ -52,10 +91,14 @@ module Wright
52
91
  # Implicitly invoking a block from within another block does not
53
92
  # work: http://blog.sidu.in/2007/11/ruby-blocks-gotchas.html
54
93
  #
94
+ # @param resource_class [Class] the resource class
95
+ # @param name [String] the name of the resource object
96
+ # @param args [Hash<Symbol, Object] the attribute hash of the resource
97
+ #
55
98
  # @yield [Resource] the resource
56
99
  # @return [void]
57
- def self.yield_resource(resource_class, name)
58
- r = resource_class.new(name)
100
+ def self.yield_resource(resource_class, name, args)
101
+ r = resource_class.new(name, args)
59
102
  yield(r) if block_given?
60
103
  r.run_action if r.respond_to?(:run_action)
61
104
  r
@@ -58,7 +58,7 @@ module Wright # rubocop:disable Documentation
58
58
  def initialize(logdev = $stdout)
59
59
  super
60
60
  Wright::Config[:log] ||= {}
61
- return if Wright::Config[:log].has_key?(:colorize)
61
+ return if Wright::Config[:log].key?(:colorize)
62
62
 
63
63
  Wright::Config[:log][:colorize] = logdev.tty?
64
64
  end
@@ -26,13 +26,16 @@ module Wright
26
26
  # @return [Bool] true if the provider was updated and false
27
27
  # otherwise
28
28
  def updated?
29
- updated = @updated
30
- @updated = false
31
- updated
29
+ updated_since_last_call = updated
30
+ self.updated = false
31
+ updated_since_last_call
32
32
  end
33
33
 
34
34
  private
35
35
 
36
+ attr_accessor :updated
37
+ attr_reader :resource
38
+
36
39
  # @api public
37
40
  # Logs an info message and runs a code block unless dry run mode
38
41
  # is active.
@@ -49,7 +52,7 @@ module Wright
49
52
 
50
53
  # @api public
51
54
  # Checks if the provider is up-to-date, runs a code block and sets
52
- # `@updated` to `true` if it is not.
55
+ # `updated` to `true` if it is not.
53
56
  #
54
57
  # @param action [String] the target action
55
58
  # @param message [String] a log message that is displayed if the
@@ -59,7 +62,7 @@ module Wright
59
62
  Wright.log.debug message
60
63
  else
61
64
  yield
62
- @updated = true
65
+ self.updated = true
63
66
  end
64
67
  end
65
68
 
@@ -42,11 +42,11 @@ module Wright
42
42
  private
43
43
 
44
44
  def dir_name
45
- @resource.name
45
+ resource.name
46
46
  end
47
47
 
48
48
  def permissions
49
- Wright::Util::FilePermissions.create_from_resource(@resource,
49
+ Wright::Util::FilePermissions.create_from_resource(resource,
50
50
  :directory)
51
51
  end
52
52
 
@@ -14,7 +14,7 @@ module Wright
14
14
  # Creates or updates the file.
15
15
  #
16
16
  # @return [void]
17
- # @raise [Errno::EISDIR] if there is already a directory with
17
+ # @raise [Errno::EISDIR] if there already is a directory with
18
18
  # the specified name
19
19
  def create
20
20
  fail_if_directory
@@ -44,15 +44,15 @@ module Wright
44
44
  private
45
45
 
46
46
  def file_name
47
- @resource.name
47
+ resource.name
48
48
  end
49
49
 
50
50
  def content
51
- @resource.content
51
+ resource.content
52
52
  end
53
53
 
54
54
  def permissions
55
- Wright::Util::FilePermissions.create_from_resource(@resource, :file)
55
+ Wright::Util::FilePermissions.create_from_resource(resource, :file)
56
56
  end
57
57
 
58
58
  def write_content_to_file
@@ -32,19 +32,19 @@ module Wright
32
32
  private
33
33
 
34
34
  def group_name
35
- @resource.name
35
+ resource.name
36
36
  end
37
37
 
38
38
  def gid
39
- @resource.gid
39
+ resource.gid
40
40
  end
41
41
 
42
42
  def members
43
- @resource.members
43
+ resource.members
44
44
  end
45
45
 
46
46
  def system_group?
47
- @resource.system
47
+ resource.system
48
48
  end
49
49
 
50
50
  def ensure_group_exists