phlex_ui 0.0.1 → 0.0.3
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 +4 -4
- data/lib/phlex_ui/button.rb +21 -1
- data/lib/phlex_ui.rb +1 -1
- data/tasks/install.rake +22 -0
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96bee30ae4924b1a8300df9b2ca4322877078a064d4b1326f9c4c43d184461f1
|
4
|
+
data.tar.gz: b3739fab746cef0e2ec75b736b4b92c4ae14daa6071ff4afc07972ecc4db5b42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aafde25ef57c8477bcfd5cb6f8c3610b9a806bf386fd7947e03943ad665edd893c2a8946e08eb22a97904092ff19813ab66e7b079c5a60ddf0ac5d5faceb31eb
|
7
|
+
data.tar.gz: a60fe88f9f889563d5ddbc8c8e2f316ecfbf74916547ba370e8bb37a4d6ba33866fc750898325fb83cedeb4b05629b35275c1856dbec4c9aaef00d036010017d
|
data/lib/phlex_ui/button.rb
CHANGED
@@ -1,7 +1,27 @@
|
|
1
1
|
module PhlexUI
|
2
2
|
class Button < Phlex::HTML
|
3
3
|
def template(&)
|
4
|
-
button(class:
|
4
|
+
button(class: klass, &)
|
5
5
|
end
|
6
|
+
|
7
|
+
private
|
8
|
+
|
9
|
+
def klass
|
10
|
+
'bg-violet-500 hover:bg-violet-700 text-white font-bold py-2 px-4 rounded'
|
11
|
+
end
|
12
|
+
|
13
|
+
# def style
|
14
|
+
# {
|
15
|
+
# 'background-color': 'violet',
|
16
|
+
# 'color': 'white',
|
17
|
+
# 'font-weight': 'bold',
|
18
|
+
# 'padding': '0.5rem 1rem',
|
19
|
+
# 'border-radius': '0.25rem',
|
20
|
+
# }
|
21
|
+
# end
|
22
|
+
|
23
|
+
# def compile_style
|
24
|
+
# style.map { |k, v| "#{k}: #{v};" }.join(' ')
|
25
|
+
# end
|
6
26
|
end
|
7
27
|
end
|
data/lib/phlex_ui.rb
CHANGED
@@ -13,7 +13,7 @@ module PhlexUI
|
|
13
13
|
# If Rails is defined, load the rake tasks
|
14
14
|
class Railtie < Rails::Railtie
|
15
15
|
rake_tasks do
|
16
|
-
load 'tasks
|
16
|
+
load File.join(Gem.loaded_specs['phlex_ui'].full_gem_path, 'tasks', 'install.rake')
|
17
17
|
end
|
18
18
|
end if defined?(Rails)
|
19
19
|
end
|
data/tasks/install.rake
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
namespace :phlex_ui do
|
4
|
+
desc "Update tailwind.config.js to include phlex_ui gem path"
|
5
|
+
task install: :environment do
|
6
|
+
dev_path = Gem.loaded_specs['phlex_ui'].full_gem_path + '/**/*.rb'
|
7
|
+
prod_path = '/app/vendor/bundle/ruby/*/gems/phlex_ui-*/**/*.rb'
|
8
|
+
|
9
|
+
puts "PhlexUI Installation steps:\n\n"
|
10
|
+
|
11
|
+
puts "1. Add these 2 paths to your tailwind.config.js file:\n\n"
|
12
|
+
print "module.exports = "
|
13
|
+
puts JSON.pretty_generate({
|
14
|
+
"content" => [
|
15
|
+
"// Other paths",
|
16
|
+
dev_path,
|
17
|
+
prod_path
|
18
|
+
]
|
19
|
+
})
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phlex_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- George Kettle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: phlex
|
@@ -59,19 +59,19 @@ dependencies:
|
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '8'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
|
-
name:
|
62
|
+
name: rake
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- - "
|
65
|
+
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: 0
|
67
|
+
version: '12.0'
|
68
68
|
type: :runtime
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- - "
|
72
|
+
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: 0
|
74
|
+
version: '12.0'
|
75
75
|
description: PhlexUI is a UI Component Library for Ruby developers. Built on top of
|
76
76
|
the Phlex Framework.
|
77
77
|
email: george.kettle@icloud.com
|
@@ -81,6 +81,7 @@ extra_rdoc_files: []
|
|
81
81
|
files:
|
82
82
|
- lib/phlex_ui.rb
|
83
83
|
- lib/phlex_ui/button.rb
|
84
|
+
- tasks/install.rake
|
84
85
|
homepage: https://rubygems.org/gems/phlex_ui
|
85
86
|
licenses:
|
86
87
|
- MIT
|