forml-rails 0.0.4 → 0.0.5

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.
@@ -1,23 +1,25 @@
1
1
  module Forml
2
+ class Error < StandardError; end
3
+
2
4
  class FormlEngine
3
5
  def initialize(file, options)
4
6
  @file = file
7
+ @forml = "forml"
5
8
  @options = options
6
9
  end
7
10
 
8
11
  def compile
9
12
  begin
10
13
  cmd = if ::Rails.env.production?
11
- %Q{forml #{@file} -silent -flush}
14
+ %Q{#{@forml} -silent -flush -no-test #{@file}}
12
15
  else
13
- %Q{forml #{@file} -silent -flush -no-opt}
16
+ %Q{#{@forml} -silent -flush -no-opt -no-test #{@file}}
14
17
  end
15
18
  puts cmd
16
19
  result = `#{cmd}`
17
- puts "Forml compiled!"
18
20
  result
19
21
  rescue Exception
20
- raise Error, "compression failed: #{result || $!}"
22
+ raise Error, "Compilation failed: #{result || $!}"
21
23
  end
22
24
  end
23
25
  end
@@ -1,3 +1,3 @@
1
1
  module Forml
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -6,7 +6,7 @@ module Forml
6
6
  source_root File.expand_path("../templates", __FILE__)
7
7
 
8
8
  def copy_forml
9
- template "javascript.js.forml", File.join('app/assets/javascripts', class_path, "#{file_name}.js.forml")
9
+ template "javascript.js.forml.erb", File.join('app/assets/javascripts', class_path, "#{file_name}.js.forml")
10
10
  end
11
11
  end
12
12
  end
@@ -0,0 +1,6 @@
1
+
2
+ module <%= name %>
3
+
4
+ main =
5
+ let greeting = "Welcome to Forml! This template is located in <%= name %>.js.forml"
6
+ do! `alert(greeting)`
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forml-rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Joshua Hawkins
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-01-10 00:00:00 Z
18
+ date: 2013-01-20 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: Enjoy Forml in your Rails with forml-rails, an adapter for the Rails asset pipeline.
@@ -41,7 +41,7 @@ files:
41
41
  - lib/forml/forml_template.rb
42
42
  - lib/forml/version.rb
43
43
  - lib/rails/generators/forml/assets/assets_generator.rb
44
- - lib/rails/generators/forml/assets/templates/javascript.js.forml
44
+ - lib/rails/generators/forml/assets/templates/javascript.js.forml.erb
45
45
  - test/lib/forml-rails_test.rb
46
46
  - test/lib/forml/version_test.rb
47
47
  - test/lib/rails/generators/forml/assets/assets_generator_test.rb
@@ -1 +0,0 @@
1
- TODO - make this an actual template