conversational 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +5 -4
- data/lib/conversational/conversation.rb +54 -57
- data/lib/conversational/version.rb +1 -1
- metadata +9 -9
data/Gemfile.lock
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
conversational (0.4.
|
4
|
+
conversational (0.4.1)
|
5
5
|
activesupport
|
6
6
|
i18n
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: http://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activesupport (3.
|
11
|
+
activesupport (3.2.0)
|
12
|
+
i18n (~> 0.6)
|
12
13
|
multi_json (~> 1.0)
|
13
14
|
diff-lcs (1.1.2)
|
14
|
-
i18n (0.
|
15
|
-
multi_json (1.0.
|
15
|
+
i18n (0.6.0)
|
16
|
+
multi_json (1.0.4)
|
16
17
|
rake (0.9.2)
|
17
18
|
rspec (2.5.0)
|
18
19
|
rspec-core (~> 2.5.0)
|
@@ -18,64 +18,62 @@ module Conversational
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
)
|
73
|
-
end
|
21
|
+
# Returns the specific sublass of conversation based from the topic
|
22
|
+
# Example:
|
23
|
+
#
|
24
|
+
# <tt>
|
25
|
+
# Class Conversation
|
26
|
+
# include Conversational::Conversation
|
27
|
+
# end
|
28
|
+
#
|
29
|
+
# Class HelloConversation < Conversation
|
30
|
+
# end
|
31
|
+
#
|
32
|
+
# Class GoodbyeConversation < Conversation
|
33
|
+
# end
|
34
|
+
#
|
35
|
+
# hello = Conversation.new("someone", "hello")
|
36
|
+
# hello.details => #<HelloConversation topic: "hello", with: "someone">
|
37
|
+
#
|
38
|
+
# unknown = Conversation.new("someone", "cheese")
|
39
|
+
# unknown.details => nil
|
40
|
+
#
|
41
|
+
# Conversation.unknown_topic_subclass = HelloConversation
|
42
|
+
#
|
43
|
+
# unknown = Conversation.new("someone", "cheese")
|
44
|
+
# unknown.details => #<HelloConversation topic: "cheese", with: "someone">
|
45
|
+
#
|
46
|
+
# blank = Conversation.new("someone")
|
47
|
+
# blank.details => nil
|
48
|
+
#
|
49
|
+
# Conversation.blank_topic_subclass = GoodbyeConversation
|
50
|
+
#
|
51
|
+
# blank = Conversation.new("someone")
|
52
|
+
# blank.details => #<GoodbyeConversation topic: nil, with: "someone">
|
53
|
+
#
|
54
|
+
# Conversation.exclude HelloConversation
|
55
|
+
#
|
56
|
+
# hello = Conversation.new("someone", "hello")
|
57
|
+
# hello.details => nil
|
58
|
+
#
|
59
|
+
# hello.details(:include_all => true) => #<HelloConversation topic: "hello", with: "someone">
|
60
|
+
#
|
61
|
+
# </tt>
|
62
|
+
def details(options = {})
|
63
|
+
details_subclass = Conversational::Conversation.find_subclass_by_topic(
|
64
|
+
topic, options
|
65
|
+
)
|
66
|
+
if details_subclass
|
67
|
+
self.respond_to?(:becomes) ?
|
68
|
+
becomes(details_subclass) :
|
69
|
+
Conversational::Conversation.becomes(
|
70
|
+
details_subclass, self
|
71
|
+
)
|
74
72
|
end
|
73
|
+
end
|
75
74
|
|
76
|
-
|
77
|
-
|
78
|
-
end
|
75
|
+
def topic_defined?
|
76
|
+
details_subclass = Conversational::Conversation.topic_defined?(topic)
|
79
77
|
end
|
80
78
|
|
81
79
|
module ClassMethods
|
@@ -277,4 +275,3 @@ module Conversational
|
|
277
275
|
end
|
278
276
|
end
|
279
277
|
end
|
280
|
-
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conversational
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-01-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
|
-
requirement: &
|
16
|
+
requirement: &78604790 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *78604790
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: i18n
|
27
|
-
requirement: &
|
27
|
+
requirement: &78604570 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *78604570
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &78604340 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *78604340
|
47
47
|
description: Allows you to instansiate conversations based on keywords
|
48
48
|
email:
|
49
49
|
- dwilkie@gmail.com
|
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
86
|
rubyforge_project: conversational
|
87
|
-
rubygems_version: 1.8.
|
87
|
+
rubygems_version: 1.8.15
|
88
88
|
signing_key:
|
89
89
|
specification_version: 3
|
90
90
|
summary: Have topic based conversations
|