phlex-rails 0.10.0 → 1.0.0

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: 555800cbdaf17b6f8b17c861a26a3d3db5d189dc85ac2bb8e4a91ee01a3451a5
4
- data.tar.gz: e6f95ee6e6ed074cb90ed8b5761fca2e5885879a6237e53287c9d19a0f7c3dc5
3
+ metadata.gz: 7b847ffd983ba4161668179eb395ccbfd50ee216892ffb7124bdacaa584a9e0a
4
+ data.tar.gz: e34aa3c4e6053b913f09f325ce11e16e6152afed5fecd18857a3ee634a735034
5
5
  SHA512:
6
- metadata.gz: 5ebedcdc21e1b898181068e2d71b15c8679c00cb66fc3f923fac36151a37fce36ad2486d7e561e6d9af8de82ea1c975d37e72b40bb01ac00a51a2e3ed2a770f1
7
- data.tar.gz: d3f0a529298f5ae7ce3c1b1628488b076a596bef03225a158baa54a80fd28282072c8d88344d5c0c21ff3071d7023d9765a3545dace66bce7f7ca4c54d8f7624
6
+ metadata.gz: e955615cd2b7ac990742dd35028d524f74f8f05f0799ede53f793435344d1b3c7db6b99c87fb2f3fedef50f016f53d7f3cf32070ab7894be1b86c734b93cca76
7
+ data.tar.gz: 675126fe1bc74b22ee7ec284f0048ca4051a4fb3ea863fe916c8c48c745ca1ea431ed84569fda5d6b9ce046a58fd67f3b11f3e78bab25f4496074fc7e55d8e8a
data/.yardopts ADDED
@@ -0,0 +1 @@
1
+ --private --hide-api private --markup markdown --exclude lib/generators
data/CHANGELOG.md CHANGED
@@ -2,14 +2,20 @@
2
2
 
3
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
4
 
5
+ ## [1.0.0] 2023-04-19
6
+
7
+ ### Added
8
+
9
+ - Added an adapter for the pluralize view helper.
10
+
5
11
  ## 0.10.0
6
12
 
7
- Added
13
+ ### Added
8
14
 
9
15
  - You can now render procs and lambdas and enumerables of renderables.
10
16
  - Experimental streaming interface
11
17
 
12
- Fixed
18
+ ### Fixed
13
19
 
14
20
  - Escaped ERB captures
15
21
  - Use buffered component unless renderin in a template
data/Gemfile CHANGED
@@ -13,3 +13,4 @@ gem "rubocop"
13
13
  gem "solargraph"
14
14
  gem "view_component"
15
15
  gem "appraisal", github: "excid3/appraisal", branch: "fix-bundle-env"
16
+ gem "yard"
@@ -4,6 +4,7 @@ require "forwardable"
4
4
 
5
5
  module Phlex::Rails
6
6
  # A decorator that buffers all missing method calls and captures the blocks passed to them.
7
+ # @api private
7
8
  class Buffered < BasicObject
8
9
  extend ::Forwardable
9
10
 
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Phlex::Rails
4
+ # @api private
4
5
  class BufferedCheckboxBuilder < Buffered
5
6
  # @!method object(...)
6
7
  # @!method text(...)
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Phlex::Rails
4
+ # @api private
4
5
  class BufferedFormBuilder < Buffered
5
6
  # @!method field_id(...)
6
7
  # @!method field_name(...)
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Phlex::Rails
4
+ # @api private
4
5
  class BufferedLabelBuilder < Buffered
5
6
  # @!method object(...)
6
7
  # @!method translation(...)
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Phlex::Rails
4
+ # @api private
4
5
  class BufferedRadioButtonBuilder < Buffered
5
6
  # @!method object(...)
6
7
  # @!method text(...)
@@ -4,6 +4,7 @@ require "rails/engine"
4
4
 
5
5
  module Phlex
6
6
  module Rails
7
+ # @api private
7
8
  class Engine < ::Rails::Engine
8
9
  end
9
10
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  module Phlex
4
4
  module Rails
5
+ # @api private
5
6
  class Form < Phlex::HTML
6
7
  def initialize(model)
7
8
  @model = model
@@ -883,6 +883,14 @@ module Phlex::Rails::Helpers
883
883
  define_output_helper :phone_field_tag
884
884
  end
885
885
 
886
+ module Pluralize
887
+ extend Phlex::Rails::HelperMacros
888
+
889
+ # @!method pluralize(...)
890
+ # @return [String]
891
+ define_value_helper :pluralize
892
+ end
893
+
886
894
  module PreloadLinkTag
887
895
  extend Phlex::Rails::HelperMacros
888
896
 
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # @api private
3
4
  module Phlex::Rails::HTML::Format
4
5
  def format
5
6
  :html
@@ -13,6 +13,7 @@ module Phlex::Rails
13
13
  include Helpers::JavaScriptImportMapTags
14
14
  include Helpers::JavaScriptImportModuleTag
15
15
 
16
+ # @api private
16
17
  module Interface
17
18
  def render(view, _locals, &block)
18
19
  component = new
@@ -60,6 +60,7 @@ module Phlex
60
60
  super&.html_safe
61
61
  end
62
62
 
63
+ # @api private
63
64
  def __text__(content)
64
65
  case content
65
66
  when ActiveSupport::SafeBuffer
@@ -69,7 +70,7 @@ module Phlex
69
70
  end
70
71
  end
71
72
 
72
- # @api experimental
73
+ # @api private
73
74
  def await(task)
74
75
  if task.is_a?(ActiveRecord::Relation)
75
76
  flush unless task.loaded?
@@ -81,6 +82,7 @@ module Phlex
81
82
  end
82
83
 
83
84
  # Trick ViewComponent into thinking we're a ViewComponent to fix rendering output
85
+ # @api private
84
86
  def set_original_view_context(view_context)
85
87
  end
86
88
  end
@@ -1,8 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # @api experimental
3
+ # @api private
4
4
  module Phlex::Rails::Streaming
5
- private def stream(view)
5
+ private
6
+
7
+ def stream(view)
6
8
  headers.delete("Content-Length")
7
9
 
8
10
  headers["X-Accel-Buffering"] = "no"
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # @api private
3
4
  module Phlex::Rails::UnbufferedOverrides
4
5
  def method_missing(name, *args, **kwargs, &block)
5
6
  if @object.respond_to?(name)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Phlex
4
4
  module Rails
5
- VERSION = "0.10.0"
5
+ VERSION = "1.0.0"
6
6
  end
7
7
  end
data/lib/phlex/rails.rb CHANGED
@@ -22,11 +22,13 @@ module Phlex
22
22
  prepend Phlex::Rails::SGML::Overrides
23
23
  end
24
24
 
25
+ # @api private
25
26
  class HTML
26
27
  extend Phlex::Rails::HTML::Format
27
28
  include Phlex::Rails::HTML::Format
28
29
  end
29
30
 
31
+ # @api private
30
32
  class Unbuffered
31
33
  prepend ::Phlex::Rails::UnbufferedOverrides
32
34
  end
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: 0.10.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Drapper
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-18 00:00:00.000000000 Z
11
+ date: 2023-04-19 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: 1.7.0
19
+ version: '1.7'
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.7.0
26
+ version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -68,6 +68,7 @@ files:
68
68
  - ".editorconfig"
69
69
  - ".rubocop.yml"
70
70
  - ".ruby-version"
71
+ - ".yardopts"
71
72
  - Appraisals
72
73
  - CHANGELOG.md
73
74
  - CODE_OF_CONDUCT.md