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 +4 -4
- data/.gitignore +17 -0
- data/.travis.yml +6 -0
- data/Gemfile +3 -0
- data/LICENSE +19 -0
- data/README.md +23 -0
- data/Rakefile +6 -0
- data/lib/lita-bor.rb +1 -0
- data/lib/lita/handlers/bor.rb +25 -0
- data/lita-bor.gemspec +23 -0
- data/spec/lita/handlers/bor_spec.rb +4 -0
- data/spec/spec_helper.rb +10 -0
- metadata +21 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06ed849c9c6579a06944e52666cc21f089477fe5
|
4
|
+
data.tar.gz: 6296295dcf79735182b2c6e151d327793b3d90b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b06d2816c6bdb4b8adb23403d9007dbfb2a65b5b059359d7957eac440c6d723aca837e0d42cc0f0d552881e188b40fb2754ac42660e4e66d1f4538b243957bb
|
7
|
+
data.tar.gz: 0e1396bd527d813c003e82d6bf35ee1bfaa6fda094974feecb3a784c293b9c478ccca6449f644141a68163ab4269d15fea1e0be0441b9a134a62c91e2e74f884
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
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.
|
data/README.md
ADDED
@@ -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)
|
data/Rakefile
ADDED
data/lib/lita-bor.rb
ADDED
@@ -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
|
data/lita-bor.gemspec
ADDED
@@ -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
|
data/spec/spec_helper.rb
ADDED
@@ -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
|
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-
|
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
|
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:
|
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
|
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
|