semrush 3.0.4 → 3.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,5 +7,6 @@ module Semrush
7
7
  class MandatoryParameterUrlNotSetOrEmtpy < BadArgument; end
8
8
  class MandatoryParameterPhraseNotSetOrEmtpy < BadArgument; end
9
9
  class WrongFormatOrEmptyKey < BadArgument; end
10
+ class Nolimit < BadArgument; end
10
11
  end
11
12
  end
@@ -235,6 +235,7 @@ module Semrush
235
235
  params.delete(:report_type) unless REPORT_TYPES.include?(params[:report_type].try(:to_sym))
236
236
  params.delete(:request_type) unless REQUEST_TYPES.include?(params[:request_type].try(:to_sym))
237
237
  @parameters = {:db => "us", :api_key => Semrush.api_key, :limit => "", :offset => "", :export_columns => ""}.merge(@parameters).merge(params)
238
+ raise Semrush::Exception::Nolimit.new(self, "The limit parameter is missing: a limit is required.") unless @parameters[:limit].present?
238
239
  raise Semrush::Exception::BadArgument.new(self, "Request parameter is missing: Domain name, URL, or keywords are required.") unless @parameters[:request].present?
239
240
  raise Semrush::Exception::BadArgument.new(self, "Bad db: #{@parameters[:db]}") unless DBS.include?(@parameters[:db].try(:to_sym))
240
241
  raise Semrush::Exception::BadArgument.new(self, "Bad report type: #{@parameters[:report_type]}") unless REPORT_TYPES.include?(@parameters[:report_type].try(:to_sym))
@@ -1,3 +1,3 @@
1
1
  module Semrush
2
- VERSION = "3.0.4" # we want to follow the API version: for API 3.0, the gem will be version 3.0.x
2
+ VERSION = "3.0.5" # we want to follow the API version: for API 3.0, the gem will be version 3.0.x
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semrush
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.4
4
+ version: 3.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-05 00:00:00.000000000 Z
12
+ date: 2013-01-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport