Sha256: 92ac85c6085fb057d981f733b4cf14ee59c61e7d5745f6bfaf9aa10ed548bc30

Contents?: true

Size: 1 KB

Versions: 18

Compression:

Stored size: 1 KB

Contents

require 'libgems/config_file'

module LibGems
  class ConfigFile

    # Duplicate, with slight work-arounds, but needed for SYSTEM_WIDE_CONFIG_FILE
    system_config_path =
      if defined?(Win32API) # Already required in original version
        CSIDL_COMMON_APPDATA = 0x0023
        path = 0.chr * 260
        if RUBY_VERSION > '1.9' then
          SHGetFolderPath = Win32API.new 'shell32', 'SHGetFolderPath', 'PLPLP',
                                         'L', :stdcall
          SHGetFolderPath.call nil, CSIDL_COMMON_APPDATA, nil, 1, path
        else
          SHGetFolderPath = Win32API.new 'shell32', 'SHGetFolderPath', 'LLLLP',
                                         'L'
          SHGetFolderPath.call 0, CSIDL_COMMON_APPDATA, 0, 1, path
        end

        path.strip
      else
        '/etc'
      end

    remove_const(:SYSTEM_WIDE_CONFIG_FILE)
    SYSTEM_WIDE_CONFIG_FILE = File.join system_config_path, 'bpmrc'

    def credentials_path
      File.join(LibGems.user_dir, "credentials")
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
bpm-1.0.0 lib/bpm/libgems_ext/config_file.rb
bpm-1.0.0.rc.4 lib/bpm/libgems_ext/config_file.rb
bpm-1.0.0.rc.3 lib/bpm/libgems_ext/config_file.rb
bpm-1.0.0.rc.2 lib/bpm/libgems_ext/config_file.rb
bpm-1.0.0.rc.1 lib/bpm/libgems_ext/config_file.rb
bpm-1.0.0.beta.13 lib/bpm/libgems_ext/config_file.rb
bpm-1.0.0.beta.12 lib/bpm/libgems_ext/config_file.rb
bpm-1.0.0.beta.11 lib/bpm/libgems_ext/config_file.rb
bpm-1.0.0.beta.10 lib/bpm/libgems_ext/config_file.rb
bpm-1.0.0.beta.9 lib/bpm/libgems_ext/config_file.rb
bpm-1.0.0.beta.8 lib/bpm/libgems_ext/config_file.rb
bpm-1.0.0.beta.6 lib/bpm/libgems_ext/config_file.rb
bpm-1.0.0.beta.5 lib/bpm/libgems_ext/config_file.rb
bpm-1.0.0.beta.4 lib/bpm/libgems_ext/config_file.rb
bpm-0.1.4 lib/bpm/libgems_ext/config_file.rb
bpm-0.1.3 lib/bpm/libgems_ext/config_file.rb
bpm-0.1.2 lib/bpm/libgems_ext/config_file.rb
bpm-0.1.0 lib/bpm/libgems_ext/config_file.rb