Skip to content

Commit

Permalink
Pasa de sip a msip
Browse files Browse the repository at this point in the history
  • Loading branch information
vtamara committed Jan 22, 2023
1 parent 12f5cc9 commit 1598240
Show file tree
Hide file tree
Showing 101 changed files with 5,959 additions and 5,741 deletions.
2 changes: 1 addition & 1 deletion .env.plantilla
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ if (test "$ORIGEN_CORS" = "") then {
} fi;


# Configuraciones requeridas por sip
# Configuraciones requeridas por msip
if (test "$SIP_FORMATO_FECHA" = "") then {
export SIP_FORMATO_FECHA='dd/M/yyyy'
} fi;
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ archivos/
public/heb412/
public/fasol/si/assets/
.byebug_history
app/views/sip/hogar/
app/views/msip/hogar/
bin/u.sh
coverage/
bin/corre.sh
Expand All @@ -41,7 +41,7 @@ config/credentials.yml.enc
.env
*.cp
app/assets/builds/
app/javascript/controllers/sip
app/javascript/controllers/msip
app/javascript/controllers/mr519_gen
app/javascript/controllers/heb412_gen
app/javascript/controllers/cor1440_gen
Expand All @@ -50,3 +50,4 @@ app/javascript/controllers/sivel2_gen
public/fasol/si/csv/
public/fasol/sipub
ref
app/javascript/controllers/sip
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ test:
- sed -e 's/provider = libc,//g;s/SET default_table_access_method.*/-- &/g' db/structure.sql.copia > db/structure.sql
- which psql
- bin/rails db:drop db:create db:setup
- bin/rails sip:indices
- bin/rails sip:stimulus_motores
- bin/rails msip:indices
- bin/rails msip:stimulus_motores
- bin/rails assets:precompile
script:
- (. .env && CONFIG_HOSTS=www.example.com bin/rails test)
Expand Down
67 changes: 67 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
require:
- rubocop-minitest
- rubocop-rails

inherit_gem:
rubocop-shopify: rubocop.yml

Style/FrozenStringLiteralComment:
Enabled: true
# SafeAutoCorrect: false

Minitest/AssertPredicate:
Enabled: false
# 1. Hace más largo el assert porque transforma `assert caso.valid?` en
# `assert_predicate caso, :valid?`
# 2. EMHO no facilita legibilidad
# 3. No es homogéneo, no transforma `assert_not caso.valid?`
# La ventaja de assert_predicate es que presenta mejor
# mensaje de error cuando la aserción falla.

Minitest/MultipleAssertions:
Enabled: false

Rails/ApplicationRecord:
Enabled: false

Rails/LexicallyScopedActionFilter:
Enabled: false

Rails/SquishedSQLHeredocs:
Enabled: false

Rails/OutputSafety:
Exclude:
- lib/msip/engine.rb
- app/helpers/msip/*

Rails/Exit:
Exclude:
- lib/generators/msip/*

Rails/Output:
Exclude:
- lib/generators/msip/*

# En generadores Rails.root es nil
Rails/FilePath:
Exclude:
- lib/msip/engine.rb

Lint/RedundantStringCoercion:
Exclude:
- lib/msip/engine.rb

Rails/RenderInline:
Enabled: false

Naming/AsciiIdentifiers:
Enabled: false

Metrics/ParameterLists:
Enabled: false

AllCops:
NewCops: enable


24 changes: 24 additions & 0 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# frozen_string_literal: true

SimpleCov.formatters = [
SimpleCov::Formatter::SimpleFormatter,
SimpleCov::Formatter::HTMLFormatter,
]

SimpleCov.coverage_dir("coverage")
if ENV["CONFIG_HOSTS"] == "www.example.com"
SimpleCov.coverage_dir("cobertura-unitarias")
elsif ENV["CONFIG_HOSTS"] == "127.0.0.1"
SimpleCov.coverage_dir("cobertura-sistema")
end

SimpleCov.start do
enable_coverage :branch
primary_coverage :branch
enable_coverage_for_eval
filters.clear # This will remove default :root_filter and :bundler_filter
add_filter do |src|
!(src.filename =~ /^#{SimpleCov.root}/) unless src.filename =~ /msip/
end
add_filter "/test/"
end
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ before_install:
- cp config/database.travis.yml config/database.yml
- cp config/application.rb.plantilla config/application.rb
- cp config/routes.rb.plantilla config/routes.rb
- cp config/initializers/sip.rb.plantilla config/initializers/sip.rb
- cp config/initializers/msip.rb.plantilla config/initializers/msip.rb
- cp config/initializers/punto_montaje.rb.plantilla config/initializers/punto_montaje.rb
- cp db/structure.sql db/structure.sql.copia # travis no soporta PostreSQL 10
- sed -e 's/provider = libc,//g;s/SET default_table_access_method.*/-- &/g' db/structure.sql.copia > db/structure.sql
- bundle exec rails db:setup
- bundle exec rails sip:indices
- bundle exec rails msip:indices

script:
- RAILS_ENV=test CONFIG_HOSTS=127.0.0.1 jest
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# CONTRIBUCIONES

Aplican los mismos lineamientos descritos en:
<https://github.com/pasosdeJesus/sip/blob/master/CONTRIBUTING.md>
<https://github.com/pasosdeJesus/msip/blob/master/CONTRIBUTING.md>

Respecto a la aplicación de prueba, una vez la configure e ingrese
a la aplicación desde un navegador en el punto de montaje `/sivel2`,
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ gem 'will_paginate' # Listados en páginas
# Motores que se sobrecargan vistas (a diferencia de las anteriores gemas,
# estas ponerse en orden de apilamiento lógico y no alfabético).

gem 'sip', # Motor generico
git: 'https://github.com/pasosdeJesus/sip.git', branch: :main
#path: '../sip'
gem 'msip', # Motor generico
git: 'https://github.com/pasosdeJesus/msip.git', branch: :main
#path: '../msip'

gem 'mr519_gen', # Motor de gestion de formularios y encuestas
git: 'https://github.com/pasosdeJesus/mr519_gen.git', branch: :main
Expand Down
12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ GIT
kt-paperclip
mr519_gen
rails
sip
msip

GIT
remote: https://github.com/pasosdeJesus/heb412_gen.git
Expand All @@ -39,7 +39,7 @@ GIT
mr519_gen
redcarpet
rspreadsheet
sip
msip

GIT
remote: https://github.com/pasosdeJesus/mr519_gen.git
Expand All @@ -48,14 +48,14 @@ GIT
specs:
mr519_gen (2.1.0.beta1)
rails
sip
msip

GIT
remote: https://github.com/pasosdeJesus/sip.git
remote: https://github.com/pasosdeJesus/msip.git
revision: 20b5646a730f8a8c174ab2bc252953e5feb9bd79
branch: main
specs:
sip (2.1.0.beta1)
msip (2.1.0.beta1)
cancancan
coffee-rails
devise
Expand Down Expand Up @@ -511,7 +511,7 @@ DEPENDENCIES
selenium-webdriver
simple_form
simplecov (< 0.18)
sip!
msip!
sivel2_gen!
spring
sprockets-rails
Expand Down
47 changes: 40 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,48 @@

valida: valida-js valida-ruby
all: sintaxis-js sintaxis-ruby bundler-audit brakeman rubocop

valida-js:
sintaxis-js:
for i in `find app/assets/javascripts/ -name "*js" -or -name "*es6"`; do \
node -c $$i; \
done
for i in `find app/assets/javascripts/ -name "*coffee"`; do \
coffee -o /tmp/ $$i; \
done

valida-ruby:
sintaxis-ruby:
find . -name "*\.rb" -exec ruby -w -W2 -c {} ';'

erd:
bundle exec erd
mv erd.pdf doc/
convert doc/erd.pdf doc/erd.png
instala-gemas:
grep "([0-9]" Gemfile.lock | sed -e "s/^ */doas gem install /g;s/ (/ -v /g;s/)//g" > /tmp/i.sh
doas chmod +x /tmp/i.sh
doas /tmp/i.sh

erd: # Antes de esto instalar graphviz con doas pkg_add graphviz
(cd test/dummy; \
bundle exec erd)
mv test/dummy/erd.pdf doc/
pdftoppm doc/erd.pdf doc/erd
convert doc/erd-1.ppm doc/erd.png
rm doc/erd-1.ppm

doc/dependencias.png: doc/dependencias.dot
dot -Tpng doc/dependencias.dot > doc/dependencias.png


bundler-audit:
bin/bundler-audit

brakeman:
bin/brakeman

rubocop:
bin/rubocop

c_brakeman:
bin/brakeman -I

c_rubocop:
bin/rubocop -a

yard:
yard
2 changes: 1 addition & 1 deletion app/assets/javascripts/recursos_sprockets.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// de las directivas soportadas.
//
//= require best_in_place
//= require sip/motor
//= require msip/motor
//= require heb412_gen/motor
//= require mr519_gen/motor
//= require sivel2_gen/motor
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/cargosestado_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Admin
class CargosestadoController < Sip::Admin::BasicasController
class CargosestadoController < Msip::Admin::BasicasController
before_action :set_cargoestado,
only: [:show, :edit, :update, :destroy]
load_and_authorize_resource class: ::Cargoestado
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ApplicationController < Sip::ApplicationController
class ApplicationController < Msip::ApplicationController
protect_from_forgery with: :exception

# No requiere autorización
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
require 'sip/concerns/controllers/orgsociales_controller'
require 'msip/concerns/controllers/orgsociales_controller'

module Sip
class OrgsocialesController < Sip::ModelosController
module Msip
class OrgsocialesController < Msip::ModelosController
before_action :set_orgsocial, only: [:show, :edit, :update, :destroy]
load_and_authorize_resource class: Sip::Orgsocial
load_and_authorize_resource class: Msip::Orgsocial

include Sip::Concerns::Controllers::OrgsocialesController
include Msip::Concerns::Controllers::OrgsocialesController

def atributos_index
[ :id,
Expand Down Expand Up @@ -38,7 +38,7 @@ def atributos_show
end

def arma_jerarquia(subde_id, nombre_papa)
hijos = Sip::Orgsocial.habilitados.where(subde_id: subde_id)
hijos = Msip::Orgsocial.habilitados.where(subde_id: subde_id)
hijosa = hijos.map do |h|
arma_jerarquia(h.id, h.grupoper.nombre)
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/sivel2_gen/conteos_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def self.calcula_fasol_banco_detalle(preg)
" ON ac.id_categoria=cat.id "\
" JOIN sivel2_gen_pconsolidado AS p "\
" ON p.id=cat.id_pconsolidado "\
" JOIN sip_persona AS per "\
" JOIN msip_persona AS per "\
" ON per.id=ac.id_persona "\
" JOIN sivel2_gen_victima AS vic "\
" ON per.id=vic.id_persona AND caso.id=vic.id_caso "\
Expand Down
10 changes: 5 additions & 5 deletions app/controllers/usuarios_controller.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
require 'sip/concerns/controllers/usuarios_controller'
require 'msip/concerns/controllers/usuarios_controller'
require 'sivel2_gen/concerns/controllers/usuarios_controller'

class UsuariosController < Heb412Gen::ModelosController

include Sip::Concerns::Controllers::UsuariosController
include Msip::Concerns::Controllers::UsuariosController
include Sivel2Gen::Concerns::Controllers::UsuariosController

def atributos_index
Expand All @@ -17,7 +17,7 @@ def atributos_index
:numerodocumento,
:email,
:rol,
:sip_grupo,
:msip_grupo,
:descripcion,
:created_at_localizada,
:habilitado
Expand All @@ -34,7 +34,7 @@ def atributos_form
:numerodocumento,
:email,
:rol,
:sip_grupo,
:msip_grupo,
:descripcion,
:tema,
:idioma,
Expand All @@ -50,7 +50,7 @@ def atributos_form
private

def lista_params
lista_params_sip + [
lista_params_msip + [
:fechanac,
:sexonac,
:tdocumento_id,
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ promesaRecursosSprocketsYDocumento.then((mensaje) => {
console.log(mensaje)
var root = window;

sip_prepara_eventos_comunes(root, null, false);
msip_prepara_eventos_comunes(root, null, false);
heb412_gen_prepara_eventos_comunes(root);
mr519_gen_prepara_eventos_comunes(root);
sivel2_gen_prepara_eventos_comunes(root);
Expand Down Expand Up @@ -89,7 +89,7 @@ document.addEventListener('turbo:load', (e) => {

console.log('Escuchador turbo:render')

sip_ejecutarAlCargarPagina(window)
msip_ejecutarAlCargarPagina(window)
})

import "./controllers"
Expand Down
Loading

0 comments on commit 1598240

Please sign in to comment.