Skip to content

Commit 8aecbf5

Browse files
Fix rubocop issues
1 parent 2399332 commit 8aecbf5

30 files changed

+153
-94
lines changed

apps/main/lib/todo/main/view/context.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
require "todo/view/context"
1+
# frozen_string_literal: true
2+
3+
require 'todo/view/context'
24

35
module Todo
46
module Main

apps/main/lib/todo/main/view/controller.rb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1+
# frozen_string_literal: true
2+
13
# auto_register: false
24

3-
require "slim"
4-
require "dry/view/controller"
5-
require "todo/main/container"
5+
require 'slim'
6+
require 'dry/view/controller'
7+
require 'todo/main/container'
68

79
module Todo
810
module Main
911
module View
1012
class Controller < Dry::View::Controller
1113
configure do |config|
12-
config.paths = [Container.root.join("web/templates")]
13-
config.context = Container["view.context"]
14-
config.layout = "application"
14+
config.paths = [Container.root.join('web/templates')]
15+
config.context = Container['view.context']
16+
config.layout = 'application'
1517
end
1618
end
1719
end

apps/main/lib/todo/main/views/welcome.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
require "todo/main/view/controller"
1+
# frozen_string_literal: true
2+
3+
require 'todo/main/view/controller'
24

35
module Todo
46
module Main
57
module Views
68
class Welcome < View::Controller
79
configure do |config|
8-
config.template = "welcome"
10+
config.template = 'welcome'
911
end
1012
end
1113
end

apps/main/system/boot.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
require_relative "todo/main/container"
1+
# frozen_string_literal: true
2+
3+
require_relative 'todo/main/container'
24

35
Todo::Main::Container.finalize!
46

5-
require "todo/main/web"
7+
require 'todo/main/web'
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
require "pathname"
2-
require "dry/web/container"
3-
require "dry/system/components"
1+
# frozen_string_literal: true
2+
3+
require 'pathname'
4+
require 'dry/web/container'
5+
require 'dry/system/components'
46

57
module Todo
68
module Main
79
class Container < Dry::Web::Container
8-
require root.join("system/todo/container")
10+
require root.join('system/todo/container')
911
import core: Todo::Container
1012

1113
configure do |config|
12-
config.root = Pathname(__FILE__).join("../../..").realpath.dirname.freeze
14+
config.root =
15+
Pathname(__FILE__).join('../../..').realpath.dirname.freeze
1316
config.logger = Todo::Container[:logger]
14-
config.default_namespace = "todo.main"
17+
config.default_namespace = 'todo.main'
1518
config.auto_register = %w[lib/todo/main]
1619
end
1720

18-
load_paths! "lib"
21+
load_paths! 'lib'
1922
end
2023
end
2124
end

apps/main/system/todo/main/import.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
require_relative "container"
1+
# frozen_string_literal: true
2+
3+
require_relative 'container'
24

35
module Todo
46
module Main

apps/main/system/todo/main/web.rb

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
require "dry/web/roda/application"
2-
require_relative "container"
1+
# frozen_string_literal: true
2+
3+
require 'dry/web/roda/application'
4+
require_relative 'container'
35

46
module Todo
57
module Main
68
class Web < Dry::Web::Roda::Application
79
configure do |config|
810
config.container = Container
9-
config.routes = "web/routes".freeze
11+
config.routes = 'web/routes'
1012
end
1113

12-
opts[:root] = Pathname(__FILE__).join("../../..").realpath.dirname
14+
opts[:root] = Pathname(__FILE__).join('../../..').realpath.dirname
1315

14-
use Rack::Session::Cookie, key: "todo.main.session", secret: self["core.settings"].session_secret
16+
use Rack::Session::Cookie, key: 'todo.main.session',
17+
secret: self['core.settings'].session_secret
1518

1619
plugin :csrf, raise: true
1720
plugin :dry_view
@@ -24,7 +27,7 @@ class Web < Dry::Web::Roda::Application
2427
# r.multi_route
2528

2629
r.root do
27-
r.view "welcome"
30+
r.view 'welcome'
2831
end
2932
end
3033

@@ -34,7 +37,7 @@ def view_context_options
3437
flash: flash,
3538
csrf_token: Rack::Csrf.token(request.env),
3639
csrf_metatag: Rack::Csrf.metatag(request.env),
37-
csrf_tag: Rack::Csrf.tag(request.env),
40+
csrf_tag: Rack::Csrf.tag(request.env)
3841
}
3942
end
4043

apps/main/web/routes/example.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# frozen_string_literal: true
12
# Define your routes like this:
23
#
34
# class Todo::Main::Web

bin/console

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
23

3-
require "bundler/setup"
4-
require "dry/web/console"
5-
require_relative "../system/boot"
4+
require 'bundler/setup'
5+
require 'dry/web/console'
6+
require_relative '../system/boot'
67

78
Dry::Web::Console.start

bin/setup

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
23

3-
APP_ROOT = File.expand_path("../../", __FILE__)
4+
APP_ROOT = File.expand_path('../../', __FILE__)
45

56
Dir.chdir(APP_ROOT) do
67
# Set up your app for development here

0 commit comments

Comments
 (0)