phlex_ui 0.0.2 → 0.0.3

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: 29e085b8d0e7610e5df2e338c62b923980042ea4a00e513db923e269c396e68e
4
- data.tar.gz: d1ea7147df22c7db15e95ff68bfaeba8b065a32af2e3b08441374c8622342433
3
+ metadata.gz: 96bee30ae4924b1a8300df9b2ca4322877078a064d4b1326f9c4c43d184461f1
4
+ data.tar.gz: b3739fab746cef0e2ec75b736b4b92c4ae14daa6071ff4afc07972ecc4db5b42
5
5
  SHA512:
6
- metadata.gz: 0b9c8a9d14c7bb3cdf6a80dca9e451232897919dc10a4da0ba03fc34e126d022360cf54dad2457ee0b4bbdac746cef2dce043db57ec3a8cf704a8a767918b0e0
7
- data.tar.gz: b60175b105044a7e0fc4c7419bcb35ae0e859e2b76ffb5dfa3cf693cebe4c098c917765f4d6d908bee5e403be4789b7ae044d16bc2e1ac42b04d93bb474ba97b
6
+ metadata.gz: aafde25ef57c8477bcfd5cb6f8c3610b9a806bf386fd7947e03943ad665edd893c2a8946e08eb22a97904092ff19813ab66e7b079c5a60ddf0ac5d5faceb31eb
7
+ data.tar.gz: a60fe88f9f889563d5ddbc8c8e2f316ecfbf74916547ba370e8bb37a4d6ba33866fc750898325fb83cedeb4b05629b35275c1856dbec4c9aaef00d036010017d
@@ -1,7 +1,27 @@
1
1
  module PhlexUI
2
2
  class Button < Phlex::HTML
3
3
  def template(&)
4
- button(class: 'bg-violet-500 hover:bg-violet-700 text-white font-bold py-2 px-4 rounded', &)
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 File.join(Gem.loaded_specs['phlex_ui'].full_gem_path, 'tasks', 'update_tailwind_config.rake')
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
@@ -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.2
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-03 00:00:00.000000000 Z
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: colorize
62
+ name: rake
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - "~>"
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
- version: 0.8.1
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.8.1
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,7 +81,7 @@ extra_rdoc_files: []
81
81
  files:
82
82
  - lib/phlex_ui.rb
83
83
  - lib/phlex_ui/button.rb
84
- - tasks/update_tailwind_config.rake
84
+ - tasks/install.rake
85
85
  homepage: https://rubygems.org/gems/phlex_ui
86
86
  licenses:
87
87
  - MIT
@@ -1,26 +0,0 @@
1
- require 'colorize'
2
-
3
- namespace :phlex_ui do
4
- desc "Print the path of phlex_ui gem"
5
- task print_gem_path: :environment do
6
- gem_path = Gem.loaded_specs['phlex_ui'].full_gem_path
7
- puts "Please update the 'content' array in your 'tailwind.config.js' file like this:".colorize(:green)
8
- puts "
9
- module.exports = {
10
- content: [
11
- './app/views/**/*.rb',
12
- './app/components/**/*rb',
13
- './app/views/**/*.{erb,haml,html,slim,rb}',
14
- './app/helpers/**/*.rb',
15
- './app/assets/stylesheets/**/*.css',
16
- './app/javascript/**/*.js',".colorize(:yellow)
17
- puts "
18
- // Add this line below so that Tailwind can find the classes in PhlexUI
19
- '#{gem_path}/**/*.rb',
20
- ".colorize(:green)
21
- puts "
22
- ],
23
- }
24
- ".colorize(:yellow)
25
- end
26
- end