malvolio 0.1.0

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.
Files changed (43) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +7 -0
  5. data/Gemfile +6 -0
  6. data/Gemfile.lock +184 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +61 -0
  9. data/Rakefile +6 -0
  10. data/bin/console +14 -0
  11. data/bin/malvolio +6 -0
  12. data/bin/setup +8 -0
  13. data/lib/generators/malvolio/create_generator.rb +27 -0
  14. data/lib/generators/malvolio/create_with_inky_generator.rb +27 -0
  15. data/lib/generators/malvolio/templates/base/config.yaml +1 -0
  16. data/lib/generators/malvolio/templates/base/index.html +16 -0
  17. data/lib/generators/malvolio/templates/base/index.scss +0 -0
  18. data/lib/generators/malvolio/templates/base_with_inky/config.yaml +1 -0
  19. data/lib/generators/malvolio/templates/base_with_inky/index.html +22 -0
  20. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/_foundation_emails.scss +27 -0
  21. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/_global.scss +95 -0
  22. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_alignment.scss +88 -0
  23. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_button.scss +312 -0
  24. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_callout.scss +85 -0
  25. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_code.scss +0 -0
  26. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_media-query.scss +139 -0
  27. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_menu.scss +83 -0
  28. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_normalize.scss +86 -0
  29. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_outlook-first.scss +11 -0
  30. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_thumbnail.scss +49 -0
  31. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_typography.scss +404 -0
  32. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_visibility.scss +66 -0
  33. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/grid/_block-grid.scss +32 -0
  34. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/grid/_grid.scss +180 -0
  35. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/settings/_settings.scss +148 -0
  36. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/util/_util.scss +22 -0
  37. data/lib/generators/malvolio/templates/base_with_inky/scss/index.scss +1 -0
  38. data/lib/malvolio.rb +7 -0
  39. data/lib/malvolio/cli.rb +50 -0
  40. data/lib/malvolio/compiler.rb +85 -0
  41. data/lib/malvolio/version.rb +3 -0
  42. data/malvolio.gemspec +46 -0
  43. metadata +228 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 55726811584affa39e9f7deb07a63a141f624a53bce6b398cdb2545d23d50be4
4
+ data.tar.gz: 5a82a6203e013b3331ad4d84aa862c147994b817ed317a897777c15ff174201d
5
+ SHA512:
6
+ metadata.gz: 690329ae5c8fb4b4a1ea315683e6e14622dee384ced8d90f349f55e765e02bdf8d6c6ce2bfa40bb361c5df790810feba62a90c06f448aeb4791c6c5c4998a682
7
+ data.tar.gz: 78d1f42adf7d14b1084e7e78ae14b1b554b4d25e3cb9168b4a64642b9d2fe9df2e6c6df720b572bd068f7077d19780e648ab4545680b26e22d690a637ee81ded
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+
13
+ # ignore gem builds
14
+ /*.gem
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.5.3
7
+ before_install: gem install bundler -v 1.17.1
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in malvolio.gemspec
6
+ gemspec
@@ -0,0 +1,184 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ malvolio (0.1.0)
5
+ compass
6
+ filewatcher
7
+ inky-rb
8
+ premailer
9
+ sass
10
+ thor
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ actioncable (5.2.1)
16
+ actionpack (= 5.2.1)
17
+ nio4r (~> 2.0)
18
+ websocket-driver (>= 0.6.1)
19
+ actionmailer (5.2.1)
20
+ actionpack (= 5.2.1)
21
+ actionview (= 5.2.1)
22
+ activejob (= 5.2.1)
23
+ mail (~> 2.5, >= 2.5.4)
24
+ rails-dom-testing (~> 2.0)
25
+ actionpack (5.2.1)
26
+ actionview (= 5.2.1)
27
+ activesupport (= 5.2.1)
28
+ rack (~> 2.0)
29
+ rack-test (>= 0.6.3)
30
+ rails-dom-testing (~> 2.0)
31
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
32
+ actionview (5.2.1)
33
+ activesupport (= 5.2.1)
34
+ builder (~> 3.1)
35
+ erubi (~> 1.4)
36
+ rails-dom-testing (~> 2.0)
37
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
38
+ activejob (5.2.1)
39
+ activesupport (= 5.2.1)
40
+ globalid (>= 0.3.6)
41
+ activemodel (5.2.1)
42
+ activesupport (= 5.2.1)
43
+ activerecord (5.2.1)
44
+ activemodel (= 5.2.1)
45
+ activesupport (= 5.2.1)
46
+ arel (>= 9.0)
47
+ activestorage (5.2.1)
48
+ actionpack (= 5.2.1)
49
+ activerecord (= 5.2.1)
50
+ marcel (~> 0.3.1)
51
+ activesupport (5.2.1)
52
+ concurrent-ruby (~> 1.0, >= 1.0.2)
53
+ i18n (>= 0.7, < 2)
54
+ minitest (~> 5.1)
55
+ tzinfo (~> 1.1)
56
+ addressable (2.5.2)
57
+ public_suffix (>= 2.0.2, < 4.0)
58
+ arel (9.0.0)
59
+ builder (3.2.3)
60
+ chunky_png (1.3.10)
61
+ compass (1.0.3)
62
+ chunky_png (~> 1.2)
63
+ compass-core (~> 1.0.2)
64
+ compass-import-once (~> 1.0.5)
65
+ rb-fsevent (>= 0.9.3)
66
+ rb-inotify (>= 0.9)
67
+ sass (>= 3.3.13, < 3.5)
68
+ compass-core (1.0.3)
69
+ multi_json (~> 1.0)
70
+ sass (>= 3.3.0, < 3.5)
71
+ compass-import-once (1.0.5)
72
+ sass (>= 3.2, < 3.5)
73
+ concurrent-ruby (1.0.5)
74
+ crass (1.0.4)
75
+ css_parser (1.6.0)
76
+ addressable
77
+ diff-lcs (1.3)
78
+ erubi (1.7.1)
79
+ ffi (1.9.25)
80
+ filewatcher (1.1.1)
81
+ optimist (~> 3.0)
82
+ foundation_emails (2.2.1.0)
83
+ globalid (0.4.1)
84
+ activesupport (>= 4.2.0)
85
+ htmlentities (4.3.4)
86
+ i18n (1.1.1)
87
+ concurrent-ruby (~> 1.0)
88
+ inky-rb (1.3.7.3)
89
+ foundation_emails (~> 2)
90
+ nokogiri
91
+ loofah (2.2.3)
92
+ crass (~> 1.0.2)
93
+ nokogiri (>= 1.5.9)
94
+ mail (2.7.1)
95
+ mini_mime (>= 0.1.1)
96
+ marcel (0.3.3)
97
+ mimemagic (~> 0.3.2)
98
+ method_source (0.9.0)
99
+ mimemagic (0.3.2)
100
+ mini_mime (1.0.1)
101
+ mini_portile2 (2.3.0)
102
+ minitest (5.11.3)
103
+ multi_json (1.13.1)
104
+ nio4r (2.3.1)
105
+ nokogiri (1.8.5)
106
+ mini_portile2 (~> 2.3.0)
107
+ optimist (3.0.0)
108
+ premailer (1.11.1)
109
+ addressable
110
+ css_parser (>= 1.6.0)
111
+ htmlentities (>= 4.0.0)
112
+ public_suffix (3.0.3)
113
+ rack (2.0.5)
114
+ rack-test (1.1.0)
115
+ rack (>= 1.0, < 3)
116
+ rails (5.2.1)
117
+ actioncable (= 5.2.1)
118
+ actionmailer (= 5.2.1)
119
+ actionpack (= 5.2.1)
120
+ actionview (= 5.2.1)
121
+ activejob (= 5.2.1)
122
+ activemodel (= 5.2.1)
123
+ activerecord (= 5.2.1)
124
+ activestorage (= 5.2.1)
125
+ activesupport (= 5.2.1)
126
+ bundler (>= 1.3.0)
127
+ railties (= 5.2.1)
128
+ sprockets-rails (>= 2.0.0)
129
+ rails-dom-testing (2.0.3)
130
+ activesupport (>= 4.2.0)
131
+ nokogiri (>= 1.6)
132
+ rails-html-sanitizer (1.0.4)
133
+ loofah (~> 2.2, >= 2.2.2)
134
+ railties (5.2.1)
135
+ actionpack (= 5.2.1)
136
+ activesupport (= 5.2.1)
137
+ method_source
138
+ rake (>= 0.8.7)
139
+ thor (>= 0.19.0, < 2.0)
140
+ rake (10.5.0)
141
+ rb-fsevent (0.10.3)
142
+ rb-inotify (0.9.10)
143
+ ffi (>= 0.5.0, < 2)
144
+ rspec (3.8.0)
145
+ rspec-core (~> 3.8.0)
146
+ rspec-expectations (~> 3.8.0)
147
+ rspec-mocks (~> 3.8.0)
148
+ rspec-core (3.8.0)
149
+ rspec-support (~> 3.8.0)
150
+ rspec-expectations (3.8.2)
151
+ diff-lcs (>= 1.2.0, < 2.0)
152
+ rspec-support (~> 3.8.0)
153
+ rspec-mocks (3.8.0)
154
+ diff-lcs (>= 1.2.0, < 2.0)
155
+ rspec-support (~> 3.8.0)
156
+ rspec-support (3.8.0)
157
+ sass (3.4.25)
158
+ sprockets (3.7.2)
159
+ concurrent-ruby (~> 1.0)
160
+ rack (> 1, < 3)
161
+ sprockets-rails (3.2.1)
162
+ actionpack (>= 4.0)
163
+ activesupport (>= 4.0)
164
+ sprockets (>= 3.0.0)
165
+ thor (0.20.0)
166
+ thread_safe (0.3.6)
167
+ tzinfo (1.2.5)
168
+ thread_safe (~> 0.1)
169
+ websocket-driver (0.7.0)
170
+ websocket-extensions (>= 0.1.0)
171
+ websocket-extensions (0.1.3)
172
+
173
+ PLATFORMS
174
+ ruby
175
+
176
+ DEPENDENCIES
177
+ bundler (~> 1.17)
178
+ malvolio!
179
+ rails
180
+ rake (~> 10.0)
181
+ rspec (~> 3.0)
182
+
183
+ BUNDLED WITH
184
+ 1.17.1
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Josh Reinhardt
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,61 @@
1
+ # Malvolio
2
+
3
+ Malvolio is a CLI tool that creates an easy workflow when developing HTML emails.
4
+
5
+ ## Installation
6
+
7
+ In your terminal, install the gem from Rubygems.
8
+
9
+ ```
10
+ gem install malvolio
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ To create a new project, run the command
16
+
17
+ ```
18
+ malvolio new <project-name> [--inky]
19
+ ```
20
+
21
+ the `--inky` option will create a project that allows you to use The [Zurb Foundation's Inky Templating Language](https://foundation.zurb.com/emails/docs/inky.html) and comes bundled with their (Foundation Email CSS Framework)[https://foundation.zurb.com/emails.html].
22
+
23
+ The `new` command will generate a new project with the following structure:
24
+
25
+ ```
26
+ /project-name
27
+ ├──tmp/
28
+ ├──dist/
29
+ └──src/
30
+ ├──index.html
31
+ └──scss/
32
+ └──index.scss
33
+ ```
34
+
35
+ Once you've done some work in the `src/` directory and are ready to build, you can run
36
+
37
+ ```
38
+ malvolio build [PROJECT PATH] [--no-warnings]
39
+ ```
40
+
41
+ Or, if you would like for your project to build automatically as you go, you can run
42
+
43
+ ```
44
+ malvolio watch [PROJECT PATH] [--no-warnings]
45
+ ```
46
+
47
+ Running either of these commands will output your final HTML email file to `dist/index.html`.
48
+
49
+ ## Development
50
+
51
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
52
+
53
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
54
+
55
+ ## Contributing
56
+
57
+ Bug reports and pull requests are welcome on GitHub at https://github.com/jereinhardt/malvolio.
58
+
59
+ ## License
60
+
61
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "malvolio"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "malvolio"
5
+
6
+ Malvolio::CLI.start(ARGV)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,27 @@
1
+ require "rails/generators"
2
+
3
+ module Malvolio
4
+ module Generators
5
+ class CreateGenerator < Rails::Generators::Base
6
+ source_root File.join(File.dirname(__FILE__), "templates", "base")
7
+ argument :project_name, type: :string
8
+
9
+ def create_html_file
10
+ template "index.html", File.join(project_name, "src", "index.html")
11
+ end
12
+
13
+ def create_css_file
14
+ template "index.scss", File.join(project_name, "src", "scss", "index.scss")
15
+ end
16
+
17
+ def create_config_file
18
+ template "config.yaml", File.join(project_name, "config.yaml")
19
+ end
20
+
21
+ def create_dist_and_tmp_dirs
22
+ Dir.mkdir File.join(project_name, "dist")
23
+ Dir.mkdir File.join(project_name, "tmp")
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,27 @@
1
+ require "rails/generators"
2
+
3
+ module Malvolio
4
+ module Generators
5
+ class CreateWithInkyGenerator < ::Rails::Generators::Base
6
+ source_root File.join(File.dirname(__FILE__), "templates", "base_with_inky")
7
+ argument :project_name, type: :string
8
+
9
+ def create_html_file
10
+ template "index.html", File.join(project_name, "src", "index.html")
11
+ end
12
+
13
+ def create_css_file
14
+ directory "scss", File.join(project_name, "src", "scss")
15
+ end
16
+
17
+ def create_config_file
18
+ template "config.yaml", File.join(project_name, "config.yaml")
19
+ end
20
+
21
+ def create_dist_and_tmp_dirs
22
+ Dir.mkdir File.join(project_name, "dist")
23
+ Dir.mkdir File.join(project_name, "tmp")
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,16 @@
1
+ <!DOCTYPE html>
2
+ <html xmlsn="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <meta name="viewport" content="width=device-width">
6
+ <link rel="stylesheet" type="text/css" href="index.css">
7
+ <!--[if mso]>
8
+ <style type="text/css">
9
+ body, table, td { font-family: Tahoma, "Helvetica", sans-serif; }
10
+ </style>
11
+ <![endif]-->
12
+ </head>
13
+ <body>
14
+
15
+ </body>
16
+ </html>
@@ -0,0 +1,22 @@
1
+ <!DOCTYPE html>
2
+ <html xmlsn="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <meta name="viewport" content="width=device-width">
6
+ <link rel="stylesheet" type="text/css" href="index.css">
7
+ <!--[if mso]>
8
+ <style type="text/css">
9
+ body, table, td { font-family: Tahoma, "Helvetica", sans-serif; }
10
+ </style>
11
+ <![endif]-->
12
+ </head>
13
+ <body>
14
+ <table class="body">
15
+ <tr>
16
+ <td>
17
+ <!-- Your awesome email content here -->
18
+ </td>
19
+ </tr>
20
+ </table>
21
+ </body>
22
+ </html>