Skip to content

Commit

Permalink
Use a new Augeas handler for @aug_version to avoid messing up with th…
Browse files Browse the repository at this point in the history
…e shared handler when resource is not defined
  • Loading branch information
raphink committed Mar 30, 2014
1 parent 7808760 commit 192e879
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/augeasproviders/provider.rb
Expand Up @@ -42,7 +42,7 @@ module ClassMethods
# @return [String] Augeas version in use
# @api public
def aug_version
@aug_version ||= augopen { |aug| aug.get('/augeas/version') }
@aug_version ||= Augeas.open(nil, nil, Augeas::NO_MODL_AUTOLOAD) { |aug| aug.get('/augeas/version') }
end

# Returns whether Augeas supports an 'i' flag in regexp expressions
Expand Down Expand Up @@ -689,8 +689,8 @@ def aug_version
# @param [Augeas] aug open Augeas handle
# @return [Boolean] whether Augeas supports case-insensitive regexp expressions
# @api public
def regexpi_supported?(aug)
self.class.regexpi_supported(aug)
def regexpi_supported?
self.class.regexpi_supported
end

# Opens Augeas and returns a handle to use. It loads only the file
Expand Down

0 comments on commit 192e879

Please sign in to comment.