Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support regular expressions for Windows registry key #892

Merged
merged 4 commits into from Aug 12, 2016

Conversation

chris-rock
Copy link
Contributor

@chris-rock chris-rock commented Aug 9, 2016

This PR aims to bring support for regular expressions to our registry_key resource. A sample could look like:

control 'regex-test' do
  title "Ensure 'Always install with elevated privileges' is set to 'Disabled'"
  children = registry_key({
      hive: 'HKEY_USERS'
  }).children(/^S-1-5-21-[0-9]+-[0-9]+-[0-9]+-[0-9]{3,}\\Software\\Policies\\Microsoft\\Windows\\Installer/)
  describe children do
    it { should_not eq []}
  end
  children.each { |key|
    describe registry_key(key) do
      its('AlwaysInstallElevated') { should cmp 0 }
    end
  }
end
  • support hash params as options for registry key
  • allow regular expression as input params

Feedback is welcome.

cc @ksubrama @mhedgpeth

end

private
# private
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should stay private

@chris-rock chris-rock force-pushed the chris-rock/registry-pattern-match branch from 8e1e57b to 63c729b Compare August 11, 2016 17:06
@chris-rock chris-rock added this to the 0.30.0 milestone Aug 11, 2016
@chris-rock chris-rock self-assigned this Aug 11, 2016
@chris-rock chris-rock force-pushed the chris-rock/registry-pattern-match branch from 63c729b to 60e2319 Compare August 11, 2016 17:42
@chris-rock chris-rock force-pushed the chris-rock/registry-pattern-match branch from 9daaf10 to 04bb833 Compare August 11, 2016 18:28
@chris-rock chris-rock changed the title WIP: Support regular expressions for Windows registry key Support regular expressions for Windows registry key Aug 12, 2016
@chris-rock chris-rock force-pushed the chris-rock/registry-pattern-match branch from 04bb833 to 945c7fd Compare August 12, 2016 08:14
@chris-rock chris-rock force-pushed the chris-rock/registry-pattern-match branch from 945c7fd to 0b195a1 Compare August 12, 2016 08:15
@chris-rock chris-rock force-pushed the chris-rock/registry-pattern-match branch from 5b4a295 to 147283e Compare August 12, 2016 11:51
@arlimus
Copy link
Contributor

arlimus commented Aug 12, 2016

Great improvement and feature!! 👍

@arlimus arlimus merged commit b0f35d0 into master Aug 12, 2016
@arlimus arlimus deleted the chris-rock/registry-pattern-match branch August 12, 2016 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants