diff --git a/.gitignore b/.gitignore index 886f714..eddbb4f 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,5 @@ # Ignore master key for decrypting credentials and more. /config/master.key + +dump.rdb diff --git a/Gemfile b/Gemfile index 8c563a9..30325c9 100644 --- a/Gemfile +++ b/Gemfile @@ -28,7 +28,7 @@ gem "stimulus-rails" gem "jbuilder" # Use Redis adapter to run Action Cable in production -# gem "redis", "~> 4.0" +gem "redis", "~> 4.0" # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] # gem "kredis" @@ -74,3 +74,5 @@ group :test do gem "selenium-webdriver" gem "webdrivers" end + +gem "hotwire-livereload", "~> 1.2" diff --git a/Gemfile.lock b/Gemfile.lock index e8fec78..111f6ea 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -108,8 +108,12 @@ GEM rubocop smart_properties erubi (1.11.0) + ffi (1.15.5) globalid (1.0.0) activesupport (>= 5.0) + hotwire-livereload (1.2.2) + listen (>= 3.0.0) + rails (>= 6.0.0) i18n (1.12.0) concurrent-ruby (~> 1.0) importmap-rails (1.1.5) @@ -127,6 +131,9 @@ GEM rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) + listen (3.7.1) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) loofah (2.18.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) @@ -193,6 +200,10 @@ GEM zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.0.6) + rb-fsevent (0.11.2) + rb-inotify (0.10.1) + ffi (~> 1.0) + redis (4.8.0) regexp_parser (2.5.0) reline (0.3.1) io-console (~> 0.5) @@ -283,10 +294,12 @@ DEPENDENCIES capybara debug erb_lint + hotwire-livereload (~> 1.2) importmap-rails jbuilder puma (~> 5.0) rails (~> 7.0.3) + redis (~> 4.0) selenium-webdriver solargraph sprockets-rails diff --git a/app/controllers/hello_codespaces_controller.rb b/app/controllers/hello_codespaces_controller.rb new file mode 100644 index 0000000..478d499 --- /dev/null +++ b/app/controllers/hello_codespaces_controller.rb @@ -0,0 +1,4 @@ +class HelloCodespacesController < ApplicationController + def index + end +end diff --git a/app/helpers/hello_codespaces_helper.rb b/app/helpers/hello_codespaces_helper.rb new file mode 100644 index 0000000..874a2ca --- /dev/null +++ b/app/helpers/hello_codespaces_helper.rb @@ -0,0 +1,2 @@ +module HelloCodespacesHelper +end diff --git a/app/views/hello_codespaces/index.html.erb b/app/views/hello_codespaces/index.html.erb new file mode 100644 index 0000000..4962e7d --- /dev/null +++ b/app/views/hello_codespaces/index.html.erb @@ -0,0 +1,2 @@ +

HelloCodespaces#index

+

Find me in app/views/hello_codespaces/index.html.erb!!

diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 0d23b0e..fa5e3a0 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -8,6 +8,7 @@ <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> <%= javascript_importmap_tags %> + <%= hotwire_livereload_tags if Rails.env.development? %> diff --git a/config/cable.yml b/config/cable.yml index ae7a225..e9b56bb 100644 --- a/config/cable.yml +++ b/config/cable.yml @@ -1,5 +1,6 @@ development: - adapter: async + adapter: redis + url: redis://localhost:6379/1 test: adapter: test diff --git a/config/environments/development.rb b/config/environments/development.rb index bac3264..031b558 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -70,8 +70,10 @@ Rails.application.configure do # config.action_view.annotate_rendered_view_with_filenames = true # Uncomment if you wish to allow Action Cable access from any origin. - # config.action_cable.disable_request_forgery_protection = true + config.action_cable.disable_request_forgery_protection = true # Allow requests from our preview domain. config.hosts << "#{ENV['CODESPACE_NAME']}-3000.preview.app.github.dev" + + # config.action_cable.allowed_request_origins = ["#{ENV['CODESPACE_NAME']}-3000.preview.app.github.dev"] end diff --git a/config/routes.rb b/config/routes.rb index 262ffd5..c9b3d85 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,3 @@ Rails.application.routes.draw do - # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html - - # Defines the root path route ("/") - # root "articles#index" + root "hello_codespaces#index" end diff --git a/test/controllers/hello_codespaces_controller_test.rb b/test/controllers/hello_codespaces_controller_test.rb new file mode 100644 index 0000000..257bffd --- /dev/null +++ b/test/controllers/hello_codespaces_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class HelloCodespacesControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get hello_codespaces_index_url + assert_response :success + end +end diff --git a/vendor/cache/ffi-1.15.5.gem b/vendor/cache/ffi-1.15.5.gem new file mode 100644 index 0000000..a632047 Binary files /dev/null and b/vendor/cache/ffi-1.15.5.gem differ diff --git a/vendor/cache/hotwire-livereload-1.2.2.gem b/vendor/cache/hotwire-livereload-1.2.2.gem new file mode 100644 index 0000000..bfd2f2c Binary files /dev/null and b/vendor/cache/hotwire-livereload-1.2.2.gem differ diff --git a/vendor/cache/listen-3.7.1.gem b/vendor/cache/listen-3.7.1.gem new file mode 100644 index 0000000..5e1eed5 Binary files /dev/null and b/vendor/cache/listen-3.7.1.gem differ diff --git a/vendor/cache/rb-fsevent-0.11.2.gem b/vendor/cache/rb-fsevent-0.11.2.gem new file mode 100644 index 0000000..e645266 Binary files /dev/null and b/vendor/cache/rb-fsevent-0.11.2.gem differ diff --git a/vendor/cache/rb-inotify-0.10.1.gem b/vendor/cache/rb-inotify-0.10.1.gem new file mode 100644 index 0000000..276590b Binary files /dev/null and b/vendor/cache/rb-inotify-0.10.1.gem differ diff --git a/vendor/cache/redis-4.8.0.gem b/vendor/cache/redis-4.8.0.gem new file mode 100644 index 0000000..d6dc447 Binary files /dev/null and b/vendor/cache/redis-4.8.0.gem differ