pandorified 0.9.0 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 86625391ab1a874c65ff69bb838fdcb9cf5849b9
4
- data.tar.gz: 60b899f6ac7405e7225e32eca029226125d17f1e
2
+ SHA256:
3
+ metadata.gz: 3dfedeca59ae78bb9a56a4b64b40b22369359c7a90041199f56cac16a1be0b6a
4
+ data.tar.gz: e81db141db2ca721de078d148c39508829ca40142ff911443337a84a7f144e93
5
5
  SHA512:
6
- metadata.gz: a4c51bab5d8f395558f4ecddf3bb8e6d5c70076831ecfbf4d0c865e6e4cc5971cd34fc9b1d98a9c4cd1c79442c5830ce459aa6e7eef2f8df6f60444c6fc6a1e1
7
- data.tar.gz: af8ebc3a61fbfc2a2f219d483d073d3cf28441940bd8c475ed51a779fde6d17e5dbb26b079221569ba0e16725712386cc357896e9f2d4db3a9ea34631b9f86c3
6
+ metadata.gz: 86b68074fecad28848ac18969b2a7e92354a21d5dcab9f6d1d7248216a2aafa35e106c2823fb09b81a45758f21d120782af71eef052c2f0a03cd592c0b88b1e9
7
+ data.tar.gz: d0f4adc516eec73c5823cdb7cdb5680b4a7f47f90edbdc59e08486c4a5a77ef6a382699c8b1fa4a7c1ae204c7b5ccc8658de328ff73739c4437ce5e7b705ee8c
data/.gitignore CHANGED
@@ -1,4 +1,6 @@
1
1
  *.gem
2
2
  .bundle
3
3
  .yardoc
4
+ Gemfile.lock
4
5
  pkg/*
6
+ doc/*
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
@@ -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 CHANGED
@@ -1,3 +1,5 @@
1
- source 'http://rubygems.org'
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
2
4
 
3
5
  gemspec
data/README.md CHANGED
@@ -6,11 +6,11 @@ Pandorified is a simple Ruby wrapper for the Pandorabots API. Talk to chat bots
6
6
  Installation
7
7
  ------------
8
8
 
9
- gem install pandorified
9
+ `gem install pandorified`
10
10
 
11
11
  Or add Pandorified to your project's Gemfile:
12
12
 
13
- gem 'pandorified'
13
+ `gem 'pandorified'`
14
14
 
15
15
  Getting Started
16
16
  ---------------
@@ -19,18 +19,22 @@ To interact with the Pandorabots, you need to know the BOTID of the bot you wish
19
19
 
20
20
  Here is a basic example:
21
21
 
22
- require 'pandorified'
23
-
24
- CHOMSKY_BOTID = 'b0dafd24ee35a477'
25
-
26
- # Send a message to Chomsky and print the response
27
- puts Pandorified.talk!("Hello, Bot!", CHOMSKY_BOTID)
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
+ ```
28
30
 
29
31
  If you want the bot to remember who you are, you can create a session object and re-use it.
30
32
 
31
- bot = Pandorified::Session.new('b0dafd24ee35a477')
32
- puts bot.talk!("Hello")
33
- puts bot.talk!("Goodbye now!")
33
+ ```ruby
34
+ bot = Pandorified::Session.new('b0dafd24ee35a477')
35
+ puts bot.talk!("Hello")
36
+ puts bot.talk!("Goodbye now!")
37
+ ```
34
38
 
35
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].
36
40
 
@@ -39,6 +43,8 @@ Contributing
39
43
 
40
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!
41
45
 
46
+ Run tests with `bundle exec rspec` or just `rake`.
47
+
42
48
  Author
43
49
  ------
44
50
 
@@ -47,7 +53,7 @@ Author
47
53
  License
48
54
  -------
49
55
 
50
- Copyright © 2011-2013 Justin Workman
56
+ Copyright © 2011-2019 Justin Workman
51
57
 
52
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:
53
59
 
@@ -55,5 +61,5 @@ The above copyright notice and this permission notice shall be included in all c
55
61
 
56
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.
57
63
 
58
- [1]: https://bitbucket.org/xtagon/pandorified/issues?status=new&status=open
64
+ [1]: https://github.com/xtagon/pandorified-gem/issues
59
65
  [2]: mailto:xtagon@gmail.com
data/Rakefile CHANGED
@@ -1,6 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
2
9
 
3
10
  desc 'Open an irb session preloaded with this library'
4
11
  task :console do
5
- sh "irb -rubygems -I lib -r pandorified.rb"
12
+ sh 'irb -rubygems -I lib -r pandorified.rb'
6
13
  end
@@ -1,35 +1,48 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pandorified/version'
2
4
  require 'pandorified/result'
3
5
  require 'pandorified/session'
4
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.
5
11
  module Pandorified
6
- # Send a message to a bot and receive a response.
7
- #
8
- # See {Pandorified::Result} for ways to handle the response, or use {.talk!} which raises an exception on errors.
9
- # If you want to remember the {botid} and {custid} between multiple calls, you should use {Pandorabots::Session} instead of this method.
10
- #
11
- # @param [String] input Text to say to the bot.
12
- # @param [String] botid A valid Pandorabots botid.
13
- # @param [String] custid An itentifier used to keep track of this conversaion.
14
- #
15
- # @return [Pandorified::Result] The bot's response as a result object.
16
- def self.talk(input, botid, custid = nil)
17
- Pandorified::Session.new(botid, custid).talk(input)
18
- end
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
19
28
 
20
- # Send a message to a bot and receive a response (if successsful).
21
- #
22
- # If Pandorabots respondes with an error, {Pandorified::PandorabotsError} is raised.
23
- # If you'd rather check for and handle the error yourself, use {.talk} instead of this method.
24
- #
25
- # If you want to remember the {botid} and {custid} between multiple calls, you should use {Pandorabots::Session} instead of this method.
26
- #
27
- # @param [String] input Text to say to the bot.
28
- # @param [String] botid A valid Pandorabots botid.
29
- # @param [String] custid An itentifier used to keep track of this conversaion.
30
- #
31
- # @return [String] The bot's response text.
32
- def self.talk!(input, botid, custid = nil)
33
- Pandorified::Session.new(botid, custid).talk!(input).to_s
34
- end
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
35
48
  end
@@ -1,65 +1,73 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rest_client'
2
4
  require 'nokogiri'
3
5
 
4
6
  module Pandorified
5
- API_URL = 'http://www.pandorabots.com/pandora/talk-xml'
7
+ API_URL = 'https://www.pandorabots.com/pandora/talk-xml'
8
+
9
+ # The result of sending a message to a bot, including the response message if
10
+ # successful.
11
+ class Result
12
+ def initialize(params)
13
+ @xml = Nokogiri::XML(RestClient.post(API_URL, params))
14
+ end
6
15
 
7
- class Result
8
- def initialize(params)
9
- @xml = Nokogiri::XML(RestClient.post(API_URL, params))
10
- end
16
+ # @return [String] The bot's response to the input.
17
+ def that
18
+ @that ||= @xml.xpath('/result/that').first.text.strip
19
+ end
11
20
 
12
- # @return [String] The bot's response to the input.
13
- def that
14
- @that ||= @xml.xpath('/result/that').first.text.strip
15
- end
21
+ alias to_s that
16
22
 
17
- alias_method :to_s, :that
23
+ # Check the status of this result. See {#success?} and {#error?}.
24
+ #
25
+ # @return [Number] A status number as returned by Pandorabots.
26
+ def status
27
+ @status ||= @xml.xpath('/result/@status').first.value.to_i
28
+ end
18
29
 
19
- # Check the status of this result. See {#success?} and {#error?}.
20
- #
21
- # @return [Number] A status number as returned by Pandorabots.
22
- def status
23
- @status ||= @xml.xpath('/result/@status').first.value.to_i
24
- end
30
+ # @return `true` if this result was successful (no error was returned by
31
+ # Pandorabots), `false` otherwise.
32
+ def success?
33
+ status.zero?
34
+ end
25
35
 
26
- # @return `true` if this result was successful (no error was returned by Pandorabots), `false` otherwise.
27
- def success?
28
- self.status.zero?
29
- end
36
+ alias ok? success?
37
+ alias successful? success?
30
38
 
31
- alias_method :ok?, :success?
32
- alias_method :successful?, :success?
39
+ # @note After checking if there is an error, you can read the error message
40
+ # with {#message}.
41
+ #
42
+ # @return `true` if Pandorabots returned an error.
43
+ def error?
44
+ !success?
45
+ end
33
46
 
34
- # @note After checking if there is an error, you can read the error message with {#message}.
35
- #
36
- # @return `true` if Pandorabots returned an error.
37
- def error?
38
- !self.success?
39
- end
47
+ # @return [String] The error message as returned by Pandorabots, if an
48
+ # error occured.
49
+ def message
50
+ return nil if success?
40
51
 
41
- # @return [String] The error message as returned by Pandorabots, if an error occured.
42
- def message
43
- return nil if self.success?
44
- @message ||= @xml.xpath('/result/message').first.text
45
- end
52
+ @message ||= @xml.xpath('/result/message').first.text
53
+ end
46
54
 
47
- alias_method :error, :message
48
- alias_method :error_message, :message
55
+ alias error message
56
+ alias error_message message
49
57
 
50
- # @return [String] The botid of the bot this result is for.
51
- def botid
52
- @botid ||= @xml.xpath('/result/@botid').first.value
53
- end
58
+ # @return [String] The botid of the bot this result is for.
59
+ def botid
60
+ @botid ||= @xml.xpath('/result/@botid').first.value
61
+ end
54
62
 
55
- # @return [String] The custid for this session.
56
- def custid
57
- @custid ||= @xml.xpath('/result/@custid').first.value
58
- end
63
+ # @return [String] The custid for this session.
64
+ def custid
65
+ @custid ||= @xml.xpath('/result/@custid').first.value
66
+ end
59
67
 
60
- # @return [String] The orginal input that triggered this response.
61
- def input
62
- @input ||= @xml.xpath('/result/input').first.text
63
- end
64
- end
68
+ # @return [String] The orginal input that triggered this response.
69
+ def input
70
+ @input ||= @xml.xpath('/result/input').first.text
71
+ end
72
+ end
65
73
  end
@@ -1,47 +1,71 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pandorified/result'
2
4
 
3
5
  module Pandorified
4
- # Raised when Pandorabots returns an API result with a non-zero status.
5
- class PandorabotsError < StandardError; end
6
-
7
- class Session
8
- # A new session for conversing with a bot.
9
- #
10
- # @note If you choose not to specify a {custid}, one will be automatically chosen and remembered throughout the session.
11
- #
12
- # @param [String] botid A valid Pandorabots botid.
13
- # @param [String] custid An identifier used to keep track of this conversation.
14
- def initialize(botid, custid = nil)
15
- @botid = botid
16
- @custid = custid
17
- end
18
-
19
- # Send a message to this session's bot and receive a response.
20
- #
21
- # See {Pandorified::Result} for how to check for an error response and get the error message.
22
- # Alternatively, you can use {#talk!} instead of this method, which raises an exception when Pandorabots API returns an error.
23
- #
24
- # @param [String] input Text to say to the bot.
25
- #
26
- # @return [Pandorified::Result] The bot's response as a result object.
27
- def talk(input)
28
- result = Pandorified::Result.new(botid: @botid, custid: @custid, input: input)
29
- @custid ||= result.custid if result.success?
30
- result
31
- end
32
-
33
- # Send a message to this session's bot and receive a response (if successful).
34
- #
35
- # If Pandorabots API responds with an error, {Pandorified::PandorabotsError} is raised with the specific error message.
36
- # If you'd like to check for and handle the error yourself, you can use {#talk} instead of this method.
37
- #
38
- # @param [String] input Text to say to the bot.
39
- #
40
- # @return [String] The bot's response text.
41
- def talk!(input)
42
- result = self.talk(input)
43
- raise Pandorified::PandorabotsError, "Pandorabots returned status #{result.status}: #{result.message}" if result.error?
44
- result.that
45
- end
46
- end
6
+ # Raised when Pandorabots returns an API result with a non-zero status.
7
+ class PandorabotsError < StandardError; end
8
+
9
+ # Represents a session (or conversation) for interacting with a bot.
10
+ class Session
11
+ # A new session for conversing with a bot.
12
+ #
13
+ # @note If you choose not to specify a {custid}, one will be automatically
14
+ # chosen and remembered throughout the session.
15
+ #
16
+ # @param [String] botid A valid Pandorabots botid.
17
+ # @param [String] custid An identifier used to keep track of this
18
+ # conversation.
19
+ def initialize(botid, custid = nil)
20
+ @botid = botid
21
+ @custid = custid
22
+ end
23
+
24
+ # Send a message to this session's bot and receive a response.
25
+ #
26
+ # See {Pandorified::Result} for how to check for an error response and get
27
+ # the error message.
28
+ #
29
+ # Alternatively, you can use {#talk!} instead of this method, which raises
30
+ # an exception when Pandorabots API returns an error.
31
+ #
32
+ # @param [String] input Text to say to the bot.
33
+ #
34
+ # @return [Pandorified::Result] The bot's response as a result object.
35
+ def talk(input)
36
+ result = Pandorified::Result.new(
37
+ botid: @botid,
38
+ custid: @custid,
39
+ input: input
40
+ )
41
+
42
+ @custid ||= result.custid if result.success?
43
+
44
+ result
45
+ end
46
+
47
+ # Send a message to this session's bot and receive a response (if
48
+ # successful).
49
+ #
50
+ # If Pandorabots API responds with an error,
51
+ # {Pandorified::PandorabotsError} is raised with the specific error
52
+ # message.
53
+ #
54
+ # If you'd like to check for and handle the error yourself, you can use
55
+ # {#talk} instead of this method.
56
+ #
57
+ # @param [String] input Text to say to the bot.
58
+ #
59
+ # @return [String] The bot's response text.
60
+ def talk!(input)
61
+ result = talk(input)
62
+
63
+ if result.error?
64
+ msg = "Pandorabots returned status #{result.status}: #{result.message}"
65
+ raise Pandorified::PandorabotsError, msg
66
+ end
67
+
68
+ result.that
69
+ end
70
+ end
47
71
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Pandorified
2
- VERSION = '0.9.0'
4
+ VERSION = '0.9.5'
3
5
  end
@@ -1,20 +1,33 @@
1
- $:.push File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.push File.expand_path('lib', __dir__)
2
4
 
3
5
  require 'pandorified/version'
4
6
 
5
7
  Gem::Specification.new do |spec|
6
- spec.name = 'pandorified'
7
- spec.version = Pandorified::VERSION
8
- spec.authors = 'Justin Workman'
9
- spec.email = 'xtagon@gmail.com'
10
- spec.summary = 'A Ruby client for the Pandorabots API.'
11
- spec.description = 'Pandorified makes it easy for your Ruby scripts to interact with chat bots hosted on Pandorabots.'
12
-
13
- spec.files = `git ls-files`.split("\n")
14
- spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
15
- spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
16
- spec.require_paths = ['lib']
17
-
18
- spec.add_runtime_dependency 'rest-client'
19
- spec.add_runtime_dependency 'nokogiri'
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
+
14
+ spec.description = <<~DOC.chomp
15
+ Pandorified makes it easy for your Ruby scripts to interact with chat bots hosted on Pandorabots.
16
+ DOC
17
+
18
+ spec.files = `git ls-files`.split("\n")
19
+ spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
+
21
+ spec.executables =
22
+ `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
23
+
24
+ spec.require_paths = ['lib']
25
+
26
+ spec.add_runtime_dependency 'nokogiri', '>= 1.11.0'
27
+ spec.add_runtime_dependency 'rest-client', '>= 1.7.3'
28
+
29
+ spec.add_development_dependency 'rspec'
30
+ spec.add_development_dependency 'rubocop'
31
+ spec.add_development_dependency 'webmock'
32
+ spec.add_development_dependency 'yard'
20
33
  end
@@ -0,0 +1,51 @@
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 { described_class.talk!(input, botid, custid) }
21
+
22
+ let(:that) { 'Of course not!' }
23
+
24
+ let(:response_body) do
25
+ <<~XML
26
+ <result status="0" botid="#{botid}" custid="fec7cfc40e5b751a"><input>#{input}</input><that>#{that}</that></result>"
27
+ XML
28
+ end
29
+
30
+ let(:response_headers) do
31
+ { content_type: 'text/xml' }
32
+ end
33
+
34
+ before :each do
35
+ stub_request(:post, 'https://www.pandorabots.com/pandora/talk-xml')
36
+ .with(body: request_body)
37
+ .to_return(
38
+ status: 200,
39
+ body: response_body,
40
+ headers: response_headers
41
+ )
42
+ end
43
+
44
+ it { is_expected.to eq(that) }
45
+ end
46
+
47
+ context 'when unsuccessful' do
48
+ pending { is_expected.to raise_error(described_class::PandorabotsError) }
49
+ end
50
+ end
51
+ 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,41 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pandorified
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Workman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-09 00:00:00.000000000 Z
11
+ date: 2021-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: nokogiri
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 1.11.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 1.11.0
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rest-client
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
- - - '>='
31
+ - - ">="
18
32
  - !ruby/object:Gem::Version
19
- version: '0'
33
+ version: 1.7.3
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
- - - '>='
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 1.7.3
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
25
53
  - !ruby/object:Gem::Version
26
54
  version: '0'
27
55
  - !ruby/object:Gem::Dependency
28
- name: nokogiri
56
+ name: rubocop
29
57
  requirement: !ruby/object:Gem::Requirement
30
58
  requirements:
31
- - - '>='
59
+ - - ">="
32
60
  - !ruby/object:Gem::Version
33
61
  version: '0'
34
- type: :runtime
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: webmock
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: yard
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
35
91
  prerelease: false
36
92
  version_requirements: !ruby/object:Gem::Requirement
37
93
  requirements:
38
- - - '>='
94
+ - - ">="
39
95
  - !ruby/object:Gem::Version
40
96
  version: '0'
41
97
  description: Pandorified makes it easy for your Ruby scripts to interact with chat
@@ -45,9 +101,10 @@ executables: []
45
101
  extensions: []
46
102
  extra_rdoc_files: []
47
103
  files:
48
- - .gitignore
104
+ - ".gitignore"
105
+ - ".rspec"
106
+ - ".rubocop.yml"
49
107
  - Gemfile
50
- - Gemfile.lock
51
108
  - README.md
52
109
  - Rakefile
53
110
  - lib/pandorified.rb
@@ -55,6 +112,8 @@ files:
55
112
  - lib/pandorified/session.rb
56
113
  - lib/pandorified/version.rb
57
114
  - pandorified.gemspec
115
+ - spec/lib/pandorified_spec.rb
116
+ - spec/spec_helper.rb
58
117
  homepage:
59
118
  licenses: []
60
119
  metadata: {}
@@ -64,17 +123,16 @@ require_paths:
64
123
  - lib
65
124
  required_ruby_version: !ruby/object:Gem::Requirement
66
125
  requirements:
67
- - - '>='
126
+ - - ">="
68
127
  - !ruby/object:Gem::Version
69
128
  version: '0'
70
129
  required_rubygems_version: !ruby/object:Gem::Requirement
71
130
  requirements:
72
- - - '>='
131
+ - - ">="
73
132
  - !ruby/object:Gem::Version
74
133
  version: '0'
75
134
  requirements: []
76
- rubyforge_project:
77
- rubygems_version: 2.0.0.rc.2
135
+ rubygems_version: 3.0.3
78
136
  signing_key:
79
137
  specification_version: 4
80
138
  summary: A Ruby client for the Pandorabots API.
@@ -1,20 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- pandorified (0.8.0)
5
- nokogiri
6
- rest-client
7
-
8
- GEM
9
- remote: http://rubygems.org/
10
- specs:
11
- mime-types (1.22)
12
- nokogiri (1.5.9)
13
- rest-client (1.6.7)
14
- mime-types (>= 1.16)
15
-
16
- PLATFORMS
17
- ruby
18
-
19
- DEPENDENCIES
20
- pandorified!