rails_app_generator 0.1.25 → 0.1.26

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
  SHA256:
3
- metadata.gz: 8402636b2b1998543616a2cd272805b60b2f2376ccf9d0820d2763b92f204b8d
4
- data.tar.gz: 3708271f45646622588ab76a546f685e0227c6eaa0c8bf4e8f7f17d98ee2e844
3
+ metadata.gz: a5ea77384e055a075b31754caf54c6b789f30916bc54f5c0e60404c946acce4b
4
+ data.tar.gz: a92a88e1257e65b9b01cde3133728deb9ac5a8b006d9664ebbe2930f3fe3101f
5
5
  SHA512:
6
- metadata.gz: 225821de9ffbc1335ebbac6b5dd916257b3e4f5b26da84d67b79d331df4bf93d9f2b6f6524c81c55c9f8dda9bd57e96db29bb6d220eac0aacdd3574a9070fe38
7
- data.tar.gz: 8e60366f1eacf5aabf9f34a44cac3d078818e314c9dda1576325942468ec922322f072a4ade15ec569b1a09868ffdec57d4c365b653528b4469c84c4236b807f
6
+ metadata.gz: a5e1d349250ecec2990a02f2630eaad82f78ef849f528f85fd5dcd97f3d05ab7662912729b7e53093db01b876b1260b43e9ea38ed63e23daabb48acd8ee894f7
7
+ data.tar.gz: b4053c0e0ade318de4a5f5d87fcb09e950565ee377d76859db23f4efe2112b1588968e975f1c220aefab6f2f10e76f64fbe8859db6420d4580e031af3958bf29
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [0.1.25](https://github.com/klueless-io/rails_app_generator/compare/v0.1.24...v0.1.25) (2022-08-06)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * addon mini_magick ([7897e60](https://github.com/klueless-io/rails_app_generator/commit/7897e60e6aaa63813135251f7337b0dab23525a5))
7
+
1
8
  ## [0.1.24](https://github.com/klueless-io/rails_app_generator/compare/v0.1.23...v0.1.24) (2022-08-06)
2
9
 
3
10
 
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ # require 'pry'
4
+
5
+ # Manipulate images with minimal use of memory via ImageMagick / GraphicsMagick
6
+ #
7
+ # exe/rag addons/mini_magick
8
+
9
+ self.local_template_path = File.dirname(__FILE__)
10
+
11
+ gac 'base rails 7 image created'
12
+
13
+ add_controller('home', 'index')
14
+ route("root 'home#index'")
15
+
16
+ force_copy
17
+
18
+ copy_file 'app/controllers/home_controller.rb' , 'app/controllers/home_controller.rb'
19
+ copy_file 'app/views/home/index.html.erb' , 'app/views/home/index.html.erb'
20
+
21
+ copy_file 'app/views/layouts/_alerts.html.erb' , 'app/views/layouts/_alerts.html.erb'
22
+ copy_file 'app/views/layouts/_navbar.html.erb' , 'app/views/layouts/_navbar.html.erb'
23
+ copy_file 'app/views/layouts/_footer.html.erb' , 'app/views/layouts/_footer.html.erb'
24
+ template 'app/views/layouts/application.html.erb' , 'app/views/layouts/application.html.erb'
25
+
26
+ copy_file 'app/assets/images/cat1.jpg' , 'app/assets/images/cat1.jpg'
27
+ copy_file 'app/assets/images/cat2.jpg' , 'app/assets/images/cat2.jpg'
28
+ copy_file 'app/assets/images/cat3.jpg' , 'app/assets/images/cat3.jpg'
@@ -0,0 +1,43 @@
1
+ class HomeController < ApplicationController
2
+ def index
3
+ @img = get_image
4
+
5
+ @img_rotate = get_image do |options|
6
+ options.resize("300x300")
7
+ options.rotate "-45"
8
+ end
9
+
10
+ @img_negate = get_image do |options|
11
+ options.resize("300x300")
12
+ options.negate
13
+ end
14
+
15
+ @img_distort = get_image do |options|
16
+ options.resize("300x300")
17
+ options.distort("Perspective", "0,0,0,0 0,45,0,45 69,0,60,10 69,45,60,35")
18
+ end
19
+ end
20
+
21
+ private
22
+
23
+ def image_name
24
+ @variable ||= begin
25
+ image_names = [
26
+ 'cat1.jpg',
27
+ 'cat2.jpg',
28
+ 'cat3.jpg'
29
+ ]
30
+
31
+ "app/assets/images/#{image_names.sample}"
32
+ end
33
+ end
34
+
35
+ def get_image(&block)
36
+ puts image_name
37
+ image = MiniMagick::Image.open(image_name)
38
+ image.combine_options(&block)
39
+
40
+ Base64.encode64(image.to_blob)
41
+ end
42
+ end
43
+
@@ -0,0 +1,25 @@
1
+ <h1>Mini magick</h1>
2
+
3
+ <h2>Manipulate images with minimal use of memory via ImageMagick / GraphicsMagick</h2>
4
+
5
+ <table>
6
+ <tr>
7
+ <td>
8
+ <h3>Plain</h3>
9
+ <%= image_tag "data://image/png;base64,#{@img}" %>
10
+ </td>
11
+ <td>
12
+ <h3>Rotate</h3>
13
+ <%= image_tag "data://image/png;base64,#{@img_rotate}" %>
14
+ </td>
15
+ <td>
16
+ <h3>Negate</h3>
17
+ <%= image_tag "data://image/png;base64,#{@img_negate}" %>
18
+ </td>
19
+ <td>
20
+ <h3>Distort</h3>
21
+ <%= image_tag "data://image/png;base64,#{@img_distort}" %>
22
+ </td>
23
+ </tr>
24
+ </table>
25
+
@@ -0,0 +1,2 @@
1
+ <% flash.each do |type, msg| %><div class="<%= type %>"><%= msg %></div><% end %>
2
+ <% if flash.any? %><hr /><% end %>
@@ -0,0 +1,3 @@
1
+ <footer>
2
+ <hr />
3
+ </footer>
@@ -0,0 +1,28 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= camelized %></title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <%%= csrf_meta_tags %>
7
+ <%%= csp_meta_tag %>
8
+
9
+ <%- if options[:skip_hotwire] || options[:skip_javascript] -%>
10
+ <%%= stylesheet_link_tag "application" %>
11
+ <%- else -%>
12
+ <%%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
13
+ <%- end -%>
14
+ <style>
15
+ .alert { color: red; }
16
+ .notice { color: green; }
17
+ </style>
18
+ </head>
19
+
20
+ <body>
21
+ <%%= render 'layouts/navbar' %>
22
+ <main>
23
+ <%%= render 'layouts/alerts' %>
24
+ <%%= yield %>
25
+ </main>
26
+ <%%= render 'layouts/footer' %>
27
+ </body>
28
+ </html>
@@ -7,24 +7,7 @@ module RailsAppGenerator
7
7
  class MiniMagick < AddOn
8
8
  required_gem gem.version('mini_magick', '4.11.0', 'Manipulate images with minimal use of memory via ImageMagick / GraphicsMagick')
9
9
 
10
- def apply
11
- say 'Setting up MiniMagick'
12
- # template('mini_magick_template.rb', 'target/mini_magick.rb', force: true)
13
- # template('app/javascript/stylesheets/components.scss')
14
- # create_file('target/mini_magick.rb', 'put your content here')
15
- # directory 'app/template', 'app/target', force: true
16
- # empty_directory 'app/target'
17
- # inject_into_file('app/application.js', "some content")
18
- # rails_command('tailwindcss:install')
19
- end
20
-
21
- def before_bundle
22
- say 'Setting up MiniMagick - before bundle install'
23
- end
24
-
25
- def after_bundle
26
- say 'Setting up MiniMagick - after bundle install'
27
- end
10
+ def apply; end
28
11
  end
29
12
  end
30
13
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsAppGenerator
4
- VERSION = '0.1.25'
4
+ VERSION = '0.1.26'
5
5
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "rails_app_generator",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "rails_app_generator",
9
- "version": "0.1.25",
9
+ "version": "0.1.26",
10
10
  "dependencies": {
11
11
  "daisyui": "^2.20.0"
12
12
  },
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rails_app_generator",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "description": "Create new Rails Application with custom opinions",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
@@ -0,0 +1,12 @@
1
+ {
2
+ "args": {
3
+ "app_path": "mini_magick",
4
+ "destination_root": "/Users/davidcruwys/dev/kgems/rails_app_generator/a/addons"
5
+ },
6
+ "opts": {
7
+ "skip_git": true,
8
+ "skip_test": true,
9
+ "template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/addons/mini_magick/_.rb",
10
+ "add_mini_magick": true
11
+ }
12
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_app_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.25
4
+ version: 0.1.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys
@@ -218,6 +218,16 @@ files:
218
218
  - after_templates/addons/httparty/app/views/layouts/_footer.html.erb
219
219
  - after_templates/addons/httparty/app/views/layouts/_navbar.html.erb
220
220
  - after_templates/addons/httparty/app/views/layouts/application.html.erb
221
+ - after_templates/addons/mini_magick/_.rb
222
+ - after_templates/addons/mini_magick/app/assets/images/cat1.jpg
223
+ - after_templates/addons/mini_magick/app/assets/images/cat2.jpg
224
+ - after_templates/addons/mini_magick/app/assets/images/cat3.jpg
225
+ - after_templates/addons/mini_magick/app/controllers/home_controller.rb
226
+ - after_templates/addons/mini_magick/app/views/home/index.html.erb
227
+ - after_templates/addons/mini_magick/app/views/layouts/_alerts.html.erb
228
+ - after_templates/addons/mini_magick/app/views/layouts/_footer.html.erb
229
+ - after_templates/addons/mini_magick/app/views/layouts/_navbar.html.erb
230
+ - after_templates/addons/mini_magick/app/views/layouts/application.html.erb
221
231
  - after_templates/addons/rails_html_sanitizer/_.rb
222
232
  - after_templates/addons/rails_html_sanitizer/home/index.html.erb
223
233
  - after_templates/addons/twilio_ruby/_.rb
@@ -431,6 +441,7 @@ files:
431
441
  - profiles/addons/hexapdf.json
432
442
  - profiles/addons/honeybadger.json
433
443
  - profiles/addons/httparty.json
444
+ - profiles/addons/mini_magick.json
434
445
  - profiles/addons/rails-html-sanitizer.json
435
446
  - profiles/addons/twilio_ruby.json
436
447
  - profiles/rag-add-some-pages.json