featurehub-sdk 1.2.2 → 1.3.0
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/.rubocop.yml +4 -2
- data/.ruby-version +1 -1
- data/CHANGELOG.md +9 -0
- data/Gemfile +3 -3
- data/Gemfile.lock +124 -63
- data/LICENSE +21 -0
- data/README.md +235 -0
- data/examples/rails_example/.env.example +13 -0
- data/examples/rails_example/.gitattributes +7 -0
- data/examples/rails_example/.gitignore +103 -0
- data/examples/rails_example/.ruby-version +1 -0
- data/examples/rails_example/Dockerfile +12 -0
- data/examples/rails_example/Gemfile +80 -0
- data/examples/rails_example/Gemfile.lock +283 -0
- data/examples/rails_example/README.md +36 -0
- data/examples/rails_example/Rakefile +8 -0
- data/examples/rails_example/app/assets/config/manifest.js +4 -0
- data/examples/rails_example/app/assets/images/.keep +0 -0
- data/examples/rails_example/app/assets/stylesheets/application.css +15 -0
- data/examples/rails_example/app/channels/application_cable/channel.rb +6 -0
- data/examples/rails_example/app/channels/application_cable/connection.rb +6 -0
- data/examples/rails_example/app/controllers/application_controller.rb +4 -0
- data/examples/rails_example/app/controllers/concerns/.keep +0 -0
- data/examples/rails_example/app/controllers/home_controller.rb +12 -0
- data/examples/rails_example/app/helpers/application_helper.rb +4 -0
- data/examples/rails_example/app/helpers/home_helper.rb +4 -0
- data/examples/rails_example/app/javascript/application.js +3 -0
- data/examples/rails_example/app/javascript/controllers/application.js +9 -0
- data/examples/rails_example/app/javascript/controllers/hello_controller.js +7 -0
- data/examples/rails_example/app/javascript/controllers/index.js +11 -0
- data/examples/rails_example/app/jobs/application_job.rb +9 -0
- data/examples/rails_example/app/mailers/application_mailer.rb +6 -0
- data/examples/rails_example/app/models/application_record.rb +5 -0
- data/examples/rails_example/app/models/concerns/.keep +0 -0
- data/examples/rails_example/app/views/home/index.html.erb +6 -0
- data/examples/rails_example/app/views/layouts/application.html.erb +16 -0
- data/examples/rails_example/app/views/layouts/mailer.html.erb +13 -0
- data/examples/rails_example/app/views/layouts/mailer.text.erb +1 -0
- data/examples/rails_example/bin/bundle +118 -0
- data/examples/rails_example/bin/importmap +5 -0
- data/examples/rails_example/bin/rails +6 -0
- data/examples/rails_example/bin/rake +6 -0
- data/examples/rails_example/bin/setup +35 -0
- data/examples/rails_example/config/application.rb +24 -0
- data/examples/rails_example/config/boot.rb +6 -0
- data/examples/rails_example/config/cable.yml +10 -0
- data/examples/rails_example/config/credentials.yml.enc +1 -0
- data/examples/rails_example/config/database.yml +25 -0
- data/examples/rails_example/config/environment.rb +7 -0
- data/examples/rails_example/config/environments/development.rb +72 -0
- data/examples/rails_example/config/environments/production.rb +95 -0
- data/examples/rails_example/config/environments/test.rb +62 -0
- data/examples/rails_example/config/importmap.rb +9 -0
- data/examples/rails_example/config/initializers/assets.rb +14 -0
- data/examples/rails_example/config/initializers/content_security_policy.rb +27 -0
- data/examples/rails_example/config/initializers/featurehub.rb +8 -0
- data/examples/rails_example/config/initializers/filter_parameter_logging.rb +10 -0
- data/examples/rails_example/config/initializers/inflections.rb +18 -0
- data/examples/rails_example/config/initializers/permissions_policy.rb +13 -0
- data/examples/rails_example/config/locales/en.yml +33 -0
- data/examples/rails_example/config/puma.rb +57 -0
- data/examples/rails_example/config/routes.rb +8 -0
- data/examples/rails_example/config/storage.yml +34 -0
- data/examples/rails_example/config.ru +8 -0
- data/examples/rails_example/db/seeds.rb +9 -0
- data/examples/rails_example/lib/assets/.keep +0 -0
- data/examples/rails_example/lib/tasks/.keep +0 -0
- data/examples/rails_example/log/.keep +0 -0
- data/examples/rails_example/public/404.html +67 -0
- data/examples/rails_example/public/422.html +67 -0
- data/examples/rails_example/public/500.html +66 -0
- data/examples/rails_example/public/apple-touch-icon-precomposed.png +0 -0
- data/examples/rails_example/public/apple-touch-icon.png +0 -0
- data/examples/rails_example/public/favicon.ico +0 -0
- data/examples/rails_example/public/robots.txt +1 -0
- data/examples/rails_example/storage/.keep +0 -0
- data/examples/rails_example/test/application_system_test_case.rb +7 -0
- data/examples/rails_example/test/channels/application_cable/connection_test.rb +15 -0
- data/examples/rails_example/test/controllers/.keep +0 -0
- data/examples/rails_example/test/controllers/home_controller_test.rb +9 -0
- data/examples/rails_example/test/fixtures/files/.keep +0 -0
- data/examples/rails_example/test/helpers/.keep +0 -0
- data/examples/rails_example/test/integration/.keep +0 -0
- data/examples/rails_example/test/mailers/.keep +0 -0
- data/examples/rails_example/test/models/.keep +0 -0
- data/examples/rails_example/test/system/.keep +0 -0
- data/examples/rails_example/test/test_helper.rb +17 -0
- data/examples/rails_example/tmp/.keep +0 -0
- data/examples/rails_example/tmp/pids/.keep +0 -0
- data/examples/rails_example/tmp/storage/.keep +0 -0
- data/examples/rails_example/vendor/.keep +0 -0
- data/examples/rails_example/vendor/javascript/.keep +0 -0
- data/examples/sinatra/.gitignore +3 -0
- data/examples/sinatra/.ruby-version +1 -0
- data/examples/sinatra/Dockerfile +42 -0
- data/examples/sinatra/Gemfile +16 -0
- data/examples/sinatra/Gemfile.lock +86 -0
- data/examples/sinatra/README.adoc +10 -0
- data/examples/sinatra/app/application.rb +141 -0
- data/examples/sinatra/build.sh +2 -0
- data/examples/sinatra/conf/nginx.conf +57 -0
- data/examples/sinatra/conf/nsswitch.conf +21 -0
- data/examples/sinatra/config.ru +17 -0
- data/examples/sinatra/docker_start.sh +3 -0
- data/examples/sinatra/sinatra.iml +22 -0
- data/examples/sinatra/start.sh +3 -0
- data/examples/sinatra/thin.ru +9 -0
- data/featurehub-ruby-sdk.iml +9 -0
- data/featurehub-sdk.gemspec +42 -0
- data/lib/feature_hub/sdk/feature_hub_config.rb +0 -2
- data/lib/feature_hub/sdk/feature_repository.rb +1 -1
- data/lib/feature_hub/sdk/impl/rollout_holders.rb +3 -3
- data/lib/feature_hub/sdk/streaming_edge_service.rb +1 -1
- data/lib/feature_hub/sdk/version.rb +1 -1
- metadata +114 -13
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Puma can serve each request in a thread from an internal thread pool.
|
|
4
|
+
# The `threads` method setting takes two numbers: a minimum and maximum.
|
|
5
|
+
# Any libraries that use thread pools should be configured to match
|
|
6
|
+
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
|
7
|
+
# and maximum; this matches the default thread size of Active Record.
|
|
8
|
+
#
|
|
9
|
+
max_threads_count = ENV.fetch("RAILS_MAX_THREADS", 5)
|
|
10
|
+
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
|
|
11
|
+
threads min_threads_count, max_threads_count
|
|
12
|
+
|
|
13
|
+
# Specifies the `worker_timeout` threshold that Puma will use to wait before
|
|
14
|
+
# terminating a worker in development environments.
|
|
15
|
+
#
|
|
16
|
+
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
|
|
17
|
+
|
|
18
|
+
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
|
|
19
|
+
#
|
|
20
|
+
port ENV.fetch("PORT", 3000)
|
|
21
|
+
|
|
22
|
+
# Specifies the `environment` that Puma will run in.
|
|
23
|
+
#
|
|
24
|
+
environment ENV.fetch("RAILS_ENV", "development")
|
|
25
|
+
|
|
26
|
+
# Specifies the `pidfile` that Puma will use.
|
|
27
|
+
pidfile ENV.fetch("PIDFILE", "tmp/pids/server.pid")
|
|
28
|
+
|
|
29
|
+
# Specifies the number of `workers` to boot in clustered mode.
|
|
30
|
+
# Workers are forked web server processes. If using threads and workers together
|
|
31
|
+
# the concurrency of the application would be max `threads` * `workers`.
|
|
32
|
+
# Workers do not work on JRuby or Windows (both of which do not support
|
|
33
|
+
# processes).
|
|
34
|
+
#
|
|
35
|
+
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
|
36
|
+
|
|
37
|
+
# Use the `preload_app!` method when specifying a `workers` number.
|
|
38
|
+
# This directive tells Puma to first boot the application and load code
|
|
39
|
+
# before forking the application. This takes advantage of Copy On Write
|
|
40
|
+
# process behavior so workers use less memory.
|
|
41
|
+
#
|
|
42
|
+
# preload_app!
|
|
43
|
+
|
|
44
|
+
# Allow puma to be restarted by `bin/rails restart` command.
|
|
45
|
+
plugin :tmp_restart
|
|
46
|
+
|
|
47
|
+
on_worker_boot do
|
|
48
|
+
# Worker specific setup for Rails 4.1+
|
|
49
|
+
# See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
|
|
50
|
+
ActiveRecord::Base.establish_connection
|
|
51
|
+
|
|
52
|
+
# configure FeatureHub
|
|
53
|
+
Rails.configuration.fh_config = Rails.configuration.fh_config = FeatureHub::Sdk::FeatureHubConfig.new(
|
|
54
|
+
ENV.fetch("FEATUREHUB_EDGE_URL"),
|
|
55
|
+
[ENV.fetch("FEATUREHUB_CLIENT_API_KEY")]
|
|
56
|
+
).init
|
|
57
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
test:
|
|
2
|
+
service: Disk
|
|
3
|
+
root: <%= Rails.root.join("tmp/storage") %>
|
|
4
|
+
|
|
5
|
+
local:
|
|
6
|
+
service: Disk
|
|
7
|
+
root: <%= Rails.root.join("storage") %>
|
|
8
|
+
|
|
9
|
+
# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
|
|
10
|
+
# amazon:
|
|
11
|
+
# service: S3
|
|
12
|
+
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
|
|
13
|
+
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
|
|
14
|
+
# region: us-east-1
|
|
15
|
+
# bucket: your_own_bucket-<%= Rails.env %>
|
|
16
|
+
|
|
17
|
+
# Remember not to checkin your GCS keyfile to a repository
|
|
18
|
+
# google:
|
|
19
|
+
# service: GCS
|
|
20
|
+
# project: your_project
|
|
21
|
+
# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
|
|
22
|
+
# bucket: your_own_bucket-<%= Rails.env %>
|
|
23
|
+
|
|
24
|
+
# Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
|
|
25
|
+
# microsoft:
|
|
26
|
+
# service: AzureStorage
|
|
27
|
+
# storage_account_name: your_account_name
|
|
28
|
+
# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
|
|
29
|
+
# container: your_container_name-<%= Rails.env %>
|
|
30
|
+
|
|
31
|
+
# mirror:
|
|
32
|
+
# service: Mirror
|
|
33
|
+
# primary: local
|
|
34
|
+
# mirrors: [ amazon, google, microsoft ]
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file should contain all the record creation needed to seed the database with its default values.
|
|
4
|
+
# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
|
|
5
|
+
#
|
|
6
|
+
# Examples:
|
|
7
|
+
#
|
|
8
|
+
# movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }])
|
|
9
|
+
# Character.create(name: "Luke", movie: movies.first)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<style>
|
|
7
|
+
.rails-default-error-page {
|
|
8
|
+
background-color: #EFEFEF;
|
|
9
|
+
color: #2E2F30;
|
|
10
|
+
text-align: center;
|
|
11
|
+
font-family: arial, sans-serif;
|
|
12
|
+
margin: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.rails-default-error-page div.dialog {
|
|
16
|
+
width: 95%;
|
|
17
|
+
max-width: 33em;
|
|
18
|
+
margin: 4em auto 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.rails-default-error-page div.dialog > div {
|
|
22
|
+
border: 1px solid #CCC;
|
|
23
|
+
border-right-color: #999;
|
|
24
|
+
border-left-color: #999;
|
|
25
|
+
border-bottom-color: #BBB;
|
|
26
|
+
border-top: #B00100 solid 4px;
|
|
27
|
+
border-top-left-radius: 9px;
|
|
28
|
+
border-top-right-radius: 9px;
|
|
29
|
+
background-color: white;
|
|
30
|
+
padding: 7px 12% 0;
|
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.rails-default-error-page h1 {
|
|
35
|
+
font-size: 100%;
|
|
36
|
+
color: #730E15;
|
|
37
|
+
line-height: 1.5em;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.rails-default-error-page div.dialog > p {
|
|
41
|
+
margin: 0 0 1em;
|
|
42
|
+
padding: 1em;
|
|
43
|
+
background-color: #F7F7F7;
|
|
44
|
+
border: 1px solid #CCC;
|
|
45
|
+
border-right-color: #999;
|
|
46
|
+
border-left-color: #999;
|
|
47
|
+
border-bottom-color: #999;
|
|
48
|
+
border-bottom-left-radius: 4px;
|
|
49
|
+
border-bottom-right-radius: 4px;
|
|
50
|
+
border-top-color: #DADADA;
|
|
51
|
+
color: #666;
|
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
55
|
+
</head>
|
|
56
|
+
|
|
57
|
+
<body class="rails-default-error-page">
|
|
58
|
+
<!-- This file lives in public/404.html -->
|
|
59
|
+
<div class="dialog">
|
|
60
|
+
<div>
|
|
61
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
|
62
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
|
63
|
+
</div>
|
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
|
65
|
+
</div>
|
|
66
|
+
</body>
|
|
67
|
+
</html>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<style>
|
|
7
|
+
.rails-default-error-page {
|
|
8
|
+
background-color: #EFEFEF;
|
|
9
|
+
color: #2E2F30;
|
|
10
|
+
text-align: center;
|
|
11
|
+
font-family: arial, sans-serif;
|
|
12
|
+
margin: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.rails-default-error-page div.dialog {
|
|
16
|
+
width: 95%;
|
|
17
|
+
max-width: 33em;
|
|
18
|
+
margin: 4em auto 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.rails-default-error-page div.dialog > div {
|
|
22
|
+
border: 1px solid #CCC;
|
|
23
|
+
border-right-color: #999;
|
|
24
|
+
border-left-color: #999;
|
|
25
|
+
border-bottom-color: #BBB;
|
|
26
|
+
border-top: #B00100 solid 4px;
|
|
27
|
+
border-top-left-radius: 9px;
|
|
28
|
+
border-top-right-radius: 9px;
|
|
29
|
+
background-color: white;
|
|
30
|
+
padding: 7px 12% 0;
|
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.rails-default-error-page h1 {
|
|
35
|
+
font-size: 100%;
|
|
36
|
+
color: #730E15;
|
|
37
|
+
line-height: 1.5em;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.rails-default-error-page div.dialog > p {
|
|
41
|
+
margin: 0 0 1em;
|
|
42
|
+
padding: 1em;
|
|
43
|
+
background-color: #F7F7F7;
|
|
44
|
+
border: 1px solid #CCC;
|
|
45
|
+
border-right-color: #999;
|
|
46
|
+
border-left-color: #999;
|
|
47
|
+
border-bottom-color: #999;
|
|
48
|
+
border-bottom-left-radius: 4px;
|
|
49
|
+
border-bottom-right-radius: 4px;
|
|
50
|
+
border-top-color: #DADADA;
|
|
51
|
+
color: #666;
|
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
55
|
+
</head>
|
|
56
|
+
|
|
57
|
+
<body class="rails-default-error-page">
|
|
58
|
+
<!-- This file lives in public/422.html -->
|
|
59
|
+
<div class="dialog">
|
|
60
|
+
<div>
|
|
61
|
+
<h1>The change you wanted was rejected.</h1>
|
|
62
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
|
63
|
+
</div>
|
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
|
65
|
+
</div>
|
|
66
|
+
</body>
|
|
67
|
+
</html>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<style>
|
|
7
|
+
.rails-default-error-page {
|
|
8
|
+
background-color: #EFEFEF;
|
|
9
|
+
color: #2E2F30;
|
|
10
|
+
text-align: center;
|
|
11
|
+
font-family: arial, sans-serif;
|
|
12
|
+
margin: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.rails-default-error-page div.dialog {
|
|
16
|
+
width: 95%;
|
|
17
|
+
max-width: 33em;
|
|
18
|
+
margin: 4em auto 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.rails-default-error-page div.dialog > div {
|
|
22
|
+
border: 1px solid #CCC;
|
|
23
|
+
border-right-color: #999;
|
|
24
|
+
border-left-color: #999;
|
|
25
|
+
border-bottom-color: #BBB;
|
|
26
|
+
border-top: #B00100 solid 4px;
|
|
27
|
+
border-top-left-radius: 9px;
|
|
28
|
+
border-top-right-radius: 9px;
|
|
29
|
+
background-color: white;
|
|
30
|
+
padding: 7px 12% 0;
|
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.rails-default-error-page h1 {
|
|
35
|
+
font-size: 100%;
|
|
36
|
+
color: #730E15;
|
|
37
|
+
line-height: 1.5em;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.rails-default-error-page div.dialog > p {
|
|
41
|
+
margin: 0 0 1em;
|
|
42
|
+
padding: 1em;
|
|
43
|
+
background-color: #F7F7F7;
|
|
44
|
+
border: 1px solid #CCC;
|
|
45
|
+
border-right-color: #999;
|
|
46
|
+
border-left-color: #999;
|
|
47
|
+
border-bottom-color: #999;
|
|
48
|
+
border-bottom-left-radius: 4px;
|
|
49
|
+
border-bottom-right-radius: 4px;
|
|
50
|
+
border-top-color: #DADADA;
|
|
51
|
+
color: #666;
|
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
55
|
+
</head>
|
|
56
|
+
|
|
57
|
+
<body class="rails-default-error-page">
|
|
58
|
+
<!-- This file lives in public/500.html -->
|
|
59
|
+
<div class="dialog">
|
|
60
|
+
<div>
|
|
61
|
+
<h1>We're sorry, but something went wrong.</h1>
|
|
62
|
+
</div>
|
|
63
|
+
<p>If you are the application owner check the logs for more information.</p>
|
|
64
|
+
</div>
|
|
65
|
+
</body>
|
|
66
|
+
</html>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "test_helper"
|
|
4
|
+
|
|
5
|
+
module ApplicationCable
|
|
6
|
+
class ConnectionTest < ActionCable::Connection::TestCase
|
|
7
|
+
# test "connects with cookies" do
|
|
8
|
+
# cookies.signed[:user_id] = 42
|
|
9
|
+
#
|
|
10
|
+
# connect
|
|
11
|
+
#
|
|
12
|
+
# assert_equal connection.user_id, "42"
|
|
13
|
+
# end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
ENV["RAILS_ENV"] ||= "test"
|
|
4
|
+
require_relative "../config/environment"
|
|
5
|
+
require "rails/test_help"
|
|
6
|
+
|
|
7
|
+
module ActiveSupport
|
|
8
|
+
class TestCase
|
|
9
|
+
# Run tests in parallel with specified workers
|
|
10
|
+
parallelize(workers: :number_of_processors)
|
|
11
|
+
|
|
12
|
+
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
|
|
13
|
+
fixtures :all
|
|
14
|
+
|
|
15
|
+
# Add more helper methods to be used by all tests here...
|
|
16
|
+
end
|
|
17
|
+
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.0.6
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
FROM ruby:2.7-bullseye
|
|
2
|
+
|
|
3
|
+
MAINTAINER info@featurehub.io
|
|
4
|
+
ENV BUNDLER_VERSION 2.3.15
|
|
5
|
+
ARG DEBIAN_FRONTEND=noninteractive
|
|
6
|
+
|
|
7
|
+
RUN apt update && \
|
|
8
|
+
apt install -y gnupg
|
|
9
|
+
|
|
10
|
+
RUN apt-get update && \
|
|
11
|
+
apt-get upgrade -y && \
|
|
12
|
+
apt-get install -y wget tzdata apt-transport-https && \
|
|
13
|
+
apt-get remove -y mysql-common
|
|
14
|
+
|
|
15
|
+
# set up nsswitch
|
|
16
|
+
COPY conf/nsswitch.conf /etc/nsswitch.conf
|
|
17
|
+
|
|
18
|
+
RUN echo 'gem: --no-document' >> ~/.gemrc && \
|
|
19
|
+
gem update --system 3.0.6 && \
|
|
20
|
+
gem install bundler -v ${BUNDLER_VERSION} --force
|
|
21
|
+
|
|
22
|
+
RUN echo "deb https://oss-binaries.phusionpassenger.com/apt/passenger bullseye main" > /etc/apt/sources.list.d/passenger.list
|
|
23
|
+
|
|
24
|
+
RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db 561F9B9CAC40B2F7 && \
|
|
25
|
+
apt-get update && \
|
|
26
|
+
apt-get install -y libnginx-mod-http-passenger=1:6.0.13-1~bullseye1 \
|
|
27
|
+
passenger=1:6.0.13-1~bullseye1 nginx && \
|
|
28
|
+
apt-get clean -y && \
|
|
29
|
+
rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*
|
|
30
|
+
# set up passenger
|
|
31
|
+
|
|
32
|
+
#ENV BUNDLE_PATH /bundle
|
|
33
|
+
RUN passenger-config build-native-support
|
|
34
|
+
RUN gem update --system
|
|
35
|
+
RUN mkdir -p /app/featurehub
|
|
36
|
+
COPY conf/nginx.conf /etc/nginx/nginx.conf
|
|
37
|
+
COPY Gemfile Gemfile.lock /app/featurehub/
|
|
38
|
+
WORKDIR /app/featurehub
|
|
39
|
+
RUN cd /app/featurehub && bundle install
|
|
40
|
+
ADD . /app/featurehub
|
|
41
|
+
|
|
42
|
+
CMD /usr/sbin/nginx -g \'daemon off;\'
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
ruby "2.7.6"
|
|
6
|
+
|
|
7
|
+
gem "rack"
|
|
8
|
+
gem "sinatra"
|
|
9
|
+
# gem "featurehub-sdk", path: "../../"
|
|
10
|
+
gem "featurehub-sdk", git: "https://github.com/featurehub-io/featurehub-ruby-sdk.git",
|
|
11
|
+
glob: "featurehub-sdk/*.gemspec"
|
|
12
|
+
|
|
13
|
+
group :development do
|
|
14
|
+
gem "shotgun"
|
|
15
|
+
gem "thin"
|
|
16
|
+
end
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
GIT
|
|
2
|
+
remote: https://github.com/featurehub-io/featurehub-ruby-sdk.git
|
|
3
|
+
revision: fa551295ec9703e630452e094d3856117c3d013d
|
|
4
|
+
glob: featurehub-sdk/*.gemspec
|
|
5
|
+
specs:
|
|
6
|
+
featurehub-sdk (1.2.1)
|
|
7
|
+
concurrent-ruby (~> 1.1.10)
|
|
8
|
+
faraday (~> 2.3)
|
|
9
|
+
ld-eventsource (~> 2.2.0)
|
|
10
|
+
murmurhash3 (~> 0.1.6)
|
|
11
|
+
sem_version (~> 2.0.0)
|
|
12
|
+
|
|
13
|
+
GEM
|
|
14
|
+
remote: https://rubygems.org/
|
|
15
|
+
specs:
|
|
16
|
+
addressable (2.8.1)
|
|
17
|
+
public_suffix (>= 2.0.2, < 6.0)
|
|
18
|
+
concurrent-ruby (1.1.10)
|
|
19
|
+
daemons (1.4.1)
|
|
20
|
+
domain_name (0.5.20190701)
|
|
21
|
+
unf (>= 0.0.5, < 1.0.0)
|
|
22
|
+
eventmachine (1.2.7)
|
|
23
|
+
faraday (2.7.4)
|
|
24
|
+
faraday-net_http (>= 2.0, < 3.1)
|
|
25
|
+
ruby2_keywords (>= 0.0.4)
|
|
26
|
+
faraday-net_http (3.0.2)
|
|
27
|
+
ffi (1.15.5)
|
|
28
|
+
ffi-compiler (1.0.1)
|
|
29
|
+
ffi (>= 1.0.0)
|
|
30
|
+
rake
|
|
31
|
+
http (5.1.1)
|
|
32
|
+
addressable (~> 2.8)
|
|
33
|
+
http-cookie (~> 1.0)
|
|
34
|
+
http-form_data (~> 2.2)
|
|
35
|
+
llhttp-ffi (~> 0.4.0)
|
|
36
|
+
http-cookie (1.0.5)
|
|
37
|
+
domain_name (~> 0.5)
|
|
38
|
+
http-form_data (2.3.0)
|
|
39
|
+
ld-eventsource (2.2.1)
|
|
40
|
+
concurrent-ruby (~> 1.0)
|
|
41
|
+
http (>= 4.4.1, < 6.0.0)
|
|
42
|
+
llhttp-ffi (0.4.0)
|
|
43
|
+
ffi-compiler (~> 1.0)
|
|
44
|
+
rake (~> 13.0)
|
|
45
|
+
murmurhash3 (0.1.7)
|
|
46
|
+
mustermann (2.0.2)
|
|
47
|
+
ruby2_keywords (~> 0.0.1)
|
|
48
|
+
public_suffix (5.0.1)
|
|
49
|
+
rack (2.2.6.4)
|
|
50
|
+
rack-protection (2.2.3)
|
|
51
|
+
rack
|
|
52
|
+
rake (13.0.6)
|
|
53
|
+
ruby2_keywords (0.0.5)
|
|
54
|
+
sem_version (2.0.1)
|
|
55
|
+
shotgun (0.9.2)
|
|
56
|
+
rack (>= 1.0)
|
|
57
|
+
sinatra (2.2.3)
|
|
58
|
+
mustermann (~> 2.0)
|
|
59
|
+
rack (~> 2.2)
|
|
60
|
+
rack-protection (= 2.2.3)
|
|
61
|
+
tilt (~> 2.0)
|
|
62
|
+
thin (1.8.1)
|
|
63
|
+
daemons (~> 1.0, >= 1.0.9)
|
|
64
|
+
eventmachine (~> 1.0, >= 1.0.4)
|
|
65
|
+
rack (>= 1, < 3)
|
|
66
|
+
tilt (2.1.0)
|
|
67
|
+
unf (0.1.4)
|
|
68
|
+
unf_ext
|
|
69
|
+
unf_ext (0.0.8.2)
|
|
70
|
+
|
|
71
|
+
PLATFORMS
|
|
72
|
+
x86_64-darwin-21
|
|
73
|
+
x86_64-linux
|
|
74
|
+
|
|
75
|
+
DEPENDENCIES
|
|
76
|
+
featurehub-sdk!
|
|
77
|
+
rack
|
|
78
|
+
shotgun
|
|
79
|
+
sinatra
|
|
80
|
+
thin
|
|
81
|
+
|
|
82
|
+
RUBY VERSION
|
|
83
|
+
ruby 2.7.6p219
|
|
84
|
+
|
|
85
|
+
BUNDLED WITH
|
|
86
|
+
2.3.15
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
= Sinatra Example
|
|
2
|
+
|
|
3
|
+
This is a simple todo server example that we use to run our Cucumber tests against
|
|
4
|
+
to ensure that the SDK is operating as expected. Please read the `application.rb`
|
|
5
|
+
for details on how it works, it is fairly simple.
|
|
6
|
+
|
|
7
|
+
It can be built into a Passenger dockerfile using the `build.sh` script and started
|
|
8
|
+
using `docker_start.sh`
|
|
9
|
+
|
|
10
|
+
|