pandorified 0.9.14 → 0.10.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: 776bf5743744b003f8922033127b24a5afbd9cede83bea1b0aa697649fe8f850
4
- data.tar.gz: dae5536d6035f67546136f12ffe1fc52d602bdffc8dd5eeba120fec2313c4cd7
3
+ metadata.gz: 88d40fc6d68b74277ad68df2ea47dd434554a78ea76f34f4e56af36471643d94
4
+ data.tar.gz: b57523f67d8a8dd6c66ad50558925b1132ca109f34854addf45e5df98b5723ea
5
5
  SHA512:
6
- metadata.gz: 4166d2f8d4b18d97189c74d722da305cf3a4393a2928f1785ba7b85daa242db0f5b1813304043e74923888c4d3002fcbda7a14f0d6e08c1240f60218519ea4e5
7
- data.tar.gz: 8cf8d948c812075b068479e25737a0d43999831f2dea87a018d6d62fe8c1049d96bb27076f88173ed91d4bd4ae1939669d768402ee9e8ce8e5c215c14014d909
6
+ metadata.gz: 1345a2df43b6cda07ac6f29d3ca08bae3da805672f822e084765c7e715c1cdf6d0363726d34e023638eaeef87b2a7ceb82dc28825f7ee4d407d4ad72f89c1869
7
+ data.tar.gz: c7971327d86af6c2f69187e434158c5a96cd6716963dd3d933e12de3d856e03229bcba571299fda77013c8023831b83bda9041e236d6cb0fdc068186ebf7e511
@@ -0,0 +1,31 @@
1
+ FROM ruby:latest
2
+
3
+ ARG USERNAME=vscode
4
+ ARG USER_UID=1000
5
+ ARG USER_GID=${USER_UID}
6
+
7
+ RUN apt-get update \
8
+ && apt-get install -y --no-install-recommends \
9
+ build-essential \
10
+ ca-certificates \
11
+ git \
12
+ sudo \
13
+ && rm -rf /var/lib/apt/lists/* \
14
+ && groupadd --gid ${USER_GID} ${USERNAME} \
15
+ && useradd --uid ${USER_UID} --gid ${USER_GID} -m ${USERNAME} \
16
+ && echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USERNAME} \
17
+ && chmod 0440 /etc/sudoers.d/${USERNAME} \
18
+ && mkdir -p /workspaces /usr/local/bundle \
19
+ /home/${USERNAME}/.bundle /home/${USERNAME}/.bundle/bin /home/${USERNAME}/.gem \
20
+ && chown -R ${USERNAME}:${USERNAME} /workspaces /usr/local/bundle \
21
+ /home/${USERNAME}/.bundle /home/${USERNAME}/.bundle/bin /home/${USERNAME}/.gem
22
+
23
+ USER ${USERNAME}
24
+ WORKDIR /workspaces/pandorified-gem
25
+
26
+ ENV BUNDLE_RETRY=3 \
27
+ BUNDLE_PATH=/home/${USERNAME}/.bundle \
28
+ BUNDLE_APP_CONFIG=/home/${USERNAME}/.bundle \
29
+ BUNDLE_BIN=/home/${USERNAME}/.bundle/bin \
30
+ GEM_HOME=/home/${USERNAME}/.gem \
31
+ PATH="${PATH}:/home/${USERNAME}/.bundle/bin"
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "pandorified-gem",
3
+ "build": {
4
+ "dockerfile": "Dockerfile",
5
+ "context": "."
6
+ },
7
+ "remoteUser": "vscode",
8
+ "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
9
+ "postCreateCommand": "BUNDLE_JOBS=$(nproc) bundle install"
10
+ }
data/.gitattributes ADDED
@@ -0,0 +1 @@
1
+ * text=auto eol=lf
data/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ *.gem
2
+ .bundle
3
+ .yardoc
4
+ Gemfile.lock
5
+ pkg/*
6
+ doc/*
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,12 @@
1
+ Metrics/BlockLength:
2
+ ExcludedMethods:
3
+ - describe
4
+
5
+ Style/HashEachMethods:
6
+ Enabled: true
7
+
8
+ Style/HashTransformKeys:
9
+ Enabled: false
10
+
11
+ Style/HashTransformValues:
12
+ Enabled: false
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
data/README.md ADDED
@@ -0,0 +1,65 @@
1
+ Summary
2
+ -------
3
+
4
+ Pandorified is a simple Ruby wrapper for the Pandorabots API. Talk to chat bots in your Ruby scripts!
5
+
6
+ Installation
7
+ ------------
8
+
9
+ `gem install pandorified`
10
+
11
+ Or add Pandorified to your project's Gemfile:
12
+
13
+ `gem 'pandorified'`
14
+
15
+ Getting Started
16
+ ---------------
17
+
18
+ To interact with the Pandorabots, you need to know the BOTID of the bot you wish to talk to. If you have published your own bot, the BOTID will be listed on your Botmaster page.
19
+
20
+ Here is a basic example:
21
+
22
+ ```ruby
23
+ require 'pandorified'
24
+
25
+ CHOMSKY_BOTID = 'b0dafd24ee35a477'
26
+
27
+ # Send a message to Chomsky and print the response
28
+ puts Pandorified.talk!("Hello, Bot!", CHOMSKY_BOTID)
29
+ ```
30
+
31
+ If you want the bot to remember who you are, you can create a session object and re-use it.
32
+
33
+ ```ruby
34
+ bot = Pandorified::Session.new('b0dafd24ee35a477')
35
+ puts bot.talk!("Hello")
36
+ puts bot.talk!("Goodbye now!")
37
+ ```
38
+
39
+ Full documentation is available [here](http://rubydoc.info/gems/pandorified/frames). If anything in the documentation is not clear, please [report it as a bug][1].
40
+
41
+ Contributing
42
+ ------------
43
+
44
+ If you've found a bug or have a feature suggestion, let me know on the [issue tracker][1] or [send me an e-mail][2]. I welcome all feedback, and I'd love to hear about what cool things you've made with this!
45
+
46
+ Run tests with `bundle exec rspec` or just `rake`.
47
+
48
+ Author
49
+ ------
50
+
51
+ [Justin Workman][2]
52
+
53
+ License
54
+ -------
55
+
56
+ Copyright © 2011-2026 Justin Workman
57
+
58
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
59
+
60
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
61
+
62
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
63
+
64
+ [1]: https://github.com/xtagon/pandorified-gem/issues
65
+ [2]: mailto:xtagon@gmail.com
data/Rakefile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/setup'
4
+ require 'bundler/gem_tasks'
5
+ require 'rspec/core/rake_task'
6
+
7
+ RSpec::Core::RakeTask.new(:spec)
8
+
9
+ task default: :spec
10
+
11
+ desc 'Open an irb session preloaded with this library'
12
+ task :console do
13
+ sh 'irb -rubygems -I lib -r pandorified.rb'
14
+ end
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rexml/document'
4
+ require 'rexml/xpath'
5
+
6
+ module Pandorified
7
+ # The result of sending a message to a bot, including the response message if
8
+ # successful.
9
+ class Result
10
+ def initialize(response_body)
11
+ @xml = REXML::Document.new(response_body)
12
+ end
13
+
14
+ # @return [String] The bot's response to the input.
15
+ def that
16
+ @that ||= REXML::XPath.first(@xml, '/result/that').text.strip
17
+ end
18
+
19
+ alias to_s that
20
+
21
+ # Check the status of this result. See {#success?} and {#error?}.
22
+ #
23
+ # @return [Number] A status number as returned by Pandorabots.
24
+ def status
25
+ @status ||= REXML::XPath.first(@xml, '/result/@status').value.to_i
26
+ end
27
+
28
+ # @return `true` if this result was successful (no error was returned by
29
+ # Pandorabots), `false` otherwise.
30
+ def success?
31
+ status.zero?
32
+ end
33
+
34
+ alias ok? success?
35
+ alias successful? success?
36
+
37
+ # @note After checking if there is an error, you can read the error message
38
+ # with {#message}.
39
+ #
40
+ # @return `true` if Pandorabots returned an error.
41
+ def error?
42
+ !success?
43
+ end
44
+
45
+ # @return [String] The error message as returned by Pandorabots, if an
46
+ # error occured.
47
+ def message
48
+ return nil if success?
49
+
50
+ @message ||= REXML::XPath.first(@xml, '/result/message').text
51
+ end
52
+
53
+ alias error message
54
+ alias error_message message
55
+
56
+ # @return [String] The botid of the bot this result is for.
57
+ def botid
58
+ @botid ||= REXML::XPath.first(@xml, '/result/@botid').value
59
+ end
60
+
61
+ # @return [String] The custid for this session.
62
+ def custid
63
+ @custid ||= REXML::XPath.first(@xml, '/result/@custid').value
64
+ end
65
+
66
+ # @return [String] The orginal input that triggered this response.
67
+ def input
68
+ @input ||= REXML::XPath.first(@xml, '/result/input').text
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,90 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'net/http'
4
+ require 'pandorified/result'
5
+ require 'uri'
6
+
7
+ module Pandorified
8
+ API_URL = 'https://www.pandorabots.com/pandora/talk-xml'
9
+
10
+ # Raised when Pandorabots returns an API result with a non-zero status.
11
+ class PandorabotsError < StandardError; end
12
+
13
+ # Represents a session (or conversation) for interacting with a bot.
14
+ class Session
15
+ # A new session for conversing with a bot.
16
+ #
17
+ # @note If you choose not to specify a {custid}, one will be automatically
18
+ # chosen and remembered throughout the session.
19
+ #
20
+ # @param [String] botid A valid Pandorabots botid.
21
+ # @param [String] custid An identifier used to keep track of this
22
+ # conversation.
23
+ def initialize(botid, custid = nil)
24
+ @botid = botid
25
+ @custid = custid
26
+ end
27
+
28
+ # Send a message to this session's bot and receive a response.
29
+ #
30
+ # See {Pandorified::Result} for how to check for an error response and get
31
+ # the error message.
32
+ #
33
+ # Alternatively, you can use {#talk!} instead of this method, which raises
34
+ # an exception when Pandorabots API returns an error.
35
+ #
36
+ # @param [String] input Text to say to the bot.
37
+ #
38
+ # @return [Pandorified::Result] The bot's response as a result object.
39
+ def talk(input)
40
+ response_body = post_talk_xml!(
41
+ botid: @botid,
42
+ custid: @custid,
43
+ input: input
44
+ )
45
+ result = Pandorified::Result.new(response_body)
46
+
47
+ @custid ||= result.custid if result.success?
48
+
49
+ result
50
+ end
51
+
52
+ # Send a message to this session's bot and receive a response (if
53
+ # successful).
54
+ #
55
+ # If Pandorabots API responds with an error,
56
+ # {Pandorified::PandorabotsError} is raised with the specific error
57
+ # message.
58
+ #
59
+ # If you'd like to check for and handle the error yourself, you can use
60
+ # {#talk} instead of this method.
61
+ #
62
+ # @param [String] input Text to say to the bot.
63
+ #
64
+ # @return [String] The bot's response text.
65
+ def talk!(input)
66
+ result = talk(input)
67
+
68
+ if result.error?
69
+ msg = "Pandorabots returned status #{result.status}: #{result.message}"
70
+ raise Pandorified::PandorabotsError, msg
71
+ end
72
+
73
+ result.that
74
+ end
75
+
76
+ private
77
+
78
+ def post_talk_xml!(params)
79
+ uri = URI(API_URL)
80
+ request = Net::HTTP::Post.new(uri)
81
+ request.set_form_data(params)
82
+
83
+ Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
84
+ response = http.request(request)
85
+ response.value
86
+ response.body
87
+ end
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pandorified
4
+ VERSION = '0.10.0'
5
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'pandorified/version'
4
+ require 'pandorified/result'
5
+ require 'pandorified/session'
6
+
7
+ # This is the top-level module for interacting with the Pandorabots API.
8
+ #
9
+ # There are some sugar methods which delegate to {Pandorified::Session} under
10
+ # the hood.
11
+ module Pandorified
12
+ # Send a message to a bot and receive a response.
13
+ #
14
+ # See {Pandorified::Result} for ways to handle the response, or use {.talk!}
15
+ # which raises an exception on errors.
16
+ #
17
+ # If you want to remember the {botid} and {custid} between multiple calls,
18
+ # you should use {Pandorabots::Session} instead of this method.
19
+ #
20
+ # @param [String] input Text to say to the bot.
21
+ # @param [String] botid A valid Pandorabots botid.
22
+ # @param [String] custid An itentifier used to keep track of this conversaion.
23
+ #
24
+ # @return [Pandorified::Result] The bot's response as a result object.
25
+ def self.talk(input, botid, custid = nil)
26
+ Pandorified::Session.new(botid, custid).talk(input)
27
+ end
28
+
29
+ # Send a message to a bot and receive a response (if successsful).
30
+ #
31
+ # If Pandorabots responds with an error, {Pandorified::PandorabotsError} is
32
+ # raised.
33
+ #
34
+ # If you'd rather check for and handle the error yourself, use {.talk}
35
+ # instead of this method.
36
+ #
37
+ # If you want to remember the {botid} and {custid} between multiple calls,
38
+ # you should use {Pandorabots::Session} instead of this method.
39
+ #
40
+ # @param [String] input Text to say to the bot.
41
+ # @param [String] botid A valid Pandorabots botid.
42
+ # @param [String] custid An itentifier used to keep track of this conversaion.
43
+ #
44
+ # @return [String] The bot's response text.
45
+ def self.talk!(input, botid, custid = nil)
46
+ Pandorified::Session.new(botid, custid).talk!(input).to_s
47
+ end
48
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.push File.expand_path('lib', __dir__)
4
+
5
+ require 'pandorified/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'pandorified'
9
+ spec.version = Pandorified::VERSION
10
+ spec.authors = 'Justin Workman'
11
+ spec.email = 'xtagon@gmail.com'
12
+ spec.summary = 'A Ruby client for the Pandorabots API.'
13
+ spec.license = 'MIT'
14
+ spec.required_ruby_version = '>= 3.0'
15
+
16
+ spec.description = <<~DOC.chomp
17
+ Pandorified makes it easy for your Ruby scripts to interact with chat bots hosted on Pandorabots.
18
+ DOC
19
+
20
+ spec.metadata = { 'rubygems_mfa_required' => 'true' }
21
+
22
+ spec.files = `git ls-files`.split("\n")
23
+ spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
24
+
25
+ spec.executables =
26
+ `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
27
+
28
+ spec.require_paths = ['lib']
29
+
30
+ spec.add_development_dependency 'rake', '~> 13.2'
31
+ spec.add_development_dependency 'bundler-audit'
32
+ spec.add_development_dependency 'rspec'
33
+ spec.add_development_dependency 'rubocop'
34
+ spec.add_development_dependency 'webmock'
35
+ spec.add_development_dependency 'yard'
36
+ end
@@ -0,0 +1,190 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Pandorified do
6
+ describe '.talk' do
7
+ let(:input) { 'Are you a robot?' }
8
+ let(:botid) { 'np218q9s7r346nqo' }
9
+ let(:custid) { nil }
10
+
11
+ let(:request_body) do
12
+ {
13
+ 'botid' => botid,
14
+ 'custid' => nil,
15
+ 'input' => input
16
+ }
17
+ end
18
+
19
+ context 'when successful' do
20
+ subject(:result) { described_class.talk(input, botid, custid) }
21
+
22
+ let(:that) { 'Of course not!' }
23
+ let(:session_custid) { 'fec7cfc40e5b751a' }
24
+
25
+ let(:response_body) do
26
+ <<~XML
27
+ <result status="0" botid="#{botid}" custid="#{session_custid}">
28
+ <input>#{input}</input>
29
+ <that>#{that}</that>
30
+ </result>
31
+ XML
32
+ end
33
+
34
+ let(:response_headers) do
35
+ { content_type: 'text/xml' }
36
+ end
37
+
38
+ before :each do
39
+ stub_request(:post, 'https://www.pandorabots.com/pandora/talk-xml')
40
+ .with(body: request_body)
41
+ .to_return(
42
+ status: 200,
43
+ body: response_body,
44
+ headers: response_headers
45
+ )
46
+ end
47
+
48
+ it 'returns the parsed successful response' do
49
+ expect(result).to be_successful
50
+ expect(result.error?).to be(false)
51
+ expect(result.status).to eq(0)
52
+ expect(result.botid).to eq(botid)
53
+ expect(result.custid).to eq(session_custid)
54
+ expect(result.input).to eq(input)
55
+ expect(result.that).to eq(that)
56
+ expect(result.message).to be_nil
57
+ expect(result.to_s).to eq(that)
58
+ end
59
+ end
60
+
61
+ context 'when unsuccessful' do
62
+ subject(:result) { described_class.talk(input, botid, custid) }
63
+
64
+ let(:response_body) do
65
+ <<~XML
66
+ <result status="1" botid="#{botid}" custid="fec7cfc40e5b751a">
67
+ <input>#{input}</input>
68
+ <message>Something went wrong!</message>
69
+ </result>
70
+ XML
71
+ end
72
+
73
+ let(:response_headers) do
74
+ { content_type: 'text/xml' }
75
+ end
76
+
77
+ before :each do
78
+ stub_request(:post, 'https://www.pandorabots.com/pandora/talk-xml')
79
+ .with(body: request_body)
80
+ .to_return(
81
+ status: 200,
82
+ body: response_body,
83
+ headers: response_headers
84
+ )
85
+ end
86
+
87
+ it 'returns the parsed error response' do
88
+ expect(result.error?).to be(true)
89
+ expect(result).not_to be_successful
90
+ expect(result.status).to eq(1)
91
+ expect(result.botid).to eq(botid)
92
+ expect(result.custid).to eq('fec7cfc40e5b751a')
93
+ expect(result.input).to eq(input)
94
+ expect(result.message).to eq('Something went wrong!')
95
+ end
96
+ end
97
+
98
+ context 'when the HTTP response is non-success' do
99
+ subject(:result) { described_class.talk(input, botid, custid) }
100
+
101
+ before :each do
102
+ stub_request(:post, 'https://www.pandorabots.com/pandora/talk-xml')
103
+ .with(body: request_body)
104
+ .to_return(
105
+ status: 404,
106
+ body: 'Not Found',
107
+ headers: { content_type: 'text/plain' }
108
+ )
109
+ end
110
+
111
+ it 'raises an HTTP error' do
112
+ expect { result }.to raise_error(Net::HTTPClientException)
113
+ end
114
+ end
115
+ end
116
+
117
+ describe '.talk!' do
118
+ let(:input) { 'Are you a robot?' }
119
+ let(:botid) { 'np218q9s7r346nqo' }
120
+ let(:custid) { nil }
121
+
122
+ let(:request_body) do
123
+ {
124
+ 'botid' => botid,
125
+ 'custid' => nil,
126
+ 'input' => input
127
+ }
128
+ end
129
+
130
+ context 'when successful' do
131
+ subject { described_class.talk!(input, botid, custid) }
132
+
133
+ let(:that) { 'Of course not!' }
134
+
135
+ let(:response_body) do
136
+ <<~XML
137
+ <result status="0" botid="#{botid}" custid="fec7cfc40e5b751a">
138
+ <input>#{input}</input>
139
+ <that>#{that}</that>
140
+ </result>
141
+ XML
142
+ end
143
+
144
+ let(:response_headers) do
145
+ { content_type: 'text/xml' }
146
+ end
147
+
148
+ before :each do
149
+ stub_request(:post, 'https://www.pandorabots.com/pandora/talk-xml')
150
+ .with(body: request_body)
151
+ .to_return(
152
+ status: 200,
153
+ body: response_body,
154
+ headers: response_headers
155
+ )
156
+ end
157
+
158
+ it { is_expected.to eq(that) }
159
+ end
160
+
161
+ context 'when unsuccessful' do
162
+ subject { described_class.talk!(input, botid, custid) }
163
+
164
+ let(:response_body) do
165
+ <<~XML
166
+ <result status="1" botid="#{botid}" custid="fec7cfc40e5b751a">
167
+ <input>#{input}</input>
168
+ <message>Something went wrong!</message>
169
+ </result>
170
+ XML
171
+ end
172
+
173
+ let(:response_headers) do
174
+ { content_type: 'text/xml' }
175
+ end
176
+
177
+ before :each do
178
+ stub_request(:post, 'https://www.pandorabots.com/pandora/talk-xml')
179
+ .with(body: request_body)
180
+ .to_return(
181
+ status: 200,
182
+ body: response_body,
183
+ headers: response_headers
184
+ )
185
+ end
186
+
187
+ it { expect { subject }.to raise_error(described_class::PandorabotsError) }
188
+ end
189
+ end
190
+ end
@@ -0,0 +1,113 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'pandorified'
4
+
5
+ require 'webmock/rspec'
6
+
7
+ # This file was generated by the `rspec --init` command. Conventionally, all
8
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
9
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
10
+ # this file to always be loaded, without a need to explicitly require it in any
11
+ # files.
12
+ #
13
+ # Given that it is always loaded, you are encouraged to keep this file as
14
+ # light-weight as possible. Requiring heavyweight dependencies from this file
15
+ # will add to the boot time of your test suite on EVERY test run, even for an
16
+ # individual file that may not need all of that loaded. Instead, consider making
17
+ # a separate helper file that requires the additional dependencies and performs
18
+ # the additional setup, and require it from the spec files that actually need
19
+ # it.
20
+ #
21
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
22
+ RSpec.configure do |config|
23
+ # rspec-expectations config goes here. You can use an alternate
24
+ # assertion/expectation library such as wrong or the stdlib/minitest
25
+ # assertions if you prefer.
26
+ config.expect_with :rspec do |expectations|
27
+ # This option will default to `true` in RSpec 4. It makes the `description`
28
+ # and `failure_message` of custom matchers include text for helper methods
29
+ # defined using `chain`, e.g.:
30
+ # be_bigger_than(2).and_smaller_than(4).description
31
+ # # => "be bigger than 2 and smaller than 4"
32
+ # ...rather than:
33
+ # # => "be bigger than 2"
34
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
35
+ end
36
+
37
+ # rspec-mocks config goes here. You can use an alternate test double
38
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
39
+ config.mock_with :rspec do |mocks|
40
+ # Prevents you from mocking or stubbing a method that does not exist on
41
+ # a real object. This is generally recommended, and will default to
42
+ # `true` in RSpec 4.
43
+ mocks.verify_partial_doubles = true
44
+ end
45
+
46
+ # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
47
+ # have no way to turn it off -- the option exists only for backwards
48
+ # compatibility in RSpec 3). It causes shared context metadata to be
49
+ # inherited by the metadata hash of host groups and examples, rather than
50
+ # triggering implicit auto-inclusion in groups with matching metadata.
51
+ config.shared_context_metadata_behavior = :apply_to_host_groups
52
+
53
+ # The settings below are suggested to provide a good initial experience
54
+ # with RSpec, but feel free to customize to your heart's content.
55
+
56
+ # This allows you to limit a spec run to individual examples or groups
57
+ # you care about by tagging them with `:focus` metadata. When nothing
58
+ # is tagged with `:focus`, all examples get run. RSpec also provides
59
+ # aliases for `it`, `describe`, and `context` that include `:focus`
60
+ # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
61
+ #
62
+ # config.filter_run_when_matching :focus
63
+
64
+ # Allows RSpec to persist some state between runs in order to support
65
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
66
+ # you configure your source control system to ignore this file.
67
+ #
68
+ # config.example_status_persistence_file_path = "spec/examples.txt"
69
+
70
+ # Limits the available syntax to the non-monkey patched syntax that is
71
+ # recommended. For more details, see:
72
+ # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
73
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
74
+ # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
75
+ #
76
+ # config.disable_monkey_patching!
77
+
78
+ # This setting enables warnings. It's recommended, but in some cases may
79
+ # be too noisy due to issues in dependencies.
80
+ #
81
+ # config.warnings = true
82
+
83
+ # Many RSpec users commonly either run the entire suite or an individual
84
+ # file, and it's useful to allow more verbose output when running an
85
+ # individual spec file.
86
+ #
87
+ # if config.files_to_run.one?
88
+ # # Use the documentation formatter for detailed output,
89
+ # # unless a formatter has already been configured
90
+ # # (e.g. via a command-line flag).
91
+ # config.default_formatter = "doc"
92
+ # end
93
+
94
+ # Print the 10 slowest examples and example groups at the
95
+ # end of the spec run, to help surface which specs are running
96
+ # particularly slow.
97
+ #
98
+ # config.profile_examples = 10
99
+
100
+ # Run specs in random order to surface order dependencies. If you find an
101
+ # order dependency and want to debug it, you can fix the order by providing
102
+ # the seed, which is printed after each run.
103
+ # --seed 1234
104
+ #
105
+ # config.order = :random
106
+
107
+ # Seed global randomization in this process using the `--seed` CLI option.
108
+ # Setting this allows you to use `--seed` to deterministically reproduce
109
+ # test failures related to randomization by passing the same `--seed` value
110
+ # as the one that triggered the failure.
111
+ #
112
+ # Kernel.srand config.seed
113
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pandorified
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.14
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Workman
@@ -9,34 +9,6 @@ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
- - !ruby/object:Gem::Dependency
13
- name: nokogiri
14
- requirement: !ruby/object:Gem::Requirement
15
- requirements:
16
- - - ">="
17
- - !ruby/object:Gem::Version
18
- version: 1.18.9
19
- type: :runtime
20
- prerelease: false
21
- version_requirements: !ruby/object:Gem::Requirement
22
- requirements:
23
- - - ">="
24
- - !ruby/object:Gem::Version
25
- version: 1.18.9
26
- - !ruby/object:Gem::Dependency
27
- name: rest-client
28
- requirement: !ruby/object:Gem::Requirement
29
- requirements:
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 1.7.3
33
- type: :runtime
34
- prerelease: false
35
- version_requirements: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - ">="
38
- - !ruby/object:Gem::Version
39
- version: 1.7.3
40
12
  - !ruby/object:Gem::Dependency
41
13
  name: rake
42
14
  requirement: !ruby/object:Gem::Requirement
@@ -127,8 +99,25 @@ email: xtagon@gmail.com
127
99
  executables: []
128
100
  extensions: []
129
101
  extra_rdoc_files: []
130
- files: []
131
- licenses: []
102
+ files:
103
+ - ".devcontainer/Dockerfile"
104
+ - ".devcontainer/devcontainer.json"
105
+ - ".gitattributes"
106
+ - ".gitignore"
107
+ - ".rspec"
108
+ - ".rubocop.yml"
109
+ - Gemfile
110
+ - README.md
111
+ - Rakefile
112
+ - lib/pandorified.rb
113
+ - lib/pandorified/result.rb
114
+ - lib/pandorified/session.rb
115
+ - lib/pandorified/version.rb
116
+ - pandorified.gemspec
117
+ - spec/lib/pandorified_spec.rb
118
+ - spec/spec_helper.rb
119
+ licenses:
120
+ - MIT
132
121
  metadata:
133
122
  rubygems_mfa_required: 'true'
134
123
  rdoc_options: []
@@ -138,14 +127,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
138
127
  requirements:
139
128
  - - ">="
140
129
  - !ruby/object:Gem::Version
141
- version: '0'
130
+ version: '3.0'
142
131
  required_rubygems_version: !ruby/object:Gem::Requirement
143
132
  requirements:
144
133
  - - ">="
145
134
  - !ruby/object:Gem::Version
146
135
  version: '0'
147
136
  requirements: []
148
- rubygems_version: 3.6.9
137
+ rubygems_version: 4.0.6
149
138
  specification_version: 4
150
139
  summary: A Ruby client for the Pandorabots API.
151
140
  test_files: []