phlex 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of phlex might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/docs/pages/rails_integration.rb +4 -4
- data/lib/generators/phlex/view/USAGE +8 -0
- data/lib/generators/phlex/{component → view}/templates/view.rb.erb +1 -1
- data/lib/generators/phlex/{component/component_generator.rb → view/view_generator.rb} +0 -0
- data/lib/install/phlex.rb +12 -0
- data/lib/phlex/version.rb +1 -1
- metadata +5 -5
- data/lib/generators/phlex/component/USAGE +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c121a23175be64626a96f07d72e4946327bf6c152bfe4492301b26d966013969
|
4
|
+
data.tar.gz: 12a03aa7e70678c0663741cec8015a8aec7ed13fd0d76cda379708bb17a0662a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dff05a4aea349c9bfc92d6536caff37d8b903a9993ddc1b37e839e6705c7754977dc9bec2315e7b4ebb9c27b450fc93d7b73385dbc5023231117135e27dcf965
|
7
|
+
data.tar.gz: f3619617c75faccb730653fbdf97bec1ab830079a56c703d4089ea1571f64171cc8552e1699e1c2e1560a0a10cf6b82d13e95c0bd24db4dd658b29476d617cba
|
@@ -11,7 +11,7 @@ module Pages
|
|
11
11
|
|
12
12
|
To install Phlex into your Rails application, you can run the `bin/rails phlex:install` command.
|
13
13
|
|
14
|
-
##
|
14
|
+
## View generator
|
15
15
|
|
16
16
|
You can generate new views with the `rails g phlex:view` command.
|
17
17
|
|
@@ -22,7 +22,7 @@ module Pages
|
|
22
22
|
# app/views/card.rb
|
23
23
|
|
24
24
|
module Views
|
25
|
-
class Card <
|
25
|
+
class Card < ApplicationView
|
26
26
|
def template
|
27
27
|
end
|
28
28
|
end
|
@@ -32,7 +32,7 @@ module Pages
|
|
32
32
|
render Markdown.new(<<~MD)
|
33
33
|
## Helpers
|
34
34
|
|
35
|
-
You can use the `helpers` proxy to access helpers within
|
35
|
+
You can use the `helpers` proxy to access helpers within your views.
|
36
36
|
|
37
37
|
For example, you can use the `#t` helper for translations:
|
38
38
|
MD
|
@@ -41,7 +41,7 @@ module Pages
|
|
41
41
|
# app/views/hello.rb
|
42
42
|
|
43
43
|
module Views
|
44
|
-
class Hello <
|
44
|
+
class Hello < ApplicationView
|
45
45
|
delegate :t, to: :helpers
|
46
46
|
|
47
47
|
def template
|
File without changes
|
data/lib/install/phlex.rb
CHANGED
@@ -15,4 +15,16 @@ unless application_configuration_content.match?(pattern)
|
|
15
15
|
)
|
16
16
|
end
|
17
17
|
|
18
|
+
unless Rails.root.join("app/views/application_view.rb").exist?
|
19
|
+
create_file(Rails.root.join("app/views/application_view.rb"), <<~RUBY)
|
20
|
+
# frozen_string_literal: true
|
21
|
+
|
22
|
+
module Views
|
23
|
+
class ApplicationView < Phlex::View
|
24
|
+
include Rails.application.routes.url_helpers
|
25
|
+
end
|
26
|
+
end
|
27
|
+
RUBY
|
28
|
+
end
|
29
|
+
|
18
30
|
say "Phlex successfully installed!"
|
data/lib/phlex/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phlex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Drapper
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: syntax_tree
|
@@ -93,9 +93,9 @@ files:
|
|
93
93
|
- fixtures/page.rb
|
94
94
|
- fixtures/test_helper.rb
|
95
95
|
- fixtures/view_helper.rb
|
96
|
-
- lib/generators/phlex/
|
97
|
-
- lib/generators/phlex/
|
98
|
-
- lib/generators/phlex/
|
96
|
+
- lib/generators/phlex/view/USAGE
|
97
|
+
- lib/generators/phlex/view/templates/view.rb.erb
|
98
|
+
- lib/generators/phlex/view/view_generator.rb
|
99
99
|
- lib/install/phlex.rb
|
100
100
|
- lib/overrides/symbol/name.rb
|
101
101
|
- lib/phlex.rb
|