magicka 0.3.0 → 0.3.1

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: 36b0fd245209516aea68b26b93305a7bb3bd2c25a37bab33a1642f61c3ddaf8a
4
- data.tar.gz: 69c0fb47a36f70010329381bdded763d45269a0b51b9984d83af78d34b56dcf7
3
+ metadata.gz: 7939778de2faac419e42a17986de873d7cbefa0b65531dcc968f697411e0ee7a
4
+ data.tar.gz: 831909938f84d296ba8706893b13c5ef7bf9f5b16e2d57cb10986e83151a2ed3
5
5
  SHA512:
6
- metadata.gz: e59e3a6feef27c1d2dca549497db8704a15ef8f3fe103ae4ebaa8a7c6b04ac7dfd918c5a097c0395043b00981368e2bd7614e94eacc6d47b69ddb6f6892a6a3d
7
- data.tar.gz: dfa188ef2f10ffbff7e3e2f8fa43495e28bfffd6d84f573ba695bc9d4c2e25a6b454a5f39bfa1e195c74636e33378d194bc43d32594a021c78f0443996afe412
6
+ metadata.gz: 74b61fb09691f38d280b08adde917d838866b918f23d4b9a530bf0f43cd22d8c963980bd5e02de23b89e601bbb708fd374da6e5285e7507d33e1b319fe9937a7
7
+ data.tar.gz: 8a263ca1eb2a0fc180e4fdc9eff054aede6452e19819d788b1e6c3f203875104ea177c1f2b8d38b14d5909d506528fb2a621fcdb4aafe9ab7ff49513bac3509e
data/README.md CHANGED
@@ -11,7 +11,7 @@ Magicka
11
11
 
12
12
  Yard Documentation
13
13
  -------------------
14
- [https://www.rubydoc.info/gems/magicka/0.3.0](https://www.rubydoc.info/gems/magicka/0.3.0)
14
+ [https://www.rubydoc.info/gems/magicka/0.3.1](https://www.rubydoc.info/gems/magicka/0.3.1)
15
15
 
16
16
  Installation
17
17
  ---------------
@@ -11,6 +11,7 @@ require 'sinclair'
11
11
  # module holding herlper to render inputs
12
12
  module Magicka
13
13
  autoload :VERSION, 'magicka/version'
14
+ autoload :Button, 'magicka/button'
14
15
  autoload :Element, 'magicka/element'
15
16
  autoload :FormElement, 'magicka/form_element'
16
17
  autoload :Input, 'magicka/input'
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Magicka
4
+ # Button element representing an HTML +<button/>+
5
+ class Button < Element
6
+ with_attribute_locals :ng_click, :ng_disabled, :classes, :text
7
+ template_folder 'templates/forms'
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Magicka
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Magicka::Button do
6
+ let(:renderer) { instance_double('renderer') }
7
+ let(:template) { 'templates/forms/button' }
8
+
9
+ let(:ng_click) { 'controler.click()' }
10
+ let(:ng_disabled) { 'false' }
11
+ let(:classes) { 'custom class' }
12
+ let(:text) { 'Click' }
13
+
14
+ let(:locals) do
15
+ {
16
+ ng_click: ng_click,
17
+ ng_disabled: ng_disabled,
18
+ classes: classes,
19
+ text: text
20
+ }
21
+ end
22
+
23
+ describe '.render' do
24
+ let(:arguments) do
25
+ {
26
+ renderer: renderer,
27
+ ng_click: ng_click,
28
+ ng_disabled: ng_disabled,
29
+ classes: classes,
30
+ text: text
31
+ }
32
+ end
33
+
34
+ before do
35
+ allow(renderer)
36
+ .to receive(:render)
37
+ .with(partial: template, locals: locals)
38
+ end
39
+
40
+ it do
41
+ described_class.render(arguments)
42
+
43
+ expect(renderer).to have_received(:render)
44
+ end
45
+
46
+ context 'when called with extra params' do
47
+ it do
48
+ described_class.render(name: 'Name', **arguments)
49
+
50
+ expect(renderer).to have_received(:render)
51
+ end
52
+ end
53
+ end
54
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magicka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - DarthJee
@@ -397,6 +397,7 @@ files:
397
397
  - config/yardstick.yml
398
398
  - docker-compose.yml
399
399
  - lib/magicka.rb
400
+ - lib/magicka/button.rb
400
401
  - lib/magicka/element.rb
401
402
  - lib/magicka/element/class_methods.rb
402
403
  - lib/magicka/form_element.rb
@@ -467,6 +468,7 @@ files:
467
468
  - spec/dummy/storage/.keep
468
469
  - spec/integration/readme/.keep
469
470
  - spec/integration/yard/.keep
471
+ - spec/lib/magicka/button_spec.rb
470
472
  - spec/lib/magicka/element/class_methods_spec.rb
471
473
  - spec/lib/magicka/element_spec.rb
472
474
  - spec/lib/magicka/form_element_spec.rb