cookbooks/application_ruby/files/halite_gem/poise_application_ruby/service_mixin.rb
def service_options(resource)
        super
        # Closure scoping for #ruby_command below.
        self_ = self
        # Create a new singleton method that fills in Python for you.
        resource.define_singleton_method(:ruby_command) do |val|
          path = self_.new_resource.app_state_environment_ruby['PATH']
          cmd = if self_.new_resource.parent_bundle
            bundle_exec_command(val, path: path)
          else
            "#{self_.new_resource.ruby} #{PoiseLanguages::Utils.absolute_command(val, path: path)}"
          end
          resource.command(cmd)
        end
        # Include env vars as needed.
        resource.environment.update(new_resource.parent_ruby.ruby_environment) if new_resource.parent_ruby
        resource.environment['BUNDLE_GEMFILE'] = new_resource.parent_bundle.gemfile_path if new_resource.parent_bundle
      end
# Set up the service for running Ruby stuff.
Set up the service for running Ruby stuff.
Set up the service for running Ruby stuff .
def service_options(resource)
        super
        self_ = self
        resource.define_singleton_method(:ruby_command) do |val|
          path = self_.new_resource.app_state_environment_ruby['PATH']
          cmd = if self_.new_resource.parent_bundle
            bundle_exec_command(val, path: path)
          else
            "#{self_.new_resource.ruby} #{PoiseLanguages::Utils.absolute_command(val, path: path)}"
          end
          resource.command(cmd)
        end
        resource.environment.update(new_resource.parent_ruby.ruby_environment) if new_resource.parent_ruby
        resource.environment['BUNDLE_GEMFILE'] = new_resource.parent_bundle.gemfile_path if new_resource.parent_bundle
      end
def service_options ( resource ) super self_ = self resource . define_singleton_method ( :ruby_command ) do | val | path = self_ . new_resource . app_state_environment_ruby [ 'PATH' ] cmd = if self_ . new_resource . parent_bundle bundle_exec_command ( val , path : path ) else "#{self_.new_resource.ruby} #{PoiseLanguages::Utils.absolute_command(val, path: path)}" end resource . command ( cmd ) end resource . environment . update ( new_resource . parent_ruby . ruby_environment ) if new_resource . parent_ruby resource . environment [ 'BUNDLE_GEMFILE' ] = new_resource . parent_bundle . gemfile_path if new_resource . parent_bundle end
Set up the service for running Ruby stuff.
Set up the service for running Ruby stuff .
# Closure scoping for #ruby_command below. # Create a new singleton method that fills in Python for you. # Include env vars as needed.
resource