asbru 0.0.1 → 0.0.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: adbc029751ba4d56cc4fa21e754fdc1dbd4e7adf82fb69325623fbeb06243fb2
4
- data.tar.gz: 19f3ed4cafb6cdde19827b9cdaa0ff5df9608fef2c9688c0f2ce17ccbcfe2e36
3
+ metadata.gz: dbe8a87c74d02a2012130ec1e2e93f3a5d5c52fe32aedfd9d85578e272e866b8
4
+ data.tar.gz: 831326c07be46d075d2f71ae17e4b86511278bdc3382368a8d0efb4602d7737d
5
5
  SHA512:
6
- metadata.gz: 36d7cfc112787a88ee64c864275163c3721a13e6bbae0b2cc454088e342e34c137568fc1ebb964e107bec310ab3ee9deae08ae6c310e35f6c1e54c01d9f99a2e
7
- data.tar.gz: b17440674f8b014ad3c081c77427240a76a989b84c37475724935cc42664ed37ef49b2edad21f1a6a5efae5cad29a760575362e07836889b651dfb84e805bd61
6
+ metadata.gz: 19fc868817266c527262c39a589bc5e5a0947de20063bfc613a6c40fa8b71a377b11d9cc7e1963ca12c86ab69ce833f462805a19dbe38c7cc56ebb1791faf360
7
+ data.tar.gz: 106625b4ace1db59f41f2060e592793ed05ba07ac18fa20d986171fe8070aff1b88c764678905ba48c3c941b880c2e63b8fe9e35fad382da58c82d0cd295f1ee
data/lib/asbru.rb CHANGED
@@ -1,5 +1,8 @@
1
1
  require "asbru/railtie"
2
+ require 'dry-configurable'
2
3
 
3
4
  module Asbru
4
-
5
+ extend Dry::Configurable
6
+ setting :component_prefix,'app'
7
+ setting :form_builder_prefix, 'app'
5
8
  end
data/lib/asbru/cml.rb CHANGED
@@ -18,35 +18,51 @@ module Asbru
18
18
  # I think I prefer 1 even though the syntax of Sage is nicer imo.
19
19
  class << self
20
20
  def p text, **opts
21
- C.text_content text: text, **opts
21
+ C.send "#{component_prefix}_content",
22
+ text: text,
23
+ **opts
22
24
  end
23
25
 
24
26
  def h1 text, **opts
25
- C.text_title size: 'h1', text: text
27
+ C.send "#{component_prefix}_title",
28
+ size: 'h1',
29
+ text: text
26
30
  end
27
31
 
28
32
  def h2 text, **opts
29
- C.text_title size: 'h2', text: text
33
+ C.send "#{component_prefix}_title",
34
+ size: 'h2',
35
+ text: text
30
36
  end
31
37
 
32
38
  def h3 text, **opts
33
- C.text_title size: 'h3', text: text
39
+ C.send "#{component_prefix}_title",
40
+ size: 'h3',
41
+ text: text
34
42
  end
35
43
 
36
44
  def h4 text, **opts
37
- C.text_title size: 'h4', text: text
45
+ C.send "#{component_prefix}_title",
46
+ size: 'h4',
47
+ text: text
38
48
  end
39
49
 
40
50
  def h5 text, **opts
41
- C.text_title size: 'h5', text: text
51
+ C.send "#{component_prefix}_title",
52
+ size: 'h5',
53
+ text: text
42
54
  end
43
55
 
44
56
  def hr color: 'stable-500'
45
- C.ui_divider color: color, height: 1
57
+ C.send "#{component_prefix}_divider",
58
+ color: color,
59
+ height: 1
46
60
  end
47
61
 
48
62
  def vertical_spacer height
49
- C.ui_divider color: :transparent, height: height
63
+ C.send "#{component_prefix}_divider",
64
+ color: :transparent,
65
+ height: height
50
66
  end
51
67
 
52
68
  def table_row(*cells)
@@ -62,6 +78,12 @@ module Asbru
62
78
  cell[:customData]['data-confirm'] = confirm if confirm.present?
63
79
  cell
64
80
  end
81
+
82
+ private
83
+
84
+ def component_prefix
85
+ Asbru.config.component_prefix
86
+ end
65
87
  end
66
88
  end
67
89
  end
@@ -80,8 +80,8 @@ module Asbru
80
80
  end
81
81
  end
82
82
 
83
-
84
- Asbru::Components::Savage.form_element **new_options
83
+ Asbru::Components::Savage.send "#{Asbru.config.form_builder_prefix}_element",
84
+ **new_options
85
85
  end
86
86
 
87
87
  def create_options(attribute, choices, chosen)
data/lib/asbru/links.rb CHANGED
@@ -18,7 +18,8 @@ module Asbru
18
18
  options[:customData][:'data-method'] = method if method.present?
19
19
  options[:customData][:'data-confirm'] = confirm if confirm.present?
20
20
  options[:customData].merge(options[:custom_data]) if options[:custom_data]
21
- Asbru::Components::Savage.button_button(**options)
21
+ Asbru::Components::Savage.send "#{Asbru.config.component_prefix}_button",
22
+ **options
22
23
  end
23
24
 
24
25
  def asbru_link_to(text, url, **options)
data/lib/asbru/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Asbru
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,35 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asbru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stev-0
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-01 00:00:00.000000000 Z
11
+ date: 2021-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: 6.0.3
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
- version: 6.0.3.5
19
+ version: '5.2'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: 6.0.3
30
24
  - - ">="
31
25
  - !ruby/object:Gem::Version
32
- version: 6.0.3.5
26
+ version: '5.2'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: react-rails
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,6 +38,20 @@ dependencies:
44
38
  - - ">="
45
39
  - !ruby/object:Gem::Version
46
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: dry-configurable
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
47
55
  description: Creating component based webpages with short hand syntax.
48
56
  email:
49
57
  - skemp@adflow.io