mandrill-template-manager 0.3.0 → 0.3.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 +1 -0
- 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: 0edd503383374d3c556c9b9d6dbc76f13358376e
|
4
|
+
data.tar.gz: 6448283aa325bf1b594ed1c0d6a7969ca163a6f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d438a36f7df0d36b2b9fb7880e2ce6b980df22845a5201315ba094291ce9b72ec8a4f6ed50424c66a1dedb7930ed0f8e72482d2c826047714dd623a2e581c48
|
7
|
+
data.tar.gz: b14581c000b0f17c880c3230d546559afe974555b5f2d387737654d4ea0e76421c5e226d19d97efae4c1e84750d82e620ff8eed7d872c275eaba12a03ffd10b3
|
data/README.md
CHANGED
@@ -29,6 +29,7 @@ Commands:
|
|
29
29
|
mandrilltemplate list # show template list both of remote and local.
|
30
30
|
mandrilltemplate publish SLUG # publish template from draft.
|
31
31
|
mandrilltemplate render SLUG [PARAMS_FILE] # render mailbody from local template data. File should be Array. see https://mandrillapp.com/api/docs/templates.JSON.html#method=render.
|
32
|
+
mandrilltemplate upload ALL # upload all template to remote as draft.
|
32
33
|
mandrilltemplate upload SLUG # upload template to remote as draft.
|
33
34
|
|
34
35
|
```
|
@@ -37,7 +37,22 @@ class MandrillTemplateManager < Thor
|
|
37
37
|
puts "Template data not found #{slug}. Please generate first."
|
38
38
|
end
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
|
+
desc "upload ALL", "upload all template to remote as draft."
|
42
|
+
option :publish, type: :boolean, default: false, aliases: :p
|
43
|
+
def upload_all()
|
44
|
+
labels = Dir.glob("#{ templates_directory }/*").map {|path| path.split(File::SEPARATOR).last}
|
45
|
+
labels.each do |label|
|
46
|
+
template = MandrillTemplate::Local.new(label)
|
47
|
+
if template.avail
|
48
|
+
upload_template(template)
|
49
|
+
publish(slug) if options[:publish]
|
50
|
+
puts "Template published #{label}. feeling good."
|
51
|
+
else
|
52
|
+
puts "Template data not found #{label}. Please generate first."
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
41
56
|
desc "delete SLUG", "delete template from remote."
|
42
57
|
option :delete_local, type: :boolean, default: false
|
43
58
|
def delete(slug)
|
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.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sawanoboly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|