Sha256: e0785e847d45e82d7a0dcac6ed5b81d91fac6511b05923f59a384ce97140132b

Contents?: true

Size: 480 Bytes

Versions: 9

Compression:

Stored size: 480 Bytes

Contents

# frozen_string_literal: true

module Runcom
  # A common context for all XDG custom objects.
  Context = Struct.new :defaults, :home, :environment, :xdg, keyword_init: true do
    def initialize *arguments
      super

      self[:home] ||= Paths::Home
      self[:environment] ||= ENV

      # rubocop:disable Style/MethodCallWithArgsParentheses
      self[:xdg] = xdg.new(home:, environment:) if xdg
      # rubocop:enable Style/MethodCallWithArgsParentheses
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
runcom-8.6.0 lib/runcom/context.rb
runcom-8.5.0 lib/runcom/context.rb
runcom-8.4.0 lib/runcom/context.rb
runcom-8.3.3 lib/runcom/context.rb
runcom-8.3.2 lib/runcom/context.rb
runcom-8.3.1 lib/runcom/context.rb
runcom-8.3.0 lib/runcom/context.rb
runcom-8.2.0 lib/runcom/context.rb
runcom-8.1.0 lib/runcom/context.rb