8000 Logux::Rack integration by dreikanter · Pull Request #75 · logux/logux_rails · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

Logux::Rack integration #75

Merged
merged 14 commits into from
Oct 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log
This project adheres to [Semantic Versioning](http://semver.org/).

# 0.1
## 0.2
* Core Logux facilities are moved to `logux-rack` gem.
* `Logux::Actions` is soft-deprecated. Please use `Logux::Action` from now on.
* `Logux::Model::UpdatesDeprecator` is now coupled with `Logux::ActionCaller` via Logux configuration.

## 0.1.1
* Rails 6.0 support.

## 0.1
* Initial release.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

# Specify your gem's dependencies in logux_rails.gemspec
gemspec

# NOTE: Remove this line after logux-rack is released on rubygems
gem 'logux-rack', github: 'logux/logux-rack'
9 changes: 7 additions & 2 deletions README.md
B41A
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,22 @@ Logux.configuration do |config|
end
```

Mount logux in routes:
Mount `Logux::Rack` in your application routing configuration:

```ruby
# config/routes.rb
Rails.application.routes.draw do
mount Logux::Engine => '/'
end
```

After this, POST requests to `/logux` will be processed by `LoguxController`. You can redefine it or inherit from, if it necessary, for example, for implementing custom authorization flow.

Logux Rails will try to find Action for the specific message from Logux Server. For example, for `project/rename` action, you should define `Action::Project` class, inherited from `Logux::Action` base class, and implement `rename` method.

You can execute `rake logux:actions` to get the list of available action types, or `rake logux:channels` to get the list of available channels.
### Rake commands

Use `rails logux:actions` command to get the list of available action types, or `rails logux:channels` for channels. The default search path is set to `app/logux/actions` and `app/logux/channels` for actions and channels correspondingly, assuming `app` directory is the root of your Rails application. Both command support custom search paths: `rails logux:actions[lib/logux/actions]`.

## Development with Docker

Expand Down
41 changes: 0 additions & 41 deletions app/controllers/logux_controller.rb

This file was deleted.

3 changes: 1 addition & 2 deletions app/helpers/logux_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# frozen_string_literal: true

module LoguxHelper
end
module LoguxHelper; end
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

Logux::Engine.routes.draw do
resource :logux, only: %i[create], controller: :logux
mount Logux::Rack::App => '/'
end
107 changes: 0 additions & 107 deletions lib/logux.rb

This file was deleted.

42 changes: 0 additions & 42 deletions lib/logux/action_caller.rb

This file was deleted.

6 changes: 0 additions & 6 deletions lib/logux/action_controller.rb

This file was deleted.

29 changes: 0 additions & 29 deletions lib/logux/actions.rb

This file was deleted.

37 changes: 0 additions & 37 deletions lib/logux/add.rb

This file was deleted.

6 changes: 0 additions & 6 deletions lib/logux/auth.rb

This file was deleted.

37 changes: 0 additions & 37 deletions lib/logux/base_controller.rb

This file was deleted.

24 changes: 0 additions & 24 deletions lib/logux/channel_controller.rb

This file was deleted.

Loading
0