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
8000
Merged

Logux::Rack integration #75

merged 14 commits into from
Oct 7, 2019

Conversation

dreikanter
Copy link
Contributor
@dreikanter dreikanter commented Oct 4, 2019

Summary

⚠️ This PR depends on logux/logux-rack#4

This patch replicates my logux_rails update with some post-merge fixes. It reduces gem responsibility scope to Rails-specific features after core Logux back-end server functionality was moved to logux-rack.

Project updates

  1. Core Logux facilities are moved to logux-rack.
  2. logux-rack is aded to the logux_rails dependencies.
  3. Logux::Model::UpdatesDeprecator is coupled with Logux::ActionCaller (from logux-rack gem) via Logux configuration.
  4. Gem version is bumped to 0.2.0.
  5. Readme is updated.
  6. Changelog.

Further improvements

It makes sense to rename the gem to logux-rails and use Logux::Rails as the primary namespace to follow RubyGems naming convention and avoid potential definition collisions. At the moment logux_rails and logux-rack both has constant definitions in the common Logux module.

I'm not aware if supporting alternative ORMs is relevant, but for now Logux::Model is kept within logux_rails (since it is designed for ActiveRecord). To make Logux framework ORM-agnostic, it is possible to extract model abstraction into logux-model gem, and then introduce a set of adapters to the Logux gems family (logux-model-active_record, logux-model-sequel, etc). This worth a separate PR, though.

References

- Remove redundant definitions from the Logux module
- Remove ActiveSupport::Autoload module from Logux, since all core modules were autoloaded with Kernel#autoload, and an explicit load path is used anyway
It makes sense to move root module to lib/logux/rails.rb after the gem is renamed to logux-rails. Gems naming convention: https://guides.rubygems.org/name-your-gem/
- The .rake module is the part of the Rails engine. It will be autoloaded.
- This update redefines default paths to match typical Rails application structure.
This update makes sure ActionCaller override is loaded: it was not possible to use autoload for lib/logux/action_caller.rb here, since the original ActionCaller implementation was already autoloaded in the logux-rack gem, and the autoload would not not trigger.
Rake tasks are moved to the logux-rack gem, and not depend on the Rails environment any longer.
@dreikanter dreikanter changed the title Logux rack Logux::Rack integration Oct 4, 2019
@dreikanter
Copy link
Contributor Author

@dsalahutdinov Take a look, pls

@dsalahutdinov dsalahutdinov changed the base branch from master to logux-rack October 7, 2019 10:44
@dsalahutdinov dsalahutdinov merged commit e783b50 into logux:logux-rack Oct 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0