Skip to content

Commit

Permalink
Merge branch 'master' of github.com:tobami/littlechef
Browse files Browse the repository at this point in the history
  • Loading branch information
tobami committed Dec 19, 2011
2 parents b3ca707 + 4504e39 commit 4edf925
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 34 deletions.
6 changes: 3 additions & 3 deletions fix
Expand Up @@ -26,13 +26,13 @@ except ImportError:




class LittlechefOptionParser(OptionParser): class LittlechefOptionParser(OptionParser):

def print_help(self, file=None): def print_help(self, file=None):
from fabric.main import list_commands, state, load_fabfile from fabric.main import list_commands, state, load_fabfile
OptionParser.print_help(self, file) OptionParser.print_help(self, file)
docstring, callables, default = load_fabfile(fabfile) docstring, callables, default = load_fabfile(fabfile)
state.commands.update(callables) state.commands.update(callables)
for c in list_commands("\n", "normal"): for c in list_commands("\n", "normal"):
print(c) print(c)
sys.exit(0) sys.exit(0)


Expand Down Expand Up @@ -78,7 +78,7 @@ else:
print(NO_ORDER) print(NO_ORDER)
else: else:
# Check for version, that overrides everything else. # Check for version, that overrides everything else.
if options.version: if options.version:
print(VERSION.format(littlechef.__version__)) print(VERSION.format(littlechef.__version__))
sys.exit(0) sys.exit(0)
if options.no_report: if options.no_report:
Expand Down
4 changes: 2 additions & 2 deletions littlechef/environment.rb
Expand Up @@ -18,7 +18,7 @@
# #


if Chef::Config[:solo] if Chef::Config[:solo]

class Chef class Chef
class Environment class Environment
def self.load(name) def self.load(name)
Expand All @@ -28,5 +28,5 @@ def self.load(name)
end end
end end
end end

end end
36 changes: 18 additions & 18 deletions littlechef/parser.rb
Expand Up @@ -70,22 +70,22 @@ def match( item )
end end
end end
end end

# we don't support range matches # we don't support range matches
# range of integers would be easy to implement # range of integers would be easy to implement
# but string ranges are hard # but string ranges are hard
class FiledRange < Treetop::Runtime::SyntaxNode class FiledRange < Treetop::Runtime::SyntaxNode
end end

class InclFieldRange < FieldRange class InclFieldRange < FieldRange
end end

class ExclFieldRange < FieldRange class ExclFieldRange < FieldRange
end end

class RangeValue < Treetop::Runtime::SyntaxNode class RangeValue < Treetop::Runtime::SyntaxNode
end end

class FieldName < Treetop::Runtime::SyntaxNode class FieldName < Treetop::Runtime::SyntaxNode
def match( item ) def match( item )
if self.text_value.count("_") > 0 if self.text_value.count("_") > 0
Expand All @@ -109,13 +109,13 @@ def match( item )
self.elements[0].match( item ) self.elements[0].match( item )
end end
end end

class Group < Treetop::Runtime::SyntaxNode class Group < Treetop::Runtime::SyntaxNode
def match( item ) def match( item )
self.elements[0].match(item) self.elements[0].match(item)
end end
end end

class BinaryOp < Treetop::Runtime::SyntaxNode class BinaryOp < Treetop::Runtime::SyntaxNode
def match( item ) def match( item )
self.elements[1].match( self.elements[1].match(
Expand All @@ -124,49 +124,49 @@ def match( item )
) )
end end
end end

class OrOperator < Treetop::Runtime::SyntaxNode class OrOperator < Treetop::Runtime::SyntaxNode
def match( cond1, cond2 ) def match( cond1, cond2 )
cond1 or cond2 cond1 or cond2
end end
end end

class AndOperator < Treetop::Runtime::SyntaxNode class AndOperator < Treetop::Runtime::SyntaxNode
def match( cond1, cond2 ) def match( cond1, cond2 )
cond1 and cond2 cond1 and cond2
end end
end end

# we don't support fuzzy string matching # we don't support fuzzy string matching
class FuzzyOp < Treetop::Runtime::SyntaxNode class FuzzyOp < Treetop::Runtime::SyntaxNode
end end

class BoostOp < Treetop::Runtime::SyntaxNode class BoostOp < Treetop::Runtime::SyntaxNode
end end

class FuzzyParam < Treetop::Runtime::SyntaxNode class FuzzyParam < Treetop::Runtime::SyntaxNode
end end

class UnaryOp < Treetop::Runtime::SyntaxNode class UnaryOp < Treetop::Runtime::SyntaxNode
def match( item ) def match( item )
self.elements[0].match( self.elements[0].match(
self.elements[1].match(item) self.elements[1].match(item)
) )
end end
end end

class NotOperator < Treetop::Runtime::SyntaxNode class NotOperator < Treetop::Runtime::SyntaxNode
def match( cond ) def match( cond )
not cond not cond
end end
end end

class RequiredOperator < Treetop::Runtime::SyntaxNode class RequiredOperator < Treetop::Runtime::SyntaxNode
end end

class ProhibitedOperator < Treetop::Runtime::SyntaxNode class ProhibitedOperator < Treetop::Runtime::SyntaxNode
end end

class Phrase < Treetop::Runtime::SyntaxNode class Phrase < Treetop::Runtime::SyntaxNode
# a quoted ::Term # a quoted ::Term
def match( value ) def match( value )
Expand Down Expand Up @@ -195,7 +195,7 @@ def self.parse(data)
self.clean_tree(tree) self.clean_tree(tree)
tree tree
end end

private private


def self.clean_tree(root_node) def self.clean_tree(root_node)
Expand Down
8 changes: 4 additions & 4 deletions littlechef/search.rb
Expand Up @@ -18,7 +18,7 @@
# #


if Chef::Config[:solo] if Chef::Config[:solo]

if (defined? require_relative).nil? if (defined? require_relative).nil?
# defenition of 'require_relative' for ruby < 1.9, found on stackoverflow.com # defenition of 'require_relative' for ruby < 1.9, found on stackoverflow.com
def require_relative(relative_feature) def require_relative(relative_feature)
Expand All @@ -32,12 +32,12 @@ def require_relative(relative_feature)
require absolute require absolute
end end
end end

require_relative 'parser.rb' require_relative 'parser.rb'

class Chef class Chef
class Recipe class Recipe

# Overwrite the search method of recipes to operate locally by using # Overwrite the search method of recipes to operate locally by using
# data found in data_bags. # data found in data_bags.
# Only very basic lucene syntax is supported and also sorting the result # Only very basic lucene syntax is supported and also sorting the result
Expand Down
2 changes: 1 addition & 1 deletion tests/auth.cfg
@@ -1,4 +1,4 @@
[userinfo] [userinfo]
user = testuser user = testuser
password = testpass password = testpass
keypair-file = keypair-file =
4 changes: 2 additions & 2 deletions tests/cookbooks/subversion/attributes/subversion.rb
Expand Up @@ -7,9 +7,9 @@
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down
4 changes: 2 additions & 2 deletions tests/cookbooks/subversion/recipes/client.rb
Expand Up @@ -7,9 +7,9 @@
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0c # http://www.apache.org/licenses/LICENSE-2.0c
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down
4 changes: 2 additions & 2 deletions tests/cookbooks/subversion/recipes/server.rb
Expand Up @@ -8,9 +8,9 @@
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down

0 comments on commit 4edf925

Please sign in to comment.