purescript-rails 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e93b0301f3fddf16b881f67b639f5b5673be3a9f
4
- data.tar.gz: a75d55ffab637ac98b8ad5fb706a96cd4d64a3b5
3
+ metadata.gz: ffcc8014ea865d222c675d29478b8820566ab1db
4
+ data.tar.gz: 30fb086bc392b446d600dba6f211c5ae16bcac04
5
5
  SHA512:
6
- metadata.gz: 821166d1da8f99ce16b190dc723ef63593105ba419a7f2473896507c0f2a86c28eaa0bbef8be6efa46333e76d0eef9a23e9982f0478dda51841567387495172e
7
- data.tar.gz: c4b304698e86e4521e51bb48b638fb7da020f311a4a468f4f1e4420f56cfa9a67bcdcca9a848f6fa367a8df34c9da626518a39b7292234ae2f166ef272f8a801
6
+ metadata.gz: 86b3d357e67c1d5ad10ced46a9d62a0799c18326e75d4834711134812fcc727e013401e85c3221c0498f56f7c76ab77da505a3a6c0f66645693b25d3711f7475
7
+ data.tar.gz: 38d32b0f718fad3d20fa12bf9b10fffbab226899feb8dc42dfda2951f83d92ebb59addcc4975154351bdef62d86e88f61c7a040448e0b2b3b39680a3b58a6b9b
@@ -8,7 +8,17 @@ module PureScript
8
8
 
9
9
  def self.call(template)
10
10
  compiled_source = erb_handler.call(template)
11
- `psc --stdin #{compiled_source}`
11
+ Tempfile.open('purescript-', Rails.root.join('tmp')) do |f|
12
+ begin
13
+ f.write(compiled_source)
14
+ f.flush
15
+ output = `psc #{compiled_source} --main`
16
+ ensure
17
+ f.close
18
+ f.unlink
19
+ end
20
+ end
21
+ output
12
22
  end
13
23
  end
14
24
  end
@@ -1,5 +1,5 @@
1
1
  module PureScript
2
2
  module Rails
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -44,7 +44,7 @@ module PureScript
44
44
  end
45
45
 
46
46
  def evaluate(scope, locals, &block)
47
- @output ||= `psc #{file}`
47
+ @output ||= `psc #{file} --main`
48
48
  end
49
49
 
50
50
  def allows_script?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: purescript-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Fox