Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1 @@
AllCops:
Exclude:
- 'apps/web/application.rb'
- 'db/**/*'
- 'spec/**/*'
- 'Rakefile'

ConditionalAssignment:
Enabled: false
StringLiterals:
Enabled: false
RedundantReturn:
Enabled: false
Documentation:
Enabled: false
WordArray:
Enabled: false
AbcSize:
Enabled: false
MutableConstant:
Enabled: false
SignalException:
Enabled: false
CyclomaticComplexity:
Enabled: false
MissingRespondToMissing:
Enabled: false
MethodMissingSuper:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
LineLength:
Max: 120
Style/EmptyMethod:
Enabled: false
Bundler/OrderedGems:
Enabled: false
Metrics/BlockLength:
Exclude:
- 'Rakefile'
- '**/*.rake'
- 'spec/**/*.rb'
Style/ClassAndModuleChildren:
Enabled: false
18 changes: 10 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
# frozen_string_literal: true

source 'https://rubygems.org'

gem 'rake'
gem 'hanami', '~> 1.3'
gem 'hanami', '~> 1.3'
gem 'hanami-model', '~> 1.3'
gem 'rake'

gem 'pg'
gem 'sass', '~> 3.4', '>= 3.4.22'
gem 'bootstrap', '~> 4.3.1'
gem 'haml'
gem 'json-schema'
gem 'sidekiq'
gem 'omni_scrapper', path: '../omni_scrapper'
gem 'pg'
gem 'sass', '~> 3.4', '>= 3.4.22'
gem 'sidekiq'

group :development do
# Code reloading
# See: http://hanamirb.org/guides/projects/code-reloading
gem 'shotgun', platforms: :ruby
gem 'hanami-webconsole'
gem 'shotgun', platforms: :ruby
end

group :test, :development do
gem 'dotenv', '~> 2.4'
gem 'rubocop'
gem 'hanami-fabrication'
gem 'pry', '~> 0.12.2'
gem 'rubocop'
end

group :test do
gem 'rspec'
gem 'capybara'
gem 'rspec'
end

group :production do
Expand Down
4 changes: 3 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# frozen_string_literal: true

require 'rake'
require 'hanami/rake_tasks'

begin
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
task default: :spec
rescue LoadError
# rescue LoadError
end
14 changes: 8 additions & 6 deletions apps/web/application.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'sass'
require 'hanami/helpers'
require 'hanami/assets'
Expand All @@ -19,10 +21,10 @@ class Application < Hanami::Application
#
# When you add new directories, remember to add them here.
#
load_paths << [
'validations',
'controllers',
'views'
load_paths << %w[
validations
controllers
views
]

# Handle exceptions with HTTP statuses (true) or don't catch them (false).
Expand Down Expand Up @@ -225,7 +227,7 @@ class Application < Hanami::Application
#
# * https://developer.mozilla.org/en-US/docs/Web/Security/CSP/CSP_policy_directives
#
security.content_security_policy %{
security.content_security_policy %(
form-action 'self';
frame-ancestors 'self';
base-uri 'self';
Expand All @@ -240,7 +242,7 @@ class Application < Hanami::Application
child-src 'self';
frame-src 'self';
media-src 'self'
}
)

##
# FRAMEWORKS
Expand Down
2 changes: 2 additions & 0 deletions apps/web/config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

root to: 'home#index'
resources :sites
resources :schemas
Expand Down
5 changes: 3 additions & 2 deletions apps/web/controllers/home/index.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# frozen_string_literal: true

module Web
module Controllers
module Home
class Index
include Web::Action

def call(params)
end
def call(params); end
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions apps/web/controllers/schemas/create.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Controllers
module Schemas
Expand Down
4 changes: 3 additions & 1 deletion apps/web/controllers/schemas/index.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Controllers
module Schemas
Expand All @@ -6,7 +8,7 @@ class Index

expose :schemas

def call(params)
def call(_params)
@schemas = SchemaRepository.new.all
end
end
Expand Down
5 changes: 3 additions & 2 deletions apps/web/controllers/schemas/new.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# frozen_string_literal: true

module Web
module Controllers
module Schemas
class New
include Web::Action

def call(params)
end
def call(params); end
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions apps/web/controllers/sites/create.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Controllers
module Sites
Expand Down
2 changes: 2 additions & 0 deletions apps/web/controllers/sites/destroy.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Controllers
module Sites
Expand Down
2 changes: 2 additions & 0 deletions apps/web/controllers/sites/edit.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Controllers
module Sites
Expand Down
2 changes: 2 additions & 0 deletions apps/web/controllers/sites/index.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Controllers
module Sites
Expand Down
5 changes: 3 additions & 2 deletions apps/web/controllers/sites/new.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# frozen_string_literal: true

module Web
module Controllers
module Sites
class New
include Web::Action

def call(params)
end
def call(params); end
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions apps/web/controllers/sites/show.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Controllers
module Sites
Expand Down
2 changes: 2 additions & 0 deletions apps/web/controllers/sites/update.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Controllers
module Sites
Expand Down
5 changes: 3 additions & 2 deletions apps/web/controllers/tasks/create.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# frozen_string_literal: true

module Web
module Controllers
module Tasks
class Create
include Web::Action

def call(params)
end
def call(params); end
end
end
end
Expand Down
4 changes: 3 additions & 1 deletion apps/web/controllers/tasks/index.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Controllers
module Tasks
Expand All @@ -6,7 +8,7 @@ class Index

expose :tasks

def call(params)
def call(_params)
@tasks = TaskRepository.new.all
end
end
Expand Down
5 changes: 3 additions & 2 deletions apps/web/controllers/tasks/new.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# frozen_string_literal: true

module Web
module Controllers
module Tasks
class New
include Web::Action

def call(params)
end
def call(params); end
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions apps/web/views/application_layout.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Views
class ApplicationLayout
Expand Down
4 changes: 3 additions & 1 deletion apps/web/views/base_view.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

module Web
module Views
class BaseView
class BaseView
include Web::View

def edit_button(path)
Expand Down
2 changes: 2 additions & 0 deletions apps/web/views/home/index.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Views
module Home
Expand Down
2 changes: 2 additions & 0 deletions apps/web/views/schemas/create.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Views
module Schemas
Expand Down
2 changes: 2 additions & 0 deletions apps/web/views/schemas/index.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Views
module Schemas
Expand Down
2 changes: 2 additions & 0 deletions apps/web/views/schemas/new.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Views
module Schemas
Expand Down
2 changes: 2 additions & 0 deletions apps/web/views/sites/edit.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Views
module Sites
Expand Down
2 changes: 2 additions & 0 deletions apps/web/views/sites/index.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Views
module Sites
Expand Down
2 changes: 2 additions & 0 deletions apps/web/views/sites/new.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Views
module Sites
Expand Down
2 changes: 2 additions & 0 deletions apps/web/views/sites/show.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Views
module Sites
Expand Down
2 changes: 2 additions & 0 deletions apps/web/views/tasks/create.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Views
module Tasks
Expand Down
2 changes: 2 additions & 0 deletions apps/web/views/tasks/index.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Views
module Tasks
Expand Down
2 changes: 2 additions & 0 deletions apps/web/views/tasks/new.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Web
module Views
module Tasks
Expand Down
2 changes: 2 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require './config/environment'

run Hanami.app
2 changes: 2 additions & 0 deletions config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# frozen_string_literal: true

require_relative './environment'
Hanami.boot
Loading