mandrill-template-manager 0.2.0 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 497f8837541cb94617a859849e922a4453e44eff
4
- data.tar.gz: 3bce101be2c0cec531c19f9578767f4dc98d1c88
3
+ metadata.gz: d301d5990ddcab5f7dfc095785c7de426e6d65fe
4
+ data.tar.gz: 6dd9e324a600280687fbfa92242bcc97d0b8d6c5
5
5
  SHA512:
6
- metadata.gz: 9950d411e0efa386ec90ede940715c6e01ab5761f368bc14e76e75966c6b132872efa3832c6015832e2c82cd05c75c831259840d80e059acb7059006492c7e18
7
- data.tar.gz: ff2cfc9dce47f6716153e2d71d7c2ff157174fcea1fa5cddb2574373377054b657b6314f650f631834bf836a9906f546e91b1a165c492f83ab2eb2b4c463058e
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 # 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 upload NAME # upload template to remote as draft.
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.0"
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 "----------------------"
@@ -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.2.0"
7
+ spec.version = "0.2.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.2.0
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-09 00:00:00.000000000 Z
11
+ date: 2015-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor