phlex-rails 1.2.1 → 2.0.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generators/phlex/component/USAGE +2 -2
  3. data/lib/generators/phlex/component/component_generator.rb +1 -1
  4. data/lib/generators/phlex/component/templates/component.rb.erb +2 -3
  5. data/lib/generators/phlex/install/USAGE +3 -1
  6. data/lib/generators/phlex/install/install_generator.rb +28 -38
  7. data/lib/generators/phlex/install/templates/base_component.rb.erb +15 -0
  8. data/lib/generators/phlex/install/templates/base_view.rb.erb +9 -0
  9. data/lib/generators/phlex/install/templates/phlex.rb.erb +16 -0
  10. data/lib/generators/phlex/view/USAGE +1 -1
  11. data/lib/generators/phlex/view/templates/view.rb.erb +2 -3
  12. data/lib/generators/phlex/view/view_generator.rb +1 -1
  13. data/lib/phlex/rails/buffered.rb +6 -7
  14. data/lib/phlex/rails/csv.rb +3 -3
  15. data/lib/phlex/rails/engine.rb +0 -1
  16. data/lib/phlex/rails/{html/method_missing.rb → helper_finder.rb} +2 -2
  17. data/lib/phlex/rails/helper_macros.rb +2 -12
  18. data/lib/phlex/rails/helpers/notice.rb +8 -0
  19. data/lib/phlex/rails/helpers/routes.rb +1 -0
  20. data/lib/phlex/rails/helpers/tag.rb +2 -2
  21. data/lib/phlex/rails/helpers/translate.rb +2 -2
  22. data/lib/phlex/rails/helpers/turbo_stream.rb +1 -1
  23. data/lib/phlex/rails/helpers.rb +11 -56
  24. data/lib/phlex/rails/html.rb +0 -2
  25. data/lib/phlex/rails/layout.rb +7 -7
  26. data/lib/phlex/rails/sgml.rb +35 -53
  27. data/lib/phlex/rails/streaming.rb +11 -9
  28. data/lib/phlex/rails/testing.rb +18 -0
  29. data/lib/phlex/rails/unbuffered.rb +50 -0
  30. data/lib/phlex/rails/version.rb +1 -1
  31. data/lib/phlex/rails.rb +6 -7
  32. metadata +16 -26
  33. data/.editorconfig +0 -13
  34. data/.rubocop.yml +0 -15
  35. data/.ruby-version +0 -1
  36. data/.yardopts +0 -1
  37. data/Appraisals +0 -11
  38. data/CHANGELOG.md +0 -38
  39. data/CODE_OF_CONDUCT.md +0 -84
  40. data/Gemfile +0 -17
  41. data/SECURITY.md +0 -5
  42. data/config.ru +0 -9
  43. data/lib/generators/phlex/install/templates/application_component.rb +0 -12
  44. data/lib/generators/phlex/install/templates/application_layout.rb +0 -24
  45. data/lib/generators/phlex/install/templates/application_view.rb +0 -9
  46. data/lib/phlex/rails/unbuffered_overrides.rb +0 -30
  47. data/lib/phlex/testing/rails/view_helper.rb +0 -19
  48. data/phlex_logo.png +0 -0
@@ -11,7 +11,7 @@ module Phlex
11
11
 
12
12
  module Overrides
13
13
  def helpers
14
- if defined?(ViewComponent::Base) && @_view_context.is_a?(ViewComponent::Base)
14
+ if defined?(ViewComponent::Base) && ViewComponent::Base === @_view_context
15
15
  @_view_context.helpers
16
16
  else
17
17
  @_view_context
@@ -22,80 +22,62 @@ module Phlex
22
22
  renderable = args[0]
23
23
 
24
24
  case renderable
25
- when Phlex::SGML, Proc, Method
25
+ when Phlex::SGML, Proc, Method, String
26
26
  return super
27
27
  when Class
28
28
  return super if renderable < Phlex::SGML
29
29
  when Enumerable
30
- return super unless renderable.is_a?(ActiveRecord::Relation)
31
- else
32
- if block
33
- @_context.target << @_view_context.render(*args, **kwargs) { capture(&block) }
34
- else
35
- @_context.target << @_view_context.render(*args, **kwargs)
30
+ return super unless ActiveRecord::Relation === renderable
31
+ when nil
32
+ partial = kwargs.delete(:partial)
33
+
34
+ if partial # this is a hack to get around https://github.com/rails/rails/issues/51015
35
+ return raw(
36
+ @_view_context.render(partial, **kwargs) do |*yielded_args|
37
+ capture(*yielded_args, &block)
38
+ end,
39
+ )
36
40
  end
37
41
  end
38
42
 
39
- nil
43
+ output = if block
44
+ @_view_context.render(*args, **kwargs) do |*yielded_args|
45
+ if yielded_args.length == 1 && defined?(ViewComponent::Base) && ViewComponent::Base === yielded_args[0]
46
+ capture(Phlex::Rails::Buffered.new(yielded_args[0], view: self), &block)
47
+ else
48
+ capture(*yielded_args, &block)
49
+ end
50
+ end
51
+ else
52
+ @_view_context.render(*args, **kwargs)
53
+ end
54
+
55
+ raw(output)
40
56
  end
41
57
 
42
- def render_in(view_context, &block)
58
+ def render_in(view_context, &erb)
43
59
  fragments = if view_context.request && (fragment_header = view_context.request.headers["X-Fragment"])
44
60
  fragment_header.split
45
61
  end
46
62
 
47
- if block_given?
48
- call(view_context: view_context, fragments: fragments) do |*args|
49
- original_length = @_context.target.bytesize
50
-
51
- if args.length == 1 && Phlex::SGML === args[0] && !block.source_location&.[](0)&.end_with?(".rb")
52
- output = view_context.capture(
53
- args[0].unbuffered, &block
54
- )
63
+ if erb
64
+ call(view_context:, fragments:) { |*args|
65
+ if args.length == 1 && Phlex::SGML === args[0] && !erb.source_location&.[](0)&.end_with?(".rb")
66
+ unbuffered = Phlex::Rails::Unbuffered.new(args[0])
67
+ raw(helpers.capture(unbuffered, &erb))
55
68
  else
56
- output = view_context.capture(*args, &block)
69
+ raw(helpers.capture(*args, &erb))
57
70
  end
58
-
59
- unchanged = (original_length == @_context.target.bytesize)
60
-
61
- if unchanged
62
- case output
63
- when ActiveSupport::SafeBuffer
64
- @_context.target << output
65
- end
66
- end
67
- end.html_safe
71
+ }.html_safe
68
72
  else
69
- call(view_context: view_context, fragments: fragments).html_safe
73
+ call(view_context:, fragments:).html_safe
70
74
  end
71
75
  end
72
76
 
73
- def capture
77
+ def capture(...)
74
78
  super&.html_safe
75
79
  end
76
80
 
77
- # @api private
78
- def __text__(content)
79
- case content
80
- when ActiveSupport::SafeBuffer
81
- @_context.target << content
82
- else
83
- super
84
- end
85
- end
86
-
87
- # TODO: Re-introduce this when we can figure out how to test it
88
- # def await(task)
89
- # case task
90
- # when ActiveRecord::Relation
91
- # future = task.instance_variable_get(:@future_result)
92
- # flush if future && future.pending?
93
- # task
94
- # else
95
- # super
96
- # end
97
- # end
98
-
99
81
  # Trick ViewComponent into thinking we're a ViewComponent to fix rendering output
100
82
  # @api private
101
83
  def set_original_view_context(view_context)
@@ -7,17 +7,19 @@ module Phlex::Rails::Streaming
7
7
  private
8
8
 
9
9
  def stream(view, last_modified: Time.now.httpdate, filename: nil)
10
- set_stream_headers(last_modified: last_modified)
10
+ __phlex_set_stream_headers__(last_modified:)
11
11
 
12
12
  case view
13
13
  when Phlex::HTML
14
- stream_html(view)
14
+ __phlex_stream_html__(view)
15
15
  when Phlex::CSV
16
- stream_csv(view, filename: filename)
16
+ __phlex_stream_csv__(view, filename:)
17
+ else
18
+ raise Phlex::ArgumentError
17
19
  end
18
20
  end
19
21
 
20
- def set_stream_headers(last_modified:)
22
+ def __phlex_set_stream_headers__(last_modified:)
21
23
  headers.delete("Content-Length")
22
24
 
23
25
  headers["X-Accel-Buffering"] = "no"
@@ -25,16 +27,16 @@ module Phlex::Rails::Streaming
25
27
  headers["Last-Modified"] = last_modified
26
28
  end
27
29
 
28
- def stream_csv(view, filename:)
30
+ def __phlex_stream_csv__(view, filename:)
29
31
  headers["Content-Type"] = "text/csv; charset=utf-8"
30
32
  headers["Content-Disposition"] = "attachment; filename=\"#{filename || view.filename}\""
31
33
 
32
34
  self.response_body = Enumerator.new do |buffer|
33
- view.call(buffer, view_context: view_context)
35
+ view.call(buffer, view_context:)
34
36
  end
35
37
  end
36
38
 
37
- def stream_html(view)
39
+ def __phlex_stream_html__(view)
38
40
  headers["Content-Type"] = "text/html; charset=utf-8"
39
41
 
40
42
  # Ensure we have a session id.
@@ -45,13 +47,13 @@ module Phlex::Rails::Streaming
45
47
  end
46
48
 
47
49
  self.response_body = Enumerator.new do |buffer|
48
- view.call(buffer, view_context: view_context)
50
+ view.call(buffer, view_context:)
49
51
  rescue => e
50
52
  raise(e) if Rails.env.test?
51
53
 
52
54
  debug_middleware = ActionDispatch::DebugExceptions.new(
53
55
  proc { |_env| raise(e) },
54
- response_format: :html
56
+ response_format: :html,
55
57
  )
56
58
 
57
59
  _debug_status, _debug_headers, debug_body = debug_middleware.call(request.env)
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "phlex/rails"
4
+ require "phlex/testing"
5
+
6
+ module Phlex::Testing::RailsContext
7
+ def view_context
8
+ controller.view_context
9
+ end
10
+
11
+ def controller
12
+ @controller ||= ActionView::TestCase::TestController.new
13
+ end
14
+ end
15
+
16
+ Phlex::Testing::SGML.include(
17
+ Phlex::Testing::RailsContext,
18
+ )
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ # @api private
4
+ class Phlex::Rails::Unbuffered
5
+ def initialize(component)
6
+ @component = component
7
+ end
8
+
9
+ def respond_to_missing?(...)
10
+ @component.respond_to?(...)
11
+ end
12
+
13
+ def method_missing(method_name, *, **, &erb)
14
+ if @component.respond_to?(method_name)
15
+ output = @component.capture do
16
+ if erb
17
+ @component.public_send(method_name, *, **) do |*a, **kw|
18
+ @component.raw(
19
+ @component.helpers.capture(
20
+ *a,
21
+ **kw,
22
+ &erb
23
+ ),
24
+ )
25
+ end
26
+ else # no erb block
27
+ @component.public_send(method_name, *, **)
28
+ end
29
+ end
30
+ else
31
+ super
32
+ end
33
+ end
34
+
35
+ def inspect
36
+ "Unbuffered(#{@component.inspect})"
37
+ end
38
+
39
+ def call(...)
40
+ @component.call(...)
41
+ end
42
+
43
+ def send(...)
44
+ @component.__send__(...)
45
+ end
46
+
47
+ def public_send(...)
48
+ @component.public_send(...)
49
+ end
50
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Phlex
4
4
  module Rails
5
- VERSION = "1.2.1"
5
+ VERSION = "2.0.0.beta2"
6
6
  end
7
7
  end
data/lib/phlex/rails.rb CHANGED
@@ -11,16 +11,15 @@ module Phlex
11
11
  autoload :BufferedLabelBuilder, "phlex/rails/buffered_label_builder"
12
12
  autoload :BufferedRadioButtonBuilder, "phlex/rails/buffered_radio_button_builder"
13
13
  autoload :CSV, "phlex/rails/csv"
14
- autoload :HTML, "phlex/rails/html"
14
+ autoload :FragmentFinder, "phlex/rails/fragment_finder"
15
+ autoload :HelperFinder, "phlex/rails/helper_finder"
15
16
  autoload :HelperMacros, "phlex/rails/helper_macros"
16
17
  autoload :Helpers, "phlex/rails/helpers"
18
+ autoload :HTML, "phlex/rails/html"
17
19
  autoload :Layout, "phlex/rails/layout"
18
20
  autoload :SGML, "phlex/rails/sgml"
19
- autoload :UnbufferedOverrides, "phlex/rails/unbuffered_overrides"
20
21
  autoload :Streaming, "phlex/rails/streaming"
21
- autoload :FragmentFinder, "phlex/rails/fragment_finder"
22
-
23
- Deprecation = ActiveSupport::Deprecation.new("2.0", "Phlex::Rails")
22
+ autoload :Unbuffered, "phlex/rails/unbuffered"
24
23
  end
25
24
 
26
25
  CSV.extend Phlex::Rails::HelperMacros
@@ -29,10 +28,10 @@ module Phlex
29
28
  SGML.extend Phlex::Rails::SGML::ClassMethods
30
29
  SGML.extend Phlex::Rails::HelperMacros
31
30
  SGML.prepend Phlex::Rails::SGML::Overrides
31
+ SGML.include Phlex::Rails::HelperFinder
32
32
 
33
33
  HTML.extend Phlex::Rails::HTML::Format
34
34
  HTML.include Phlex::Rails::HTML::Format
35
- HTML.include Phlex::Rails::HTML::MethodMissing
36
35
 
37
- Unbuffered.prepend Phlex::Rails::UnbufferedOverrides
36
+ ActiveSupport::SafeBuffer.include(Phlex::SGML::SafeObject)
38
37
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phlex-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
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-04-05 00:00:00.000000000 Z
11
+ date: 2024-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: phlex
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.10.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: 1.10.0
26
+ version: 2.0.0.beta2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: railties
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,33 +44,23 @@ dependencies:
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '8'
47
- description: A high-performance view framework optimised for developer happiness.
47
+ description: A high-performance view framework optimised for fun.
48
48
  email:
49
49
  - joel@drapper.me
50
50
  executables: []
51
51
  extensions: []
52
52
  extra_rdoc_files: []
53
53
  files:
54
- - ".editorconfig"
55
- - ".rubocop.yml"
56
- - ".ruby-version"
57
- - ".yardopts"
58
- - Appraisals
59
- - CHANGELOG.md
60
- - CODE_OF_CONDUCT.md
61
- - Gemfile
62
54
  - LICENSE.txt
63
55
  - README.md
64
- - SECURITY.md
65
- - config.ru
66
56
  - lib/generators/phlex/component/USAGE
67
57
  - lib/generators/phlex/component/component_generator.rb
68
58
  - lib/generators/phlex/component/templates/component.rb.erb
69
59
  - lib/generators/phlex/install/USAGE
70
60
  - lib/generators/phlex/install/install_generator.rb
71
- - lib/generators/phlex/install/templates/application_component.rb
72
- - lib/generators/phlex/install/templates/application_layout.rb
73
- - lib/generators/phlex/install/templates/application_view.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
74
64
  - lib/generators/phlex/view/USAGE
75
65
  - lib/generators/phlex/view/templates/view.rb.erb
76
66
  - lib/generators/phlex/view/view_generator.rb
@@ -84,6 +74,7 @@ files:
84
74
  - lib/phlex/rails/csv.rb
85
75
  - lib/phlex/rails/engine.rb
86
76
  - lib/phlex/rails/fragment_finder.rb
77
+ - lib/phlex/rails/helper_finder.rb
87
78
  - lib/phlex/rails/helper_macros.rb
88
79
  - lib/phlex/rails/helpers.rb
89
80
  - lib/phlex/rails/helpers/action_cable_meta_tag.rb
@@ -177,6 +168,7 @@ files:
177
168
  - lib/phlex/rails/helpers/mail_to.rb
178
169
  - lib/phlex/rails/helpers/month_field.rb
179
170
  - lib/phlex/rails/helpers/month_field_tag.rb
171
+ - lib/phlex/rails/helpers/notice.rb
180
172
  - lib/phlex/rails/helpers/number_field.rb
181
173
  - lib/phlex/rails/helpers/number_field_tag.rb
182
174
  - lib/phlex/rails/helpers/number_to_currency.rb
@@ -284,14 +276,12 @@ files:
284
276
  - lib/phlex/rails/helpers/with_output_buffer.rb
285
277
  - lib/phlex/rails/helpers/word_wrap.rb
286
278
  - lib/phlex/rails/html.rb
287
- - lib/phlex/rails/html/method_missing.rb
288
279
  - lib/phlex/rails/layout.rb
289
280
  - lib/phlex/rails/sgml.rb
290
281
  - lib/phlex/rails/streaming.rb
291
- - lib/phlex/rails/unbuffered_overrides.rb
282
+ - lib/phlex/rails/testing.rb
283
+ - lib/phlex/rails/unbuffered.rb
292
284
  - lib/phlex/rails/version.rb
293
- - lib/phlex/testing/rails/view_helper.rb
294
- - phlex_logo.png
295
285
  homepage: https://www.phlex.fun
296
286
  licenses:
297
287
  - MIT
@@ -309,14 +299,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
309
299
  requirements:
310
300
  - - ">="
311
301
  - !ruby/object:Gem::Version
312
- version: '2.7'
302
+ version: 3.3.1
313
303
  required_rubygems_version: !ruby/object:Gem::Requirement
314
304
  requirements:
315
305
  - - ">="
316
306
  - !ruby/object:Gem::Version
317
307
  version: '0'
318
308
  requirements: []
319
- rubygems_version: 3.4.22
309
+ rubygems_version: 3.5.18
320
310
  signing_key:
321
311
  specification_version: 4
322
312
  summary: A Phlex adapter for Rails
data/.editorconfig DELETED
@@ -1,13 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- indent_style = tab
5
- indent_size = 2
6
-
7
- [*.yml]
8
- indent_style = space
9
- indent_size = 2
10
-
11
- [*.erb]
12
- indent_style = space
13
- indent_size = 2
data/.rubocop.yml DELETED
@@ -1,15 +0,0 @@
1
- inherit_from:
2
- - "https://www.goodcop.style/rubocop.yml"
3
- - "https://www.goodcop.style/tabs.yml"
4
-
5
- AllCops:
6
- TargetRubyVersion: 2.7
7
- Exclude:
8
- - "lib/phlex-rails.rb"
9
- SuggestExtensions: false
10
-
11
- Style/MissingRespondToMissing:
12
- Enabled: false
13
-
14
- Style/RescueStandardError:
15
- Enabled: false
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 3.2.2
data/.yardopts DELETED
@@ -1 +0,0 @@
1
- --private --hide-api private --markup markdown --exclude lib/generators
data/Appraisals DELETED
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- appraise "rails-7" do
4
- gem "rails", "~> 7"
5
- end
6
-
7
- if RUBY_VERSION >= "3.1.0"
8
- appraise "rails-edge" do
9
- gem "rails", github: "rails/rails"
10
- end
11
- end
data/CHANGELOG.md DELETED
@@ -1,38 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
-
5
-
6
- # [1.1.1] 2023-11-27
7
-
8
- - Fixed a bug where Phlex would try to capture `nil` when rendered from ActionView without a block.
9
-
10
- ## [1.1.0] 2023-11-24
11
-
12
- - Dropped dependency on `rails` and now only depends on `railties`
13
- - Fix an out of order rendering issue when yielding from a partial rendered with a block delegated from a component’s content block
14
- - Added `flash` helper adapter in `Phlex::Rails::Helpers::Flash`
15
- - Removed experimental form component
16
- - Updated `phlex` dependency to `~> 1.9`
17
-
18
- ## [1.0.0] 2023-04-19
19
-
20
- ### Added
21
-
22
- - Added an adapter for the pluralize view helper.
23
-
24
- ## 0.10.0
25
-
26
- ### Added
27
-
28
- - You can now render procs and lambdas and enumerables of renderables.
29
- - Experimental streaming interface
30
-
31
- ### Fixed
32
-
33
- - Escaped ERB captures
34
- - Use buffered component unless renderin in a template
35
-
36
- ***
37
-
38
- Before this changelog was introduced, changes were logged in the [release notes](https://github.com/phlex-ruby/phlex-rails/releases).
data/CODE_OF_CONDUCT.md DELETED
@@ -1,84 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
-
7
- We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
-
9
- ## Our Standards
10
-
11
- Examples of behavior that contributes to a positive environment for our community include:
12
-
13
- * Demonstrating empathy and kindness toward other people
14
- * Being respectful of differing opinions, viewpoints, and experiences
15
- * Giving and gracefully accepting constructive feedback
16
- * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
- * Focusing on what is best not just for us as individuals, but for the overall community
18
-
19
- Examples of unacceptable behavior include:
20
-
21
- * The use of sexualized language or imagery, and sexual attention or
22
- advances of any kind
23
- * Trolling, insulting or derogatory comments, and personal or political attacks
24
- * Public or private harassment
25
- * Publishing others' private information, such as a physical or email
26
- address, without their explicit permission
27
- * Other conduct which could reasonably be considered inappropriate in a
28
- professional setting
29
-
30
- ## Enforcement Responsibilities
31
-
32
- Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
-
34
- Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
-
36
- ## Scope
37
-
38
- This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
-
40
- ## Enforcement
41
-
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at joel@drapper.me. All complaints will be reviewed and investigated promptly and fairly.
43
-
44
- All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
-
46
- ## Enforcement Guidelines
47
-
48
- Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
-
50
- ### 1. Correction
51
-
52
- **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
-
54
- **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
-
56
- ### 2. Warning
57
-
58
- **Community Impact**: A violation through a single incident or series of actions.
59
-
60
- **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
-
62
- ### 3. Temporary Ban
63
-
64
- **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
-
66
- **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
-
68
- ### 4. Permanent Ban
69
-
70
- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
-
72
- **Consequence**: A permanent ban from any sort of public interaction within the community.
73
-
74
- ## Attribution
75
-
76
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
- available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
-
79
- Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
-
81
- [homepage]: https://www.contributor-covenant.org
82
-
83
- For answers to common questions about this code of conduct, see the FAQ at
84
- https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile DELETED
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
- git_source(:github) { |repo| "https://github.com/#{repo}.git" }
5
-
6
- gemspec
7
-
8
- gem "phlex", github: "phlex-ruby/phlex", branch: "1.10"
9
- gem "rubocop"
10
- gem "solargraph"
11
- gem "view_component"
12
- gem "appraisal", github: "excid3/appraisal", branch: "fix-bundle-env"
13
- gem "yard"
14
-
15
- gem "rails"
16
- gem "puma"
17
- gem "sqlite3"
data/SECURITY.md DELETED
@@ -1,5 +0,0 @@
1
- # Security Policy
2
-
3
- ## Reporting a Vulnerability
4
-
5
- If you found a possible security vulnerability in Phlex, please email security@phlex.fun.
data/config.ru DELETED
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "rubygems"
4
- require "bundler"
5
-
6
- Bundler.require :default, :development
7
-
8
- Combustion.initialize! :all
9
- run Combustion::Application
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ApplicationComponent < Phlex::HTML
4
- include Phlex::Rails::Helpers::Routes
5
-
6
- if Rails.env.development?
7
- def before_template
8
- comment { "Before #{self.class.name}" }
9
- super
10
- end
11
- end
12
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ApplicationLayout < ApplicationView
4
- include Phlex::Rails::Layout
5
-
6
- def view_template(&block)
7
- doctype
8
-
9
- html do
10
- head do
11
- title { "You're awesome" }
12
- meta name: "viewport", content: "width=device-width,initial-scale=1"
13
- csp_meta_tag
14
- csrf_meta_tags
15
- stylesheet_link_tag "application", data_turbo_track: "reload"
16
- javascript_importmap_tags
17
- end
18
-
19
- body do
20
- main(&block)
21
- end
22
- end
23
- end
24
- end
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ApplicationView < ApplicationComponent
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