tjplurk 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tjplurk/robot/response.rb +10 -0
- data/lib/tjplurk/robot/topic.rb +23 -0
- data/lib/tjplurk/robot.rb +13 -0
- data/lib/tjplurk/version.rb +1 -1
- data/lib/tjplurk.rb +0 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e1dcd345564228d02697e72691d1f52400c2f49
|
4
|
+
data.tar.gz: 8b1fc2bbd60aabb7d9491a2dc721acce3a9d420a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6e8f8730155a3dc73ca6fa5fd180ca4f2485e37ff2112dc64055418b429eb870984e7ee5d7863a4e4b98300b1f6d5ff8db15addb5e7e328151f4dad2c408395
|
7
|
+
data.tar.gz: 028ed05cc9a3ef8aec4491f4d6aaa54699ff05b64aab43739837102a83acf8547da89969c8a44d377b865aab0694555a01a790db204cb11127366f99dda46eb1
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'tjplurk/robot/response'
|
2
|
+
require 'yaml'
|
3
|
+
|
4
|
+
module Tjplurk
|
5
|
+
class Robot
|
6
|
+
class Topic
|
7
|
+
attr_accessor :name, :pattern, :responses
|
8
|
+
class << self
|
9
|
+
def load yaml
|
10
|
+
YAML.load(yaml).map do |attributes|
|
11
|
+
topic = self.new name: attributes['name'], pattern: attributes['pattern']
|
12
|
+
topic.responses = attributes['responses'].map{|res| Response.new(topic: topic, content: res)}
|
13
|
+
topic
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def initialize(**params)
|
19
|
+
params.each{|key, value| send("#{key}=", value)}
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/tjplurk/version.rb
CHANGED
data/lib/tjplurk.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tjplurk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Jian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oauth
|
@@ -77,6 +77,9 @@ files:
|
|
77
77
|
- lib/tjplurk.rb
|
78
78
|
- lib/tjplurk/api.rb
|
79
79
|
- lib/tjplurk/cli.rb
|
80
|
+
- lib/tjplurk/robot.rb
|
81
|
+
- lib/tjplurk/robot/response.rb
|
82
|
+
- lib/tjplurk/robot/topic.rb
|
80
83
|
- lib/tjplurk/version.rb
|
81
84
|
homepage: https://github.com/tonytonyjan/tjplurk
|
82
85
|
licenses:
|