lita-bor 0.0.1.alpha → 0.0.1

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
2
  SHA1:
3
- metadata.gz: be6974daf3eed1c8e1dd0f31c74865dbfed93435
4
- data.tar.gz: c4a0271ae1d3993b005680d3b85982a9dfb61de4
3
+ metadata.gz: 06ed849c9c6579a06944e52666cc21f089477fe5
4
+ data.tar.gz: 6296295dcf79735182b2c6e151d327793b3d90b6
5
5
  SHA512:
6
- metadata.gz: 56760497066481136496658341c5b86d765dc914822f021f6e6fa74e934caebc50f2e340457b45e79c4a909af2d84f3095f2634813c66c3411094e636cecb941
7
- data.tar.gz: 94aa48375577eeadc827ec9a7c661abd81773af5cb644b9c60883c0f0158ba4f2a72e410531dffebbab6766317aa6d10db69b57f54375ddfd0b3bd0edf639493
6
+ metadata.gz: 5b06d2816c6bdb4b8adb23403d9007dbfb2a65b5b059359d7957eac440c6d723aca837e0d42cc0f0d552881e188b40fb2754ac42660e4e66d1f4538b243957bb
7
+ data.tar.gz: 0e1396bd527d813c003e82d6bf35ee1bfaa6fda094974feecb3a784c293b9c478ccca6449f644141a68163ab4269d15fea1e0be0441b9a134a62c91e2e74f884
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ script: bundle exec rake
5
+ before_install:
6
+ - gem update --system
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2013 Andrei Beliankou
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
@@ -0,0 +1,23 @@
1
+ # lita-bor
2
+
3
+ TODO: Add a description of the plugin.
4
+
5
+ ## Installation
6
+
7
+ Add lita-bor to your Lita instance's Gemfile:
8
+
9
+ ``` ruby
10
+ gem "lita-bor"
11
+ ```
12
+
13
+ ## Configuration
14
+
15
+ TODO: Describe any configuration attributes the plugin exposes.
16
+
17
+ ## Usage
18
+
19
+ TODO: Describe the plugin's features and how to use them.
20
+
21
+ ## License
22
+
23
+ [MIT](http://opensource.org/licenses/MIT)
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1 @@
1
+ require "lita/handlers/bor"
@@ -0,0 +1,25 @@
1
+ require 'lita'
2
+ require 'net/http'
3
+ require 'cgi'
4
+
5
+ module Lita
6
+ module Handlers
7
+ class Bor < Handler
8
+ route(/^bor/, :bor)
9
+
10
+ # Some implementation based on Rebular Expressions.
11
+ # TODO: use Nokogiri or an other HTML parser.
12
+ def bor(response)
13
+ str = Net::HTTP.get(URI('http://bash.im/forweb/?u'))
14
+ str = str.gsub(/'\s+\+\s+'/, '')
15
+ str = str.match(/<div id="b_q_t" [^>]+>(.+?)<\/div>/)[1]
16
+ str = str.gsub(/<br[^>]*>/, "\n")
17
+ str = CGI.unescapeHTML(str)
18
+ str = "#{str}\n"
19
+ response.reply(str)
20
+ end
21
+ end
22
+
23
+ Lita.register_handler(Bor)
24
+ end
25
+ end
@@ -0,0 +1,23 @@
1
+ Gem::Specification.new do |spec|
2
+ spec.name = "lita-bor"
3
+ spec.version = "0.0.1"
4
+ spec.authors = ["Andrei Beliankou"]
5
+ spec.email = ["arbox@yandex.ru"]
6
+ spec.description = 'Lita handler for http://bash.im'
7
+ spec.summary = 'Lita handler for http://bash.im'
8
+ spec.homepage = "http://bu.chsta.be"
9
+ spec.license = "MIT"
10
+
11
+ spec.files = `git ls-files`.split($/)
12
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
13
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
14
+ spec.require_paths = ["lib"]
15
+
16
+ spec.add_runtime_dependency "lita", "~> 2.5"
17
+
18
+ spec.add_development_dependency "bundler", "~> 1.3"
19
+ spec.add_development_dependency "rake"
20
+ spec.add_development_dependency "rspec", ">= 2.14"
21
+ spec.add_development_dependency "simplecov"
22
+ spec.add_development_dependency "coveralls"
23
+ end
@@ -0,0 +1,4 @@
1
+ require "spec_helper"
2
+
3
+ describe Lita::Handlers::Bor, lita_handler: true do
4
+ end
@@ -0,0 +1,10 @@
1
+ require "simplecov"
2
+ require "coveralls"
3
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
4
+ SimpleCov::Formatter::HTMLFormatter,
5
+ Coveralls::SimpleCov::Formatter
6
+ ]
7
+ SimpleCov.start { add_filter "/spec/" }
8
+
9
+ require "lita-bor"
10
+ require "lita/rspec"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-bor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Beliankou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-25 00:00:00.000000000 Z
11
+ date: 2013-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita
@@ -94,13 +94,24 @@ dependencies:
94
94
  - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- description: Lita handler for _bash.org_
97
+ description: Lita handler for http://bash.im
98
98
  email:
99
99
  - arbox@yandex.ru
100
100
  executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
- files: []
103
+ files:
104
+ - .gitignore
105
+ - .travis.yml
106
+ - Gemfile
107
+ - LICENSE
108
+ - README.md
109
+ - Rakefile
110
+ - lib/lita-bor.rb
111
+ - lib/lita/handlers/bor.rb
112
+ - lita-bor.gemspec
113
+ - spec/lita/handlers/bor_spec.rb
114
+ - spec/spec_helper.rb
104
115
  homepage: http://bu.chsta.be
105
116
  licenses:
106
117
  - MIT
@@ -116,13 +127,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
127
  version: '0'
117
128
  required_rubygems_version: !ruby/object:Gem::Requirement
118
129
  requirements:
119
- - - '>'
130
+ - - '>='
120
131
  - !ruby/object:Gem::Version
121
- version: 1.3.1
132
+ version: '0'
122
133
  requirements: []
123
134
  rubyforge_project:
124
135
  rubygems_version: 2.0.2
125
136
  signing_key:
126
137
  specification_version: 4
127
- summary: Lita handler for _bash.org_
128
- test_files: []
138
+ summary: Lita handler for http://bash.im
139
+ test_files:
140
+ - spec/lita/handlers/bor_spec.rb
141
+ - spec/spec_helper.rb