phlex-rails 2.0.0.beta1 → 2.0.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/phlex/component/USAGE +8 -0
- data/lib/generators/phlex/component/templates/component.rb.erb +8 -0
- data/lib/generators/phlex/install/USAGE +10 -0
- data/lib/generators/phlex/install/install_generator.rb +1 -5
- data/lib/generators/phlex/install/templates/base_component.rb.erb +15 -0
- data/lib/generators/phlex/install/templates/base_view.rb.erb +9 -0
- data/lib/generators/phlex/install/templates/phlex.rb.erb +16 -0
- data/lib/generators/phlex/view/USAGE +8 -0
- data/lib/generators/phlex/view/templates/view.rb.erb +8 -0
- data/lib/phlex/rails/version.rb +1 -1
- metadata +12 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 884bb8de02703c59d0756050a402a853af780a4c9bc37805483d3446b17acdb2
|
4
|
+
data.tar.gz: de4bd44c31da7580ec9c158d1d004b03c3be89b419b78abc5c6eb9b67b97e1c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20f911fd5441cbca7281b63c94b4d1f3ef8b604c88550b5e0b1c4889eab9286f827430a7e05cd35b3be8c49d9d0679f781c33ee8d0e7a6d8bdfbf3676d3a54bd
|
7
|
+
data.tar.gz: 0a096db9f03bc6164b5cf951128a2b751d2de052588aea26f1a8c82a36d125798c198fbd32b06ebce2e0b6c65c52158f8d17e0d61586408307cd98808266e84b
|
@@ -10,7 +10,7 @@ module Phlex::Generators
|
|
10
10
|
if tailwind_configuration_path
|
11
11
|
insert_into_file tailwind_configuration_path, after: "content: [" do
|
12
12
|
"\n './app/views/**/*.rb', // Phlex views" \
|
13
|
-
|
13
|
+
"\n './app/components/**/*.rb', // Phlex components" \
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -23,10 +23,6 @@ module Phlex::Generators
|
|
23
23
|
template "base_view.rb.erb", Rails.root.join("app/views/base.rb")
|
24
24
|
end
|
25
25
|
|
26
|
-
def create_hello_component
|
27
|
-
template "hello_component.rb.erb", Rails.root.join("app/components/hello.rb")
|
28
|
-
end
|
29
|
-
|
30
26
|
def create_initializer
|
31
27
|
template "phlex.rb.erb", Rails.root.join("config/initializers/phlex.rb")
|
32
28
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Components::Base < Phlex::HTML
|
4
|
+
include Components
|
5
|
+
|
6
|
+
# Include any helpers you want to be available across all components
|
7
|
+
include Phlex::Rails::Helpers::Routes
|
8
|
+
|
9
|
+
if Rails.env.development?
|
10
|
+
def before_template
|
11
|
+
comment { "Before #{self.class.name}" }
|
12
|
+
super
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Views::Base < Components::Base
|
4
|
+
# The ApplicationView is an abstract class for all your views.
|
5
|
+
|
6
|
+
# By default, it inherits from `ApplicationComponent`, but you
|
7
|
+
# can change that to `Phlex::HTML` if you want to keep views and
|
8
|
+
# components independent.
|
9
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Views
|
4
|
+
end
|
5
|
+
|
6
|
+
module Components
|
7
|
+
extend Phlex::Kit
|
8
|
+
end
|
9
|
+
|
10
|
+
Rails.autoloaders.main.push_dir(
|
11
|
+
"#{Rails.root}/app/views", namespace: Views
|
12
|
+
)
|
13
|
+
|
14
|
+
Rails.autoloaders.main.push_dir(
|
15
|
+
"#{Rails.root}/app/components", namespace: Components
|
16
|
+
)
|
data/lib/phlex/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phlex-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Drapper
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: phlex
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.0.0.
|
19
|
+
version: 2.0.0.beta2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.0.0.
|
26
|
+
version: 2.0.0.beta2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: railties
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,8 +53,16 @@ extra_rdoc_files: []
|
|
53
53
|
files:
|
54
54
|
- LICENSE.txt
|
55
55
|
- README.md
|
56
|
+
- lib/generators/phlex/component/USAGE
|
56
57
|
- lib/generators/phlex/component/component_generator.rb
|
58
|
+
- lib/generators/phlex/component/templates/component.rb.erb
|
59
|
+
- lib/generators/phlex/install/USAGE
|
57
60
|
- lib/generators/phlex/install/install_generator.rb
|
61
|
+
- lib/generators/phlex/install/templates/base_component.rb.erb
|
62
|
+
- lib/generators/phlex/install/templates/base_view.rb.erb
|
63
|
+
- lib/generators/phlex/install/templates/phlex.rb.erb
|
64
|
+
- lib/generators/phlex/view/USAGE
|
65
|
+
- lib/generators/phlex/view/templates/view.rb.erb
|
58
66
|
- lib/generators/phlex/view/view_generator.rb
|
59
67
|
- lib/phlex-rails.rb
|
60
68
|
- lib/phlex/rails.rb
|