isis-plugin-insult 1.0.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 839107a71eae578988dae8210a8af8c6a44512b9
4
+ data.tar.gz: 9c05bf2b5cb673c2edbe5e72c687b12be5cd5eae
5
+ SHA512:
6
+ metadata.gz: 007dee285f9e825cfd43730d4600e3464f7c953225eea0bf813579c94ad34ec6668a15d1b65cf34004fd6dc08fd5bf740dfc128cb0d565b2b1867671c60fede7
7
+ data.tar.gz: 0c0c86ef4f9caa37a5bef2847e43c2406079f56b9575ecc3f686e789aabcc816dd4b1e23952ae1fbae2a78bccf2082fbdd227d46702bd306e4cbca889a931889
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ tags
11
+ *.gem
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.5
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in isis-plugin-insult.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 silentgrowl
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,23 @@
1
+ # Isis plugin: Insult
2
+
3
+ This plugin adds an insult command to the [Isis chatbot](https://github.com/silentgrowl/isis)
4
+
5
+ ## Installation
6
+
7
+ Add this line to your Isis installation's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'isis-plugin-insult'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ ## Usage
18
+
19
+ To have Isis insult a chat user, type ```!insult (username)``` in chat.
20
+
21
+ ## Links
22
+
23
+ * [isis-plugin-insult on RubyGems](https://rubygems.org/gems/isis-plugin-insult)
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "isis/plugin/insult"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "isis-plugin-insult"
7
+ spec.version = "1.0.0"
8
+ spec.authors = ["Brendon Rapp"]
9
+ spec.email = ["brendon@jaguardesignstudio.com"]
10
+ spec.license = 'MIT'
11
+
12
+ spec.summary = %q{Isis plugin: Insult}
13
+ spec.description = %q{Isis plugin: Insult}
14
+ spec.homepage = "https://github.com/silentgrowl/isis-plugin-insult"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_runtime_dependency "nokogiri"
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.9"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ end
@@ -0,0 +1,40 @@
1
+ require 'nokogiri'
2
+
3
+ module Isis
4
+ module Plugin
5
+ class Insult < Isis::Plugin::Base
6
+ TRIGGERS = %w(!insult)
7
+
8
+ def respond_to_msg?(msg, speaker)
9
+ @commands = msg.downcase.split
10
+ TRIGGERS.include? @commands[0]
11
+ end
12
+
13
+ private
14
+
15
+ def response_text
16
+ insult = case rand(0..3)
17
+ when 0, 1, 2
18
+ randominsults
19
+ when 3
20
+ pirate
21
+ end
22
+ if @commands[1].nil?
23
+ "#{insult}"
24
+ else
25
+ subject = @commands[1].gsub('@', '')
26
+ "@#{subject} #{insult}"
27
+ end
28
+ end
29
+
30
+ def randominsults
31
+ page = Nokogiri.HTML(open('http://www.randominsults.net/'))
32
+ page.css('i').text.strip
33
+ end
34
+
35
+ def pirate
36
+ open('http://pir.to/api/insult').string
37
+ end
38
+ end
39
+ end
40
+ end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: isis-plugin-insult
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Brendon Rapp
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-05-15 00:00:00.000000000 Z
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: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.9'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.9'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: 'Isis plugin: Insult'
56
+ email:
57
+ - brendon@jaguardesignstudio.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".travis.yml"
64
+ - Gemfile
65
+ - LICENSE
66
+ - README.md
67
+ - Rakefile
68
+ - bin/console
69
+ - bin/setup
70
+ - isis-plugin-insult.gemspec
71
+ - lib/isis/plugin/insult.rb
72
+ homepage: https://github.com/silentgrowl/isis-plugin-insult
73
+ licenses:
74
+ - MIT
75
+ metadata: {}
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubyforge_project:
92
+ rubygems_version: 2.2.2
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: 'Isis plugin: Insult'
96
+ test_files: []
97
+ has_rdoc: