anycable-rails 1.4.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- metadata +10 -58
- data/lib/action_cable/subscription_adapter/any_cable.rb +0 -40
- data/lib/action_cable/subscription_adapter/anycable.rb +0 -10
- data/lib/anycable/rails/action_cable_ext/channel.rb +0 -51
- data/lib/anycable/rails/action_cable_ext/connection.rb +0 -90
- data/lib/anycable/rails/action_cable_ext/remote_connections.rb +0 -13
- data/lib/anycable/rails/channel_state.rb +0 -108
- data/lib/anycable/rails/compatibility/rubocop/config/default.yml +0 -14
- data/lib/anycable/rails/compatibility/rubocop/cops/anycable/instance_vars.rb +0 -50
- data/lib/anycable/rails/compatibility/rubocop/cops/anycable/periodical_timers.rb +0 -29
- data/lib/anycable/rails/compatibility/rubocop/cops/anycable/stream_from.rb +0 -100
- data/lib/anycable/rails/compatibility/rubocop.rb +0 -27
- data/lib/anycable/rails/compatibility.rb +0 -63
- data/lib/anycable/rails/config.rb +0 -19
- data/lib/anycable/rails/connection.rb +0 -211
- data/lib/anycable/rails/connection_factory.rb +0 -44
- data/lib/anycable/rails/connections/persistent_session.rb +0 -40
- data/lib/anycable/rails/connections/serializable_identification.rb +0 -46
- data/lib/anycable/rails/connections/session_proxy.rb +0 -81
- data/lib/anycable/rails/middlewares/executor.rb +0 -31
- data/lib/anycable/rails/middlewares/log_tagging.rb +0 -21
- data/lib/anycable/rails/rack.rb +0 -56
- data/lib/anycable/rails/railtie.rb +0 -92
- data/lib/anycable/rails/version.rb +0 -7
- data/lib/anycable/rails.rb +0 -76
- data/lib/anycable-rails.rb +0 -3
- data/lib/generators/anycable/download/USAGE +0 -14
- data/lib/generators/anycable/download/download_generator.rb +0 -85
- data/lib/generators/anycable/setup/USAGE +0 -2
- data/lib/generators/anycable/setup/setup_generator.rb +0 -300
- data/lib/generators/anycable/setup/templates/Procfile.dev.tt +0 -6
- data/lib/generators/anycable/setup/templates/config/anycable.yml.tt +0 -48
- data/lib/generators/anycable/setup/templates/config/cable.yml.tt +0 -11
- data/lib/generators/anycable/setup/templates/config/initializers/anycable.rb.tt +0 -9
- data/lib/generators/anycable/with_os_helpers.rb +0 -55
@@ -1,55 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module AnyCableRailsGenerators
|
4
|
-
module WithOSHelpers
|
5
|
-
OS_NAMES = %w[linux darwin freebsd win].freeze
|
6
|
-
CPU_NAMES = %w[amd64 arm64 386 arm].freeze
|
7
|
-
DEFAULT_BIN_PATH = "/usr/local/bin"
|
8
|
-
|
9
|
-
def self.included(base)
|
10
|
-
base.class_option :os,
|
11
|
-
type: :string,
|
12
|
-
desc: "Specify the OS for AnyCable-Go server binary (options: #{OS_NAMES.join(", ")})"
|
13
|
-
base.class_option :cpu,
|
14
|
-
type: :string,
|
15
|
-
desc: "Specify the CPU architecturefor AnyCable-Go server binary (options: #{CPU_NAMES.join(", ")})"
|
16
|
-
|
17
|
-
private :current_cpu, :supported_current_cpu, :supported_current_os
|
18
|
-
end
|
19
|
-
|
20
|
-
def current_cpu
|
21
|
-
case Gem::Platform.local.cpu
|
22
|
-
when "x86_64", "x64"
|
23
|
-
"amd64"
|
24
|
-
when "x86_32", "x86", "i386", "i486", "i686"
|
25
|
-
"i386"
|
26
|
-
when "aarch64", "aarch64_be", "arm64", /armv8/
|
27
|
-
"arm64"
|
28
|
-
when "arm", /armv7/, /armv6/
|
29
|
-
"arm"
|
30
|
-
else
|
31
|
-
"unknown"
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def os_name
|
36
|
-
options[:os] ||
|
37
|
-
supported_current_os ||
|
38
|
-
ask("What is your OS name?", limited_to: OS_NAMES)
|
39
|
-
end
|
40
|
-
|
41
|
-
def cpu_name
|
42
|
-
options[:cpu] ||
|
43
|
-
supported_current_cpu ||
|
44
|
-
ask("What is your CPU architecture?", limited_to: CPU_NAMES)
|
45
|
-
end
|
46
|
-
|
47
|
-
def supported_current_cpu
|
48
|
-
CPU_NAMES.find(¤t_cpu.method(:==))
|
49
|
-
end
|
50
|
-
|
51
|
-
def supported_current_os
|
52
|
-
OS_NAMES.find(&Gem::Platform.local.os.method(:==))
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|