@@ -367,7 +367,7 @@ yml_other_set()
367
367
);
368
368
match_group=Value['rules'].grep(/(MATCH|FINAL)/)[0];
369
369
if not match_group.nil? then
370
- common_port_group= match_group.split(',')[2] or common_port_group= match_group.split(',')[1];
370
+ common_port_group = ( match_group.split(',')[-1] =~ /^no-resolve$|^src$/) ? match_group.split(',')[- 2] : match_group.split(',')[- 1];
371
371
if not common_port_group.nil? then
372
372
ruby_add_index = Value['rules'].index(Value['rules'].grep(/(MATCH|FINAL)/).first);
373
373
ruby_add_index ||= -1;
@@ -486,7 +486,7 @@ yml_other_set()
486
486
Value_1 = YAML.load_file('/tmp/yaml_rule_set_bottom_custom.yaml');
487
487
if ruby_add_index != -1 then
488
488
Value_1['rules'].uniq.reverse.each{|x|
489
- RULE_GROUP = x.split(',')[2] || RULE_GROUP = x.split(',')[1];
489
+ RULE_GROUP = ( x.split(',')[-1] =~ /^no-resolve$|^src$/) ? x.split(',')[-2] : x.split(',')[- 1];
490
490
if CONFIG_GROUP.include?(RULE_GROUP) then
491
491
Value['rules'].insert(ruby_add_index,x);
492
492
else
@@ -495,7 +495,7 @@ yml_other_set()
495
495
};
496
496
else
497
497
Value_1['rules'].uniq.each{|x|
498
- RULE_GROUP = x.split(',')[2] || RULE_GROUP = x.split(',')[1];
498
+ RULE_GROUP = ( x.split(',')[-1] =~ /^no-resolve$|^src$/) ? x.split(',')[-2] : x.split(',')[- 1];
499
499
if CONFIG_GROUP.include?(RULE_GROUP) then
500
500
Value['rules'].insert(ruby_add_index,x);
501
501
else
@@ -507,7 +507,7 @@ yml_other_set()
507
507
if File::exist?('/tmp/yaml_rule_set_top_custom.yaml') then
508
508
Value_1 = YAML.load_file('/tmp/yaml_rule_set_top_custom.yaml');
509
509
Value_1['rules'].uniq.reverse.each{|x|
510
- RULE_GROUP = x.split(',')[2] || RULE_GROUP = x.split(',')[1];
510
+ RULE_GROUP = ( x.split(',')[-1] =~ /^no-resolve$|^src$/) ? x.split(',')[-2] : x.split(',')[- 1];
511
511
if CONFIG_GROUP.include?(RULE_GROUP) then
512
512
Value['rules'].insert(0,x);
513
513
else
@@ -519,7 +519,7 @@ yml_other_set()
519
519
if File::exist?('/tmp/yaml_rule_set_top_custom.yaml') then
520
520
Value_1 = YAML.load_file('/tmp/yaml_rule_set_top_custom.yaml')['rules'].uniq;
521
521
Value_1.each{|x|
522
- RULE_GROUP = x.split(',')[2] || RULE_GROUP = x.split(',')[1];
522
+ RULE_GROUP = ( x.split(',')[-1] =~ /^no-resolve$|^src$/) ? x.split(',')[-2] : x.split(',')[- 1];
523
523
if not CONFIG_GROUP.include?(RULE_GROUP) then
524
524
Value_1.delete(x);
525
525
YAML.LOG('Warning: Skiped The Custom Rule Because Group & Proxy Not Found:【' + x + '】');
@@ -530,7 +530,7 @@ yml_other_set()
530
530
if File::exist?('/tmp/yaml_rule_set_bottom_custom.yaml') then
531
531
Value_1 = YAML.load_file('/tmp/yaml_rule_set_bottom_custom.yaml')['rules'].uniq;
532
532
Value_1.each{|x|
533
- RULE_GROUP = x.split(',')[2] || RULE_GROUP = x.split(',')[1];
533
+ RULE_GROUP = ( x.split(',')[-1] =~ /^no-resolve$|^src$/) ? x.split(',')[-2] : x.split(',')[- 1];
534
534
if not CONFIG_GROUP.include?(RULE_GROUP) then
535
535
Value_1.delete(x);
536
536
YAML.LOG('Warning: Skiped The Custom Rule Because Group & Proxy Not Found:【' + x + '】');
@@ -564,7 +564,7 @@ yml_other_set()
564
564
end;
565
565
if defined? Value_2 then
566
566
Value_2.each{|x|
567
- RULE_GROUP = x.split(',')[2] || RULE_GROUP = x.split(',')[1];
567
+ RULE_GROUP = ( x.split(',')[-1] =~ /^no-resolve$|^src$/) ? x.split(',')[-2] : x.split(',')[- 1];
568
568
if CONFIG_GROUP.include?(RULE_GROUP) then
569
569
Value['rules'].insert(0,x);
570
570
else
@@ -597,7 +597,7 @@ yml_other_set()
597
597
Value_4 = Value_4.reverse!;
598
598
end;
599
599
Value_4.each{|x|
600
- RULE_GROUP = x.split(',')[2] || RULE_GROUP = x.split(',')[1];
600
+ RULE_GROUP = ( x.split(',')[-1] =~ /^no-resolve$|^src$/) ? x.split(',')[-2] : x.split(',')[- 1];
601
601
if CONFIG_GROUP.include?(RULE_GROUP) then
602
602
Value['rules'].insert(ruby_add_index,x);
603
603
else
@@ -615,7 +615,7 @@ yml_other_set()
615
615
if Value_1.class.to_s == 'Hash' then
616
616
if not Value_1['rules'].to_a.empty? and Value_1['rules'].class.to_s == 'Array' then
617
617
Value_1['rules'].to_a.each{|x|
618
- RULE_GROUP = x.split(',')[2] || RULE_GROUP = x.split(',')[1];
618
+ RULE_GROUP = ( x.split(',')[-1] =~ /^no-resolve$|^src$/) ? x.split(',')[-2] : x.split(',')[- 1];
619
619
if not CONFIG_GROUP.include?(RULE_GROUP) then
620
620
Value_1['rules'].delete(x);
621
621
YAML.LOG('Warning: Skiped The Custom Rule Because Group & Proxy Not Found:【' + x + '】');
@@ -626,7 +626,7 @@ yml_other_set()
626
626
end;
627
627
elsif Value_1.class.to_s == 'Array' then
628
628
Value_1.each{|x|
629
- RULE_GROUP = x.split(',')[2] || RULE_GROUP = x.split(',')[1];
629
+ RULE_GROUP = ( x.split(',')[-1] =~ /^no-resolve$|^src$/) ? x.split(',')[-2] : x.split(',')[- 1];
630
630
if not CONFIG_GROUP.include?(RULE_GROUP) then
631
631
Value_1.delete(x);
632
632
YAML.LOG('Warning: Skiped The Custom Rule Because Group & Proxy Not Found:【' + x + '】');
@@ -644,7 +644,7 @@ yml_other_set()
644
644
if Value_2.class.to_s == 'Hash' then
645
645
if not Value_2['rules'].to_a.empty? and Value_2['rules'].class.to_s == 'Array' then
646
646
Value_2['rules'].to_a.each{|x|
647
- RULE_GROUP = x.split(',')[2] || RULE_GROUP = x.split(',')[1];
647
+ RULE_GROUP = ( x.split(',')[-1] =~ /^no-resolve$|^src$/) ? x.split(',')[-2] : x.split(',')[- 1];
648
648
if not CONFIG_GROUP.include?(RULE_GROUP) then
649
649
Value_2['rules'].delete(x);
650
650
YAML.LOG('Warning: Skiped The Custom Rule Because Group & Proxy Not Found:【' + x + '】');
@@ -655,7 +655,7 @@ yml_other_set()
655
655
end;
656
656
elsif Value_2.class.to_s == 'Array' then
657
657
Value_2.each{|x|
658
- RULE_GROUP = x.split(',')[2] || RULE_GROUP = x.split(',')[1];
658
+ RULE_GROUP = ( x.split(',')[-1] =~ /^no-resolve$|^src$/) ? x.split(',')[-2] : x.split(',')[- 1];
659
659
if not CONFIG_GROUP.include?(RULE_GROUP) then
660
660
Value_2.delete(x);
661
661
YAML.LOG('Warning: Skiped The Custom Rule Because Group & Proxy Not Found:【' + x + '】');
@@ -684,7 +684,7 @@ yml_other_set()
684
684
Value_3 = Value_3.reverse!;
685
685
end
686
686
Value_3.each{|x|
687
- RULE_GROUP = x.split(',')[2] || RULE_GROUP = x.split(',')[1];
687
+ RULE_GROUP = ( x.split(',')[-1] =~ /^no-resolve$|^src$/) ? x.split(',')[-2] : x.split(',')[- 1];
688
688
if CONFIG_GROUP.include?(RULE_GROUP) then
689
689
Value['rules'].insert(ruby_add_index,x);
690
690
else
@@ -780,6 +780,9 @@ yml_other_set()
780
780
v=File.basename(x['path']);
781
781
x['path']='./'+p+'/'+v;
782
782
end;
783
+ if not x['path'] and x['type'] == 'http' then
784
+ x['path']='./'+p+'/'+x['name'];
785
+ end;
783
786
#CDN Replace
784
787
if '$github_address_mod ' != '0' then
785
788
if '$github_address_mod ' == 'https://cdn.jsdelivr.net/' or '$github_address_mod ' == 'https://fastly.jsdelivr.net/' or '$github_address_mod ' == 'https://testingcf.jsdelivr.net/'then
0 commit comments