Skip to content

Commit

Permalink
gems: add anycable-rails-core
Browse files Browse the repository at this point in the history
This is a base version depending on anycable-core (i.e., without gRPC as a dependency)
  • Loading branch information
palkan committed Jul 12, 2023
1 parent 90cfe1f commit 94fa330
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 6 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
all: release

release:
gem release anycable-rails-core
gem release anycable-rails -t
git push
git push --tags
32 changes: 32 additions & 0 deletions anycable-rails-core.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# frozen_string_literal: true

require_relative "lib/anycable/rails/version"

Gem::Specification.new do |spec|
spec.name = "anycable-rails-core"
spec.version = AnyCable::Rails::VERSION
spec.authors = ["palkan"]
spec.email = ["[email protected]"]

spec.summary = "AnyCable integration for Rails (w/o RPC dependencies)"
spec.description = "AnyCable integration for Rails (w/o RPC dependencies)"
spec.homepage = "http://github.com/anycable/anycable-rails"
spec.license = "MIT"
spec.metadata = {
"bug_tracker_uri" => "http://github.com/anycable/anycable-rails/issues",
"changelog_uri" => "https://github.com/anycable/anycable-rails/blob/master/CHANGELOG.md",
"documentation_uri" => "https://docs.anycable.io/#/using_with_rails",
"homepage_uri" => "https://anycable.io/",
"source_code_uri" => "http://github.com/anycable/anycable-rails",
"funding_uri" => "https://github.com/sponsors/anycable"
}

spec.files = Dir.glob("lib/**/*") + %w[README.md MIT-LICENSE CHANGELOG.md]
spec.require_paths = ["lib"]

spec.required_ruby_version = ">= 2.7"

spec.add_dependency "anycable-core", "~> 1.4"
spec.add_dependency "actioncable", ">= 6.0"
spec.add_dependency "globalid"
end
11 changes: 5 additions & 6 deletions anycable-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
spec.authors = ["palkan"]
spec.email = ["[email protected]"]

spec.summary = "Rails adapter for AnyCable"
spec.description = "Rails adapter for AnyCable"
spec.summary = "AnyCable integration for Rails"
spec.description = "AnyCable integration for Rails"
spec.homepage = "http://github.com/anycable/anycable-rails"
spec.license = "MIT"
spec.metadata = {
Expand All @@ -21,14 +21,13 @@ Gem::Specification.new do |spec|
"funding_uri" => "https://github.com/sponsors/anycable"
}

spec.files = Dir.glob("lib/**/*") + %w[README.md MIT-LICENSE CHANGELOG.md]
spec.files = %w[README.md MIT-LICENSE CHANGELOG.md]
spec.require_paths = ["lib"]

spec.required_ruby_version = ">= 2.7"

spec.add_dependency "anycable", "~> 1.4"
spec.add_dependency "actioncable", ">= 6.0"
spec.add_dependency "globalid"
spec.add_dependency "anycable-rails-core", AnyCable::Rails::VERSION
spec.add_dependency "anycable"

spec.add_development_dependency "ammeter", "~> 1.1"
spec.add_development_dependency "bundler", ">= 1.10"
Expand Down
2 changes: 2 additions & 0 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ development:

Alternatively, you can also embed HTTP RPC into your Rails web server. See [HTTP RPC docs](../ruby/http_rpc.md).

If you use only HTTP RPC in all environments, you can avoid installing gRPC depenпыdencies by using the `anycable-rails-core` gem instead of `anycable-rails`.

### Testing with AnyCable

If you'd like to run AnyCable RPC server in tests (for example, in system tests), we recommend to start it manually only when necessary (i.e., when dependent tests are executed) and use the embedded mode. That's how we do it with RSpec:
Expand Down

0 comments on commit 94fa330

Please sign in to comment.