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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4314dc80b5da3795454b1906f8c51b0b875fc6fea6962c2a77476dd6a4f01d34
4
- data.tar.gz: 7ca6921fed9c3d2d6122dd0e77e2a97f5f100dc4a003d76c76c8dd407fddf86e
3
+ metadata.gz: c121a23175be64626a96f07d72e4946327bf6c152bfe4492301b26d966013969
4
+ data.tar.gz: 12a03aa7e70678c0663741cec8015a8aec7ed13fd0d76cda379708bb17a0662a
5
5
  SHA512:
6
- metadata.gz: 9e7a837a1c2584e7c7f0c7955c2f49f48d4cbc049e19ba2cb707f6cfb3662edca2c05dc5cb80fc59ec6d50416fcc60894ec77bf3cc987cf22aab4ea9c470e95a
7
- data.tar.gz: 1365cfd00e035b4364a66d89d3657e1d49745e1950d64b7b0fe9a17bcf27551d59447f6cd86451c3279886303cef119a69b8c752acddc81045b0eefc66fd5a4f
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
- ## Component generator
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 < Phlex::View
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 a `Phlex::View`.
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 < Phlex::View
44
+ class Hello < ApplicationView
45
45
  delegate :t, to: :helpers
46
46
 
47
47
  def template
@@ -0,0 +1,8 @@
1
+ Description:
2
+ Generates a Phlex view with the given name
3
+
4
+ Example:
5
+ rails generate phlex:view Sidebar
6
+
7
+ This will create:
8
+ app/views/sidebar.rb
@@ -1,6 +1,6 @@
1
1
  <% module_namespacing do -%>
2
2
  module Views
3
- class <%= class_name %> < Phlex::View
3
+ class <%= class_name %> < ApplicationView
4
4
  def template
5
5
  end
6
6
  end
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Phlex
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
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.0
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-29 00:00:00.000000000 Z
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/component/USAGE
97
- - lib/generators/phlex/component/component_generator.rb
98
- - lib/generators/phlex/component/templates/view.rb.erb
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
@@ -1,8 +0,0 @@
1
- Description:
2
- Generates a phlex component with the given name
3
-
4
- Example:
5
- rails generate phlex:component Sidebar
6
-
7
- This will create:
8
- app/views/components/sidebar.rb