fbe 0.0.53 → 0.0.54
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +2 -2
- data/lib/fbe/conclude.rb +0 -1
- data/lib/fbe/copy.rb +4 -1
- data/lib/fbe/octo.rb +200 -0
- data/lib/fbe.rb +1 -1
- data/test/fbe/test_copy.rb +11 -0
- data/test/fbe/test_octo.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b0b9b1716b7cc0b7f757fdbc023c90254d27582eba1e865e1d003a9a1b212f5
|
4
|
+
data.tar.gz: ba55f263c9a091c14ea08764bd081bc93e53e842539a9294899a5f6b760f32ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de5a40ffed186489c61661796d469c1b67a323230fb60120e4db02d6389b73e8c3d03071171dfd208e5e35813d82c05927a35f4b8e5e545507ed0e09199977a3
|
7
|
+
data.tar.gz: e2301187e03a966495eb31bd8f8ba89675ca0b78effe4f4542b04a9b03c4ce9e53f9fb31f2f0f126188187c29c9e6e06df6d562ade4e510bcae52060a816b1d5
|
data/Gemfile
CHANGED
@@ -24,7 +24,7 @@ source 'https://rubygems.org'
|
|
24
24
|
gemspec
|
25
25
|
|
26
26
|
gem 'graphql-client'
|
27
|
-
gem 'minitest', '5.25.
|
27
|
+
gem 'minitest', '5.25.1', require: false
|
28
28
|
gem 'minitest-reporters', '1.7.1', require: false
|
29
29
|
gem 'rake', '13.2.1', require: false
|
30
30
|
gem 'rspec-rails', '6.1.4', require: false
|
data/Gemfile.lock
CHANGED
@@ -141,7 +141,7 @@ GEM
|
|
141
141
|
crass (~> 1.0.2)
|
142
142
|
nokogiri (>= 1.12.0)
|
143
143
|
loog (0.6.0)
|
144
|
-
minitest (5.25.
|
144
|
+
minitest (5.25.1)
|
145
145
|
minitest-reporters (1.7.1)
|
146
146
|
ansi
|
147
147
|
builder
|
@@ -287,7 +287,7 @@ PLATFORMS
|
|
287
287
|
DEPENDENCIES
|
288
288
|
fbe!
|
289
289
|
graphql-client
|
290
|
-
minitest (= 5.25.
|
290
|
+
minitest (= 5.25.1)
|
291
291
|
minitest-reporters (= 1.7.1)
|
292
292
|
rake (= 13.2.1)
|
293
293
|
rspec-rails (= 6.1.4)
|
data/lib/fbe/conclude.rb
CHANGED
data/lib/fbe/copy.rb
CHANGED
@@ -29,11 +29,14 @@ require_relative 'fb'
|
|
29
29
|
#
|
30
30
|
# @param [Factbase::Fact] source The source
|
31
31
|
# @param [Factbase::Fact] target The targer
|
32
|
-
|
32
|
+
# @param [Array<String>] except List of properties to NOT copy
|
33
|
+
def Fbe.copy(source, target, except: [])
|
33
34
|
raise 'The source is nil' if source.nil?
|
34
35
|
raise 'The target is nil' if target.nil?
|
36
|
+
raise 'The except is nil' if except.nil?
|
35
37
|
source.all_properties.each do |k|
|
36
38
|
next unless target[k].nil?
|
39
|
+
next if except.include?(k)
|
37
40
|
source[k].each do |v|
|
38
41
|
target.send(:"#{k}=", v)
|
39
42
|
end
|
data/lib/fbe/octo.rb
CHANGED
@@ -498,6 +498,206 @@ class Fbe::FakeOctokit
|
|
498
498
|
},
|
499
499
|
created_at: random_time,
|
500
500
|
public: true
|
501
|
+
},
|
502
|
+
{
|
503
|
+
id: 42,
|
504
|
+
created_at: Time.now,
|
505
|
+
actor: { id: 42 },
|
506
|
+
type: 'PullRequestEvent',
|
507
|
+
repo: { id: repo },
|
508
|
+
payload: {
|
509
|
+
action: 'closed',
|
510
|
+
number: 172,
|
511
|
+
ref_type: 'tag',
|
512
|
+
ref: 'foo',
|
513
|
+
pull_request: {
|
514
|
+
url: 'https://api.github.com/repos/yegor256/judges/pulls/93',
|
515
|
+
id: 1_990_323_142,
|
516
|
+
node_id: 'PR_kwDOL6GCO852oevG',
|
517
|
+
number: 172,
|
518
|
+
state: 'closed',
|
519
|
+
locked: false,
|
520
|
+
title: '#999 new feature',
|
521
|
+
user: {
|
522
|
+
login: 'test',
|
523
|
+
id: 88_084_038,
|
524
|
+
node_id: 'MDQ6VXNlcjE2NDYwMjA=',
|
525
|
+
type: 'User',
|
526
|
+
site_admin: false
|
527
|
+
},
|
528
|
+
base: {
|
529
|
+
label: 'zerocracy:master',
|
530
|
+
ref: 'master',
|
531
|
+
user: {
|
532
|
+
login: 'zerocracy',
|
533
|
+
id: 24_234_201
|
534
|
+
},
|
535
|
+
repo: {
|
536
|
+
id: repo,
|
537
|
+
node_id: 'R_kgDOK2_4Aw',
|
538
|
+
name: 'baza',
|
539
|
+
full_name: 'zerocracy/baza',
|
540
|
+
private: false
|
541
|
+
}
|
542
|
+
},
|
543
|
+
head: {
|
544
|
+
ref: 'zerocracy/baza'
|
545
|
+
},
|
546
|
+
merged_at: Time.now,
|
547
|
+
comments: 2,
|
548
|
+
review_comments: 2,
|
549
|
+
commits: 1,
|
550
|
+
additions: 3,
|
551
|
+
deletions: 3,
|
552
|
+
changed_files: 2
|
553
|
+
}
|
554
|
+
}
|
555
|
+
}
|
556
|
+
]
|
557
|
+
end
|
558
|
+
|
559
|
+
def pull_request_comments(_name, _number)
|
560
|
+
[
|
561
|
+
{
|
562
|
+
pull_request_review_id: 2_227_372_510,
|
563
|
+
id: 1_709_082_318,
|
564
|
+
path: 'test/baza/test_locks.rb',
|
565
|
+
commit_id: 'a9f5f94cf28f29a64d5dd96d0ee23b4174572847',
|
566
|
+
original_commit_id: 'e8c6f94274d14ed3cb26fe71467a9c3f229df59c',
|
567
|
+
user: {
|
568
|
+
login: 'Reviewer',
|
569
|
+
id: 2_566_462
|
570
|
+
},
|
571
|
+
body: 'Most likely, parentheses were missed here.',
|
572
|
+
created_at: '2024-08-08T09:41:46Z',
|
573
|
+
updated_at: '2024-08-08T09:42:46Z',
|
574
|
+
reactions: {
|
575
|
+
url: 'https://api.github.com/repos/zerocracy/baza/pulls/comments/1709082318/reactions',
|
576
|
+
total_count: 0
|
577
|
+
},
|
578
|
+
start_line: 'null',
|
579
|
+
original_start_line: 'null',
|
580
|
+
start_side: 'null',
|
581
|
+
line: 'null',
|
582
|
+
original_line: 62,
|
583
|
+
side: 'RIGHT',
|
584
|
+
original_position: 25,
|
585
|
+
position: 'null',
|
586
|
+
subject_type: 'line'
|
587
|
+
},
|
588
|
+
{
|
589
|
+
pull_request_review_id: 2_227_372_510,
|
590
|
+
id: 1_709_082_319,
|
591
|
+
path: 'test/baza/test_locks.rb',
|
592
|
+
commit_id: 'a9f5f94cf28f29a64d5dd96d0ee23b4174572847',
|
593
|
+
original_commit_id: 'e8c6f94274d14ed3cb26fe71467a9c3f229df59c',
|
594
|
+
user: {
|
595
|
+
login: 'test',
|
596
|
+
id: 88_084_038
|
597
|
+
},
|
598
|
+
body: 'definitely a typo',
|
599
|
+
created_at: '2024-08-08T09:42:46Z',
|
600
|
+
updated_at: '2024-08-08T09:42:46Z',
|
601
|
+
reactions: {
|
602
|
+
url: 'https://api.github.com/repos/zerocracy/baza/pulls/comments/1709082319/reactions',
|
603
|
+
total_count: 0
|
604
|
+
},
|
605
|
+
start_line: 'null',
|
606
|
+
original_start_line: 'null',
|
607
|
+
start_side: 'null',
|
608
|
+
line: 'null',
|
609
|
+
original_line: 62,
|
610
|
+
side: 'RIGHT',
|
611
|
+
original_position: 25,
|
612
|
+
in_reply_to_id: 1_709_082_318,
|
613
|
+
position: 'null',
|
614
|
+
subject_type: 'line'
|
615
|
+
}
|
616
|
+
]
|
617
|
+
end
|
618
|
+
|
619
|
+
def issue_comments(_name, _number)
|
620
|
+
[
|
621
|
+
{
|
622
|
+
pull_request_review_id: 2_227_372_510,
|
623
|
+
id: 1_709_082_320,
|
624
|
+
path: 'test/baza/test_locks.rb',
|
625
|
+
commit_id: 'a9f5f94cf28f29a64d5dd96d0ee23b4174572847',
|
626
|
+
original_commit_id: 'e8c6f94274d14ed3cb26fe71467a9c3f229df59c',
|
627
|
+
user: {
|
628
|
+
login: 'Reviewer',
|
629
|
+
id: 2_566_462
|
630
|
+
},
|
631
|
+
body: 'reviewer comment',
|
632
|
+
created_at: '2024-08-08T09:41:46Z',
|
633
|
+
updated_at: '2024-08-08T09:42:46Z',
|
634
|
+
reactions: {
|
635
|
+
url: 'https://api.github.com/repos/zerocracy/baza/pulls/comments/1709082320/reactions',
|
636
|
+
total_count: 1
|
637
|
+
},
|
638
|
+
start_line: 'null',
|
639
|
+
original_start_line: 'null',
|
640
|
+
start_side: 'null',
|
641
|
+
line: 'null',
|
642
|
+
original_line: 62,
|
643
|
+
side: 'RIGHT',
|
644
|
+
original_position: 25,
|
645
|
+
position: 'null',
|
646
|
+
subject_type: 'line'
|
647
|
+
},
|
648
|
+
{
|
649
|
+
pull_request_review_id: 2_227_372_510,
|
650
|
+
id: 1_709_082_321,
|
651
|
+
path: 'test/baza/test_locks.rb',
|
652
|
+
commit_id: 'a9f5f94cf28f29a64d5dd96d0ee23b4174572847',
|
653
|
+
original_commit_id: 'e8c6f94274d14ed3cb26fe71467a9c3f229df59c',
|
654
|
+
user: {
|
655
|
+
login: 'test',
|
656
|
+
id: 88_084_038
|
657
|
+
},
|
658
|
+
body: 'author comment',
|
659
|
+
created_at: '2024-08-08T09:42:46Z',
|
660
|
+
updated_at: '2024-08-08T09:42:46Z',
|
661
|
+
reactions: {
|
662
|
+
url: 'https://api.github.com/repos/zerocracy/baza/pulls/comments/1709082321/reactions',
|
663
|
+
total_count: 1
|
664
|
+
},
|
665
|
+
start_line: 'null',
|
666
|
+
original_start_line: 'null',
|
667
|
+
start_side: 'null',
|
668
|
+
line: 'null',
|
669
|
+
original_line: 62,
|
670
|
+
side: 'RIGHT',
|
671
|
+
original_position: 25,
|
672
|
+
in_reply_to_id: 1_709_082_318,
|
673
|
+
position: 'null',
|
674
|
+
subject_type: 'line'
|
675
|
+
}
|
676
|
+
]
|
677
|
+
end
|
678
|
+
|
679
|
+
def issue_comment_reactions(_name, _comment)
|
680
|
+
[
|
681
|
+
{
|
682
|
+
id: 248_923_574,
|
683
|
+
user: {
|
684
|
+
login: 'user',
|
685
|
+
id: 8_086_956
|
686
|
+
},
|
687
|
+
content: 'heart'
|
688
|
+
}
|
689
|
+
]
|
690
|
+
end
|
691
|
+
|
692
|
+
def pull_request_review_comment_reactions(_name, _comment)
|
693
|
+
[
|
694
|
+
{
|
695
|
+
id: 248_923_574,
|
696
|
+
user: {
|
697
|
+
login: 'user',
|
698
|
+
id: 8_086_956
|
699
|
+
},
|
700
|
+
content: 'heart'
|
501
701
|
}
|
502
702
|
]
|
503
703
|
end
|
data/lib/fbe.rb
CHANGED
data/test/fbe/test_copy.rb
CHANGED
@@ -43,4 +43,15 @@ class TestCopy < Minitest::Test
|
|
43
43
|
assert_equal(2, f2._id)
|
44
44
|
assert_equal(42, f2.foo)
|
45
45
|
end
|
46
|
+
|
47
|
+
def test_with_except
|
48
|
+
fb = Factbase.new
|
49
|
+
f1 = fb.insert
|
50
|
+
f1._id = 1
|
51
|
+
f1.foo = 42
|
52
|
+
f2 = fb.insert
|
53
|
+
f2._id = 2
|
54
|
+
Fbe.copy(f1, f2, except: ['foo'])
|
55
|
+
assert(f2['foo'].nil?)
|
56
|
+
end
|
46
57
|
end
|
data/test/fbe/test_octo.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fbe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.54
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backtrace
|