fbe 0.0.30 → 0.0.32
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 +4 -4
 - data/Gemfile.lock +1 -0
 - data/lib/fbe/award.rb +1 -1
 - data/lib/fbe/octo.rb +36 -0
 - data/lib/fbe.rb +1 -1
 - data/test/fbe/test_award.rb +4 -3
 - 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: 9a8447eeed3cc3037b51e2513e0edf5f29fd6ddc8a2e290942f1df43f98beb91
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 19bdc222aec0586871e428b34c24dd44ebc80b7bf3d6d4a8f41bf7909a5e888f
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 95e4144d5d6b2770ce66e64e7b299df69b284046672c44dc5fce0881c4841a5a4e8aeeada40c38b901b212ebc61311da4dbe9d7b63dd65e13bfef2e76c22b636
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 5ccbfd382e1a85c1513fc3957a6018dfad25158e53bcfad39a2dde584fe5c66eeb40fd0d9addf9bffa0ad687e911150a8193019121a703f86e0afebc1ac12101
         
     | 
    
        data/Gemfile.lock
    CHANGED
    
    
    
        data/lib/fbe/award.rb
    CHANGED
    
    | 
         @@ -149,7 +149,7 @@ class Fbe::Award 
     | 
|
| 
       149 
149 
     | 
    
         
             
                    a = to_val(@operands[1], bill)
         
     | 
| 
       150 
150 
     | 
    
         
             
                    b = to_val(@operands[2], bill)
         
     | 
| 
       151 
151 
     | 
    
         
             
                    min, max = [a, b].minmax
         
     | 
| 
       152 
     | 
    
         
            -
                    return 0 if (v. 
     | 
| 
      
 152 
     | 
    
         
            +
                    return 0 if (!v.negative? && v < min) || (!v.positive? && v > max)
         
     | 
| 
       153 
153 
     | 
    
         | 
| 
       154 
154 
     | 
    
         
             
                    v.clamp(min, max)
         
     | 
| 
       155 
155 
     | 
    
         
             
                  else
         
     | 
    
        data/lib/fbe/octo.rb
    CHANGED
    
    | 
         @@ -247,6 +247,26 @@ class Fbe::FakeOctokit 
     | 
|
| 
       247 
247 
     | 
    
         
             
                ]
         
     | 
| 
       248 
248 
     | 
    
         
             
              end
         
     | 
| 
       249 
249 
     | 
    
         | 
| 
      
 250 
     | 
    
         
            +
              def list_issues(repo, _options = {})
         
     | 
| 
      
 251 
     | 
    
         
            +
                [
         
     | 
| 
      
 252 
     | 
    
         
            +
                  issue(repo, 42),
         
     | 
| 
      
 253 
     | 
    
         
            +
                  issue(repo, 43)
         
     | 
| 
      
 254 
     | 
    
         
            +
                ]
         
     | 
| 
      
 255 
     | 
    
         
            +
              end
         
     | 
| 
      
 256 
     | 
    
         
            +
             
     | 
| 
      
 257 
     | 
    
         
            +
              def issue(repo, number)
         
     | 
| 
      
 258 
     | 
    
         
            +
                {
         
     | 
| 
      
 259 
     | 
    
         
            +
                  id: 42,
         
     | 
| 
      
 260 
     | 
    
         
            +
                  number:,
         
     | 
| 
      
 261 
     | 
    
         
            +
                  repo: {
         
     | 
| 
      
 262 
     | 
    
         
            +
                    full_name: repo
         
     | 
| 
      
 263 
     | 
    
         
            +
                  },
         
     | 
| 
      
 264 
     | 
    
         
            +
                  pull_request: {
         
     | 
| 
      
 265 
     | 
    
         
            +
                    merged_at: nil
         
     | 
| 
      
 266 
     | 
    
         
            +
                  }
         
     | 
| 
      
 267 
     | 
    
         
            +
                }
         
     | 
| 
      
 268 
     | 
    
         
            +
              end
         
     | 
| 
      
 269 
     | 
    
         
            +
             
     | 
| 
       250 
270 
     | 
    
         
             
              def pull_request(repo, number)
         
     | 
| 
       251 
271 
     | 
    
         
             
                {
         
     | 
| 
       252 
272 
     | 
    
         
             
                  id: 42,
         
     | 
| 
         @@ -289,6 +309,22 @@ class Fbe::FakeOctokit 
     | 
|
| 
       289 
309 
     | 
    
         
             
                }
         
     | 
| 
       290 
310 
     | 
    
         
             
              end
         
     | 
| 
       291 
311 
     | 
    
         | 
| 
      
 312 
     | 
    
         
            +
              def commits_since(repo, _since)
         
     | 
| 
      
 313 
     | 
    
         
            +
                [
         
     | 
| 
      
 314 
     | 
    
         
            +
                  commit(repo, 'a1b2c3d4e5f6a1b2c3d4e5f6'),
         
     | 
| 
      
 315 
     | 
    
         
            +
                  commit(repo, 'a1b2c3d4e5fff1b2c3d4e5f6')
         
     | 
| 
      
 316 
     | 
    
         
            +
                ]
         
     | 
| 
      
 317 
     | 
    
         
            +
              end
         
     | 
| 
      
 318 
     | 
    
         
            +
             
     | 
| 
      
 319 
     | 
    
         
            +
              def commit(_repo, sha)
         
     | 
| 
      
 320 
     | 
    
         
            +
                {
         
     | 
| 
      
 321 
     | 
    
         
            +
                  sha:,
         
     | 
| 
      
 322 
     | 
    
         
            +
                  stats: {
         
     | 
| 
      
 323 
     | 
    
         
            +
                    total: 123
         
     | 
| 
      
 324 
     | 
    
         
            +
                  }
         
     | 
| 
      
 325 
     | 
    
         
            +
                }
         
     | 
| 
      
 326 
     | 
    
         
            +
              end
         
     | 
| 
      
 327 
     | 
    
         
            +
             
     | 
| 
       292 
328 
     | 
    
         
             
              def issue_timeline(_repo, _issue, _options = {})
         
     | 
| 
       293 
329 
     | 
    
         
             
                [
         
     | 
| 
       294 
330 
     | 
    
         
             
                  {
         
     | 
    
        data/lib/fbe.rb
    CHANGED
    
    
    
        data/test/fbe/test_award.rb
    CHANGED
    
    | 
         @@ -58,12 +58,11 @@ class TestAward < Minitest::Test 
     | 
|
| 
       58 
58 
     | 
    
         
             
                b = a.bill(hours: 10)
         
     | 
| 
       59 
59 
     | 
    
         
             
                assert(b.points <= 100)
         
     | 
| 
       60 
60 
     | 
    
         
             
                assert(b.points >= 5)
         
     | 
| 
       61 
     | 
    
         
            -
                assert_equal( 
     | 
| 
      
 61 
     | 
    
         
            +
                assert_equal(40, b.points)
         
     | 
| 
       62 
62 
     | 
    
         
             
                g = b.greeting
         
     | 
| 
       63 
63 
     | 
    
         
             
                [
         
     | 
| 
       64 
     | 
    
         
            -
                  'You\'ve earned + 
     | 
| 
      
 64 
     | 
    
         
            +
                  'You\'ve earned +40 points for this',
         
     | 
| 
       65 
65 
     | 
    
         
             
                  '+10 for resolving the bug in 10',
         
     | 
| 
       66 
     | 
    
         
            -
                  'too long (0 days)',
         
     | 
| 
       67 
66 
     | 
    
         
             
                  'bug in 10 (<36) hours',
         
     | 
| 
       68 
67 
     | 
    
         
             
                  '+30 as a basis'
         
     | 
| 
       69 
68 
     | 
    
         
             
                ].each { |t| assert(g.include?(t), g) }
         
     | 
| 
         @@ -89,9 +88,11 @@ class TestAward < Minitest::Test 
     | 
|
| 
       89 
88 
     | 
    
         | 
| 
       90 
89 
     | 
    
         
             
              def test_must_not_give_anything_when_too_small_value
         
     | 
| 
       91 
90 
     | 
    
         
             
                {
         
     | 
| 
      
 91 
     | 
    
         
            +
                  '(award (give (between 0 5 20)))' => 0,
         
     | 
| 
       92 
92 
     | 
    
         
             
                  '(award (give (between 13 5 20)))' => 13,
         
     | 
| 
       93 
93 
     | 
    
         
             
                  '(award (give (between 3 5 20)))' => 0,
         
     | 
| 
       94 
94 
     | 
    
         
             
                  '(award (give (between 25 5 20)))' => 20,
         
     | 
| 
      
 95 
     | 
    
         
            +
                  '(award (give (between 0 -10 -30)))' => 0,
         
     | 
| 
       95 
96 
     | 
    
         
             
                  '(award (give (between -2 -10 -30)))' => 0,
         
     | 
| 
       96 
97 
     | 
    
         
             
                  '(award (give (between -15 -10 -30)))' => -15,
         
     | 
| 
       97 
98 
     | 
    
         
             
                  '(award (give (between -50 -10 -30)))' => -30
         
     | 
    
        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.32
         
     | 
| 
       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-07- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2024-07-29 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: backtrace
         
     |