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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f266294f177aacc1b9526a166683283d174b3f41
4
- data.tar.gz: 2325b885208b5dd04fc6f8f1693baa119e8ebca5
3
+ metadata.gz: 0edd503383374d3c556c9b9d6dbc76f13358376e
4
+ data.tar.gz: 6448283aa325bf1b594ed1c0d6a7969ca163a6f0
5
5
  SHA512:
6
- metadata.gz: 7361dfc08ed25beab0f5512303752b1cf5a07b8f88d17c95bbfa4f6ad72fe7272be46b94accfa4d66b912f0a189f58f79059b7ffff5aaae23cb00f759498449a
7
- data.tar.gz: 097ad4edb603d6d857ea456286cfa4811435b112796dadd7fa06650ae507108ca9777bebc5f3fee3f65e3278a47f7b25673364bb1baffaf5a8b5c705b66091ff
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)
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "mandrill-template-manager"
7
- spec.version = "0.3.0"
7
+ spec.version = "0.3.1"
8
8
  spec.authors = ["sawanoboly"]
9
9
  spec.email = ["sawanoboriyu@higanworks.com"]
10
10
 
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.0
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-02-08 00:00:00.000000000 Z
11
+ date: 2016-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor