From e593051e03c05d8a0169d1ceb6929e93271edc8c Mon Sep 17 00:00:00 2001 From: Chavez Date: Sat, 29 Nov 2014 23:49:57 -0700 Subject: [PATCH] Styling fixes --- Rakefile | 2 +- lib/al_papi/config.rb | 2 +- lib/al_papi/http.rb | 2 +- lib/al_papi/keyword.rb | 8 ++++---- lib/al_papi/response.rb | 2 +- spec/keywords_spec.rb | 4 ++-- spec/spec_helper.rb | 6 +++--- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Rakefile b/Rakefile index 97b2064..ba20f8f 100644 --- a/Rakefile +++ b/Rakefile @@ -10,7 +10,7 @@ RSpec::Core::RakeTask.new('spec') do |t| t.pattern = 'spec/**/*_spec.rb' end -task :default => 'spec' +task default: 'spec' YARD::Rake::YardocTask.new(:doc) do |t| t.files = ['lib/**/*.rb', '-', 'README.md'] diff --git a/lib/al_papi/config.rb b/lib/al_papi/config.rb index 9b625ad..d80203e 100644 --- a/lib/al_papi/config.rb +++ b/lib/al_papi/config.rb @@ -21,7 +21,7 @@ def initialize @host = DEFAULT_HOST @port = DEFAULT_PORT end - + end end diff --git a/lib/al_papi/http.rb b/lib/al_papi/http.rb index 5c29ebd..dabcdcc 100644 --- a/lib/al_papi/http.rb +++ b/lib/al_papi/http.rb @@ -17,7 +17,7 @@ def post(path, params = {}) end def build_params(params = {}) - params.merge(:auth_token => @config.api_key, :format => 'json') + params.merge(auth_token: @config.api_key, format: 'json') end def request(http_verb, path, params = nil) diff --git a/lib/al_papi/keyword.rb b/lib/al_papi/keyword.rb index 46a4d20..ee5fb55 100644 --- a/lib/al_papi/keyword.rb +++ b/lib/al_papi/keyword.rb @@ -1,7 +1,7 @@ module AlPapi class Keyword - + ## # # POST a keyword/engine/locale combination to get SERP for. @@ -16,11 +16,11 @@ def self.post(params = {}, priority = false) path = priority ? '/keywords/priority' : '/keywords' AlPapi.http.post path, params end - + ## # # See post method {AlPapi::Keyword.post} for required params - + def self.priority_post(params = {}) post params, true end @@ -41,5 +41,5 @@ def self.get(params = {}) end end - + end diff --git a/lib/al_papi/response.rb b/lib/al_papi/response.rb index b07f92d..937553f 100644 --- a/lib/al_papi/response.rb +++ b/lib/al_papi/response.rb @@ -14,7 +14,7 @@ def initialize(http, _code, _path, _params) # @private @over_limit, @suspended = http.over_limit, http.suspended @code, @path, @params = _code, _path, _params end - + ## # # Convenience method to determine if request was successfull or not diff --git a/spec/keywords_spec.rb b/spec/keywords_spec.rb index 9d8a599..4063a34 100644 --- a/spec/keywords_spec.rb +++ b/spec/keywords_spec.rb @@ -18,7 +18,7 @@ expect(@res).to_not be_suspended expect(@res.body).to_not be_nil expect(@res.code).to eql(200) - expect(@res.params).to eql({ :keyword => 'splash town', :auth_token => TEST_KEY, :format => 'json'}) + expect(@res.params).to eql({ keyword: 'splash town', auth_token: TEST_KEY, format: 'json'}) expect(@res.path).to eql('/keywords') end @@ -47,7 +47,7 @@ expect(@res).to_not be_suspended expect(@res.body).to_not be_nil expect(@res.code).to eql 200 - expect(@res.params).to eql({ :keyword => 'splash town', :auth_token => TEST_KEY, :format => 'json'}) + expect(@res.params).to eql({ keyword: 'splash town', auth_token: TEST_KEY, format: 'json'}) expect(@res.path).to eql '/keywords/priority' end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 24ec0b3..2da8396 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -7,7 +7,7 @@ require 'coveralls' Coveralls.wear! -project_root = File.expand_path(File.dirname(__FILE__) + "/..") +project_root = File.expand_path(File.dirname(__FILE__) + '/..') $LOAD_PATH << "#{project_root}/lib" require 'rubygems' @@ -15,7 +15,7 @@ require 'vcr' require 'pry' -Dir[("#{project_root}/spec/support/**/*.rb")].each {|f| require f} +Dir[("#{project_root}/spec/support/**/*.rb")].each { |f| require f } RSpec.configure do |config| config.run_all_when_everything_filtered = true @@ -35,5 +35,5 @@ config.hook_into :webmock config.cassette_library_dir = 'spec/support' config.ignore_localhost = true - config.default_cassette_options = { :record => :none } + config.default_cassette_options = { record: :none } end