redmine_with_git 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 41c5cef1997a8a62157c3688bfac26cfd32716f6c42a5b746e69ce1a905804ce
4
- data.tar.gz: 691b298324491169f88ce6701d550a513a8082542e3891d5c2fb8c4d51836f00
3
+ metadata.gz: 180c030aca85081dfee8c238bd41483d38635843330381e7ca83684d6c486516
4
+ data.tar.gz: e24239fb73c7e0d4d23f2526104c89c1b29b0b4e4744249ef26e07a1020ec3a2
5
5
  SHA512:
6
- metadata.gz: ddae741acd3582e0961e70d0d96aa3be9644f9cf5c6d9e0e798264d32f4afc6b1c99e4db5a4eb96e95cce57591ce8fec95b06abd04c2e5057d02a3f35bc7c62a
7
- data.tar.gz: f7e6693264bc94c099d629a22534dfe9b193a5f20971aba95af4eda4b9d94303a3d61cf69c3a06b01210dfa7d4b43fe80ad5dcb878258baded852a420450de5f
6
+ metadata.gz: 97b5072b4f3bf68f9e3113cc5e1704546065c3fcefb171cc4cbfd141d81e1d98c9a99a51b70220522a2532010af639851631dc4c4442dfff8f3226391b26e27a
7
+ data.tar.gz: a49321b8ed13fbe126260dffe6ba063a5177e441a89fbeb58e1985acaecdf05f8f1d86cf61961dc018351e70e1ad06cf5947168042eb4e68c66319075d843727
@@ -0,0 +1,4 @@
1
+ patches_root = ::File.dirname(::File.dirname(__dir__))
2
+ Dir["#{patches_root}/lib/**/*.rb"].each do |f|
3
+ load(f)
4
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RedmineGitHosting
4
+ module Cache
5
+ module DatabasePatch
6
+ def self.included(base)
7
+ base.include(InstanceMethods)
8
+ base.class_eval do
9
+ alias_method_chain :apply_cache_limit, :redmine_with_git
10
+ end
11
+ end
12
+
13
+ module InstanceMethods
14
+ def apply_cache_limit_with_redmine_with_git
15
+ return unless max_cache_elements >= 0 && GitCache.count > max_cache_elements
16
+
17
+ GitCache.order(created_at: :desc).last.destroy
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+
24
+ patch = ::RedmineGitHosting::Cache::DatabasePatch
25
+ target = ::RedmineGitHosting::Cache::Database
26
+ target.send(:include, patch) unless target.included_modules.include? patch
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RedmineWithGit
4
- VERSION = '0.1.4'.freeze
4
+ VERSION = '0.1.5'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine_with_git
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-14 00:00:00.000000000 Z
11
+ date: 2019-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_rails_utils
@@ -58,6 +58,7 @@ files:
58
58
  - app/views/redmine_with_git/_import.html.erb
59
59
  - app/views/redmine_with_git/index.html.erb
60
60
  - config/initializers/000_dependencies.rb
61
+ - config/initializers/001_patches.rb
61
62
  - config/locales/en.yml
62
63
  - config/locales/pt-BR.yml
63
64
  - config/routes.rb
@@ -77,6 +78,7 @@ files:
77
78
  - lib/redmine_with_git/load/database.rb
78
79
  - lib/redmine_with_git/load/files.rb
79
80
  - lib/redmine_with_git/load/git.rb
81
+ - lib/redmine_with_git/patches/redmine_git_hosting/cache/database_patch.rb
80
82
  - lib/redmine_with_git/version.rb
81
83
  - lib/tasks/redmine_with_git.rake
82
84
  homepage: