Project

ruby-elm

0.0
No commit activity in last 3 years
No release in over 3 years
Executable and ruby library to compiler elm files.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 2.3.2, ~> 2.3
>= 2.13.0, ~> 2.13
>= 4.6.4, ~> 4.6
~> 10.5
>= 3.3.0, ~> 3.3
~> 0.37
>= 0.10.0, ~> 0.10

Runtime

~> 0.13.0
 Project Readme

ruby-elm

Build Status [Gem Version](https://badge.fury .io/rb/ruby-elm)

Ruby wrapper over elm.

Allow to compile elm files using ruby.

Installation

Prerequisites

  • Tested against Ruby 2.3
  • elm make installed and available in $PATH

Setup

gem install ruby-elm

Usage

Library

require 'elm'

# Compile files to a string
Elm.compiler.files(['test.elm']).to_s

# Compile files to a file
# index.html
Elm.compiler.files(['test.elm']).to_file
# other output
Elm.compiler.files(['test.elm'],
  with_options: { output: 'out.js' }).to_file

# Compile content to a string or file
content = <<EOF
import Html exposing (text)

main =
  text "Hello, World!"

EOF
Elm.compiler.content(content).to_s
Elm.compiler.content(content).to_file

Some options are available:

  • output: String
  • yes: Bool
  • report: :normal/:json
  • warn: Bool
  • docs: String

When compile using Elm.compiler, yes is always forced as the ruby wrapper is not interactive.

Executable

The executable works as elm-make:

ruby-elm-make test.elm --warn --output out.js

yes is always forced as the wrapper is not interactive.

ToDo

Force json mode and extract warnings and errors to ruby objects.

Contributing

  1. Fork it
  2. Install dependencies (bundle install)
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Write and run tests (rspec)
  5. Commit your changes (git commit -am 'Add some feature)
  6. Push to the branch (git push origin my-new-feature)
  7. Create a new Pull Request

LICENSE

Please see LICENSE.

AUTHOR

Yves Brissaud, @_crev_, @eunomie