amazon-chime-sdk-rails 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +87 -0
- data/.rspec +2 -0
- data/.travis.yml +47 -0
- data/.yardopts +6 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +25 -0
- data/LICENSE +21 -0
- data/README.md +1109 -0
- data/Rakefile +20 -0
- data/amazon-chime-sdk-rails.gemspec +29 -0
- data/gemfiles/Gemfile.rails-5.0 +25 -0
- data/gemfiles/Gemfile.rails-5.1 +25 -0
- data/gemfiles/Gemfile.rails-5.2 +25 -0
- data/gemfiles/Gemfile.rails-6.0 +25 -0
- data/lib/amazon-chime-sdk-rails.rb +37 -0
- data/lib/chime_sdk/config.rb +90 -0
- data/lib/chime_sdk/controller/attendees.rb +128 -0
- data/lib/chime_sdk/controller/common.rb +202 -0
- data/lib/chime_sdk/controller/meetings.rb +192 -0
- data/lib/chime_sdk/meeting_coordinator.rb +184 -0
- data/lib/chime_sdk/version.rb +4 -0
- data/lib/generators/chime_sdk/controllers_generator.rb +104 -0
- data/lib/generators/chime_sdk/install_generator.rb +27 -0
- data/lib/generators/chime_sdk/js_generator.rb +67 -0
- data/lib/generators/chime_sdk/views_generator.rb +43 -0
- data/lib/generators/templates/chime_sdk.rb +28 -0
- data/lib/generators/templates/controllers/README +35 -0
- data/lib/generators/templates/controllers/meeting_attendees_controller.rb +106 -0
- data/lib/generators/templates/controllers/meetings_controller.rb +146 -0
- data/lib/generators/templates/views/meetings/index.html.erb +27 -0
- data/lib/generators/templates/views/meetings/show.html.erb +136 -0
- data/spec/factories/rooms.rb +5 -0
- data/spec/factories/users.rb +8 -0
- data/spec/generators/controllers_generator_spec.rb +113 -0
- data/spec/generators/install_generator_spec.rb +24 -0
- data/spec/generators/js_generator_spec.rb +26 -0
- data/spec/generators/views_generator_spec.rb +46 -0
- data/spec/rails_app/Rakefile +15 -0
- data/spec/rails_app/app/assets/config/manifest.js +2 -0
- data/spec/rails_app/app/assets/images/.keep +0 -0
- data/spec/rails_app/app/assets/javascripts/.keep +0 -0
- data/spec/rails_app/app/assets/stylesheets/application.css +15 -0
- data/spec/rails_app/app/assets/stylesheets/scaffolds.scss +65 -0
- data/spec/rails_app/app/controllers/api/meeting_attendees_controller.rb +3 -0
- data/spec/rails_app/app/controllers/api/meetings_controller.rb +3 -0
- data/spec/rails_app/app/controllers/api/rooms_controller.rb +3 -0
- data/spec/rails_app/app/controllers/application_controller.rb +11 -0
- data/spec/rails_app/app/controllers/entries_controller.rb +47 -0
- data/spec/rails_app/app/controllers/meeting_attendees_controller.rb +121 -0
- data/spec/rails_app/app/controllers/meetings_controller.rb +162 -0
- data/spec/rails_app/app/controllers/rooms_controller.rb +76 -0
- data/spec/rails_app/app/controllers/spa_controller.rb +6 -0
- data/spec/rails_app/app/javascript/App.vue +50 -0
- data/spec/rails_app/app/javascript/channels/consumer.js +6 -0
- data/spec/rails_app/app/javascript/channels/index.js +5 -0
- data/spec/rails_app/app/javascript/components/DeviseTokenAuth.vue +84 -0
- data/spec/rails_app/app/javascript/components/meetings/Index.vue +100 -0
- data/spec/rails_app/app/javascript/components/meetings/Meeting.vue +178 -0
- data/spec/rails_app/app/javascript/components/rooms/Index.vue +53 -0
- data/spec/rails_app/app/javascript/components/rooms/Show.vue +91 -0
- data/spec/rails_app/app/javascript/packs/application.js +17 -0
- data/spec/rails_app/app/javascript/packs/spa.js +14 -0
- data/spec/rails_app/app/javascript/router/index.js +74 -0
- data/spec/rails_app/app/javascript/store/index.js +37 -0
- data/spec/rails_app/app/models/application_record.rb +3 -0
- data/spec/rails_app/app/models/entry.rb +5 -0
- data/spec/rails_app/app/models/room.rb +12 -0
- data/spec/rails_app/app/models/user.rb +6 -0
- data/spec/rails_app/app/views/devise/registrations/new.html.erb +34 -0
- data/spec/rails_app/app/views/layouts/_header.html.erb +20 -0
- data/spec/rails_app/app/views/layouts/application.html.erb +18 -0
- data/spec/rails_app/app/views/meetings/index.html.erb +28 -0
- data/spec/rails_app/app/views/meetings/show.html.erb +136 -0
- data/spec/rails_app/app/views/rooms/_form.html.erb +22 -0
- data/spec/rails_app/app/views/rooms/_room.json.jbuilder +7 -0
- data/spec/rails_app/app/views/rooms/edit.html.erb +6 -0
- data/spec/rails_app/app/views/rooms/index.html.erb +27 -0
- data/spec/rails_app/app/views/rooms/index.json.jbuilder +1 -0
- data/spec/rails_app/app/views/rooms/new.html.erb +5 -0
- data/spec/rails_app/app/views/rooms/show.html.erb +42 -0
- data/spec/rails_app/app/views/rooms/show.json.jbuilder +1 -0
- data/spec/rails_app/app/views/spa/index.html.erb +1 -0
- data/spec/rails_app/babel.config.js +72 -0
- data/spec/rails_app/bin/bundle +114 -0
- data/spec/rails_app/bin/rails +9 -0
- data/spec/rails_app/bin/rake +9 -0
- data/spec/rails_app/bin/setup +36 -0
- data/spec/rails_app/bin/spring +17 -0
- data/spec/rails_app/bin/webpack +18 -0
- data/spec/rails_app/bin/webpack-dev-server +18 -0
- data/spec/rails_app/bin/yarn +11 -0
- data/spec/rails_app/config.ru +5 -0
- data/spec/rails_app/config/application.rb +21 -0
- data/spec/rails_app/config/boot.rb +4 -0
- data/spec/rails_app/config/cable.yml +10 -0
- data/spec/rails_app/config/credentials.yml.enc +1 -0
- data/spec/rails_app/config/database.yml +25 -0
- data/spec/rails_app/config/environment.rb +14 -0
- data/spec/rails_app/config/environments/development.rb +62 -0
- data/spec/rails_app/config/environments/production.rb +112 -0
- data/spec/rails_app/config/environments/test.rb +49 -0
- data/spec/rails_app/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/rails_app/config/initializers/assets.rb +15 -0
- data/spec/rails_app/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/rails_app/config/initializers/chime_sdk.rb +28 -0
- data/spec/rails_app/config/initializers/content_security_policy.rb +30 -0
- data/spec/rails_app/config/initializers/cookies_serializer.rb +5 -0
- data/spec/rails_app/config/initializers/devise.rb +311 -0
- data/spec/rails_app/config/initializers/devise_token_auth.rb +60 -0
- data/spec/rails_app/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/rails_app/config/initializers/inflections.rb +16 -0
- data/spec/rails_app/config/initializers/mime_types.rb +4 -0
- data/spec/rails_app/config/initializers/wrap_parameters.rb +14 -0
- data/spec/rails_app/config/locales/devise.en.yml +65 -0
- data/spec/rails_app/config/locales/en.yml +33 -0
- data/spec/rails_app/config/puma.rb +38 -0
- data/spec/rails_app/config/routes.rb +24 -0
- data/spec/rails_app/config/secrets.yml +8 -0
- data/spec/rails_app/config/spring.rb +6 -0
- data/spec/rails_app/config/storage.yml +34 -0
- data/spec/rails_app/config/webpack/development.js +5 -0
- data/spec/rails_app/config/webpack/environment.js +7 -0
- data/spec/rails_app/config/webpack/loaders/vue.js +6 -0
- data/spec/rails_app/config/webpack/production.js +5 -0
- data/spec/rails_app/config/webpack/test.js +5 -0
- data/spec/rails_app/config/webpacker.yml +97 -0
- data/spec/rails_app/db/migrate/20200912140231_devise_create_users.rb +45 -0
- data/spec/rails_app/db/migrate/20200912140352_add_tokens_to_users.rb +12 -0
- data/spec/rails_app/db/migrate/20200912140657_create_rooms.rb +9 -0
- data/spec/rails_app/db/migrate/20200912140749_create_entries.rb +10 -0
- data/spec/rails_app/db/schema.rb +49 -0
- data/spec/rails_app/db/seeds.rb +41 -0
- data/spec/rails_app/log/.keep +0 -0
- data/spec/rails_app/package.json +23 -0
- data/spec/rails_app/postcss.config.js +12 -0
- data/spec/rails_app/public/404.html +67 -0
- data/spec/rails_app/public/422.html +67 -0
- data/spec/rails_app/public/500.html +66 -0
- data/spec/rails_app/public/favicon.ico +0 -0
- data/spec/rails_app/public/robots.txt +1 -0
- data/spec/rails_app/tmp/.keep +0 -0
- data/spec/requests/atendees_spec.rb +182 -0
- data/spec/requests/meetings_spec.rb +433 -0
- data/spec/spec_helper.rb +35 -0
- metadata +400 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1>Rooms</h1>
|
4
|
+
|
5
|
+
<table>
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
<th>Name</th>
|
9
|
+
<th colspan="3"></th>
|
10
|
+
</tr>
|
11
|
+
</thead>
|
12
|
+
|
13
|
+
<tbody>
|
14
|
+
<% @rooms.each do |room| %>
|
15
|
+
<tr>
|
16
|
+
<td><%= room.name %></td>
|
17
|
+
<td><%= link_to 'Show', room %></td>
|
18
|
+
<td><%= link_to 'Edit', edit_room_path(room) %></td>
|
19
|
+
<td><%= link_to 'Destroy', room, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
20
|
+
</tr>
|
21
|
+
<% end %>
|
22
|
+
</tbody>
|
23
|
+
</table>
|
24
|
+
|
25
|
+
<br>
|
26
|
+
|
27
|
+
<%= link_to 'New Room', new_room_path %>
|
@@ -0,0 +1 @@
|
|
1
|
+
json.array! @rooms, partial: "rooms/room", as: :room
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<p>
|
4
|
+
<strong>Name:</strong>
|
5
|
+
<%= @room.name %>
|
6
|
+
</p>
|
7
|
+
|
8
|
+
<p>
|
9
|
+
<strong>Private Meeting:</strong>
|
10
|
+
<p><%= link_to 'Show Meetings', room_meetings_path(@room) %></p>
|
11
|
+
<p>
|
12
|
+
Create Meeting
|
13
|
+
<%= link_to 'GET', room_meetings_path(@room, create_meeting: true) %>
|
14
|
+
<%= link_to 'POST', room_meetings_path(@room), method: :post %>
|
15
|
+
</p>
|
16
|
+
</p>
|
17
|
+
|
18
|
+
<p>
|
19
|
+
<strong>Members:</strong>
|
20
|
+
<table>
|
21
|
+
<tbody>
|
22
|
+
<% @room.entries.each do |entry| %>
|
23
|
+
<tr>
|
24
|
+
<td><%= entry.user.name %></td>
|
25
|
+
<td><%= link_to 'Remove', [@room, entry], method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
26
|
+
</tr>
|
27
|
+
<% end %>
|
28
|
+
</tbody>
|
29
|
+
</table>
|
30
|
+
</p>
|
31
|
+
|
32
|
+
<p>
|
33
|
+
<strong>Add members:</strong>
|
34
|
+
<%= form_for [@room, @entry] do |f| %>
|
35
|
+
<%= f.hidden_field :room_id, value: @room.id %>
|
36
|
+
<%= f.collection_select :user_id, User.all, :id, :name %>
|
37
|
+
<%= f.submit "Add" %>
|
38
|
+
<% end %>
|
39
|
+
</p>
|
40
|
+
|
41
|
+
<%= link_to 'Edit', edit_room_path(@room) %> |
|
42
|
+
<%= link_to 'Back', rooms_path %>
|
@@ -0,0 +1 @@
|
|
1
|
+
json.partial! "rooms/room", room: @room
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= content_for(:javascript_pack_tag, javascript_pack_tag('spa', 'data-turbolinks-track': 'reload')) %>
|
@@ -0,0 +1,72 @@
|
|
1
|
+
module.exports = function(api) {
|
2
|
+
var validEnv = ['development', 'test', 'production']
|
3
|
+
var currentEnv = api.env()
|
4
|
+
var isDevelopmentEnv = api.env('development')
|
5
|
+
var isProductionEnv = api.env('production')
|
6
|
+
var isTestEnv = api.env('test')
|
7
|
+
|
8
|
+
if (!validEnv.includes(currentEnv)) {
|
9
|
+
throw new Error(
|
10
|
+
'Please specify a valid `NODE_ENV` or ' +
|
11
|
+
'`BABEL_ENV` environment variables. Valid values are "development", ' +
|
12
|
+
'"test", and "production". Instead, received: ' +
|
13
|
+
JSON.stringify(currentEnv) +
|
14
|
+
'.'
|
15
|
+
)
|
16
|
+
}
|
17
|
+
|
18
|
+
return {
|
19
|
+
presets: [
|
20
|
+
isTestEnv && [
|
21
|
+
'@babel/preset-env',
|
22
|
+
{
|
23
|
+
targets: {
|
24
|
+
node: 'current'
|
25
|
+
}
|
26
|
+
}
|
27
|
+
],
|
28
|
+
(isProductionEnv || isDevelopmentEnv) && [
|
29
|
+
'@babel/preset-env',
|
30
|
+
{
|
31
|
+
forceAllTransforms: true,
|
32
|
+
useBuiltIns: 'entry',
|
33
|
+
corejs: 3,
|
34
|
+
modules: false,
|
35
|
+
exclude: ['transform-typeof-symbol']
|
36
|
+
}
|
37
|
+
]
|
38
|
+
].filter(Boolean),
|
39
|
+
plugins: [
|
40
|
+
'babel-plugin-macros',
|
41
|
+
'@babel/plugin-syntax-dynamic-import',
|
42
|
+
isTestEnv && 'babel-plugin-dynamic-import-node',
|
43
|
+
'@babel/plugin-transform-destructuring',
|
44
|
+
[
|
45
|
+
'@babel/plugin-proposal-class-properties',
|
46
|
+
{
|
47
|
+
loose: true
|
48
|
+
}
|
49
|
+
],
|
50
|
+
[
|
51
|
+
'@babel/plugin-proposal-object-rest-spread',
|
52
|
+
{
|
53
|
+
useBuiltIns: true
|
54
|
+
}
|
55
|
+
],
|
56
|
+
[
|
57
|
+
'@babel/plugin-transform-runtime',
|
58
|
+
{
|
59
|
+
helpers: false,
|
60
|
+
regenerator: true,
|
61
|
+
corejs: false
|
62
|
+
}
|
63
|
+
],
|
64
|
+
[
|
65
|
+
'@babel/plugin-transform-regenerator',
|
66
|
+
{
|
67
|
+
async: false
|
68
|
+
}
|
69
|
+
]
|
70
|
+
].filter(Boolean)
|
71
|
+
}
|
72
|
+
}
|
@@ -0,0 +1,114 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'bundle' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "rubygems"
|
12
|
+
|
13
|
+
m = Module.new do
|
14
|
+
module_function
|
15
|
+
|
16
|
+
def invoked_as_script?
|
17
|
+
File.expand_path($0) == File.expand_path(__FILE__)
|
18
|
+
end
|
19
|
+
|
20
|
+
def env_var_version
|
21
|
+
ENV["BUNDLER_VERSION"]
|
22
|
+
end
|
23
|
+
|
24
|
+
def cli_arg_version
|
25
|
+
return unless invoked_as_script? # don't want to hijack other binstubs
|
26
|
+
return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
|
27
|
+
bundler_version = nil
|
28
|
+
update_index = nil
|
29
|
+
ARGV.each_with_index do |a, i|
|
30
|
+
if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
|
31
|
+
bundler_version = a
|
32
|
+
end
|
33
|
+
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
|
34
|
+
bundler_version = $1
|
35
|
+
update_index = i
|
36
|
+
end
|
37
|
+
bundler_version
|
38
|
+
end
|
39
|
+
|
40
|
+
def gemfile
|
41
|
+
gemfile = ENV["BUNDLE_GEMFILE"]
|
42
|
+
return gemfile if gemfile && !gemfile.empty?
|
43
|
+
|
44
|
+
File.expand_path("../../Gemfile", __FILE__)
|
45
|
+
end
|
46
|
+
|
47
|
+
def lockfile
|
48
|
+
lockfile =
|
49
|
+
case File.basename(gemfile)
|
50
|
+
when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
|
51
|
+
else "#{gemfile}.lock"
|
52
|
+
end
|
53
|
+
File.expand_path(lockfile)
|
54
|
+
end
|
55
|
+
|
56
|
+
def lockfile_version
|
57
|
+
return unless File.file?(lockfile)
|
58
|
+
lockfile_contents = File.read(lockfile)
|
59
|
+
return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
|
60
|
+
Regexp.last_match(1)
|
61
|
+
end
|
62
|
+
|
63
|
+
def bundler_version
|
64
|
+
@bundler_version ||=
|
65
|
+
env_var_version || cli_arg_version ||
|
66
|
+
lockfile_version
|
67
|
+
end
|
68
|
+
|
69
|
+
def bundler_requirement
|
70
|
+
return "#{Gem::Requirement.default}.a" unless bundler_version
|
71
|
+
|
72
|
+
bundler_gem_version = Gem::Version.new(bundler_version)
|
73
|
+
|
74
|
+
requirement = bundler_gem_version.approximate_recommendation
|
75
|
+
|
76
|
+
return requirement unless Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.7.0")
|
77
|
+
|
78
|
+
requirement += ".a" if bundler_gem_version.prerelease?
|
79
|
+
|
80
|
+
requirement
|
81
|
+
end
|
82
|
+
|
83
|
+
def load_bundler!
|
84
|
+
ENV["BUNDLE_GEMFILE"] ||= gemfile
|
85
|
+
|
86
|
+
activate_bundler
|
87
|
+
end
|
88
|
+
|
89
|
+
def activate_bundler
|
90
|
+
gem_error = activation_error_handling do
|
91
|
+
gem "bundler", bundler_requirement
|
92
|
+
end
|
93
|
+
return if gem_error.nil?
|
94
|
+
require_error = activation_error_handling do
|
95
|
+
require "bundler/version"
|
96
|
+
end
|
97
|
+
return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
|
98
|
+
warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
|
99
|
+
exit 42
|
100
|
+
end
|
101
|
+
|
102
|
+
def activation_error_handling
|
103
|
+
yield
|
104
|
+
nil
|
105
|
+
rescue StandardError, LoadError => e
|
106
|
+
e
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
m.load_bundler!
|
111
|
+
|
112
|
+
if m.invoked_as_script?
|
113
|
+
load Gem.bin_path("bundler", "bundle")
|
114
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
begin
|
3
|
+
load File.expand_path('../spring', __FILE__)
|
4
|
+
rescue LoadError => e
|
5
|
+
raise unless e.message.include?('spring')
|
6
|
+
end
|
7
|
+
APP_PATH = File.expand_path('../config/application', __dir__)
|
8
|
+
require_relative '../config/boot'
|
9
|
+
require 'rails/commands'
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
# path to your application root.
|
5
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
6
|
+
|
7
|
+
def system!(*args)
|
8
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
9
|
+
end
|
10
|
+
|
11
|
+
FileUtils.chdir APP_ROOT do
|
12
|
+
# This script is a way to setup or update your development environment automatically.
|
13
|
+
# This script is idempotent, so that you can run it at anytime and get an expectable outcome.
|
14
|
+
# Add necessary setup steps to this file.
|
15
|
+
|
16
|
+
puts '== Installing dependencies =='
|
17
|
+
system! 'gem install bundler --conservative'
|
18
|
+
system('bundle check') || system!('bundle install')
|
19
|
+
|
20
|
+
# Install JavaScript dependencies
|
21
|
+
# system('bin/yarn')
|
22
|
+
|
23
|
+
# puts "\n== Copying sample files =="
|
24
|
+
# unless File.exist?('config/database.yml')
|
25
|
+
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
|
26
|
+
# end
|
27
|
+
|
28
|
+
puts "\n== Preparing database =="
|
29
|
+
system! 'bin/rails db:prepare'
|
30
|
+
|
31
|
+
puts "\n== Removing old logs and tempfiles =="
|
32
|
+
system! 'bin/rails log:clear tmp:clear'
|
33
|
+
|
34
|
+
puts "\n== Restarting application server =="
|
35
|
+
system! 'bin/rails restart'
|
36
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# This file loads Spring without using Bundler, in order to be fast.
|
4
|
+
# It gets overwritten when you run the `spring binstub` command.
|
5
|
+
|
6
|
+
unless defined?(Spring)
|
7
|
+
require 'rubygems'
|
8
|
+
require 'bundler'
|
9
|
+
|
10
|
+
lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
|
11
|
+
spring = lockfile.specs.detect { |spec| spec.name == 'spring' }
|
12
|
+
if spring
|
13
|
+
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
|
14
|
+
gem 'spring', spring.version
|
15
|
+
require 'spring/binstub'
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
|
4
|
+
ENV["NODE_ENV"] ||= "development"
|
5
|
+
|
6
|
+
require "pathname"
|
7
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
8
|
+
Pathname.new(__FILE__).realpath)
|
9
|
+
|
10
|
+
require "bundler/setup"
|
11
|
+
|
12
|
+
require "webpacker"
|
13
|
+
require "webpacker/webpack_runner"
|
14
|
+
|
15
|
+
APP_ROOT = File.expand_path("..", __dir__)
|
16
|
+
Dir.chdir(APP_ROOT) do
|
17
|
+
Webpacker::WebpackRunner.run(ARGV)
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
|
4
|
+
ENV["NODE_ENV"] ||= "development"
|
5
|
+
|
6
|
+
require "pathname"
|
7
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
8
|
+
Pathname.new(__FILE__).realpath)
|
9
|
+
|
10
|
+
require "bundler/setup"
|
11
|
+
|
12
|
+
require "webpacker"
|
13
|
+
require "webpacker/dev_server_runner"
|
14
|
+
|
15
|
+
APP_ROOT = File.expand_path("..", __dir__)
|
16
|
+
Dir.chdir(APP_ROOT) do
|
17
|
+
Webpacker::DevServerRunner.run(ARGV)
|
18
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
3
|
+
Dir.chdir(APP_ROOT) do
|
4
|
+
begin
|
5
|
+
exec "yarnpkg", *ARGV
|
6
|
+
rescue Errno::ENOENT
|
7
|
+
$stderr.puts "Yarn executable was not detected in the system."
|
8
|
+
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
|
9
|
+
exit 1
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require_relative 'boot'
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
# Require the gems listed in Gemfile, including any gems
|
6
|
+
# you've limited to :test, :development, or :production.
|
7
|
+
Bundler.require(*Rails.groups)
|
8
|
+
|
9
|
+
module RailsApp
|
10
|
+
class Application < Rails::Application
|
11
|
+
# Initialize configuration defaults for originally generated Rails version.
|
12
|
+
if Rails.version.to_f >= 5.1
|
13
|
+
config.load_defaults Rails.version.to_f
|
14
|
+
end
|
15
|
+
|
16
|
+
if Rails::VERSION::MAJOR >= 6
|
17
|
+
# Allow requests to www.example.com for RSpec
|
18
|
+
config.hosts << 'www.example.com'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|