text_message_rails 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +10 -1
- data/lib/text_message_rails/providers/text_magic.rb +1 -0
- data/lib/text_message_rails/providers.rb +4 -2
- data/lib/text_message_rails/railtie.rb +4 -2
- data/lib/text_message_rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ed8db9bab0015b9afb253c1c295348b76fcfd14
|
4
|
+
data.tar.gz: c0707f4cc5528b0ed36f942f0fb98ce14ec1f767
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f386a532342730dc6372235cfa660c2d4d096b15719ab193126f1d0f80bef1f2735661cc372ac1b963370fd23d35cb8c9113050c4d86fa88be1a5d56119c5ac
|
7
|
+
data.tar.gz: 29d47f73dcef3bf0115c281288d0ed9ab0fd47a8ecfdef9fdf3d97e2884ace798a6bc0535b0dba32ec50836034f13de4d4dfbd6c1263e34b24bf4e6633879f19
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -65,6 +65,8 @@ ClientTextMessages.confirm_order(order).deliver_later!
|
|
65
65
|
|
66
66
|
For the time being, only the `TextMagic` provider is supported.
|
67
67
|
|
68
|
+
### TextMagic
|
69
|
+
|
68
70
|
To use it, include it in you `Gemfile`:
|
69
71
|
|
70
72
|
```ruby
|
@@ -76,12 +78,19 @@ gem "text_magic"
|
|
76
78
|
gem "phony_rails"
|
77
79
|
```
|
78
80
|
|
79
|
-
|
81
|
+
Enable its use in the configuration:
|
80
82
|
|
81
83
|
```ruby
|
82
84
|
config.text_message.provider = :text_magic
|
83
85
|
```
|
84
86
|
|
87
|
+
And provision the following environment variables:
|
88
|
+
|
89
|
+
```yaml
|
90
|
+
TEXTMAGIC_USERNAME: "my textmagic user name"
|
91
|
+
TEXTMAGIC_PASSWORD: "my textmagic password"
|
92
|
+
```
|
93
|
+
|
85
94
|
## Development
|
86
95
|
|
87
96
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -24,12 +24,14 @@ module TextMessage
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def message
|
27
|
-
delivery.body.
|
27
|
+
delivery.body.to_s
|
28
28
|
end
|
29
29
|
|
30
30
|
def recipients
|
31
|
-
delivery.recipients.map(&:
|
31
|
+
delivery.recipients.map(&:to_s)
|
32
32
|
end
|
33
|
+
|
34
|
+
delegate :logger, to: Rails
|
33
35
|
end
|
34
36
|
|
35
37
|
# Known providers
|
@@ -5,12 +5,14 @@ module TextMessage
|
|
5
5
|
config.text_message = ActiveSupport::OrderedOptions.new
|
6
6
|
|
7
7
|
initializer "text_message.configure" do |app|
|
8
|
-
|
8
|
+
# Update load paths
|
9
|
+
app.config.paths.add "app/text_messages", eager_load: true
|
9
10
|
|
11
|
+
# Load plugin-specific options
|
12
|
+
app_options = app.config.text_message
|
10
13
|
if default_url_options = app_options.default_url_options
|
11
14
|
TextMessage::Controller.default_url_options = default_url_options
|
12
15
|
end
|
13
|
-
|
14
16
|
if provider_key = app_options.provider
|
15
17
|
TextMessage::Controller.provider = TextMessage::Providers.find(provider_key)
|
16
18
|
end
|