frails 0.8.1 → 0.8.2

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: 40e800d031dda8188539dcd2de1a7a39dcb8a8b92febb17f15c17584822d7413
4
- data.tar.gz: 571f9743b449c15ad36138f304921c8bce4b2749195699378dd63fe51cfca378
3
+ metadata.gz: a93cf0d24b2623de0992aac2576ee6644a6619b7ef19215fe9bb064c20420bcb
4
+ data.tar.gz: e7763d77d31ff21d4dd636a399e5877354eab31c09bf2a74354661afd8d18599
5
5
  SHA512:
6
- metadata.gz: c488c6f79278e55cc8597958119fa9584d62fa3c092886297096601a290103f1b31b3cba2278f0530f54370f36a7cd5e7682e99e1f756344bef26a70fcb00d9b
7
- data.tar.gz: a870cde84bdc3672353ad26197271159db22eeefa429a027e584babc2eb6499aaf035812adee88e36e2fae3feb28534ad46ea677ed31d7b4045f93ddcd18d5ea
6
+ metadata.gz: be38da133a5c64aeb15315341a14c267b8cf8c6af32097b3f01ab52341e7156854ed26c75ff231ce313b52753b8d53729014c20816e7909cebff28522ca1c805
7
+ data.tar.gz: 475867a9abb8594a0649cc9f770994f8b9c6b7530b6044e816d64445a7fb5c3e542598366c0ae922474c6a421a2042b9646db5fad82a1c4c9452c25c6d393138
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- frails (0.8.1)
4
+ frails (0.8.2)
5
5
  activesupport (>= 6.0)
6
6
  nokogiri (>= 1.10.4)
7
7
  rack-proxy (>= 0.6.5)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Frails
4
- VERSION = '0.8.1'
4
+ VERSION = '0.8.2'
5
5
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frails",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "A Modern [F]ront End on [Rails] and Webpack",
5
5
  "main": "index.js",
6
6
  "repository": "git@github.com:joelmoss/frails.git",
@@ -1,7 +1,10 @@
1
1
  const spawnSync = require("child_process").spawnSync;
2
2
  const path = require("path");
3
3
 
4
- const configFromRails = railsRun("print Frails.config_as_json");
4
+ const ioDelimiter = "__FRAILS_RAILS_RUNNER_DELIMETER__";
5
+ const configFromRails = railsRun(
6
+ `puts "${ioDelimiter}#{Frails.config_as_json}${ioDelimiter}"`
7
+ );
5
8
  const rootPath = process.cwd();
6
9
 
7
10
  module.exports = {
@@ -20,10 +23,18 @@ function railsRun(argument) {
20
23
  const result = spawnSync("./bin/rails", ["runner", argument]);
21
24
 
22
25
  if (result.status === 0) {
23
- return JSON.parse(result.stdout.toString());
26
+ // Output is delimited to filter out unwanted warnings or other output
27
+ // that we don't want in our files.
28
+ const sourceRegex = new RegExp(ioDelimiter + "([\\s\\S]+)" + ioDelimiter);
29
+ const matches = result.stdout.toString().match(sourceRegex);
30
+ if (matches) {
31
+ return JSON.parse(matches[1]);
32
+ } else {
33
+ throw "Rails runner failed having been unable to parse the output.";
34
+ }
24
35
  } else if (result.signal !== null) {
25
36
  throw `Rails runner was terminated with signal: ${result.signal}`;
26
37
  } else {
27
- throw `Rails runner failed with '${result.error.toString()}'.`;
38
+ throw `Rails runner failed with '${result.stderr.toString()}'.`;
28
39
  }
29
40
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Moss
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-10 00:00:00.000000000 Z
11
+ date: 2020-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport