quandora 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b4de63dd967d6c394471027c0afb17f21903e83001b0447f7bd8737e01b1381
4
- data.tar.gz: b3960388e08511a9d025cb45390d098208a5e350bb536a30e4f8e4580cf64204
3
+ metadata.gz: bfe0e37b28d861381e141ee3c01878bda3ea9bb1651b1b38e3c211b9d1d8a6e6
4
+ data.tar.gz: 80bdd2540e2c2196001de475e04e45b6af93dbbf117661ed13522ee7a954189a
5
5
  SHA512:
6
- metadata.gz: d461213c354c9e0bccc33b2735a7bf90e1e553257c7e7bbe140660e16b588a5cdb8a0788bfbacebaa74dae0d28159873ddd3177f50b7b8f5ed70501f752267f6
7
- data.tar.gz: 9eabe75a79676d558621d5d0c8fce46a7a0c78356f33f0ccef0a89fef180aeba11f9839f037f9d9de3913594d46f7b85e22663e4d1a8edd93a128a3e558f46bd
6
+ metadata.gz: dae6adefbf47a3ea366320ec2df0e194890ce5b6da830a7312c86504a7bd7f7b3e1d574c34f013d8d6f379d39e4b2dd36dca9400f755003c5f70ef18d338c022
7
+ data.tar.gz: e082571e7caaf9a7884e6749acf94befcf2102342b9bec1fbd591c3853565bf7a44aa51a758778a61a96037c6153ed844e8c5e05bd7f6d6b7b186e0cd39f0586
data/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # 0.3.0
2
+
3
+ Now we support string and symbol keys in the `args` option.
4
+
5
+ # 0.2.0
6
+
7
+ Updated [byebug](https://github.com/deivid-rodriguez/byebug) version to 11.1.3
8
+
9
+ Updated [bundler](https://rubygems.org/gems/bundler) version to 2.3.12
10
+
11
+ Updated [Faraday](https://github.com/lostisland/faraday) version to 2.2
12
+
13
+ The deprecated method names of the Faraday gem were changed
data/Gemfile.lock CHANGED
@@ -1,46 +1,42 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- quandora (0.1.0)
5
- faraday
4
+ quandora (0.3.0)
5
+ faraday (~> 2.2)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- addressable (2.7.0)
10
+ addressable (2.8.0)
11
11
  public_suffix (>= 2.0.2, < 5.0)
12
- byebug (3.5.1)
13
- columnize (~> 0.8)
14
- debugger-linecache (~> 1.2)
15
- slop (~> 3.6)
16
- columnize (0.9.0)
17
- crack (0.4.3)
18
- safe_yaml (~> 1.0.0)
19
- debugger-linecache (1.2.0)
20
- diff-lcs (1.3)
21
- faraday (0.17.1)
22
- multipart-post (>= 1.2, < 3)
23
- hashdiff (1.0.0)
24
- multipart-post (2.1.1)
25
- public_suffix (4.0.1)
26
- rake (10.5.0)
27
- rspec (3.9.0)
28
- rspec-core (~> 3.9.0)
29
- rspec-expectations (~> 3.9.0)
30
- rspec-mocks (~> 3.9.0)
31
- rspec-core (3.9.0)
32
- rspec-support (~> 3.9.0)
33
- rspec-expectations (3.9.0)
12
+ byebug (11.1.3)
13
+ crack (0.4.5)
14
+ rexml
15
+ diff-lcs (1.5.0)
16
+ faraday (2.2.0)
17
+ faraday-net_http (~> 2.0)
18
+ ruby2_keywords (>= 0.0.4)
19
+ faraday-net_http (2.0.2)
20
+ hashdiff (1.0.1)
21
+ public_suffix (4.0.7)
22
+ rake (13.0.6)
23
+ rexml (3.2.5)
24
+ rspec (3.11.0)
25
+ rspec-core (~> 3.11.0)
26
+ rspec-expectations (~> 3.11.0)
27
+ rspec-mocks (~> 3.11.0)
28
+ rspec-core (3.11.0)
29
+ rspec-support (~> 3.11.0)
30
+ rspec-expectations (3.11.0)
34
31
  diff-lcs (>= 1.2.0, < 2.0)
35
- rspec-support (~> 3.9.0)
36
- rspec-mocks (3.9.0)
32
+ rspec-support (~> 3.11.0)
33
+ rspec-mocks (3.11.1)
37
34
  diff-lcs (>= 1.2.0, < 2.0)
38
- rspec-support (~> 3.9.0)
39
- rspec-support (3.9.0)
40
- safe_yaml (1.0.5)
41
- slop (3.6.0)
42
- webmock (3.7.6)
43
- addressable (>= 2.3.6)
35
+ rspec-support (~> 3.11.0)
36
+ rspec-support (3.11.0)
37
+ ruby2_keywords (0.0.5)
38
+ webmock (3.14.0)
39
+ addressable (>= 2.8.0)
44
40
  crack (>= 0.3.2)
45
41
  hashdiff (>= 0.4.0, < 2.0.0)
46
42
 
@@ -48,12 +44,12 @@ PLATFORMS
48
44
  ruby
49
45
 
50
46
  DEPENDENCIES
51
- bundler (~> 2.0)
52
- byebug (~> 3.0)
47
+ bundler (~> 2.3, >= 2.3.12)
48
+ byebug (~> 11.1, >= 11.1.3)
53
49
  quandora!
54
- rake (~> 10.0)
50
+ rake (~> 13.0)
55
51
  rspec (~> 3.0)
56
52
  webmock (~> 3.0)
57
53
 
58
54
  BUNDLED WITH
59
- 2.0.2
55
+ 2.3.12
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Quandora
2
2
 
3
- a simple gem to connect to the [quandora](https://www.quandora.com/).
3
+ A simple gem to connect to the [quandora](https://www.quandora.com/).
4
4
 
5
5
  ## Installation
6
6
 
@@ -102,7 +102,7 @@ the args it must be:
102
102
  "content": "content"
103
103
  }
104
104
 
105
- udpate: Quandora.bases.tag('base_id').udpate(args)
105
+ update: Quandora.bases.tag('base_id').update(args)
106
106
  the args it must be:
107
107
  {
108
108
  "uid": "uid",
@@ -157,22 +157,37 @@ the args it must be:
157
157
  delete: Quandora.question.comment('question_id').delete('hash')
158
158
  ```
159
159
 
160
- For more information please go to the [quandora api document](https://www.quandora.com/quandora-rest-api-documentation/)
160
+ For more information please go to the [Quandora api
161
+ document](https://www.quandora.com/quandora-rest-api-documentation/).
161
162
 
162
163
  ## Development
163
164
 
164
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
165
+ After checking out the repo, run `bin/setup` to install dependencies.
166
+ Then, run `rake spec` to run the tests. You can also run `bin/console`
167
+ for an interactive prompt that will allow you to experiment.
165
168
 
166
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
169
+ To install this gem onto your local machine, run `bundle exec rake
170
+ install`. To release a new version, update the version number in
171
+ `version.rb`, and then run `bundle exec rake release`, which will create
172
+ a git tag for the version, push git commits and tags, and push the
173
+ `.gem` file to [rubygems.org](https://rubygems.org).
167
174
 
168
175
  ## Contributing
169
176
 
170
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/quandora. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
177
+ Bug reports and pull requests are welcome on GitHub at
178
+ https://github.com/buzzjective/quandora. This project is intended to be
179
+ a safe, welcoming space for collaboration, and contributors are expected
180
+ to adhere to the [Contributor Covenant](http://contributor-covenant.org)
181
+ code of conduct.
171
182
 
172
183
  ## License
173
184
 
174
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
185
+ The gem is available as open source under the terms of the [MIT
186
+ License](https://opensource.org/licenses/MIT).
175
187
 
176
188
  ## Code of Conduct
177
189
 
178
- Everyone interacting in the Quandora project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/quandora/blob/master/CODE_OF_CONDUCT.md).
190
+ Everyone interacting in the Quandora project’s codebases, issue
191
+ trackers, chat rooms and mailing lists is expected to follow the [code
192
+ of
193
+ conduct](https://github.com/buzzjective/quandora/blob/master/CODE_OF_CONDUCT.md).
@@ -2,6 +2,8 @@
2
2
 
3
3
  class Quandora::Activity < Quandora::Request
4
4
  def index(args = {})
5
+ args = args.stringify_keys
6
+
5
7
  @params.merge!("userId": args["user_id"]) unless args.fetch('user_id', nil).nil?
6
8
  super
7
9
  end
@@ -1,5 +1,7 @@
1
1
  class Quandora::Answer < Quandora::Request
2
2
  def vote(answer_id, args)
3
+ args = args.stringify_keys
4
+
3
5
  body = {
4
6
  "type": "boolean",
5
7
  "data": args["vote"]
@@ -12,6 +14,8 @@ class Quandora::Answer < Quandora::Request
12
14
  end
13
15
 
14
16
  def accept(answer_id, args)
17
+ args = args.stringify_keys
18
+
15
19
  body = {
16
20
  "type": "boolean",
17
21
  "data": args["accept"]
@@ -24,6 +28,6 @@ class Quandora::Answer < Quandora::Request
24
28
  end
25
29
 
26
30
  def comment(answer_id)
27
- Comment.new(@conn, "a", answer_id)
31
+ Comment.new(@conn, "a", answer_id)
28
32
  end
29
33
  end
@@ -5,6 +5,8 @@ class Quandora::Bases < Quandora::Request
5
5
  end
6
6
 
7
7
  def questions(base_id, args = {})
8
+ args = args.stringify_keys
9
+
8
10
  @api = "kb/#{base_id}/list"
9
11
  @params.merge!("o": args["o"]) unless args.fetch('o', nil).nil?
10
12
  @params.merge!("l": args["l"]) unless args.fetch('l', nil).nil?
@@ -15,12 +17,16 @@ class Quandora::Bases < Quandora::Request
15
17
  end
16
18
 
17
19
  def mlt(base_id, args = {})
20
+ args = args.stringify_keys
21
+
18
22
  @api = "kb/#{base_id}/mlt"
19
23
  @params.merge!("q": args["q"]) unless args.fetch('q', nil).nil?
20
24
  index
21
25
  end
22
26
 
23
27
  def ask(base_id, args = {})
28
+ args = args.stringify_keys
29
+
24
30
  body = {
25
31
  "type": "post-question",
26
32
  "data": {
@@ -42,10 +48,10 @@ class Quandora::Bases < Quandora::Request
42
48
  end
43
49
 
44
50
  def tag(kb_id)
45
- Quandora::Tag.new(@conn, "kb", kb_id)
51
+ Quandora::Tag.new(@conn, "kb", kb_id)
46
52
  end
47
53
 
48
54
  def report(kb_id)
49
- Quandora::Report.new(@conn, "kb", kb_id)
55
+ Quandora::Report.new(@conn, "kb", kb_id)
50
56
  end
51
57
  end
@@ -6,6 +6,8 @@ class Quandora::Comment
6
6
  end
7
7
 
8
8
  def create(args)
9
+ args = args.stringify_keys
10
+
9
11
  body = {
10
12
  "type": "post-comment",
11
13
  "data": {
@@ -20,6 +22,8 @@ class Quandora::Comment
20
22
  end
21
23
 
22
24
  def update(args)
25
+ args = args.stringify_keys
26
+
23
27
  body = {
24
28
  "type": "post-comment",
25
29
  "data": {
@@ -1,5 +1,7 @@
1
1
  class Quandora::EndPoints < Quandora::Request
2
2
  def index(args = {})
3
+ args = args.stringify_keys
4
+
3
5
  @api = ""
4
6
  super
5
7
  end
@@ -17,6 +17,8 @@ class Quandora::Question < Quandora::Request
17
17
  end
18
18
 
19
19
  def answer(question_id, args)
20
+ args = args.stringify_keys
21
+
20
22
  body = {
21
23
  "type": "post-answer",
22
24
  "data": {
@@ -31,6 +33,8 @@ class Quandora::Question < Quandora::Request
31
33
  end
32
34
 
33
35
  def vote(question_id, args)
36
+ args = args.stringify_keys
37
+
34
38
  body = {
35
39
  "type": "boolean",
36
40
  "data": args["vote"]
@@ -43,10 +47,10 @@ class Quandora::Question < Quandora::Request
43
47
  end
44
48
 
45
49
  def comment(question_id)
46
- Quandora::Comment.new(@conn, "q", question_id)
50
+ Quandora::Comment.new(@conn, "q", question_id)
47
51
  end
48
52
 
49
53
  def tag(answer_id)
50
- Quandora::Tag.new(@conn, "q", answer_id)
54
+ Quandora::Tag.new(@conn, "q", answer_id)
51
55
  end
52
56
  end
@@ -8,6 +8,8 @@ class Quandora::Request
8
8
  end
9
9
 
10
10
  def index(args = {})
11
+ args = args.stringify_keys
12
+
11
13
  @params.merge!("o": args["o"]) unless args.fetch('o', nil).nil?
12
14
  @params.merge!("l": args["l"]) unless args.fetch('l', nil).nil?
13
15
 
@@ -18,6 +20,8 @@ class Quandora::Request
18
20
  end
19
21
 
20
22
  def show(id, args = {})
23
+ args = args.stringify_keys
24
+
21
25
  resp = @conn.get("#{@api}/#{id}") do |req|
22
26
  req.params = @params
23
27
  req.headers['Content-Type'] = 'application/json'
data/lib/quandora/tag.rb CHANGED
@@ -6,6 +6,8 @@ class Quandora::Tag
6
6
  end
7
7
 
8
8
  def index(args={})
9
+ args = args.stringify_keys
10
+
9
11
  query = {}
10
12
  query.merge!("q": args["q"]) unless args.fetch('q', nil).nil?
11
13
  query.merge!("s": args["s"]) unless args.fetch('s', nil).nil?
@@ -23,14 +25,16 @@ class Quandora::Tag
23
25
  end
24
26
 
25
27
  def create(args)
28
+ args = args.stringify_keys
29
+
26
30
  body = {
27
31
  "type": "tag-content",
28
32
  "data": {
29
- "name": args[:name],
33
+ "name": args['name'],
30
34
  "category": nil,
31
35
  "location": nil,
32
- "url": args[:url],
33
- "content": args[:content]
36
+ "url": args['url'],
37
+ "content": args['content']
34
38
  }
35
39
  }
36
40
 
@@ -41,6 +45,8 @@ class Quandora::Tag
41
45
  end
42
46
 
43
47
  def update(args)
48
+ args = args.stringify_keys
49
+
44
50
  body = {
45
51
  "type": "tag-content",
46
52
  "data": {
@@ -5,6 +5,8 @@ class Quandora::Users < Quandora::Request
5
5
  end
6
6
 
7
7
  def create(args)
8
+ args = args.stringify_keys
9
+
8
10
  body = {
9
11
  "type": "post-user",
10
12
  "data": {
@@ -1,3 +1,3 @@
1
1
  module Quandora
2
- VERSION = "0.1.0"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/quandora.rb CHANGED
@@ -37,9 +37,10 @@ module Quandora
37
37
  define_method :"#{api}" do |args = {}|
38
38
  @conn = Faraday.new(url: configuration.url) do |conn|
39
39
  conn.adapter Faraday.default_adapter # make requests with Net::HTTP
40
- conn.basic_auth(configuration.username, configuration.password)
40
+ conn.set_basic_auth(configuration.username, configuration.password)
41
41
  end
42
42
 
43
+ args = args.stringify_keys
43
44
  find_api(api).new(@conn, api, args)
44
45
  end
45
46
  end
data/quandora.gemspec CHANGED
@@ -26,10 +26,10 @@ Gem::Specification.new do |spec|
26
26
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
27
  spec.require_paths = ["lib"]
28
28
 
29
- spec.add_development_dependency "bundler", "~> 2.0"
30
- spec.add_development_dependency "rake", "~> 10.0"
29
+ spec.add_development_dependency 'bundler', '~> 2.3', '>= 2.3.12'
30
+ spec.add_development_dependency "rake", "~> 13.0"
31
31
  spec.add_development_dependency "rspec", "~> 3.0"
32
32
  spec.add_development_dependency "webmock", "~> 3.0"
33
- spec.add_development_dependency "byebug", "~> 3.0"
34
- spec.add_dependency "faraday"
33
+ spec.add_development_dependency 'byebug', '~> 11.1', '>= 11.1.3'
34
+ spec.add_dependency 'faraday', '~> 2.2'
35
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quandora
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - buzzjective
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-25 00:00:00.000000000 Z
11
+ date: 2022-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,28 +16,34 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: '2.3'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 2.3.12
20
23
  type: :development
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - "~>"
25
28
  - !ruby/object:Gem::Version
26
- version: '2.0'
29
+ version: '2.3'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 2.3.12
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rake
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
37
  - - "~>"
32
38
  - !ruby/object:Gem::Version
33
- version: '10.0'
39
+ version: '13.0'
34
40
  type: :development
35
41
  prerelease: false
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
44
  - - "~>"
39
45
  - !ruby/object:Gem::Version
40
- version: '10.0'
46
+ version: '13.0'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: rspec
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -72,28 +78,34 @@ dependencies:
72
78
  requirements:
73
79
  - - "~>"
74
80
  - !ruby/object:Gem::Version
75
- version: '3.0'
81
+ version: '11.1'
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: 11.1.3
76
85
  type: :development
77
86
  prerelease: false
78
87
  version_requirements: !ruby/object:Gem::Requirement
79
88
  requirements:
80
89
  - - "~>"
81
90
  - !ruby/object:Gem::Version
82
- version: '3.0'
91
+ version: '11.1'
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: 11.1.3
83
95
  - !ruby/object:Gem::Dependency
84
96
  name: faraday
85
97
  requirement: !ruby/object:Gem::Requirement
86
98
  requirements:
87
- - - ">="
99
+ - - "~>"
88
100
  - !ruby/object:Gem::Version
89
- version: '0'
101
+ version: '2.2'
90
102
  type: :runtime
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
93
105
  requirements:
94
- - - ">="
106
+ - - "~>"
95
107
  - !ruby/object:Gem::Version
96
- version: '0'
108
+ version: '2.2'
97
109
  description: A simple gem to connect to the quandora
98
110
  email:
99
111
  - hamid@buzzjective.com
@@ -104,6 +116,7 @@ files:
104
116
  - ".gitignore"
105
117
  - ".rspec"
106
118
  - ".travis.yml"
119
+ - CHANGELOG.md
107
120
  - CODE_OF_CONDUCT.md
108
121
  - Gemfile
109
122
  - Gemfile.lock
@@ -135,7 +148,7 @@ metadata:
135
148
  homepage_uri: https://buzzjective.com/
136
149
  source_code_uri: https://github.com/buzzjective/quandora/
137
150
  changelog_uri: https://github.com/buzzjective/quandora/
138
- post_install_message:
151
+ post_install_message:
139
152
  rdoc_options: []
140
153
  require_paths:
141
154
  - lib
@@ -150,9 +163,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
163
  - !ruby/object:Gem::Version
151
164
  version: '0'
152
165
  requirements: []
153
- rubyforge_project:
154
- rubygems_version: 2.7.6
155
- signing_key:
166
+ rubygems_version: 3.3.3
167
+ signing_key:
156
168
  specification_version: 4
157
169
  summary: A simple gem to connect to the quandora
158
170
  test_files: []