Giter Site home page Giter Site logo

repl's Introduction

DEPRECATED / ARCHIVED

This functionality is now available in the far more streamlined project https://github.com/lfe-rebar3/rebar3_lfe

lfe-repl

The LFE rebar3 REPL plugin

Contents

Build

$ rebar3 compile

Use

Add the required plugins and provider hooks to your rebar.config:

{plugins, [
  {'lfe-compile',
    {git, "https://github.com/lfe-rebar3/compile.git", {tag, "0.4.0"}}},
  {'lfe-repl',
    {git, "https://github.com/lfe-rebar3/repl.git", {tag, "0.2.1"}}}
]}.

{provider_hooks, [
   {pre, [{compile, {lfe, compile}}]}
  ]}.

Then just call your plugin directly from your project directory:

$ rebar3 help lfe repl

The LFE rebar3 LFE REPL plugin.

Start an LFE REPL for a project with its dependencies preloaded, similar to
'lfe -pa ebin -pa deps/*/ebin' with support for -name and -sname parameters.
$ rebar3 lfe repl

LFE Shell V7.0 (abort with ^G)
>

repl's People

Contributors

oubiwann avatar yurrriq avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

repl's Issues

Only plugin libs are getting added to the path

The dependency libs aren't getting added. For ltool, this means the following are not accessible in the REPL:

$ ls -l _build/default/lib/
drwxr-xr-x  14 oubiwann  wheel  476 Nov 21 22:00 clj
drwxr-xr-x  12 oubiwann  wheel  408 Nov 21 22:00 color
drwxr-xr-x  13 oubiwann  wheel  442 Nov 21 22:00 kla
drwxr-xr-x  26 oubiwann  wheel  884 Nov 21 22:00 lfe
drwxr-xr-x  15 oubiwann  wheel  510 Nov 21 22:00 ltest
drwxr-xr-x   6 oubiwann  staff  204 Nov 21 22:00 ltool
drwxr-xr-x  14 oubiwann  wheel  476 Nov 21 22:00 lutil

This can be seen by examining the paths:

> (lists:foreach (lambda (x) (io:format "~p~n" `(,x))) (code:get_path))
"/Users/oubiwann/lab/lfe/rebar3/ltool/_build/default/plugins/lfe-clean/ebin"
"/Users/oubiwann/lab/lfe/rebar3/ltool/_build/default/plugins/clj/ebin"
"/Users/oubiwann/lab/lfe/rebar3/ltool/_build/default/plugins/lfe/ebin"
"/Users/oubiwann/lab/lfe/rebar3/ltool/_build/default/plugins/kla/ebin"
"/Users/oubiwann/lab/lfe/rebar3/ltool/_build/default/plugins/lfe-compile/ebin"
"/Users/oubiwann/lab/lfe/rebar3/ltool/_build/default/plugins/lfe-repl/ebin"
"/Users/oubiwann/lab/lfe/rebar3/ltool/_build/default/plugins/lfe-version/ebin"
"/usr/local/bin/rebar3/ssl_verify_hostname/ebin"
"/usr/local/bin/rebar3/relx/ebin"
"/usr/local/bin/rebar3/rebar/ebin"
"/usr/local/bin/rebar3/providers/ebin"
"/usr/local/bin/rebar3/getopt/ebin"
"/usr/local/bin/rebar3/eunit_formatters/ebin"
"/usr/local/bin/rebar3/erlware_commons/ebin"
"/usr/local/bin/rebar3/cth_readable/ebin"
"/usr/local/bin/rebar3/cf/ebin"
"/usr/local/bin/rebar3/certifi/ebin"
"/usr/local/bin/rebar3/bbmustache/ebin"
"/usr/local/bin/rebar3"
"."
"/opt/erlang/18.0/lib/kernel-4.0/ebin"
"/opt/erlang/18.0/lib/stdlib-2.5/ebin"
"/opt/erlang/18.0/lib/xmerl-1.3.8/ebin"
"/opt/erlang/18.0/lib/wx-1.4/ebin"
"/opt/erlang/18.0/lib/webtool-0.9/ebin"
"/opt/erlang/18.0/lib/typer-0.9.9/ebin"
"/opt/erlang/18.0/lib/tools-2.8/ebin"
"/opt/erlang/18.0/lib/test_server-3.9/ebin"
"/opt/erlang/18.0/lib/syntax_tools-1.7/ebin"
"/opt/erlang/18.0/lib/ssl-7.0/ebin"
"/opt/erlang/18.0/lib/ssh-4.0/ebin"
"/opt/erlang/18.0/lib/snmp-5.2/ebin"
"/opt/erlang/18.0/lib/sasl-2.5/ebin"
"/opt/erlang/18.0/lib/runtime_tools-1.9/ebin"
"/opt/erlang/18.0/lib/reltool-0.7/ebin"
"/opt/erlang/18.0/lib/public_key-1.0/ebin"
"/opt/erlang/18.0/lib/percept-0.8.11/ebin"
"/opt/erlang/18.0/lib/parsetools-2.1/ebin"
"/opt/erlang/18.0/lib/otp_mibs-1.1/ebin"
"/opt/erlang/18.0/lib/ose-1.1/ebin"
"/opt/erlang/18.0/lib/os_mon-2.4/ebin"
"/opt/erlang/18.0/lib/orber-3.8/ebin"
"/opt/erlang/18.0/lib/observer-2.1/ebin"
"/opt/erlang/18.0/lib/mnesia-4.13/ebin"
"/opt/erlang/18.0/lib/megaco-3.18/ebin"
"/opt/erlang/18.0/lib/jinterface-1.6/ebin"
"/opt/erlang/18.0/lib/inets-6.0/ebin"
"/opt/erlang/18.0/lib/ic-4.4/ebin"
"/opt/erlang/18.0/lib/hipe-3.12/ebin"
"/opt/erlang/18.0/lib/gs-1.6/ebin"
"/opt/erlang/18.0/lib/eunit-2.2.10/ebin"
"/opt/erlang/18.0/lib/et-1.5.1/ebin"
"/opt/erlang/18.0/lib/erts-7.0/ebin"
"/opt/erlang/18.0/lib/erl_interface-3.8/ebin"
"/opt/erlang/18.0/lib/erl_docgen-0.4/ebin"
"/opt/erlang/18.0/lib/eldap-1.2/ebin"
"/opt/erlang/18.0/lib/edoc-0.7.17/ebin"
"/opt/erlang/18.0/lib/diameter-1.10/ebin"
"/opt/erlang/18.0/lib/dialyzer-2.8/ebin"
"/opt/erlang/18.0/lib/debugger-4.1/ebin"
"/opt/erlang/18.0/lib/crypto-3.6/ebin"
"/opt/erlang/18.0/lib/cosTransactions-1.3/ebin"
"/opt/erlang/18.0/lib/cosTime-1.2/ebin"
"/opt/erlang/18.0/lib/cosProperty-1.2/ebin"
"/opt/erlang/18.0/lib/cosNotification-1.2/ebin"
"/opt/erlang/18.0/lib/cosFileTransfer-1.2/ebin"
"/opt/erlang/18.0/lib/cosEventDomain-1.2/ebin"
"/opt/erlang/18.0/lib/cosEvent-2.2/ebin"
"/opt/erlang/18.0/lib/compiler-6.0/ebin"
"/opt/erlang/18.0/lib/common_test-1.11/ebin"
"/opt/erlang/18.0/lib/asn1-4.0/ebin"
ok

lfe repl task doesn't do anything with the passed options

The LFE REPL rebar3 plugin is derived from the rebar3 Erlang shell plugin. It is written to accept options, as noted in the help:

The LFE rebar3 LFE REPL plugin.

Start an LFE REPL for a project with its dependencies preloaded, similar to
'lfe -pa ebin -pa deps/*/ebin' with support for -name and -sname parameters.

Usage: rebar3 lfe repl [--name <name>] [--sname <sname>] [--apps <apps>]

  --name   Gives a long name to the node.
  --sname  Gives a short name to the node.
  --apps   A list of apps to boot before starting the shell. (E.g. --apps
           app1,app2,app3) Defaults to rebar.config {shell, [{apps,
           Apps}]} or relx apps if not specified.

However, passing values for these doesn't seem to chanve anything. This may actually be due to the way the LFE shell is written (you may not be able to set these options when starting lfe_shell:server as it is currently written -- will need to confer with @rvirding on that ... we've talked about this on the mail list and in other tickets, I just need to be sure).

Erratic behaviour in the rebar3 repl

I've installed the lfe-repl plugin for rebar3 alongside lfe-compile. However, the lfe-repl plugin offers a REPL with a different behaviour from the standard LFE REPL. For example, I can't fetch the history since the keyboard's up and down arrow are not decoded properly and I can't also move around with the cursor with the left and right arrow keys for the same reason.

I'm on MacOS Sierra.

Error starting repl

I try a very simple:

    rebar3 new release foo
    cd foo
    edit rebar.config
    # just add one line:
    # {plugins, [{'lfe-repl', {git, "https://github.com/lfe-rebar3/repl.git", {tag, "0.1.1"}}}]}.
    rebar3 lfe shell

and that fails.
There is an error. It starts with:

    ===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace
    ===> Uncaught error: function_clause
    ===> Stack trace to the error location: [{proplists,get_value,
                                                     [applications,
                                                      {ok,
                                                       [{description,
                                                         "SASL  CXC 138 11"},
                                                        {id,[]},
                                                        {vsn,"2.6.1"},
                                                        {modules,
                                                         [sasl,alarm_handler,
                                                          format_lib_supp,
                                                          misc_supp,overload,rb,
                                                          rb_format_supp,
                                                          release_handler,
                                                          release_handler_1,
                                                          erlsrv,sasl_report,
                                                          sasl_report_tty_h,
                                                          sasl_report_file_h,si,
                                                          si_sasl_supp,systools,
                                                          systools_make,
                                                          systools_rc,
                                                          systools_relup,
                                                          systools_lib]},
                                                        {maxP,infinity},
                                                        {maxT,infinity},

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.