Sha256: 5cb2b3a9d4e8be753b9d304a1372a6607c018430056eca77e56f07a593597e2c
Contents?: true
Size: 1.07 KB
Versions: 5
Compression:
Stored size: 1.07 KB
Contents
module Gondler class Env class << self def accessor(name, source) original_value = ENV[source.to_s] define_method("orig_#{name}") do original_value end define_method(name) do @environments[source] end define_method("#{name}=") do |val| val = val.to_s ENV[source.to_s] = val @environments[source] = val end end end def initialize reload! end def reload! @environments = {} `go env`.each_line do |define| matched = define.match(/\A([A-Z]+)="(.*)"\Z/) @environments[matched[1].to_sym] = matched[2] if matched end end accessor :arch, :GOARCH accessor :bin, :GOBIN accessor :char, :GOCHAR accessor :exe, :GOEXE accessor :host_arch, :GOHOSTARCH accessor :host_os, :GOHOSTOS accessor :os, :GOOS accessor :path, :GOPATH accessor :race, :GORACE accessor :root, :GOROOT accessor :tool_dir, :GOTOOLDIR accessor :cc, :CC accessor :gcc_flags, :GOGCCGLAGS end end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
gondler-0.4.1 | lib/gondler/env.rb |
gondler-0.4.0 | lib/gondler/env.rb |
gondler-0.3.1 | lib/gondler/env.rb |
gondler-0.3.0 | lib/gondler/env.rb |
gondler-0.2.0 | lib/gondler/env.rb |