isis-plugin-lynda 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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 82ff22f42beb7d6725bb2ca9e57e76bafb3a6271
4
+ data.tar.gz: 806f82024513dab411b58767ab57f58a953b4737
5
+ SHA512:
6
+ metadata.gz: e10fdf504dce195091788c2acf225a39d3c7ecb4550e2f20fe16834739ec5be5b7e8d5ee5c7d6d836b017781e7f028508ecc0e238ecf60d687a38242d9843e05
7
+ data.tar.gz: 656a9cf6faf32312c3d3706a45e892182e9bcb9be313a4d0dabb53509f2ea6fea58bb833225cc286abfb94e71488d33b911f4113dc82a8bcb8e4a6facbecde01
data/.gitignore ADDED
@@ -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
data/.travis.yml ADDED
@@ -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-lynda.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # Isis plugin: Lynda.com New Releases
2
+
3
+ This plugin adds a [Lynda.com](http://www.lynda.com) 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-lynda'
11
+ ``
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ ## Usage
18
+
19
+ Post the newest Lynda.com releases into a room by typing ```!lynda``` in chat.
20
+
21
+ ## Links
22
+
23
+ * [isis-plugin-lynda on RubyGems](https://rubygems.org/gems/isis-plugin-lynda)
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/lynda"
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,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,23 @@
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-lynda"
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: Lynda.com New Releases}
13
+ spec.description = %q{Isis plugin: Lynda.com New Releases}
14
+ spec.homepage = "https://github.com/silentgrowl/isis-plugin-lynda"
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_development_dependency "bundler", "~> 1.9"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ end
@@ -0,0 +1,38 @@
1
+ require "rss"
2
+
3
+ module Isis
4
+ module Plugin
5
+ class Lynda < Isis::Plugin::Base
6
+ TRIGGERS = %w(!lynda)
7
+
8
+ def respond_to_msg?(msg, speaker)
9
+ TRIGGERS.include? msg.downcase
10
+ end
11
+
12
+ private
13
+
14
+ def response_html
15
+ feed_items.reduce('Lynda.com New Releases<br>') do |output, item|
16
+ output += %Q(<a href="#{item.link}">#{item.title}</a><br>)
17
+ end
18
+ end
19
+
20
+ def response_md
21
+ feed_items.reduce("Lynda.com New Releases\n") do |output, item|
22
+ output += %Q(<#{item.link}|#{item.title}>\n)
23
+ end
24
+ end
25
+
26
+ def response_text
27
+ feed_items.reduce(['Lynda.com New Releases']) do |output, item|
28
+ output.push "#{item.title}: #{item.link}"
29
+ end
30
+ end
31
+
32
+ def feed_items
33
+ feed = RSS::Parser.parse(open('http://feeds2.feedburner.com/lyndablog'), false)
34
+ feed.items[0..4]
35
+ end
36
+ end
37
+ end
38
+ end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: isis-plugin-lynda
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: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.9'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.9'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: 'Isis plugin: Lynda.com New Releases'
42
+ email:
43
+ - brendon@silentgrowl.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - ".travis.yml"
50
+ - Gemfile
51
+ - README.md
52
+ - Rakefile
53
+ - bin/console
54
+ - bin/setup
55
+ - isis-plugin-lynda.gemspec
56
+ - lib/isis/plugin/lynda.rb
57
+ homepage: https://github.com/silentgrowl/isis-plugin-lynda
58
+ licenses:
59
+ - MIT
60
+ metadata: {}
61
+ post_install_message:
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubyforge_project:
77
+ rubygems_version: 2.2.2
78
+ signing_key:
79
+ specification_version: 4
80
+ summary: 'Isis plugin: Lynda.com New Releases'
81
+ test_files: []
82
+ has_rdoc: