summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAdam Jacob <adam@hjksolutions.com>2008-05-30 09:09:18 -0700
committerAdam Jacob <adam@hjksolutions.com>2008-05-30 09:09:18 -0700
commitd373915a1ac9ea25fcb52ac8468e4670425e3376 (patch)
tree6273a88ff4c37f42bb817c95db177bc41133c64a /lib
parent900e8372d8232cf5b2c3489065b4568670e0e487 (diff)
downloadchef-d373915a1ac9ea25fcb52ac8468e4670425e3376.tar.gz
Cleaning up openid, starting client support
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/file_store.rb19
-rw-r--r--lib/chef/rest.rb33
2 files changed, 52 insertions, 0 deletions
diff --git a/lib/chef/file_store.rb b/lib/chef/file_store.rb
index b834624090..1c2b02ed2f 100644
--- a/lib/chef/file_store.rb
+++ b/lib/chef/file_store.rb
@@ -77,6 +77,25 @@ class Chef
keys
end
+ def has_key?(obj_type, name)
+ validate(
+ {
+ :obj_type => obj_type,
+ :name => name,
+ },
+ {
+ :obj_type => { :kind_of => String },
+ :name => { :kind_of => String },
+ }
+ )
+ Dir[File.join(Chef::Config[:file_store_path], obj_type, '**', '*')].each do |f|
+ if File.file?(f)
+ return true if File.basename(f) == name
+ end
+ end
+ return false
+ end
+
def create_store_path(obj_type, key)
shadigest = Digest::SHA2.hexdigest("#{obj_type}#{key}")
diff --git a/lib/chef/rest.rb b/lib/chef/rest.rb
new file mode 100644
index 0000000000..1ca18e4ef5
--- /dev/null
+++ b/lib/chef/rest.rb
@@ -0,0 +1,33 @@
+#
+# Author:: Adam Jacob (<adam@hjksolutions.com>)
+# Copyright:: Copyright (c) 2008 HJK Solutions, LLC
+# License:: GNU General Public License version 2 or later
+#
+# This program and entire repository is free software; you can
+# redistribute it and/or modify it under the terms of the GNU
+# General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+require File.join(File.dirname(__FILE__), "mixin", "params_validate")
+require 'net/https'
+require 'uri'
+require 'json'
+
+class Chef
+ class REST
+
+ def initialize(url, username)
+ end
+
+ end
+end \ No newline at end of file