README.md in cogy-0.0.2 vs README.md in cogy-0.0.3
- old
+ new
@@ -1,38 +1,54 @@
# Cogy
-Cogy provides a way to integrate Cog with Rails apps, in a way that managing
-and adding commands is a breeze.
+Cogy integrates [Cog](https://operable.io/) with Rails
+in a way that managing commands becomes a breeze.
+## Status
+
+*DISCLAIMER*: While we use Cogy in production, it's still in public alpha and
+is under heavy development.
+
+This means that a few critical bits are missing (the Relay executable and
+RSpec helpers to name a few) and the API is not stable yet.
+
+However, feel free to test it and gives us your feedback!
+
## Why
-Creating a command that talks with a Rails app, typically involves writing
+Creating a Cog command that talks with a Rails app typically involves writing
a route, maybe a controller, an action and code to handle the command arguments
and options.
-This is a repetitive task and Cogy provides a way to get rid of this tedious
-boilerplate code.
+This is a tedious and repetitive task and involves writing a lot of boilerplate
+code each time someone wants to add a new command.
-With Cogy, writing a new command is as simple as adding the following line
+Cogy is an opinionated library that provides a way to get rid of all the
+repetitive work and makes writing commands a breeze!
+
+Making a new command available for use is as simple as adding the following line
to a file in your application:
```ruby
# in cogy/my_commands.rb
-on "foo", desc: "Echo a foo bar back at you!" do |req_args, _, user|
+on "foo", desc: "Echo a foo bar back at you!" do |_args, _opts, user|
"@#{user}: foo bar"
end
```
+...and deploying!
+
## How it works
Cogy is essentially three things:
-1. An opinionated way to build commands: All Cogy commands are defined in your
- Rails app and end up in a single executable within the Relay (see below).
- Cogy provides versioning and dynamically generates the bundle config, which
- is also served by your Rails app. This, accompanied with the command [TODO: INSERT LINK HERE] that
+1. An opinionated way to write, manage & ship commands: All Cogy commands are
+ defined in your Rails app and end up invoking a single executable within the
+ Relay (see below). Cogy provides versioning and dynamically generates the
+ bundle config, which is also served by your Rails app (via a Rails Engine).
+ This, accompanied with the command [TODO: INSERT LINK HERE] that
can install bundles from other bundles, makes it possible to automatically
install the newly-written commands by invoking a trigger when you deploy
your app.
2. A Rails Engine that is mounted in your application and routes the incoming
requests to their user-defined handlers. It also creates the `/inventory`
@@ -118,11 +134,11 @@
# in cogy/commands.rb
on "calc",
args: [:a, :b],
opts: { op: { type: "string", required: true, short_flag: "o" } },
desc: "Performs a calculation between numbers <a> and <b>",
- example: "!myapp:calc sum 1 2" do |req_args, req_opts, user|
+ examples: "!myapp:calc sum 1 2" do |req_args, req_opts, user|
op = req_opts[:op].to_sym
result = req_args.map(&:to_i).inject(&op)
"Hello @#{user}, the result is: #{result}"
end
```
@@ -142,13 +158,11 @@
`app/views/cogy/error.text.erb`.
## Authors
* [Agis Anastasopoulos](https://github.com/agis-)
+* [Mpampis Kostas](https://github.com/charkost)
## License
Cogy is licensed under MIT. See [LICENSE](LICENSE).
-
-
-