multi_render 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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 848e5c5575c1b5bdfa4ebca5cd8fab80369b0d800dfc035f11f148f8d3f6d8e4
4
+ data.tar.gz: 648b2a9e2122185357f1627e06ecd7133721f2b54010b3c86eaaabc1961c8815
5
+ SHA512:
6
+ metadata.gz: 76449a92916c95b1edd74970f6891463bac85d035c6e265f20cb4bc16fdfe701de6b331513752f6415a3e4752c54fdb29219e303ba3f53118659cb9b86f225bf
7
+ data.tar.gz: 57b8e1aa4294a432505ed31fc2f4ab9469f5e34e2f7aa38ce181f668c977252835754b865d39108baff30781fbab89acbacc45de57875d709650f6b436011742
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2021 Karl Heitmann
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # MultiRender
2
+ Short description and motivation.
3
+
4
+ ## Usage
5
+ How to use my plugin.
6
+
7
+ ## Installation
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'multi_render'
12
+ ```
13
+
14
+ And then execute:
15
+ ```bash
16
+ $ bundle
17
+ ```
18
+
19
+ Or install it yourself as:
20
+ ```bash
21
+ $ gem install multi_render
22
+ ```
23
+
24
+ ## Contributing
25
+ Contribution directions go here.
26
+
27
+ ## License
28
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,13 @@
1
+ require "bundler/setup"
2
+
3
+ require "bundler/gem_tasks"
4
+
5
+ require "rake/testtask"
6
+
7
+ Rake::TestTask.new(:test) do |t|
8
+ t.libs << 'test'
9
+ t.pattern = 'test/**/*_test.rb'
10
+ t.verbose = false
11
+ end
12
+
13
+ task default: :test
@@ -0,0 +1,20 @@
1
+ class MR
2
+ def initialize
3
+ @data = {}
4
+ end
5
+
6
+ def add(name, route, data)
7
+ @data[name.to_s] = {
8
+ data_array: data,
9
+ render_partial: ->(x) {x.call({partial: route, locals: @data[name.to_s][:data_array]})}
10
+ }
11
+ end
12
+
13
+ def render_partial(name, _render)
14
+ @data[name.to_s][:render_partial].call(_render)
15
+ end
16
+
17
+ def get_data
18
+ @data
19
+ end
20
+ end
@@ -0,0 +1,4 @@
1
+ module MultiRender
2
+ class Railtie < ::Rails::Railtie
3
+ end
4
+ end
@@ -0,0 +1,3 @@
1
+ module MultiRender
2
+ VERSION = '0.1.0'
3
+ end
@@ -0,0 +1,7 @@
1
+ require "multi_render/version"
2
+ require "multi_render/railtie"
3
+ require "multi_render/mr"
4
+
5
+ module MultiRender
6
+ # Your code goes here...
7
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :multi_render do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: multi_render
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Karl Heitmann
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-10-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 6.1.4
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 6.1.4.1
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: 6.1.4
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 6.1.4.1
33
+ description: Once you provide to a MultiRenderer instance the data it needs in each
34
+ partial you are rendering in your view, the instance will render the given partial
35
+ with it's local variables. This is usefull if you have a big view on your project,
36
+ and you are rendering multiple arrays. Having all your iterations running on your
37
+ controller can help you to detect a bottle neck that is causing your web page to
38
+ run slow.
39
+ email:
40
+ - khf1988@gmail.com
41
+ executables: []
42
+ extensions: []
43
+ extra_rdoc_files: []
44
+ files:
45
+ - MIT-LICENSE
46
+ - README.md
47
+ - Rakefile
48
+ - lib/multi_render.rb
49
+ - lib/multi_render/mr.rb
50
+ - lib/multi_render/railtie.rb
51
+ - lib/multi_render/version.rb
52
+ - lib/tasks/multi_render_tasks.rake
53
+ homepage: https://github.com/KarlHeitmann/multi_renderer
54
+ licenses:
55
+ - MIT
56
+ metadata:
57
+ homepage_uri: https://github.com/KarlHeitmann/multi_renderer
58
+ source_code_uri: https://github.com/KarlHeitmann/multi_renderer
59
+ changelog_uri: https://github.com/KarlHeitmann/multi_renderer/blob/master/CHANGELOG.md
60
+ post_install_message:
61
+ rdoc_options: []
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ requirements: []
75
+ rubygems_version: 3.2.22
76
+ signing_key:
77
+ specification_version: 4
78
+ summary: MultiRenderer is a class that renders multiple partials on your view.
79
+ test_files: []