aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ievkit.rb
diff options
context:
space:
mode:
authorLuc Donnet2015-03-23 21:12:56 +0100
committerLuc Donnet2015-03-23 21:12:56 +0100
commitfa7e745459aefd64086869882fcca73f948b46fa (patch)
treea5df17d4498b4ca612f6398156a667d2593cc76e /lib/ievkit.rb
parent0740decc6a2c5117d1dc89e3665774460626f86b (diff)
downloadchouette-core-fa7e745459aefd64086869882fcca73f948b46fa.tar.bz2
Change ruby client for iev server
Diffstat (limited to 'lib/ievkit.rb')
-rw-r--r--lib/ievkit.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/ievkit.rb b/lib/ievkit.rb
new file mode 100644
index 000000000..7e47e9d84
--- /dev/null
+++ b/lib/ievkit.rb
@@ -0,0 +1,33 @@
+require 'ievkit/client'
+require 'ievkit/default'
+
+# Ruby toolkit for the GitHub API
+module Ievkit
+
+ class << self
+ include Ievkit::Configurable
+
+ # API client based on configured options {Configurable}
+ #
+ # @return [Ievkit::Client] API wrapper
+ def client
+ @client = Ievkit::Client.new(options) unless defined?(@client) && @client.same_options?(options)
+ @client
+ end
+
+ # @private
+ def respond_to_missing?(method_name, include_private=false); client.respond_to?(method_name, include_private); end if RUBY_VERSION >= "1.9"
+ # @private
+ def respond_to?(method_name, include_private=false); client.respond_to?(method_name, include_private) || super; end if RUBY_VERSION < "1.9"
+
+ private
+
+ def method_missing(method_name, *args, &block)
+ return super unless client.respond_to?(method_name)
+ client.send(method_name, *args, &block)
+ end
+
+ end
+end
+
+Ievkit.setup