Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elorest/cry
Ability to execute crystal code in a fashion similar to pry edit.
https://github.com/elorest/cry
Last synced: about 2 months ago
JSON representation
Ability to execute crystal code in a fashion similar to pry edit.
- Host: GitHub
- URL: https://github.com/elorest/cry
- Owner: elorest
- License: mit
- Created: 2017-11-20T02:03:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-10-30T20:41:14.000Z (over 2 years ago)
- Last Synced: 2024-02-01T16:07:43.974Z (5 months ago)
- Language: Crystal
- Size: 459 KB
- Stars: 34
- Watchers: 4
- Forks: 33
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-crystal - cry - Ability to execute crystal code in a fashion similar to Ruby's pry edit (Official Documentation Translations)
- awesome-crystal - cry - Ability to execute crystal code in a fashion similar to Ruby's pry edit (Official Documentation Translations)
- awesome-crystal - cry - Ability to execute crystal code in a fashion similar to Ruby's pry edit (Official Documentation Translations)
README
# CRY
Evaluate crystal code from files and command lines similar to edit in ruby pry.
## Installation
Source
______```sh
curl -L https://github.com/elorest/cry/archive/master.tar.gz | tar xz
cd cry-master/
make install
```OSX Homebrew
____________```sh
brew install elorest/crystal/cry
```## Usage
1. *inline mode*: inline code specified in the command line as a string argument
- `cry Time.now`
1. *editor mode*: a terminal-based code editor is opened and the resulting code is executed once you save and exit
- `cry`... edit code in Vim... code runs.
1. *file mode*: code within an existing .cr file is copied to a tmp file for editing and run once editor is closed.
- `cry scripts/stuff.cr`
1. *back*: open and previous run in editor mode.
- `cry -b 1` ... copies previous run to tmp file for editing and runs when editor is closed.
1. *loop*: continuously edit and execute code.
- `cry -r -b 1` ... copies previous run to tmp file for editing and runs when editor is closed in a loop.
1. *log*: show a log of all previous runs.
- `cry --log`Here is a list of the commands available:
```sh
command [OPTIONS] [CODE]Arguments:
CODE Crystal code or .cr file to execute within the application scope
(default: )Options:
-b, --back Runs prevous command files: 'amber exec -b [times_ago]'
(default: 0)
-e, --editor Prefered editor: [vim, nano, pico, etc], only used when no code or .cr file is specified
(default: vim)
-l, --log Prints results of previous run
-r, --repeat Runs editor in a loop (can be combined with -b 1)
```## Contributing
1. Fork it ( https://github.com/elorest/cry/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request## Contributors
- [elorest](https://github.com/elorest) Isaac Sloan - creator, maintainer
- [lady-elorest](https://github.com/lady-elorest) Shauna Sloan - documentation