majestic_seo_api 1.2.6 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0bedd1c8d8849e90e9e6ae53dfd86dec203cd422
4
+ data.tar.gz: d86804a3906c4b5fcbd178375a530deb22135eee
5
+ SHA512:
6
+ metadata.gz: 18aff57ff3cb19af4b6f3b4481ac3b0d1606e1b18af038efa58e1e54352f8112efbe82b508d4d4b61e794f3f890b5c5db87c7384172574ffe70df3de0fad876a
7
+ data.tar.gz: 4356995e2cac7082546218fa0f2a8cca80917fdb99edc6df2334658635629efcba974a01205c328307a8f05b8d49f21f1e8bff80465ee27cf7fb3f998ee6e8e9
@@ -139,7 +139,7 @@ module MajesticSeo
139
139
  response = nil
140
140
 
141
141
  begin
142
- log(:info, "[MajesticSeo::Api::Client] - Sending API Request to Namecheap. Parameters: #{parameters.inspect}. Options: #{options.inspect}")
142
+ log(:info, "[MajesticSeo::Api::Client] - Sending API Request to Majestic SEO. Parameters: #{parameters.inspect}. Options: #{options.inspect}")
143
143
  response = @connection.get do |request|
144
144
  request.params = parameters if (!parameters.empty?)
145
145
  request.options = options if (!options.empty?)
@@ -155,5 +155,4 @@ module MajesticSeo
155
155
  end
156
156
 
157
157
  end
158
- end
159
-
158
+ end
@@ -0,0 +1,5 @@
1
+ module MajesticSeo
2
+ module Api
3
+ class InsufficientIndexItemInfoUnitsException < StandardError; end
4
+ end
5
+ end
@@ -37,9 +37,17 @@ module MajesticSeo
37
37
  def initialize(response, table_key = "Results")
38
38
  self.table_key = table_key
39
39
  super(response)
40
+ raise_exceptions_if_necessary
40
41
  parse_item_info_objects
41
42
  end
42
43
 
44
+ def raise_exceptions_if_necessary
45
+ case self.code
46
+ when 'InsufficientIndexItemInfoUnits'
47
+ raise MajesticSeo::Api::InsufficientIndexItemInfoUnitsException.new(self.error_message)
48
+ end unless success?
49
+ end
50
+
43
51
  def parse_item_info_objects
44
52
  parsed = []
45
53
  item_infos = self.items
@@ -1,5 +1,5 @@
1
1
  module MajesticSeoApi
2
- VERSION = "1.2.6"
2
+ VERSION = "1.2.7"
3
3
 
4
4
  require File.join(File.dirname(__FILE__), 'majestic_seo/railtie') if defined?(Rails)
5
5
 
@@ -8,6 +8,7 @@ module MajesticSeoApi
8
8
  end
9
9
 
10
10
  require File.join(File.dirname(__FILE__), 'majestic_seo/api/logger')
11
+ require File.join(File.dirname(__FILE__), 'majestic_seo/api/exceptions')
11
12
 
12
13
  require File.join(File.dirname(__FILE__), 'majestic_seo/api/response')
13
14
  require File.join(File.dirname(__FILE__), 'majestic_seo/api/item_info_response')
@@ -15,5 +16,4 @@ module MajesticSeoApi
15
16
  require File.join(File.dirname(__FILE__), 'majestic_seo/api/data_table')
16
17
  require File.join(File.dirname(__FILE__), 'majestic_seo/api/item_info')
17
18
  require File.join(File.dirname(__FILE__), 'majestic_seo/api/client')
18
- end
19
-
19
+ end
@@ -3,7 +3,7 @@ Gem::Specification.new do |s|
3
3
  s.required_rubygems_version = Gem::Requirement.new(">= 1.3.5") if s.respond_to? :required_rubygems_version=
4
4
 
5
5
  s.name = 'majestic_seo_api'
6
- s.version = '1.2.6'
6
+ s.version = '1.2.7'
7
7
 
8
8
  s.homepage = "http://developer-support.majesticseo.com/connectors/"
9
9
  s.email = "sebastian@agiley.se"
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
28
28
  lib/generators/templates/majestic_seo.template.yml
29
29
  lib/majestic_seo/api/client.rb
30
30
  lib/majestic_seo/api/data_table.rb
31
+ lib/majestic_seo/api/exceptions.rb
31
32
  lib/majestic_seo/api/item_info.rb
32
33
  lib/majestic_seo/api/item_info_response.rb
33
34
  lib/majestic_seo/api/logger.rb
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: majestic_seo_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
5
- prerelease:
4
+ version: 1.2.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Majestic-12 Ltd
@@ -10,86 +9,76 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2014-05-08 00:00:00.000000000 Z
12
+ date: 2014-11-06 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: faraday
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ! '>='
18
+ - - ">="
21
19
  - !ruby/object:Gem::Version
22
20
  version: 0.8.7
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
- - - ! '>='
25
+ - - ">="
29
26
  - !ruby/object:Gem::Version
30
27
  version: 0.8.7
31
28
  - !ruby/object:Gem::Dependency
32
29
  name: nokogiri
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
- - - ! '>='
32
+ - - ">="
37
33
  - !ruby/object:Gem::Version
38
34
  version: 1.5.9
39
35
  type: :runtime
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
- - - ! '>='
39
+ - - ">="
45
40
  - !ruby/object:Gem::Version
46
41
  version: 1.5.9
47
42
  - !ruby/object:Gem::Dependency
48
43
  name: rake
49
44
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
45
  requirements:
52
- - - ! '>='
46
+ - - ">="
53
47
  - !ruby/object:Gem::Version
54
48
  version: '0'
55
49
  type: :development
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
52
  requirements:
60
- - - ! '>='
53
+ - - ">="
61
54
  - !ruby/object:Gem::Version
62
55
  version: '0'
63
56
  - !ruby/object:Gem::Dependency
64
57
  name: rspec
65
58
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
59
  requirements:
68
- - - ! '>='
60
+ - - ">="
69
61
  - !ruby/object:Gem::Version
70
62
  version: '0'
71
63
  type: :development
72
64
  prerelease: false
73
65
  version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
66
  requirements:
76
- - - ! '>='
67
+ - - ">="
77
68
  - !ruby/object:Gem::Version
78
69
  version: '0'
79
70
  - !ruby/object:Gem::Dependency
80
71
  name: mocha
81
72
  requirement: !ruby/object:Gem::Requirement
82
- none: false
83
73
  requirements:
84
- - - ! '>='
74
+ - - ">="
85
75
  - !ruby/object:Gem::Version
86
76
  version: '0'
87
77
  type: :development
88
78
  prerelease: false
89
79
  version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
80
  requirements:
92
- - - ! '>='
81
+ - - ">="
93
82
  - !ruby/object:Gem::Version
94
83
  version: '0'
95
84
  description: Interface for communicating with Majestic SEO's API
@@ -106,6 +95,7 @@ files:
106
95
  - lib/generators/templates/majestic_seo.template.yml
107
96
  - lib/majestic_seo/api/client.rb
108
97
  - lib/majestic_seo/api/data_table.rb
98
+ - lib/majestic_seo/api/exceptions.rb
109
99
  - lib/majestic_seo/api/item_info.rb
110
100
  - lib/majestic_seo/api/item_info_response.rb
111
101
  - lib/majestic_seo/api/logger.rb
@@ -124,28 +114,24 @@ files:
124
114
  - spec/spec_helper.rb
125
115
  homepage: http://developer-support.majesticseo.com/connectors/
126
116
  licenses: []
117
+ metadata: {}
127
118
  post_install_message:
128
119
  rdoc_options: []
129
120
  require_paths:
130
121
  - lib
131
122
  required_ruby_version: !ruby/object:Gem::Requirement
132
- none: false
133
123
  requirements:
134
- - - ! '>='
124
+ - - ">="
135
125
  - !ruby/object:Gem::Version
136
126
  version: '0'
137
- segments:
138
- - 0
139
- hash: -831160463907842459
140
127
  required_rubygems_version: !ruby/object:Gem::Requirement
141
- none: false
142
128
  requirements:
143
- - - ! '>='
129
+ - - ">="
144
130
  - !ruby/object:Gem::Version
145
131
  version: 1.3.5
146
132
  requirements: []
147
133
  rubyforge_project:
148
- rubygems_version: 1.8.24
134
+ rubygems_version: 2.2.2
149
135
  signing_key:
150
136
  specification_version: 2
151
137
  summary: Interface for communicating with Majestic SEO's API