bushpig 0.1.12 → 0.1.13

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: 74a53f240f755c6d98d37f2790ac903fb3b6fd2b2470341c2dc357579605f51e
4
- data.tar.gz: ddfc8337f32005071b941ea1dd6e1e1599fb7b27a8c2b3e72b941c95be26d25a
3
+ metadata.gz: 3734548409aa83fc79488340605bfaa5e0392256d824582f4ccda55373ee583a
4
+ data.tar.gz: 255742a44f9c90708e4b43c220b8b4e59473a7acbb394ea3429def0048967422
5
5
  SHA512:
6
- metadata.gz: cb792068441f32529b3075a9972a7f96c09cdcd64649dfa3d9a145e9bfb77502e85841ec9526a9612073a6d44b9f5f83951c0a458ce790ee0afe82330548a8d5
7
- data.tar.gz: 578ab0ac3b7e9a69a8be8cd5df311caea42824267cfb44960b9519fe22015c56156b024082d8dd9e6d7e13bc949e54bce4357f21ff1420b7a6d3da31d4bbcadc
6
+ metadata.gz: 463def79cc73a657c34e3175e01f46c7d69707863039e915e785cf19c5ecdfbbd5fe1568ab9b2af447bc5cd336ea6439876de088632f9114bbe832a5bc838b33
7
+ data.tar.gz: 5441f75ed689e920a833e455d20da4c6aa4dec1367779ed2a457e078f4af055ae02bdb1169a858d438b49025677ae4cbfa8c386714c39087a056655f88812aed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bushpig (0.1.12)
4
+ bushpig (0.1.13)
5
5
  connection_pool (~> 2.2)
6
6
  json (>= 1.8)
7
7
  redis (~> 3.3)
@@ -16,15 +16,23 @@ GEM
16
16
  coderay (1.1.3)
17
17
  connection_pool (2.2.5)
18
18
  e2mmap (0.1.0)
19
+ io-wait (0.1.0)
19
20
  jaro_winkler (1.5.4)
20
- json (2.1.0)
21
+ json (2.5.1)
21
22
  kramdown (2.3.1)
22
23
  rexml
23
24
  kramdown-parser-gfm (1.1.0)
24
25
  kramdown (~> 2.0)
25
26
  method_source (1.0.0)
26
- mini_portile2 (2.5.1)
27
- nokogiri (1.11.3)
27
+ mini_portile2 (2.5.2)
28
+ net-ftp (~> 0.1)
29
+ net-ftp (0.1.2)
30
+ net-protocol
31
+ time
32
+ net-protocol (0.1.1)
33
+ io-wait
34
+ timeout
35
+ nokogiri (1.11.6)
28
36
  mini_portile2 (~> 2.5.0)
29
37
  racc (~> 1.4)
30
38
  parallel (1.20.1)
@@ -41,7 +49,7 @@ GEM
41
49
  reverse_markdown (2.0.0)
42
50
  nokogiri
43
51
  rexml (3.2.5)
44
- rubocop (1.14.0)
52
+ rubocop (1.15.0)
45
53
  parallel (~> 1.10)
46
54
  parser (>= 3.0.0.0)
47
55
  rainbow (>= 2.2.2, < 4.0)
@@ -50,10 +58,10 @@ GEM
50
58
  rubocop-ast (>= 1.5.0, < 2.0)
51
59
  ruby-progressbar (~> 1.7)
52
60
  unicode-display_width (>= 1.4.0, < 3.0)
53
- rubocop-ast (1.5.0)
61
+ rubocop-ast (1.7.0)
54
62
  parser (>= 3.0.1.1)
55
63
  ruby-progressbar (1.11.0)
56
- solargraph (0.40.4)
64
+ solargraph (0.41.0)
57
65
  backport (~> 1.1)
58
66
  benchmark
59
67
  bundler (>= 1.17.2)
@@ -69,6 +77,8 @@ GEM
69
77
  yard (~> 0.9, >= 0.9.24)
70
78
  thor (1.1.0)
71
79
  tilt (2.0.10)
80
+ time (0.1.0)
81
+ timeout (0.1.1)
72
82
  unicode-display_width (2.0.0)
73
83
  yard (0.9.26)
74
84
 
data/gemset.nix CHANGED
@@ -186,7 +186,7 @@
186
186
  path = ./.;
187
187
  type = "path";
188
188
  };
189
- version = "0.1.12";
189
+ version = "0.1.13";
190
190
  };
191
191
  coderay = {
192
192
  groups = ["default" "development"];
@@ -367,6 +367,16 @@
367
367
  };
368
368
  version = "0.1.0";
369
369
  };
370
+ io-wait = {
371
+ groups = ["default" "development"];
372
+ platforms = [];
373
+ source = {
374
+ remotes = ["https://rubygems.org"];
375
+ sha256 = "11zpcigndc11fkr2s6659d7nh1hj09zpmxlyqp9yq1mx76038s6w";
376
+ type = "gem";
377
+ };
378
+ version = "0.1.0";
379
+ };
370
380
  jaro_winkler = {
371
381
  groups = ["default" "development"];
372
382
  platforms = [];
@@ -531,10 +541,10 @@
531
541
  }];
532
542
  source = {
533
543
  remotes = ["https://rubygems.org"];
534
- sha256 = "01v6jjpvh3gnq6sgllpfqahlgxzj50ailwhj9b3cd20hi2dx0vxp";
544
+ sha256 = "0lrirj0gw420kw71bjjlqkqhqbrplla61gbv1jzgsz6bv90qr3ci";
535
545
  type = "gem";
536
546
  };
537
- version = "2.1.0";
547
+ version = "2.5.1";
538
548
  };
539
549
  kramdown = {
540
550
  dependencies = ["rexml"];
@@ -569,14 +579,37 @@
569
579
  version = "1.0.0";
570
580
  };
571
581
  mini_portile2 = {
582
+ dependencies = ["net-ftp"];
572
583
  groups = ["default" "development"];
573
584
  platforms = [];
574
585
  source = {
575
586
  remotes = ["https://rubygems.org"];
576
- sha256 = "0xg1x4708a4pn2wk8qs2d8kfzzdyv9kjjachg2f1phsx62ap2rx2";
587
+ sha256 = "0a2y04km3aciybk12yimkqn0ycrzy23iygl116n7addix9xdii3s";
577
588
  type = "gem";
578
589
  };
579
- version = "2.5.1";
590
+ version = "2.5.2";
591
+ };
592
+ net-ftp = {
593
+ dependencies = ["net-protocol" "time"];
594
+ groups = ["default" "development"];
595
+ platforms = [];
596
+ source = {
597
+ remotes = ["https://rubygems.org"];
598
+ sha256 = "1gx09b00k454fgn7q41r9xs5j5v9qj8xhfxnm650cns1ywcmzkil";
599
+ type = "gem";
600
+ };
601
+ version = "0.1.2";
602
+ };
603
+ net-protocol = {
604
+ dependencies = ["io-wait" "timeout"];
605
+ groups = ["default" "development"];
606
+ platforms = [];
607
+ source = {
608
+ remotes = ["https://rubygems.org"];
609
+ sha256 = "1ivxcqwgnrqbp2y0zpxz64in9a2cx9q9b0fxb630c51a1jaq63yz";
610
+ type = "gem";
611
+ };
612
+ version = "0.1.1";
580
613
  };
581
614
  nokogiri = {
582
615
  dependencies = ["mini_portile2" "racc"];
@@ -584,10 +617,10 @@
584
617
  platforms = [];
585
618
  source = {
586
619
  remotes = ["https://rubygems.org"];
587
- sha256 = "19d78mdg2lbz9jb4ph6nk783c9jbsdm8rnllwhga6pd53xffp6x0";
620
+ sha256 = "1z4x366icbl9w13pk50vxx5kywlksvhxqxrpv8f5xpjxfl3jl64z";
588
621
  type = "gem";
589
622
  };
590
- version = "1.11.3";
623
+ version = "1.11.6";
591
624
  };
592
625
  parallel = {
593
626
  groups = ["default" "development"];
@@ -847,10 +880,10 @@
847
880
  platforms = [];
848
881
  source = {
849
882
  remotes = ["https://rubygems.org"];
850
- sha256 = "0chjr6i0g7frbp7dhi4d83ppf7akkdaw7mcgcwbxd6a9mairafpp";
883
+ sha256 = "1xhay8qn3p5f3g6x8i6zh372zk5w2wjrv9dksysxal1r5brkly1w";
851
884
  type = "gem";
852
885
  };
853
- version = "1.14.0";
886
+ version = "1.15.0";
854
887
  };
855
888
  rubocop-ast = {
856
889
  dependencies = ["parser"];
@@ -858,10 +891,10 @@
858
891
  platforms = [];
859
892
  source = {
860
893
  remotes = ["https://rubygems.org"];
861
- sha256 = "0hx4im1a2qpiwipvsl3fma358ixjp4h0mhj56ichq15xrq709qlf";
894
+ sha256 = "1hnrfy928mwpa0ippqs4s8xwghwwp5h853naphgqxcd53l33chlv";
862
895
  type = "gem";
863
896
  };
864
- version = "1.5.0";
897
+ version = "1.7.0";
865
898
  };
866
899
  ruby-progressbar = {
867
900
  groups = ["default" "development"];
@@ -879,10 +912,10 @@
879
912
  platforms = [];
880
913
  source = {
881
914
  remotes = ["https://rubygems.org"];
882
- sha256 = "0xrad7amwf3nmdbif566qprk6xvwydxwz0s7arnzpvr01anc9gcl";
915
+ sha256 = "18daiaffwniprkfn9xq0njzqr8n37kw2605608njz2gz02m7b1rj";
883
916
  type = "gem";
884
917
  };
885
- version = "0.40.4";
918
+ version = "0.41.0";
886
919
  };
887
920
  thor = {
888
921
  groups = ["default"];
@@ -1053,6 +1086,26 @@
1053
1086
  };
1054
1087
  version = "2.0.10";
1055
1088
  };
1089
+ time = {
1090
+ groups = ["default" "development"];
1091
+ platforms = [];
1092
+ source = {
1093
+ remotes = ["https://rubygems.org"];
1094
+ sha256 = "1ayfwm8b0c6n0z34vwfpmy83lf1gd0mq7jbybzarkqp2ylmdlzvy";
1095
+ type = "gem";
1096
+ };
1097
+ version = "0.1.0";
1098
+ };
1099
+ timeout = {
1100
+ groups = ["default" "development"];
1101
+ platforms = [];
1102
+ source = {
1103
+ remotes = ["https://rubygems.org"];
1104
+ sha256 = "0lr1pp2hh6np1x9milzs4rim9sfpsb4izhs4dd5q5nnhkcwx8i63";
1105
+ type = "gem";
1106
+ };
1107
+ version = "0.1.1";
1108
+ };
1056
1109
  unicode-display_width = {
1057
1110
  groups = ["default" "development"];
1058
1111
  platforms = [];
data/lib/bushpig.rb CHANGED
@@ -6,6 +6,7 @@ require 'bushpig/redis_pool'
6
6
  require 'bushpig/job'
7
7
  require 'bushpig/client'
8
8
  require 'bushpig/server'
9
+ require 'bushpig/testing'
9
10
 
10
11
  module Bushpig
11
12
  NAME = 'Bushpig'
@@ -31,6 +32,14 @@ module Bushpig
31
32
  @server = server
32
33
  end
33
34
 
35
+ def self.testing
36
+ @testing ||= false
37
+ end
38
+
39
+ def self.testing=(testing)
40
+ @testing = testing
41
+ end
42
+
34
43
  def self.configure_server
35
44
  yield self if server?
36
45
  end
@@ -19,6 +19,10 @@ module Bushpig
19
19
  end
20
20
 
21
21
  def submit(queue, job, score: default_score, ttl: default_ttl)
22
+ if Bushpig.testing
23
+ job.handle
24
+ return true
25
+ end
22
26
  modified = @callback.call(job)
23
27
  redis_pool.with do |conn|
24
28
  conn.set(Bushpig.job_key(modified.job_key), modified.job_payload, ex: ttl)
@@ -0,0 +1,14 @@
1
+
2
+ # frozen_string_literal: true
3
+
4
+ module Bushpig
5
+ module Testing
6
+ def self.inline!(&block)
7
+ old = Bushpig.testing
8
+ Bushpig.testing = true
9
+ result = block.call
10
+ Bushpig.testing = old
11
+ result
12
+ end
13
+ end
14
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bushpig
4
- VERSION = '0.1.12'
4
+ VERSION = '0.1.13'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bushpig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shaun Sharples
@@ -162,6 +162,7 @@ files:
162
162
  - lib/bushpig/job.rb
163
163
  - lib/bushpig/redis_pool.rb
164
164
  - lib/bushpig/server.rb
165
+ - lib/bushpig/testing.rb
165
166
  - lib/bushpig/version.rb
166
167
  - shell.nix
167
168
  homepage: https://github.com/mpowered/bushpig
@@ -190,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
191
  - !ruby/object:Gem::Version
191
192
  version: '0'
192
193
  requirements: []
193
- rubygems_version: 3.1.3
194
+ rubygems_version: 3.2.16
194
195
  signing_key:
195
196
  specification_version: 4
196
197
  summary: Simple job system.