ruboty-aa 0.0.1

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: e81ec95780837848e2a854fbcf6e2cecc3e32850
4
+ data.tar.gz: d6494e51a77237905646f70c6aa6ef6cf131430b
5
+ SHA512:
6
+ metadata.gz: 165d817a14643c24caf6dc6babb350024753ab27ed268631715450fea610330ef41a9267287447ecdc61ff11632c5b1ee530216699f9f4699b651b080b497352
7
+ data.tar.gz: 124bb71540dcbc06e784b5ff95c0dd897bf6b6db9a32bfb0dc436b1b7da2c334230ffec0d42943d5453c3990ad3367a3c99683bb0804271963faded43056adcc
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ruboty-aa.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Yuichi Tateno
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # ruboty-aa
2
+
3
+ A Ruboty plugin for Ascii Art
4
+
5
+ ![](http://f.st-hatena.com/images/fotolife/s/secondlife/20140903/20140903162737.png?1409729171)
6
+
7
+ ```ruby
8
+ gem 'ruboty-aa'
9
+ ```
10
+
11
+ ## env options
12
+
13
+ ```ruby
14
+ ENV['AA_PREFIX'] # default "```\n"
15
+ ENV['AA_SUFFIX'] # default "```\n"
16
+ ENV['AA_FONT'] # default "big", see https://github.com/miketierney/artii
17
+ ```
18
+
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/lib/ruboty/aa.rb ADDED
@@ -0,0 +1,34 @@
1
+ require "ruboty/aa/version"
2
+ require "artii"
3
+
4
+ module Ruboty
5
+ module Handlers
6
+ class Aa < Base
7
+ on(
8
+ /aa(?:\s+(.*))?/,
9
+ name: 'aa',
10
+ description: 'Ascii Art'
11
+ )
12
+
13
+ def prefix
14
+ ENV['AA_PREFIX'] ||= "```\n"
15
+ end
16
+
17
+ def suffix
18
+ ENV['AA_SUFFIX'] ||= "\n```"
19
+ end
20
+
21
+
22
+ def artii
23
+ @artii ||= Artii::Base.new(font: (ENV['AA_FONT'] || 'big'))
24
+ end
25
+
26
+ def aa(message)
27
+ word = message.match_data[1]
28
+ if word && !word.empty?
29
+ message.reply prefix + artii.asciify(word).chomp + suffix
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,5 @@
1
+ module Ruboty
2
+ module Aa
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
data/ruboty-aa.gemspec 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
+ require 'ruboty/aa/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ruboty-aa"
8
+ spec.version = Ruboty::Aa::VERSION
9
+ spec.authors = ["Yuichi Tateno"]
10
+ spec.email = ["hotchpotch@gmail.com"]
11
+ spec.summary = %q{A ruboty plugin for ascii art}
12
+ spec.description = %q{A ruboty plugin for ascii art}
13
+ spec.homepage = "http://github.com/hotchpotch/ruboty-aa"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "ruboty"
22
+ spec.add_dependency "artii", ">= 2.0"
23
+ spec.add_development_dependency "bundler", "~> 1.6"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ end
metadata ADDED
@@ -0,0 +1,108 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruboty-aa
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Yuichi Tateno
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-09-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ruboty
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: artii
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.6'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.6'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ description: A ruboty plugin for ascii art
70
+ email:
71
+ - hotchpotch@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - Gemfile
78
+ - LICENSE.txt
79
+ - README.md
80
+ - Rakefile
81
+ - lib/ruboty/aa.rb
82
+ - lib/ruboty/aa/version.rb
83
+ - ruboty-aa.gemspec
84
+ homepage: http://github.com/hotchpotch/ruboty-aa
85
+ licenses:
86
+ - MIT
87
+ metadata: {}
88
+ post_install_message:
89
+ rdoc_options: []
90
+ require_paths:
91
+ - lib
92
+ required_ruby_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ required_rubygems_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ requirements: []
103
+ rubyforge_project:
104
+ rubygems_version: 2.0.14
105
+ signing_key:
106
+ specification_version: 4
107
+ summary: A ruboty plugin for ascii art
108
+ test_files: []