Skip to content

Commit

Permalink
Mimic CLI behavior to node, python or other repls, update doc and ver…
Browse files Browse the repository at this point in the history
…sions of npm and pip package.
  • Loading branch information
viferga committed Jan 23, 2020
1 parent 4dd06b2 commit 814e5e7
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 15 deletions.
4 changes: 1 addition & 3 deletions source/examples/metacallcli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,14 @@ install(TARGETS ${target}
# Define test
#

set(TEST_COMMAND_LINE_ARGS "test.mock")

if(WIN32)
set(TEST_COMMAND cmd /c)
else()
set(TEST_COMMAND sh -c)
endif()

add_test(NAME ${target}
COMMAND ${TEST_COMMAND} "echo 'inspect\nexit' | $<TARGET_FILE:${target}> ${TEST_COMMAND_LINE_ARGS}"
COMMAND ${TEST_COMMAND} "echo 'load mock a.mock\ninspect\nexit' | $<TARGET_FILE:${target}>"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)

Expand Down
6 changes: 2 additions & 4 deletions source/examples/metacallcli/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,8 @@ void application::parameter_iterator::operator()(const char * parameter)

const std::string tag = extension_to_tag[script.substr(script.find_last_of(".") + 1)];

if (!app.load(tag, script))
{
app.shutdown();
}
app.load(tag, script);
app.shutdown();
}

bool application::load(const std::string & tag, const std::string & script)
Expand Down
6 changes: 3 additions & 3 deletions source/ports/node_port/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Install MetaCall binaries first:
curl -sL https://raw.githubusercontent.com/metacall/install/master/install.sh | bash
```

Then install NodeJS package:
Then install MetaCall NodeJS package through MetaCall:
```bash
metacall install node metacall
metacall npm install metacall
```

# Example
Expand All @@ -38,5 +38,5 @@ metacall('sum', 3, 4); // 7
```

``` sh
metacall load node main.js
metacall main.js
```
2 changes: 1 addition & 1 deletion source/ports/node_port/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "metacall",
"version": "0.1.8",
"version": "0.1.9",
"description": "Call Python, C#, Ruby... functions from NodeJS (a NodeJS Port for MetaCall)",
"repository": "github:metacall/core",
"bugs": "https://github.com/metacall/core/issues",
Expand Down
6 changes: 3 additions & 3 deletions source/ports/py_port/package/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ Install MetaCall binaries first:
curl -sL https://raw.githubusercontent.com/metacall/install/master/install.sh | bash
Then install Python package through MetaCall:
Then install MetaCall Python package through MetaCall:

.. code:: console
metacall install py metacall
metacall pip3 install metacall
Example
========
Expand All @@ -52,4 +52,4 @@ Running the example:

.. code:: console
metacall load py main.py
metacall main.py
2 changes: 1 addition & 1 deletion source/ports/py_port/package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
'version': '0.1.17',
'version': '0.1.18',

'description': 'A library for providing inter-language foreign function interface calls',
'long_description': long_description,
Expand Down

0 comments on commit 814e5e7

Please sign in to comment.