twilio_contactable 0.8.0 → 0.8.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.
- data/VERSION +1 -1
- data/lib/configuration.rb +2 -2
- data/lib/contactable.rb +3 -3
- data/lib/controller.rb +1 -1
- data/test/twilio_contactable_contactable_test.rb +5 -1
- data/twilio_contactable.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.1
|
data/lib/configuration.rb
CHANGED
@@ -14,11 +14,11 @@ module TwilioContactable
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def configuration
|
17
|
-
|
17
|
+
@configuration ||= Configuration.new
|
18
18
|
end
|
19
19
|
|
20
20
|
def configure(&block)
|
21
|
-
|
21
|
+
@configuration = Configuration.new(&block)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
data/lib/contactable.rb
CHANGED
@@ -39,10 +39,10 @@ module TwilioContactable
|
|
39
39
|
|
40
40
|
# set up the configuration, available within the class object
|
41
41
|
# via this same 'twilio_contactable' method
|
42
|
-
model
|
42
|
+
class << model
|
43
43
|
def twilio_contactable(&block)
|
44
|
-
|
45
|
-
|
44
|
+
@twilio_contactable = Configuration.new(&block) if block
|
45
|
+
@twilio_contactable ||= Configuration.new
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
data/lib/controller.rb
CHANGED
@@ -2,7 +2,7 @@ module TwilioContactable
|
|
2
2
|
module Controller
|
3
3
|
|
4
4
|
def self.included(controller)
|
5
|
-
controller
|
5
|
+
class << controller
|
6
6
|
# the developer should specify which model(s) will be sought
|
7
7
|
# when the app receives incoming requests.
|
8
8
|
# See the 'Controller' part of the README for details
|
@@ -8,10 +8,14 @@ class TwilioContactableContactableTest < ActiveSupport::TestCase
|
|
8
8
|
context "configuration" do
|
9
9
|
TwilioContactable::Contactable::Attributes.each do |attr|
|
10
10
|
context "attribute: #{attr}" do
|
11
|
-
should "begin with appropriate default for #{attr}_column
|
11
|
+
should "begin with appropriate default for #{attr}_column" do
|
12
12
|
klass = Class.new
|
13
13
|
klass.send :include, TwilioContactable::Contactable
|
14
14
|
assert_equal attr, klass.twilio_contactable.send("#{attr}_column")
|
15
|
+
end
|
16
|
+
should "allow overwriting the default" do
|
17
|
+
klass = Class.new
|
18
|
+
klass.send :include, TwilioContactable::Contactable
|
15
19
|
klass.twilio_contactable do |config|
|
16
20
|
config.send("#{attr}_column=", :custom_column)
|
17
21
|
end
|
data/twilio_contactable.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twilio_contactable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 61
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 8
|
9
|
-
-
|
10
|
-
version: 0.8.
|
9
|
+
- 1
|
10
|
+
version: 0.8.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jack Danger Canty
|