custom_tag 0.2.0 → 0.3.1

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: 0dfccbf62198fd61a1e7ea003c67c1ceb3391581993e0c5005e205e1c5b2c165
4
- data.tar.gz: 19606024d58651af802af5e588b34517c690c862cd394dba8046265a043b5e33
3
+ metadata.gz: aba8f2f968ae1d62894e5aa84c4847e4402f8de6d3a5bec3b15b35fb80e06729
4
+ data.tar.gz: 5516364edb4df8a9da7797b31782182bfe52ef220c9c02bf251173223d45744b
5
5
  SHA512:
6
- metadata.gz: 554eb2aaa0f13e077e0309a9268a7bf80165473a24c36a4784b9fbf6659644c11d7ea08ee2ec77215765c5766be66f069c5f644389029f01ce226ad6e784f44a
7
- data.tar.gz: 33ef60f7c42ca57dec42022e2fda73d4e545574964a23ee86e70653dc307e378a00658f6b6b06a22fb041f3d729ff68c76cf7c735a2934fd05ee86efdbdc00a8
6
+ metadata.gz: 134db783451bce7d6776782c27277e3a55007454339ef3576cb82027f299d8bd2c120c56fc76acbd1bff04f118e95c49403954731d70d9ed6831f1abd82494c5
7
+ data.tar.gz: 1f0636438ddd5296a9717eb1dd1a85e5dc5c777f6965b2d94f173b9d846299cebce0263aeb3e3e0a1a48de14dc2b6a0277d5858f8c230fee3939738d1b68ca7d
data/.rubocop.yml CHANGED
@@ -62,6 +62,8 @@ Lint/StructNewOverride:
62
62
  Enabled: true
63
63
  Style/ExponentialNotation:
64
64
  Enabled: true
65
+ Style/ClassVars:
66
+ Enabled: false
65
67
  Style/HashEachMethods:
66
68
  Enabled: true
67
69
  Style/Documentation:
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # CHANGELOG for CustomTag
2
2
 
3
+ ## 0.3.1 - 16 August 2023
4
+
5
+ Handling `ActionDispatch::Response::RackBody` as well as array body responses.
6
+
7
+ ## 0.3.0 - 16 August 2023
8
+
9
+ Configured Railtie to correctly use Rack middleware.
10
+
3
11
  ## 0.2.0 - 9 July 2023
4
12
 
5
13
  Rack middleware implemented and documentation written.
data/Gemfile CHANGED
@@ -11,5 +11,6 @@ gem "rspec", "~> 3.0"
11
11
 
12
12
  gem "rubocop"
13
13
  gem "rubocop-performance"
14
+ gem 'rubocop-rake', require: false
14
15
 
15
16
  gem "rack"
data/Gemfile.lock CHANGED
@@ -51,6 +51,8 @@ GEM
51
51
  rubocop-performance (1.18.0)
52
52
  rubocop (>= 1.7.0, < 2.0)
53
53
  rubocop-ast (>= 0.4.0)
54
+ rubocop-rake (0.6.0)
55
+ rubocop (~> 1.0)
54
56
  ruby-progressbar (1.13.0)
55
57
  unicode-display_width (2.4.2)
56
58
 
@@ -65,6 +67,7 @@ DEPENDENCIES
65
67
  rspec (~> 3.0)
66
68
  rubocop
67
69
  rubocop-performance
70
+ rubocop-rake
68
71
 
69
72
  BUNDLED WITH
70
73
  2.4.6
data/Rakefile CHANGED
@@ -2,7 +2,12 @@
2
2
 
3
3
  require "bundler/gem_tasks"
4
4
  require "rspec/core/rake_task"
5
+ require "rubocop/rake_task"
5
6
 
6
7
  RSpec::Core::RakeTask.new(:spec)
7
8
 
8
9
  task default: %i[spec rubocop]
10
+
11
+ RuboCop::RakeTask.new do |task|
12
+ task.requires << 'rubocop-rake'
13
+ end
data/custom_tag.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = "CustomTag allows you to use custom HTML tags in your Rails project and have them be replaced with standard HTML tags and attributes"
12
12
  spec.description = "Jealous of custom <tags> in JS frameworks and want them in your Rails apps? CustomTag allows you to use custom HTML tags in your Rails project and have them be replaced with standard HTML tags and attributes."
13
13
  spec.homepage = "https://github.com/andyjeffries/customtag"
14
- spec.required_ruby_version = ">= 2.6.0"
14
+ spec.required_ruby_version = ">= 2.7.0"
15
15
 
16
16
  # spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
17
17
 
@@ -7,9 +7,15 @@ module CustomTag
7
7
  def call(env)
8
8
  code, headers, response = @app.call(env)
9
9
 
10
- response[0] = CustomTag.parse_and_replace(response[0]) if headers["Content-Type"]&.include?("text/html")
10
+ response_body = if response.respond_to?(:body)
11
+ response.body
12
+ else
13
+ response[0]
14
+ end
11
15
 
12
- [code, headers, response]
16
+ response_body = CustomTag.parse_and_replace(response_body) if headers["Content-Type"]&.include?("text/html")
17
+
18
+ [code, headers, [response_body]]
13
19
  end
14
20
  end
15
21
  end
@@ -1,7 +1,7 @@
1
1
  if defined?(Rails::Railtie)
2
2
  module CustomTag
3
3
  class Railtie < Rails::Railtie
4
- initializer do |app|
4
+ initializer "custom_tag.configure_rails_installation" do |app|
5
5
  app.middleware.use Middleware
6
6
  end
7
7
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CustomTag
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: custom_tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Jeffries
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-09 00:00:00.000000000 Z
11
+ date: 2023-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -63,7 +63,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
63
63
  requirements:
64
64
  - - ">="
65
65
  - !ruby/object:Gem::Version
66
- version: 2.6.0
66
+ version: 2.7.0
67
67
  required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  requirements:
69
69
  - - ">="