magicka 0.5.5 → 0.5.6

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: c5648c42b3fd9a9cbfdf7b9e72df4a88374d0fb2164aaa5c96cee42c21cf97ef
4
- data.tar.gz: 984fccb391fd20285a9ecbe498289ad789da1ea9a62eeb71b5b1b1b60c1ff384
3
+ metadata.gz: 2b014302f0498ecea2e69670c168bdf2ee5eaaa8162b210faf007351d4417976
4
+ data.tar.gz: 1ee57425d99ce223334f9567156ff1ab791f78e6f043c9ae5adca87291e28f1b
5
5
  SHA512:
6
- metadata.gz: 33f95d6caa25e20d6af95b2e47411840be056512de6533c322808d719105030ca3464edbe8786b7982527ef904b9131b53c6197f00d5729038fc12fd55ef6747
7
- data.tar.gz: 51ee56a29de58f704bcd3b2babb0b2181f3c0eab207c37acfdb08cd00125e82c73154376b2579909dff1c2dcb7b42b95211249ccd75c09b3e974cc637121b6c8
6
+ metadata.gz: 37e81304adc719f63fd65d3a643d2392cca27fdce94489072f675571b440815f074e9bf5613bf365dae1b8f26edc24cdf4a564d8821e69a49d4419488bf7cd0c
7
+ data.tar.gz: 20b572511516fd8af749499059b2d14d01bf0047fbe3b509304b4c117032b617427aa84d7389ed400aa5b9acfb0d6c6dff539cd67e448b55e0c25dd5582f17ab
data/.circleci/config.yml CHANGED
@@ -22,7 +22,7 @@ workflows:
22
22
  jobs:
23
23
  test:
24
24
  docker:
25
- - image: darthjee/circleci_rails_gems:0.6.3
25
+ - image: darthjee/circleci_rails_gems:0.7.0
26
26
  environment:
27
27
  PROJECT: magicka
28
28
  steps:
@@ -41,7 +41,7 @@ jobs:
41
41
  command: cc-test-reporter after-build --exit-code $?
42
42
  checks:
43
43
  docker:
44
- - image: darthjee/circleci_rails_gems:0.6.3
44
+ - image: darthjee/circleci_rails_gems:0.7.0
45
45
  environment:
46
46
  PROJECT: magicka
47
47
  steps:
@@ -66,7 +66,7 @@ jobs:
66
66
  command: check_specs
67
67
  build-and-release:
68
68
  docker:
69
- - image: darthjee/circleci_rails_gems:0.6.3
69
+ - image: darthjee/circleci_rails_gems:0.7.0
70
70
  environment:
71
71
  PROJECT: magicka
72
72
  steps:
data/Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
1
  FROM darthjee/scripts:0.1.8 as scripts
2
2
 
3
- FROM darthjee/rails_gems:0.6.3 as base
3
+ FROM darthjee/rails_gems:0.7.0 as base
4
4
 
5
5
  COPY --chown=app:app ./ /home/app/app/
6
6
 
data/README.md CHANGED
@@ -9,20 +9,23 @@ Magicka
9
9
 
10
10
  ![magicka](https://raw.githubusercontent.com/darthjee/magicka/master/magicka.jpg)
11
11
 
12
+ Magica helps creating html templates for forms and display data using js applications
13
+ such as AngulaJS
14
+
12
15
  Yard Documentation
13
16
  -------------------
14
- [https://www.rubydoc.info/gems/magicka/0.5.5](https://www.rubydoc.info/gems/magicka/0.5.5)
17
+ [https://www.rubydoc.info/gems/magicka/0.5.6](https://www.rubydoc.info/gems/magicka/0.5.6)
15
18
 
16
19
  Installation
17
20
  ---------------
18
21
 
19
- - Install it
22
+ - Install it
20
23
 
21
24
  ```ruby
22
25
  gem install magicka
23
26
  ```
24
27
 
25
- - Or add Magicka to your `Gemfile` and `bundle install`:
28
+ - Or add Magicka to your `Gemfile` and `bundle install`:
26
29
 
27
30
  ```ruby
28
31
  gem 'magicka'
@@ -31,3 +34,72 @@ Installation
31
34
  ```bash
32
35
  bundle install magicka
33
36
  ```
37
+
38
+ ## Usage
39
+ Magicka is used as a helper for erb coding so that each element is paired with an
40
+ element class, a template and a method in an aggregator.
41
+
42
+ Different aggregators have the same method so that they render the same `element` in
43
+ different ways
44
+
45
+ ### example
46
+ ```html.erb
47
+ <!-- new.html.erb -->
48
+
49
+ <% magicka_form('controller.person') do |form| %>
50
+ <%= render partial: 'person_form', locals: { form: form } %>
51
+ <% end %>
52
+ ```
53
+
54
+ ```html.erb
55
+ <!-- show.html.erb -->
56
+
57
+ <% magicka_display('controller.person') do |form| %>
58
+ <%= render partial: 'person_form', locals: { form: form } %>
59
+ <% end %>
60
+ ```
61
+
62
+ ```html.erb
63
+ <!-- _person_form.html.erb -->
64
+
65
+ <%= form.input(:first_name) %>
66
+ <%= form.input(:last_name) %>
67
+ <%= form.input(:age) %>
68
+ <%= form.select(:gender, options: %w[MALE FEMALE] %>
69
+ <%= form.button(ng_click: 'controller.save', text: 'Save') %>
70
+ ```
71
+
72
+ ## Configuring
73
+ In order to use magicka, the helper has to added to the controllers and any custom
74
+ element needs to added
75
+
76
+ `app/controllers/application_controller.rb`
77
+ ```ruby
78
+ class ApplicationController < ActionController::Base
79
+ helper Magicka::Helper
80
+ end
81
+ ```
82
+
83
+ ### Including custom elements
84
+
85
+ Elements can be included by defining attributes that they can be initialized with
86
+ and that can be passed to the template
87
+
88
+ `config/initializers/magicka.rb`
89
+ ```ruby
90
+ module Magicka
91
+ class MyTextInput < Magicka::Element
92
+ with_attribute_locals :label, :field, :id
93
+ end
94
+ end
95
+
96
+ Magicka::Form.with_element(Magicka::MyTextInput)
97
+ ```
98
+
99
+ `templates/form/_my_text_input.html.erb`
100
+ ```html.erb
101
+ <div>
102
+ <label for="<%= field %>"><%= label %></label>
103
+ <input type="text" id="<%= id %>" name="field" />
104
+ </div>
105
+ ```
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Magicka
4
- VERSION = '0.5.5'
4
+ VERSION = '0.5.6'
5
5
  end
data/magicka.gemspec CHANGED
@@ -26,24 +26,24 @@ Gem::Specification.new do |gem|
26
26
  gem.add_development_dependency 'activerecord', '~> 5.2.x'
27
27
  gem.add_development_dependency 'bundler', '1.16.1'
28
28
  gem.add_development_dependency 'factory_bot', '5.2.0'
29
- gem.add_development_dependency 'nokogiri', '1.11.3'
29
+ gem.add_development_dependency 'nokogiri', '1.11.4'
30
30
  gem.add_development_dependency 'pry', '0.12.2'
31
31
  gem.add_development_dependency 'pry-nav', '0.3.0'
32
32
  gem.add_development_dependency 'rails', '~> 5.2.x'
33
33
  gem.add_development_dependency 'rails-controller-testing', '1.0.4'
34
34
  gem.add_development_dependency 'rake', '13.0.1'
35
- gem.add_development_dependency 'reek', '5.6.0'
35
+ gem.add_development_dependency 'reek', '6.0.3'
36
36
  gem.add_development_dependency 'rspec', '3.9.0'
37
- gem.add_development_dependency 'rspec-core', '3.9.1'
38
- gem.add_development_dependency 'rspec-expectations', '3.9.1'
37
+ gem.add_development_dependency 'rspec-core', '3.9.3'
38
+ gem.add_development_dependency 'rspec-expectations', '3.9.4'
39
39
  gem.add_development_dependency 'rspec-mocks', '3.9.1'
40
- gem.add_development_dependency 'rspec-rails', '3.9.0'
41
- gem.add_development_dependency 'rspec-support', '3.9.2'
40
+ gem.add_development_dependency 'rspec-rails', '3.9.1'
41
+ gem.add_development_dependency 'rspec-support', '3.9.4'
42
42
  gem.add_development_dependency 'rubocop', '0.80.1'
43
43
  gem.add_development_dependency 'rubocop-rspec', '1.38.1'
44
- gem.add_development_dependency 'rubycritic', '4.4.1'
44
+ gem.add_development_dependency 'rubycritic', '4.6.1'
45
45
  gem.add_development_dependency 'simplecov', '0.17.1'
46
46
  gem.add_development_dependency 'sqlite3', '1.4.2'
47
- gem.add_development_dependency 'yard', '0.9.24'
47
+ gem.add_development_dependency 'yard', '0.9.26'
48
48
  gem.add_development_dependency 'yardstick', '0.9.9'
49
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magicka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - DarthJee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-19 00:00:00.000000000 Z
11
+ date: 2021-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 1.11.3
103
+ version: 1.11.4
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 1.11.3
110
+ version: 1.11.4
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: pry
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -184,14 +184,14 @@ dependencies:
184
184
  requirements:
185
185
  - - '='
186
186
  - !ruby/object:Gem::Version
187
- version: 5.6.0
187
+ version: 6.0.3
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - '='
193
193
  - !ruby/object:Gem::Version
194
- version: 5.6.0
194
+ version: 6.0.3
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: rspec
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -212,28 +212,28 @@ dependencies:
212
212
  requirements:
213
213
  - - '='
214
214
  - !ruby/object:Gem::Version
215
- version: 3.9.1
215
+ version: 3.9.3
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - '='
221
221
  - !ruby/object:Gem::Version
222
- version: 3.9.1
222
+ version: 3.9.3
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: rspec-expectations
225
225
  requirement: !ruby/object:Gem::Requirement
226
226
  requirements:
227
227
  - - '='
228
228
  - !ruby/object:Gem::Version
229
- version: 3.9.1
229
+ version: 3.9.4
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - '='
235
235
  - !ruby/object:Gem::Version
236
- version: 3.9.1
236
+ version: 3.9.4
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: rspec-mocks
239
239
  requirement: !ruby/object:Gem::Requirement
@@ -254,28 +254,28 @@ dependencies:
254
254
  requirements:
255
255
  - - '='
256
256
  - !ruby/object:Gem::Version
257
- version: 3.9.0
257
+ version: 3.9.1
258
258
  type: :development
259
259
  prerelease: false
260
260
  version_requirements: !ruby/object:Gem::Requirement
261
261
  requirements:
262
262
  - - '='
263
263
  - !ruby/object:Gem::Version
264
- version: 3.9.0
264
+ version: 3.9.1
265
265
  - !ruby/object:Gem::Dependency
266
266
  name: rspec-support
267
267
  requirement: !ruby/object:Gem::Requirement
268
268
  requirements:
269
269
  - - '='
270
270
  - !ruby/object:Gem::Version
271
- version: 3.9.2
271
+ version: 3.9.4
272
272
  type: :development
273
273
  prerelease: false
274
274
  version_requirements: !ruby/object:Gem::Requirement
275
275
  requirements:
276
276
  - - '='
277
277
  - !ruby/object:Gem::Version
278
- version: 3.9.2
278
+ version: 3.9.4
279
279
  - !ruby/object:Gem::Dependency
280
280
  name: rubocop
281
281
  requirement: !ruby/object:Gem::Requirement
@@ -310,14 +310,14 @@ dependencies:
310
310
  requirements:
311
311
  - - '='
312
312
  - !ruby/object:Gem::Version
313
- version: 4.4.1
313
+ version: 4.6.1
314
314
  type: :development
315
315
  prerelease: false
316
316
  version_requirements: !ruby/object:Gem::Requirement
317
317
  requirements:
318
318
  - - '='
319
319
  - !ruby/object:Gem::Version
320
- version: 4.4.1
320
+ version: 4.6.1
321
321
  - !ruby/object:Gem::Dependency
322
322
  name: simplecov
323
323
  requirement: !ruby/object:Gem::Requirement
@@ -352,14 +352,14 @@ dependencies:
352
352
  requirements:
353
353
  - - '='
354
354
  - !ruby/object:Gem::Version
355
- version: 0.9.24
355
+ version: 0.9.26
356
356
  type: :development
357
357
  prerelease: false
358
358
  version_requirements: !ruby/object:Gem::Requirement
359
359
  requirements:
360
360
  - - '='
361
361
  - !ruby/object:Gem::Version
362
- version: 0.9.24
362
+ version: 0.9.26
363
363
  - !ruby/object:Gem::Dependency
364
364
  name: yardstick
365
365
  requirement: !ruby/object:Gem::Requirement