isis-plugin-missionstatement 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.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.travis.yml +3 -0
- data/Gemfile +4 -0
- data/README.md +23 -0
- data/Rakefile +1 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/isis-plugin-missionstatement.gemspec +25 -0
- data/lib/isis/plugin/missionstatement.rb +57 -0
- metadata +96 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: cfd84592ba96507656efaba49b3918cd91dea939
|
|
4
|
+
data.tar.gz: 8ddcf46512ad954ddd2021d2abb0ee6e94fa5492
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: b9ccae94a5db0c84d147cbc12c64e57d49078416b3c535b5e7207246140ac91635fc0789535cab689ffdb19d552dd5f5dc8ebbe11abbaf5b52d01616ae732acc
|
|
7
|
+
data.tar.gz: b807ec7d5080ce3d8217aae5e291350a555c1d2fb7d0b190eae34207fb7fdc8b1b457fe27c0a88679e3cc6c9aacfbfaa46ab78de7d6819a57acf597ab0537b41
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Isis plugin: Mission Statement
|
|
2
|
+
|
|
3
|
+
This plugin adds a mission statement generator 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-missionstatement'
|
|
11
|
+
``
|
|
12
|
+
|
|
13
|
+
And then execute:
|
|
14
|
+
|
|
15
|
+
$ bundle
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
Post a generated mission statetment into a room by typing ```!missionstatement``` in chat.
|
|
20
|
+
|
|
21
|
+
## Links
|
|
22
|
+
|
|
23
|
+
* [isis-plugin-missionstatement on RubyGems](https://rubygems.org/gems/isis-plugin-missionstatement)
|
data/Rakefile
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/console
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "isis/plugin/missionstatement"
|
|
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
|
data/bin/setup
ADDED
|
@@ -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-missionstatement"
|
|
7
|
+
spec.version = "1.0.0"
|
|
8
|
+
spec.authors = ["Brendon Rapp"]
|
|
9
|
+
spec.email = ["brendon@silentgrowl.com"]
|
|
10
|
+
spec.license = 'MIT'
|
|
11
|
+
|
|
12
|
+
spec.summary = %q{Isis plugin: Mission Statement generator}
|
|
13
|
+
spec.description = %q{Isis plugin: Mission Statement generator}
|
|
14
|
+
spec.homepage = "https://github.com/silentgrowl/isis-plugin-missionstatement"
|
|
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,57 @@
|
|
|
1
|
+
require "nokogiri"
|
|
2
|
+
|
|
3
|
+
module Isis
|
|
4
|
+
module Plugin
|
|
5
|
+
class MissionStatement < Isis::Plugin::Base
|
|
6
|
+
TRIGGERS = %w(!missionstatement !mission !ms)
|
|
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_html
|
|
16
|
+
"<b>Our mission statement:</b> #{statement}"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def response_md
|
|
20
|
+
"*Our mission statement:* #{statement}"
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def response_text
|
|
24
|
+
"Our mission statement: #{statement}"
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def statement
|
|
28
|
+
case rand(0..2)
|
|
29
|
+
when 0
|
|
30
|
+
laughing_buddha
|
|
31
|
+
when 1
|
|
32
|
+
comfychair
|
|
33
|
+
when 2
|
|
34
|
+
talbot
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def laughing_buddha
|
|
39
|
+
page = Nokogiri.HTML(open('http://www.laughing-buddha.net/toys/mission?'))
|
|
40
|
+
page.css('#content p')[1].text.strip
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def comfychair
|
|
44
|
+
page = Nokogiri.HTML(open('http://www.lotta.se/mission-statement-generator/'))
|
|
45
|
+
page.css('div div div div').text.strip # lol wut. classes and ids are for sissies
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Nokogiri not working on this page anymore, so let's Regexp
|
|
49
|
+
def talbot
|
|
50
|
+
regex = Regexp.new('<h2>(?<content>.*)?</h2>', Regexp::IGNORECASE | Regexp::MULTILINE)
|
|
51
|
+
content = open('http://www.harding.motd.ca/cgi-bin/msgen').read
|
|
52
|
+
matches = regex.match(content)
|
|
53
|
+
matches[:content].strip.gsub(/\n/, ' ')
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: isis-plugin-missionstatement
|
|
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: Mission Statement generator'
|
|
56
|
+
email:
|
|
57
|
+
- brendon@silentgrowl.com
|
|
58
|
+
executables: []
|
|
59
|
+
extensions: []
|
|
60
|
+
extra_rdoc_files: []
|
|
61
|
+
files:
|
|
62
|
+
- ".gitignore"
|
|
63
|
+
- ".travis.yml"
|
|
64
|
+
- Gemfile
|
|
65
|
+
- README.md
|
|
66
|
+
- Rakefile
|
|
67
|
+
- bin/console
|
|
68
|
+
- bin/setup
|
|
69
|
+
- isis-plugin-missionstatement.gemspec
|
|
70
|
+
- lib/isis/plugin/missionstatement.rb
|
|
71
|
+
homepage: https://github.com/silentgrowl/isis-plugin-missionstatement
|
|
72
|
+
licenses:
|
|
73
|
+
- MIT
|
|
74
|
+
metadata: {}
|
|
75
|
+
post_install_message:
|
|
76
|
+
rdoc_options: []
|
|
77
|
+
require_paths:
|
|
78
|
+
- lib
|
|
79
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
80
|
+
requirements:
|
|
81
|
+
- - ">="
|
|
82
|
+
- !ruby/object:Gem::Version
|
|
83
|
+
version: '0'
|
|
84
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
|
+
requirements:
|
|
86
|
+
- - ">="
|
|
87
|
+
- !ruby/object:Gem::Version
|
|
88
|
+
version: '0'
|
|
89
|
+
requirements: []
|
|
90
|
+
rubyforge_project:
|
|
91
|
+
rubygems_version: 2.2.2
|
|
92
|
+
signing_key:
|
|
93
|
+
specification_version: 4
|
|
94
|
+
summary: 'Isis plugin: Mission Statement generator'
|
|
95
|
+
test_files: []
|
|
96
|
+
has_rdoc:
|