turbo_reflex 0.0.20 → 0.0.21

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: b4f13b4fc982df84856930201eb9cda65ffe0487a7a483f455d29f1e6f8cecd0
4
- data.tar.gz: 28545eed0c26f068117514a1fa611ce816d67bdd957b88f12422648489f35543
3
+ metadata.gz: 14ea470bd66a4d392babd0d00d219091b5a778f9723383cc0746ea1ce58a3cc0
4
+ data.tar.gz: 14cbf3b9d078897ac2e4d00810a9988d5e5781339a2271e9565d26b2a5fffe31
5
5
  SHA512:
6
- metadata.gz: 73f534399ae27474b6fe9d9d99449880d1d4cb6a2f64164b120e3debb0f55101d1376c4ef68a764cb1234c45ce7b17ab35f17c7d4932d33a3f5d1d44792c7bb9
7
- data.tar.gz: 43b1537cfe4b33f38afd5bcc520e77290bec5cac8a31d95837dfbae938d32b5251e3acd4c830a933cd7eb8c3fb8deecafef76484c8553772187f47911f685572
6
+ metadata.gz: 2483370dcdd02c59cfcdadfd84826f7c87ae64151d8fbc8a226df8b0055812c860b8347bdecdb5ad745b0a395e564159300278f05a5fbb102deff3bc5821b82e
7
+ data.tar.gz: b9bf3a744c88330bf715abdb16da828712183fd005366c7ebb730e2dd170e0e68cb06c913f9589a2955ffc0233de5643ce46d6647c17482e234aef8d33378cf8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- turbo_reflex (0.0.20)
4
+ turbo_reflex (0.0.21)
5
5
  rails (>= 6.1)
6
6
  turbo-rails (>= 1.1)
7
7
  turbo_ready (>= 0.1)
data/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
  </h1>
9
9
  <p align="center">
10
10
  <a href="http://blog.codinghorror.com/the-best-code-is-no-code-at-all/">
11
- <img alt="Lines of Code" src="https://img.shields.io/badge/loc-1182-47d299.svg" />
11
+ <img alt="Lines of Code" src="https://img.shields.io/badge/loc-1187-47d299.svg" />
12
12
  </a>
13
13
  <a href="https://codeclimate.com/github/hopsoft/turbo_reflex/maintainability">
14
14
  <img src="https://api.codeclimate.com/v1/badges/fe1162a742fe83a4fdfd/maintainability" />
@@ -267,10 +267,16 @@ class TurboReflex::Runner
267
267
  sanitized_content = content_sanitizer.sanitize(content).html_safe
268
268
  return if sanitized_content.blank?
269
269
 
270
+ # TODO: setup negative lookahead instead of using match
270
271
  case response_type
271
- when :body then response.body.sub!(/<\/\s*body.*>/i, "#{sanitized_content}</body>")
272
- when :frame then response.body.sub!(/<\/\s*turbo-frame.*>/i, "#{sanitized_content}</turbo-frame>")
273
- else response_body << sanitized_content
272
+ when :body
273
+ match = response.body.match(/<\/\s*body.*>/i).to_s
274
+ response.body.sub!(match, match.prepend(sanitized_content))
275
+ when :frame
276
+ match = response.body.match(/<\/\s*turbo-frame.*>/i).to_s
277
+ response.body.sub!(match, match.prepend(sanitized_content))
278
+ else
279
+ response_body << sanitized_content
274
280
  end
275
281
  rescue => error
276
282
  Rails.logger.error "TurboReflex::Runner failed to append to the response! #{error.message}"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TurboReflex
4
- VERSION = "0.0.20"
4
+ VERSION = "0.0.21"
5
5
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turbo_reflex",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "description": "Reflexes for Turbo Frames that help you build robust reactive applications",
5
5
  "main": "app/javascript/index.js",
6
6
  "repository": "https://github.com/hopsoft/turbo_reflex",
data/tags CHANGED
@@ -216620,7 +216620,7 @@ VDash node_modules/parse-srcset/tests/he.js /^ var decodeMap = {'Aacute':'\\xC1'
216620
216620
  VDash node_modules/simple-html-tokenizer/dist/es6/index.js /^ Aacute: "Á", aacute: "á", Abreve: "Ă", abreve: "ă", ac: "∾", acd: "∿", acE: "∾̳",/;" p variable:namedCharRefs
216621
216621
  VDash node_modules/simple-html-tokenizer/dist/simple-html-tokenizer.js /^ Aacute: "Á", aacute: "á", Abreve: "Ă", abreve: "ă", ac: "∾", acd: "∿", acE: "∾/;" p variable:anonymousFunction3825d8d70300.namedCharRefs
216622
216622
  VDash node_modules/simple-html-tokenizer/dist/types/generated/html5-named-char-refs.d.ts /^ VDash: string;$/;" C
216623
- VERSION lib/turbo_reflex/version.rb /^ VERSION = "0.0.20"$/;" C module:TurboReflex
216623
+ VERSION lib/turbo_reflex/version.rb /^ VERSION = "0.0.21"$/;" C module:TurboReflex
216624
216624
  VERSION node_modules/@angular/compiler/esm2015/src/output/source_map.js /^const VERSION = 3;$/;" C
216625
216625
  VERSION node_modules/@angular/compiler/esm2015/src/version.js /^export const VERSION = new Version('8.2.14');$/;" C
216626
216626
  VERSION node_modules/@angular/compiler/esm5/src/output/source_map.js /^var VERSION = 3;$/;" v
@@ -468457,7 +468457,7 @@ version node_modules/yaml/dist/index.js /^ version: '1.2'$/;" p variable:defaul
468457
468457
  version node_modules/yaml/dist/test-events.js /^ version: '1.2'$/;" p variable:testEvents.anonymousObjecta2b129440205
468458
468458
  version node_modules/yaml/package.json /^ "version": "1.8.3",$/;" s
468459
468459
  version node_modules/yocto-queue/package.json /^ "version": "0.1.0",$/;" s
468460
- version package.json /^ "version": "0.0.19",$/;" s
468460
+ version package.json /^ "version": "0.0.20",$/;" s
468461
468461
  versionIncluded node_modules/prettier-standard/src/vendor/node_modules/resolve/lib/core.js /^function versionIncluded(specifierValue) {$/;" f
468462
468462
  versionIncluded node_modules/resolve/lib/core.js /^function versionIncluded(specifierValue) {$/;" f
468463
468463
  versionInfo node_modules/graphql/version.d.ts /^export const versionInfo: {$/;" C
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo_reflex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate Hopkins (hopsoft)