mandrill-template-manager 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +54 -7
- data/lib/mandrill_template/cli.rb +16 -1
- data/mandrill-template-manager.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d301d5990ddcab5f7dfc095785c7de426e6d65fe
|
4
|
+
data.tar.gz: 6dd9e324a600280687fbfa92242bcc97d0b8d6c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f18d136470bafcb4e305763d0036505189782b8b0444a83ec743c5266093be4b8a06bdad1e3116a0b9fb061b1ff5860df1b1ffd4b8cf6f02b4af0f420f96d5f8
|
7
|
+
data.tar.gz: 2a055423ed19a854511284d912b1b63f16f0ec3ce4a512a13bfa64d126d9f9dff32b88a66efdb1473e0d87990c68ae00b4394a309b99216f43cf7488aceed0bf
|
data/README.md
CHANGED
@@ -17,13 +17,15 @@ gem 'unicode'
|
|
17
17
|
```
|
18
18
|
$ ./bin/mandrilltemplate
|
19
19
|
Commands:
|
20
|
-
mandrilltemplate delete NAME
|
21
|
-
mandrilltemplate export NAME
|
22
|
-
mandrilltemplate generate NAME
|
23
|
-
mandrilltemplate help [COMMAND]
|
24
|
-
mandrilltemplate list
|
25
|
-
mandrilltemplate publish NAME
|
26
|
-
mandrilltemplate
|
20
|
+
mandrilltemplate delete NAME # delete template from remote.
|
21
|
+
mandrilltemplate export NAME # export template from remote to local files.
|
22
|
+
mandrilltemplate generate NAME # generate new template files.
|
23
|
+
mandrilltemplate help [COMMAND] # Describe available commands or one specific command
|
24
|
+
mandrilltemplate list # show template list both of remote and local.
|
25
|
+
mandrilltemplate publish NAME # publish template from draft.
|
26
|
+
mandrilltemplate render NAME [PARAMS_FILE] # render mailbody from local template data. File should be Array. see https://mandrillapp.com/api/docs/templates.JSON.html#method=render.
|
27
|
+
mandrilltemplate upload NAME # upload template to remote as draft.
|
28
|
+
|
27
29
|
```
|
28
30
|
|
29
31
|
## Workflow
|
@@ -95,6 +97,51 @@ from_email: test@example.com
|
|
95
97
|
from_name: Boss
|
96
98
|
```
|
97
99
|
|
100
|
+
## Optional: render suppots Handlebars preview.
|
101
|
+
|
102
|
+
If you would like to use handlebars template.
|
103
|
+
You should add handlebars rubygem to Gemfile.
|
104
|
+
|
105
|
+
```
|
106
|
+
gem 'mandrill-template-manager'
|
107
|
+
gem 'handlebars'
|
108
|
+
# if fails on OSX to install Handlebars, try below.
|
109
|
+
# bundle config build.libv8 --with-system-v8
|
110
|
+
```
|
111
|
+
|
112
|
+
And, pass `--handlebars` option to render subcommand.
|
113
|
+
It will be compiled as Handlebars Template.
|
114
|
+
|
115
|
+
```
|
116
|
+
Usage:
|
117
|
+
mandrilltemplate render NAME [PARAMS_FILE]
|
118
|
+
|
119
|
+
Options:
|
120
|
+
[--handlebars], [--no-handlebars]
|
121
|
+
```
|
122
|
+
|
123
|
+
> Note: This feature provides without api call.
|
124
|
+
> I can't guarantee that this will work same as send api.
|
125
|
+
|
126
|
+
Json example. This is same format when using send api.
|
127
|
+
|
128
|
+
```
|
129
|
+
[
|
130
|
+
{
|
131
|
+
"name": "UserName",
|
132
|
+
"content": "ExampleUser"
|
133
|
+
},
|
134
|
+
{
|
135
|
+
"name": "ImpossibleMissions",
|
136
|
+
"content": [
|
137
|
+
"Mission A",
|
138
|
+
"Mission B",
|
139
|
+
"Mission C"
|
140
|
+
]
|
141
|
+
}
|
142
|
+
]
|
143
|
+
```
|
144
|
+
|
98
145
|
## License
|
99
146
|
|
100
147
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
@@ -9,7 +9,7 @@ autoload "Handlebars", 'handlebars'
|
|
9
9
|
|
10
10
|
class MandrillTemplateManager < Thor
|
11
11
|
include Thor::Actions
|
12
|
-
VERSION = "0.2.
|
12
|
+
VERSION = "0.2.1"
|
13
13
|
|
14
14
|
desc "export NAME", "export template from remote to local files."
|
15
15
|
def export(name)
|
@@ -71,6 +71,7 @@ class MandrillTemplateManager < Thor
|
|
71
71
|
end
|
72
72
|
|
73
73
|
desc "list", "show template list both of remote and local."
|
74
|
+
option :verbose, type: :boolean, default: false, aliases: :v
|
74
75
|
def list
|
75
76
|
puts "Remote Templates"
|
76
77
|
puts "----------------------"
|
@@ -80,6 +81,7 @@ class MandrillTemplateManager < Thor
|
|
80
81
|
template
|
81
82
|
end
|
82
83
|
|
84
|
+
if options[:verbose]
|
83
85
|
Formatador.display_compact_table(
|
84
86
|
remote_templates,
|
85
87
|
["has_diff",
|
@@ -96,6 +98,19 @@ class MandrillTemplateManager < Thor
|
|
96
98
|
"from_name",
|
97
99
|
"publish_from_name"]
|
98
100
|
)
|
101
|
+
else
|
102
|
+
Formatador.display_compact_table(
|
103
|
+
remote_templates,
|
104
|
+
["has_diff",
|
105
|
+
"name",
|
106
|
+
"slug",
|
107
|
+
"from_email",
|
108
|
+
"from_name",
|
109
|
+
"subject",
|
110
|
+
"labels",
|
111
|
+
"from_name"]
|
112
|
+
)
|
113
|
+
end
|
99
114
|
|
100
115
|
puts "Local Templates"
|
101
116
|
puts "----------------------"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mandrill-template-manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sawanoboly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|