lib/itamae/resource/service.rb in itamae-1.0.0.beta41 vs lib/itamae/resource/service.rb in itamae-1.0.0.beta42

- old
+ new

@@ -7,46 +7,46 @@ define_attribute :name, type: String, default_name: true def pre_action case @current_action when :start, :restart - @attributes[:running?] = true + attributes.running = true when :stop - @attributes[:running?] = false + attributes.running = false when :enable - @attributes[:enabled?] = true + attributes.enabled = true when :disable - @attributes[:enabled?] = false + attributes.enabled = false end end def set_current_attributes - @current_attributes[:running?] = run_specinfra(:check_service_is_running, name) - @current_attributes[:enabled?] = run_specinfra(:check_service_is_enabled, name) + current.running = run_specinfra(:check_service_is_running, attributes.name) + current.enabled = run_specinfra(:check_service_is_enabled, attributes.name) end def action_start(options) - run_specinfra(:start_service, name) + run_specinfra(:start_service, attributes.name) end def action_stop(options) - run_specinfra(:stop_service, name) + run_specinfra(:stop_service, attributes.name) end def action_restart(options) - run_specinfra(:restart_service, name) + run_specinfra(:restart_service, attributes.name) end def action_reload(options) - run_specinfra(:reload_service, name) + run_specinfra(:reload_service, attributes.name) end def action_enable(options) - run_specinfra(:enable_service, name) + run_specinfra(:enable_service, attributes.name) end def action_disable(options) - run_specinfra(:disable_service, name) + run_specinfra(:disable_service, attributes.name) end end end end