cocoapods-binary-flutter 0.0.13 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf0a48430c58de7c8c8f8e98e01e2f7613138895c0df930685d2e0d2feb64b17
4
- data.tar.gz: ef036fbdc80ecc1aafdbb6775520de7cbe910e6362647e4d5a7e73fa8892ef48
3
+ metadata.gz: 0f717b026a079723850dc52daac7bc27be4f292a87a3b3492fc37ec94dd87515
4
+ data.tar.gz: 937a86786a0237c85791a682c343c708b51d665c47139df9e96e163d01dfdbde
5
5
  SHA512:
6
- metadata.gz: 263c9e302eaa6ad137f9edda5127aa38c9f95e33adb98aef44898c8de3e4ec345d358a5c5c6aed270cee54b9aae82388c1bef865e7b4d6835fc7d65ddda5b662
7
- data.tar.gz: 41ead2a9275e20fdaf63a5073c36dc520a29bdd2d6e8b4eb1c84338d9f6e64b2e0bc382462ca9e8651c27fc3f79fc4aecee35f65aa3ea8e50bc7ef2074e2f803
6
+ metadata.gz: 6951f405ee5a35a15a244d0df125b1c6894055d998dcea380e4df32c373c5a4f94c797939c35f687989cf2e690cfe5d176a9da646b9c775e5edfadd4a23e6066
7
+ data.tar.gz: b8904c4062b4565764506919b14aeb572575c20d78fa3c323befc7ec44fa0bc184142cf76446dd298539c4a38fc30de45e0b39977432ffaad4d7e27666b07b3f
@@ -1,3 +1,3 @@
1
1
  module CocoapodsBinaryFlutter
2
- VERSION = "0.0.13"
2
+ VERSION = "0.0.15"
3
3
  end
@@ -33,22 +33,23 @@ module Pod
33
33
  flutter_binary_home = flutter_f_home+md5value
34
34
  flutter_binary_path = flutter_binary_home+'/binary'
35
35
 
36
- #创建目录
37
- FileUtils.mkdir_p(flutter_binary_home)
36
+ # 创建目录(如果不存在)
37
+ FileUtils.mkdir_p(flutter_binary_home) unless Dir.exist?(flutter_binary_home)
38
38
 
39
- #清除超过30天的缓存
40
- Dir.foreach(flutter_f_home) do |item|
41
- next if item == '.' or item == '..' or item == '.DS_Store'
42
- # do work on real items
43
- dirpath = flutter_f_home+item
44
- if File.directory?(dirpath)
39
+ # 获取flutter_f_home目录下的所有子目录
40
+ subdirectories = Dir.entries(flutter_f_home).select { |entry| File.directory?(File.join(flutter_f_home, entry)) && !(entry =='.' || entry == '..' || entry == '.DS_Store') }
41
+
42
+ # 清除超过30天的缓存只有当子目录数量大于5个时才执行
43
+ if subdirectories.length > 5
44
+ subdirectories.each do |subdirectory|
45
+ next if subdirectory == md5value # 跳过flutter_binary_home目录
46
+ dirpath = File.join(flutter_f_home, subdirectory)
45
47
  a = File.mtime(dirpath)
46
- t = Time.new
47
- if (t-a).round/60/60/24 > 30
48
+ t = Time.now
49
+ if (t - a).round / 60 / 60 / 24 > 30
48
50
  FileUtils.remove_dir(dirpath)
49
51
  end
50
- end
51
-
52
+ end
52
53
  end
53
54
 
54
55
  #下载解压
@@ -4,7 +4,7 @@ require 'cocoapods-binary-flutter/hook'
4
4
  # 解决多工程 target 的情况下,编译错误,找不到 <Flutter/Flutter.h> 文件
5
5
  Pod::HooksManager.register('cocoapods-binary-flutter', :pre_install) do |_installer_context, _options|
6
6
  next unless Pod::Podfile::DSL.enable_fix_flutter_post_install
7
- next unless defined?(Pod::Podfile.instance_method(:flutter_post_install))
7
+ next unless defined?(flutter_post_install)
8
8
 
9
9
  swizzled_parse_subspecs = Pod::Podfile.instance_method(:flutter_post_install)
10
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-binary-flutter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jacky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-15 00:00:00.000000000 Z
11
+ date: 2024-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake