diff --git a/.rubocop.yml b/.rubocop.yml index b7222b739..d35f0a87c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -211,6 +211,9 @@ Layout/SpaceInsideBrackets: Layout/SpaceInsideHashLiteralBraces: Enabled: false +Layout/SpaceInsideArrayLiteralBrackets: + Enabled: false + Layout/SpaceInsideParens: Enabled: false @@ -317,9 +320,6 @@ Lint/IneffectiveAccessModifier: Lint/InheritException: Enabled: false -Lint/InvalidCharacterLiteral: - Enabled: false - Lint/LiteralInCondition: Enabled: false @@ -381,7 +381,7 @@ Lint/StringConversionInInterpolation: Enabled: false Lint/Syntax: - Enabled: false + Enabled: true Lint/UnderscorePrefixedVariableName: Enabled: false @@ -404,6 +404,12 @@ Lint/UnusedBlockArgument: Lint/UnusedMethodArgument: Enabled: false +Lint/UriEscapeUnescape: + Enabled: false + +Lint/UriRegexp: + Enabled: false + Lint/UselessAccessModifier: Enabled: false @@ -452,6 +458,39 @@ Metrics/ParameterLists: Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Enabled: false + +Naming/AsciiIdentifiers: + Enabled: false + +Naming/BinaryOperatorParameterName: + Enabled: false + +Naming/ClassAndModuleCamelCase: + Enabled: false + +Naming/ConstantName: + Enabled: false + +Naming/FileName: + Enabled: false + +Naming/HeredocDelimiterNaming: + Enabled: false + +Naming/MethodName: + Enabled: false + +Naming/PredicateName: + Enabled: false + +Naming/VariableName: + Enabled: false + +Naming/VariableNumber: + Enabled: false + Performance/Caller: Enabled: true @@ -539,6 +578,9 @@ Rails/ApplicationRecord: Rails/Blank: Enabled: false +Rails/CreateTableWithTimestamps: + Enabled: false + Rails/Date: Enabled: false @@ -554,6 +596,9 @@ Rails/DynamicFindBy: Rails/EnumUniqueness: Enabled: false +Rails/EnvironmentComparison: + Enabled: false + Rails/Exit: Enabled: false @@ -569,9 +614,18 @@ Rails/FindEach: Rails/HasAndBelongsToMany: Enabled: false +Rails/HasManyOrHasOneDependent: + Enabled: false + Rails/HttpPositionalArguments: Enabled: false +Rails/InverseOf: + Enabled: false + +Rails/LexicallyScopedActionFilter: + Enabled: false + Rails/NotNullColumn: Enabled: false @@ -584,6 +638,9 @@ Rails/OutputSafety: Rails/PluralizationGrammar: Enabled: false +Rails/Presence: + Enabled: false + Rails/Present: Enabled: true @@ -617,6 +674,9 @@ Rails/TimeZone: Rails/UniqBeforePluck: Enabled: false +Rails/UnknownEnv: + Enabled: false + Rails/Validation: Enabled: false @@ -638,9 +698,6 @@ Security/MarshalLoad: Security/YAMLLoad: Enabled: false -Style/AccessorMethodName: - Enabled: false - Style/Alias: Enabled: false @@ -653,9 +710,6 @@ Style/ArrayJoin: Style/AsciiComments: Enabled: false -Style/AsciiIdentifiers: - Enabled: false - Style/Attr: Enabled: false @@ -683,9 +737,6 @@ Style/CaseEquality: Style/CharacterLiteral: Enabled: false -Style/ClassAndModuleCamelCase: - Enabled: false - Style/ClassAndModuleChildren: Enabled: false @@ -710,13 +761,16 @@ Style/CommandLiteral: Style/CommentAnnotation: Enabled: false +Style/CommentedKeyword: + Enabled: false + Style/ConditionalAssignment: Enabled: false -Style/ConstantName: +Style/Copyright: Enabled: false -Style/Copyright: +Style/DateTime: Enabled: false Style/DefWithParentheses: @@ -755,10 +809,10 @@ Style/Encoding: Style/EndBlock: Enabled: false -Style/EvenOdd: +Style/EvalWithLocation: Enabled: false -Style/FileName: +Style/EvenOdd: Enabled: false Style/FlipFlop: @@ -839,15 +893,15 @@ Style/MethodDefParentheses: Style/MethodMissing: Enabled: false -Style/MethodName: - Enabled: false - Style/MissingElse: Enabled: false Style/MixinGrouping: Enabled: false +Style/MixinUsage: + Enabled: false + Style/ModuleFunction: Enabled: false @@ -911,9 +965,6 @@ Style/NumericPredicate: Style/OneLineConditional: Enabled: false -Style/OpMethod: - Enabled: false - Style/OptionHash: Enabled: false @@ -935,9 +986,6 @@ Style/PercentQLiterals: Style/PerlBackrefs: Enabled: false -Style/PredicateName: - Enabled: false - Style/PreferredHashMethods: Enabled: false @@ -947,6 +995,9 @@ Style/Proc: Style/RaiseArgs: Enabled: false +Style/RandomWithOffset: + Enabled: false + Style/RedundantBegin: Enabled: false @@ -971,6 +1022,9 @@ Style/RegexpLiteral: Style/RescueModifier: Enabled: false +Style/RescueStandardError: + Enabled: false + Style/SafeNavigation: Enabled: false @@ -1049,12 +1103,6 @@ Style/UnneededPercentQ: Style/VariableInterpolation: Enabled: false -Style/VariableName: - Enabled: false - -Style/VariableNumber: - Enabled: false - Style/WhenThen: Enabled: false diff --git a/Gemfile b/Gemfile index c7e41c398..591ce5f76 100644 --- a/Gemfile +++ b/Gemfile @@ -20,6 +20,8 @@ gem 'sdoc', '~> 0.4.0', group: :doc # Enable deep clone of active record models gem 'deep_cloneable', '~> 2.2.1' +gem 'warden', git: 'https://github.com/hassox/warden.git', branch: 'master' + # Use Unicorn as the app server gem 'unicorn' diff --git a/Gemfile.lock b/Gemfile.lock index f3a9f14d7..df20eaa38 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,11 @@ +GIT + remote: https://github.com/hassox/warden.git + revision: a4b197e0b28e7b576b0745b0f6aeaed8dbb774a4 + branch: master + specs: + warden (1.2.8) + rack (>= 1.0) + GIT remote: https://github.com/mina-deploy/mina.git revision: 343a7ab672d8b4f0ddb84ec240cde7d94b46397a @@ -133,6 +141,7 @@ GEM carrierwave (>= 0.9) crack (0.4.3) safe_yaml (~> 1.0.0) + crass (1.0.3) daemons (1.2.4) database_cleaner (1.5.3) datetime_picker_rails (0.0.7) @@ -142,7 +151,7 @@ GEM activerecord (>= 3.1.0, < 5.2.0) delayed_cron_job (0.7.2) delayed_job (>= 4.1) - delayed_job (4.1.3) + delayed_job (4.1.4) activesupport (>= 3.0, < 5.2) delayed_job_active_record (4.1.2) activerecord (>= 3.0, < 5.2) @@ -151,14 +160,14 @@ GEM activerecord (> 3.0.0) delayed_job (> 2.0.3) sinatra (>= 1.4.4) - devise (4.2.0) + devise (4.4.0) bcrypt (~> 3.0) orm_adapter (~> 0.1) - railties (>= 4.1.0, < 5.1) + railties (>= 4.1.0, < 5.2) responders warden (~> 1.2.3) diff-lcs (1.2.5) - domain_name (0.5.20161129) + domain_name (0.5.20170404) unf (>= 0.0.5, < 1.0.0) dotenv (2.2.0) dotenv-rails (2.2.0) @@ -389,7 +398,7 @@ GEM leaflet-markercluster-rails (0.7.0) railties (>= 3.1) leaflet-rails (0.7.7) - libv8 (3.16.14.17) + libv8 (3.16.14.19) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -400,7 +409,8 @@ GEM activesupport (>= 4.0) logstash-event (~> 1.2.0) request_store - loofah (2.0.3) + loofah (2.1.1) + crass (~> 1.0.2) nokogiri (>= 1.5.9) lumberjack (1.0.10) mail (2.6.4) @@ -416,7 +426,7 @@ GEM mime-types-data (3.2016.0521) mimemagic (0.3.2) mini_portile2 (2.3.0) - minitest (5.10.3) + minitest (5.11.1) momentjs-rails (2.17.1) railties (>= 3.1) multi_json (1.12.1) @@ -465,9 +475,9 @@ GEM openstack (3.3.7) json orm_adapter (0.5.0) - parallel (1.11.2) - parser (2.4.0.0) - ast (~> 2.2) + parallel (1.12.1) + parser (2.4.0.2) + ast (~> 2.3) pdf-core (0.6.1) pg (0.19.0) powerpack (0.1.1) @@ -485,7 +495,7 @@ GEM byebug (~> 9.0) pry (~> 0.10) public_suffix (2.0.5) - rack (2.0.1) + rack (2.0.3) rack-handlers (0.7.3) rack rack-mini-profiler (0.10.7) @@ -527,10 +537,9 @@ GEM method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rainbow (2.2.2) - rake + rainbow (3.0.0) raindrops (0.17.0) - rake (12.0.0) + rake (12.3.0) rb-fsevent (0.9.8) rb-inotify (0.9.7) ffi (>= 0.5.0) @@ -542,9 +551,10 @@ GEM rdoc (4.3.0) ref (2.0.0) request_store (1.3.1) - responders (2.3.0) - railties (>= 4.2.0, < 5.1) - rest-client (2.0.0) + responders (2.4.0) + actionpack (>= 4.2.0, < 5.3) + railties (>= 4.2.0, < 5.3) + rest-client (2.0.2) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) @@ -578,16 +588,16 @@ GEM rspec-support (3.5.0) rspec_junit_formatter (0.3.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (0.49.1) + rubocop (0.52.1) parallel (~> 1.10) - parser (>= 2.3.3.1, < 3.0) + parser (>= 2.4.0.2, < 3.0) powerpack (~> 0.1) - rainbow (>= 1.99.1, < 3.0) + rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) rubocop-rspec-focused (0.1.0) rubocop (>= 0.37) - ruby-progressbar (1.8.1) + ruby-progressbar (1.9.0) ruby_dep (1.5.0) ruby_parser (3.10.1) sexp_processor (~> 4.9) @@ -660,10 +670,10 @@ GEM i18n json (>= 1.4.3) sysexits (1.2.0) - therubyracer (0.12.2) - libv8 (~> 3.16.14.0) + therubyracer (0.12.3) + libv8 (~> 3.16.14.15) ref - thor (0.19.4) + thor (0.20.0) thread_safe (0.3.6) tilt (2.0.8) timecop (0.8.1) @@ -674,12 +684,12 @@ GEM turbolinks-source (5.0.0) tzinfo (1.2.4) thread_safe (~> 0.1) - uglifier (3.0.4) + uglifier (4.1.3) execjs (>= 0.3.0, < 3) unf (0.1.4) unf_ext - unf_ext (0.0.7.2) - unicode-display_width (1.2.1) + unf_ext (0.0.7.4) + unicode-display_width (1.3.0) unicode_utils (1.4.0) unicorn (5.2.0) kgio (~> 2.6) @@ -692,8 +702,6 @@ GEM activemodel (>= 3.0.0) addressable vcr (3.0.3) - warden (1.2.6) - rack (>= 1.0) web-console (3.4.0) actionview (>= 5.0) activemodel (>= 5.0) @@ -804,6 +812,7 @@ DEPENDENCIES unicode_utils unicorn vcr + warden! web-console webmock xray-rails diff --git a/db/migrate/20170215102943_remove_duplicate_email_received.rb b/db/migrate/20170215102943_remove_duplicate_email_received.rb index e69945626..4464e7ffd 100644 --- a/db/migrate/20170215102943_remove_duplicate_email_received.rb +++ b/db/migrate/20170215102943_remove_duplicate_email_received.rb @@ -3,7 +3,7 @@ class RemoveDuplicateEmailReceived < ActiveRecord::Migration[5.0] all_mails = MailReceived.all groupped = all_mails.group_by { |m| m.procedure_id } filtered = groupped.reject { |k, v| v.length < 2 } - filtered.each do |k, duplicate_mails| + filtered.each_value do |duplicate_mails| duplicate_mails.pop duplicate_mails.each(&:destroy) end diff --git a/lib/tasks/2017_10_30_copy_commentaire_piece_justificative_to_file.rake b/lib/tasks/2017_10_30_copy_commentaire_piece_justificative_to_file.rake index f26a04edb..2ad820f4a 100644 --- a/lib/tasks/2017_10_30_copy_commentaire_piece_justificative_to_file.rake +++ b/lib/tasks/2017_10_30_copy_commentaire_piece_justificative_to_file.rake @@ -21,7 +21,7 @@ namespace :'2017_10_30_copy_commentaire_piece_justificative_to_file' do def sanitize_name(name) # from https://github.com/carrierwaveuploader/carrierwave/blob/master/lib/carrierwave/sanitized_file.rb#L323 name = name.gsub(/[^[:word:]\.\-\+]/,"_") - name = "_#{name}" if name =~ /\A\.+\z/ + name = "_#{name}" if name.match?(/\A\.+\z/) name = "unnamed" if name.size == 0 return name.mb_chars.to_s end