Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
Open up methods to allow easier programmatic usage
Browse files Browse the repository at this point in the history
  • Loading branch information
schleyfox committed Nov 25, 2014
1 parent 1859859 commit 26ab2d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 10 additions & 3 deletions lib/gratan/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,22 @@ def chunk_by_user(exported)
def apply(file, options = {})
options = @options.merge(options)

apply_context(
load_file(file, options),
options)
end

def apply_context(expected, options = {})
options = @options.merge(options)

in_progress do
walk(file, options)
walk(expected, options)
end
end

private

def walk(file, options)
expected = load_file(file, options)
def walk(expected, options)
actual = Gratan::Exporter.export(@driver, options.merge(:with_identifier => true))

expected.each do |user_host, expected_attrs|
Expand Down
2 changes: 0 additions & 2 deletions lib/gratan/dsl/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ def initialize(path, options = {}, &block)
instance_eval(&block)
end

private

def require(file)
grantfile = (file =~ %r|\A/|) ? file : File.expand_path(File.join(File.dirname(@path), file))

Expand Down

0 comments on commit 26ab2d4

Please sign in to comment.