Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ Other versions of the gem can be installed in addition like so:

Install the gem and add to the application's Gemfile by executing:

$ bundle add win32-registry
```bash
bundle add win32-registry
```

If bundler is not being used to manage dependencies, install the gem by executing:

$ gem install win32-registry
```bash
gem install win32-registry
```

## Usage

Expand All @@ -38,10 +42,8 @@ If bundler is not being used to manage dependencies, install the gem by executin
end
```

Be sure to use backslashs "\\" as path separator.
Forward slashs "/" will not work.
This is in contrast to file paths, which accept forward and backward slashs at will on Windows.

Be sure to use backslashes "\\" as the path separator. Forward slashes "/" will not work.
This is in contrast to file paths, which accept forward and backward slashes at will on Windows.

## Development

Expand Down
6 changes: 3 additions & 3 deletions lib/win32/registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def QueryInfoKey(hkey)
# Replace %\w+% into the environment value of what is contained between the %'s
# This method is used for REG_EXPAND_SZ.
#
# For detail, see expandEnvironmentStrings[http://msdn.microsoft.com/library/en-us/sysinfo/base/expandenvironmentstrings.asp] \Win32 \API.
# For detail, see expandEnvironmentStrings[https://learn.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv-expandenvironmentstringsa] \Win32 \API.
#
def self.expand_environ(str)
str.gsub(Regexp.compile("%([^%]+)%".encode(str.encoding))) {
Expand Down Expand Up @@ -487,7 +487,7 @@ def initialize(hkey, parent, keyname, disposition)
ObjectSpace.define_finalizer self, @@final.call(@hkeyfinal)
end

# Win32::Registry object of parent key, or nil if predefeined key.
# Win32::Registry object of parent key, or nil if predefined key.
attr_reader :parent
# Same as subkey value of Registry.open or
# Registry.create method.
Expand Down Expand Up @@ -571,7 +571,7 @@ def close
# For each value it yields key, type and data.
#
# key is a String which contains name of key.
# type is a type contant kind of Win32::Registry::REG_*
# type is a type constant kind of Win32::Registry::REG_*
# data is the value of this key.
#
def each_value
Expand Down