isis-plugin-bash 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 20496adf218d60e58f18b73818a4305db8615f9c
4
+ data.tar.gz: 8cc2abe42e240aa48edcaf123796e69c9b8f46b2
5
+ SHA512:
6
+ metadata.gz: a54d6caa445d0a43ce8a6260f11c3db14f7a54779bbe4f94827e8497f5efb10adc92b2fbad3fd2f802997d3a690def1de992aa6e2f3c3bd8d1fbef9fc9621b30
7
+ data.tar.gz: 24a0a0b37a4c0f81a094163f47cddd9e7eda4e115daf0f1557ee678eb64ecb698efd7427b172916f7569f142b0bf07604cbfebc7e76b38cbb88287dbf4e0a54f
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ tags
@@ -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-bash.gemspec
4
+ gemspec
@@ -0,0 +1,19 @@
1
+ # Isis plugin: Bash.org
2
+
3
+ This plugin adds a command for random [bash.org](http://bash.org) quotes 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-bash'
11
+ ``
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ ## Usage
18
+
19
+ Trigger a random bash.org quite by typing ``!bash`` in chat.`
@@ -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/bash"
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,24 @@
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-bash"
7
+ spec.version = "1.0.0"
8
+ spec.authors = ["Brendon Rapp"]
9
+ spec.email = ["brendon@silentgrowl.com"]
10
+
11
+ spec.summary = %q{Isis plugin: bash.org}
12
+ spec.description = %q{Isis plugin: bash.org}
13
+ spec.homepage = "https://github.com/silentgrowl/isis-plugin-bash"
14
+
15
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
16
+ spec.bindir = "exe"
17
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_runtime_dependency "nokogiri"
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.9"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ end
@@ -0,0 +1,22 @@
1
+ require "nokogiri"
2
+
3
+ module Isis
4
+ module Plugin
5
+ class Bash < Isis::Plugin::Base
6
+ def respond_to_msg?(msg, speaker)
7
+ /\b!bash\b/i =~ msg
8
+ end
9
+
10
+ private
11
+
12
+ def response_text
13
+ page = Nokogiri.HTML(open('http://bash.org?random1'))
14
+ selected = rand(page.css('.quote').length)
15
+ link = page.css('.quote')[selected].css('a').first['href']
16
+ quote = page.css('.qt')[selected].text
17
+ number = link.gsub('?', '')
18
+ "bash.org ##{number}: \r\n#{quote}\r\n(link: http://bash.org#{link})"
19
+ end
20
+ end
21
+ end
22
+ end
metadata ADDED
@@ -0,0 +1,95 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: isis-plugin-bash
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: bash.org'
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-bash.gemspec
70
+ - lib/isis/plugin/bash.rb
71
+ homepage: https://github.com/silentgrowl/isis-plugin-bash
72
+ licenses: []
73
+ metadata: {}
74
+ post_install_message:
75
+ rdoc_options: []
76
+ require_paths:
77
+ - lib
78
+ required_ruby_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ required_rubygems_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ requirements: []
89
+ rubyforge_project:
90
+ rubygems_version: 2.2.2
91
+ signing_key:
92
+ specification_version: 4
93
+ summary: 'Isis plugin: bash.org'
94
+ test_files: []
95
+ has_rdoc: