Permalink
Browse files

Merge branch 'master' of github.com:tobami/littlechef

  • Loading branch information...
2 parents b3ca707 + 4504e39 commit 4edf9255ec31f9d4c94447c190cf4bc34d30124b @tobami committed Dec 19, 2011
View
@@ -26,13 +26,13 @@ except ImportError:
class LittlechefOptionParser(OptionParser):
-
+
def print_help(self, file=None):
from fabric.main import list_commands, state, load_fabfile
OptionParser.print_help(self, file)
docstring, callables, default = load_fabfile(fabfile)
state.commands.update(callables)
- for c in list_commands("\n", "normal"):
+ for c in list_commands("\n", "normal"):
print(c)
sys.exit(0)
@@ -78,7 +78,7 @@ else:
print(NO_ORDER)
else:
# Check for version, that overrides everything else.
- if options.version:
+ if options.version:
print(VERSION.format(littlechef.__version__))
sys.exit(0)
if options.no_report:
@@ -18,7 +18,7 @@
#
if Chef::Config[:solo]
-
+
class Chef
class Environment
def self.load(name)
@@ -28,5 +28,5 @@ def self.load(name)
end
end
end
-
+
end
View
@@ -70,22 +70,22 @@ def match( item )
end
end
end
-
+
# we don't support range matches
# range of integers would be easy to implement
# but string ranges are hard
class FiledRange < Treetop::Runtime::SyntaxNode
end
-
+
class InclFieldRange < FieldRange
end
-
+
class ExclFieldRange < FieldRange
end
-
+
class RangeValue < Treetop::Runtime::SyntaxNode
end
-
+
class FieldName < Treetop::Runtime::SyntaxNode
def match( item )
if self.text_value.count("_") > 0
@@ -109,13 +109,13 @@ def match( item )
self.elements[0].match( item )
end
end
-
+
class Group < Treetop::Runtime::SyntaxNode
def match( item )
self.elements[0].match(item)
end
end
-
+
class BinaryOp < Treetop::Runtime::SyntaxNode
def match( item )
self.elements[1].match(
@@ -124,49 +124,49 @@ def match( item )
)
end
end
-
+
class OrOperator < Treetop::Runtime::SyntaxNode
def match( cond1, cond2 )
cond1 or cond2
end
end
-
+
class AndOperator < Treetop::Runtime::SyntaxNode
def match( cond1, cond2 )
cond1 and cond2
end
end
-
+
# we don't support fuzzy string matching
class FuzzyOp < Treetop::Runtime::SyntaxNode
end
-
+
class BoostOp < Treetop::Runtime::SyntaxNode
end
-
+
class FuzzyParam < Treetop::Runtime::SyntaxNode
end
-
+
class UnaryOp < Treetop::Runtime::SyntaxNode
def match( item )
self.elements[0].match(
self.elements[1].match(item)
)
end
end
-
+
class NotOperator < Treetop::Runtime::SyntaxNode
def match( cond )
not cond
end
end
-
+
class RequiredOperator < Treetop::Runtime::SyntaxNode
end
-
+
class ProhibitedOperator < Treetop::Runtime::SyntaxNode
end
-
+
class Phrase < Treetop::Runtime::SyntaxNode
# a quoted ::Term
def match( value )
@@ -195,7 +195,7 @@ def self.parse(data)
self.clean_tree(tree)
tree
end
-
+
private
def self.clean_tree(root_node)
@@ -18,7 +18,7 @@
#
if Chef::Config[:solo]
-
+
if (defined? require_relative).nil?
# defenition of 'require_relative' for ruby < 1.9, found on stackoverflow.com
def require_relative(relative_feature)
@@ -32,12 +32,12 @@ def require_relative(relative_feature)
require absolute
end
end
-
+
require_relative 'parser.rb'
-
+
class Chef
class Recipe
-
+
# Overwrite the search method of recipes to operate locally by using
# data found in data_bags.
# Only very basic lucene syntax is supported and also sorting the result
View
@@ -1,4 +1,4 @@
[userinfo]
user = testuser
password = testpass
-keypair-file =
+keypair-file =
@@ -7,9 +7,9 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -7,9 +7,9 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0c
-#
+#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -8,9 +8,9 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

0 comments on commit 4edf925

Please sign in to comment.