diff --git a/Gemfile b/Gemfile index c8c9324..a95ac24 100644 --- a/Gemfile +++ b/Gemfile @@ -7,6 +7,7 @@ end group :development, :test do gem 'rake', '~> 13.2.1' + gem 'ruby2_keywords' end group :test do diff --git a/Gemfile.lock b/Gemfile.lock index 7f117a5..8073159 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -72,7 +72,8 @@ DEPENDENCIES rack-test (~> 2) rake (~> 13.2.1) redcarpet (~> 3.6.0) + ruby2_keywords simplecov (~> 0.22.0) BUNDLED WITH - 2.4.14 + 2.4.22 diff --git a/lib/looker-sdk.rb b/lib/looker-sdk.rb index fc1a3bc..cfc6054 100644 --- a/lib/looker-sdk.rb +++ b/lib/looker-sdk.rb @@ -50,6 +50,7 @@ #require 'rack' #require 'rack/mock_response' +require 'ruby2_keywords' require 'looker-sdk/client' require 'looker-sdk/default' @@ -74,7 +75,7 @@ def respond_to?(method_name, include_private=false); client.respond_to?(method_n private - def method_missing(method_name, *args, &block) + ruby2_keywords def method_missing(method_name, *args, &block) return super unless client.respond_to?(method_name) client.send(method_name, *args, &block) end diff --git a/lib/looker-sdk/client.rb b/lib/looker-sdk/client.rb index f4f8620..6d82614 100644 --- a/lib/looker-sdk/client.rb +++ b/lib/looker-sdk/client.rb @@ -30,6 +30,7 @@ require 'looker-sdk/rate_limit' require 'looker-sdk/client/dynamic' require 'looker-sdk/error' +require 'ruby2_keywords' module LookerSDK @@ -293,7 +294,7 @@ def client_secret=(value) # LOOKER_SILENT is set to true. # # @return [nil] - def looker_warn(*message) + ruby2_keywords def looker_warn(*message) unless ENV['LOOKER_SILENT'] warn message end diff --git a/lib/looker-sdk/client/dynamic.rb b/lib/looker-sdk/client/dynamic.rb index 1c47a8a..a2a65b4 100644 --- a/lib/looker-sdk/client/dynamic.rb +++ b/lib/looker-sdk/client/dynamic.rb @@ -22,6 +22,8 @@ # THE SOFTWARE. ############################################################################################ +require 'ruby2_keywords' + module LookerSDK class Client @@ -97,12 +99,12 @@ def method_link(entry) # Callers can explicitly 'invoke' remote methods or let 'method_missing' do the trick. # If nothing else, this gives clients a way to deal with potential conflicts between remote method # names and names of methods on client itself. - def invoke(method_name, *args, &block) + ruby2_keywords def invoke(method_name, *args, &block) entry = find_entry(method_name) || raise(NameError, "undefined remote method '#{method_name}'") invoke_remote(entry, method_name, *args, &block) end - def method_missing(method_name, *args, &block) + ruby2_keywords def method_missing(method_name, *args, &block) entry = find_entry(method_name) || (return super) invoke_remote(entry, method_name, *args, &block) end @@ -117,7 +119,7 @@ def find_entry(method_name) operations && operations[method_name.to_sym] if dynamic end - def invoke_remote(entry, method_name, *args, &block) + ruby2_keywords def invoke_remote(entry, method_name, *args, &block) args = (args || []).dup route = entry[:route].to_s.dup params = (entry[:info][:parameters] || []).select {|param| param[:in] == 'path'} diff --git a/lib/looker-sdk/default.rb b/lib/looker-sdk/default.rb index b1ac7df..ea4bd6f 100644 --- a/lib/looker-sdk/default.rb +++ b/lib/looker-sdk/default.rb @@ -31,7 +31,7 @@ module LookerSDK module Default # Default API endpoint look TODO update this as needed - API_ENDPOINT = "https://localhost:19999/api/3.0/".freeze + API_ENDPOINT = "https://localhost:19999/api/4.0/".freeze # Default User Agent header string USER_AGENT = "Looker Ruby Gem #{LookerSDK::VERSION}".freeze