judges 0.22.0 → 0.22.1

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: 17df0b6c88dd19b576bc701737985db26986e9818eb3c87b36180be92fca54f6
4
- data.tar.gz: 48ef9ea5656a6bd78264f0b1f7021555ffa92eaf5be71d311d60e59ab0d3c0c8
3
+ metadata.gz: cbef0d45d39354c46895af943ef6180bed47a28b4738bcca9755f9b66a282756
4
+ data.tar.gz: 8dec5ca451e4499509f7158f9c1b115f301713d3e065becd53be78fc82e75c87
5
5
  SHA512:
6
- metadata.gz: 722ef79a6af057ba1f4cf37860212b6a3c08f7aff838dfb4e8034e7970e27c4efe98e66da9c774e45707999b9e70966eacd19e4a1478a54a798d12b1d03b662b
7
- data.tar.gz: c9551f302a6f0f02ef81e4a2ef5631c98bc2ad08a39982563749b29867d0bf06258a5e7a167179f70f899031cf2ffe097a014e9480a0a767192915d68f78479a
6
+ metadata.gz: 074313a259b93c9979a941231251335481cca8212ecea88df3a25d8c70eefed71b55064e11f48e9f63b2c3d8f15982d9647193515a4ec57a1b6120afdf302485
7
+ data.tar.gz: 3b5628e0ae419cb8197ab4845165ddcde7de4e02bd6174ca6057dd76b3982475bc036d74a778dbca7f6c0b97f605a836e824d1fd1377d0e92a47212cde879db0
data/Gemfile.lock CHANGED
@@ -79,7 +79,7 @@ GEM
79
79
  bigdecimal
80
80
  cucumber-gherkin (27.0.0)
81
81
  cucumber-messages (>= 19.1.4, < 23)
82
- cucumber-html-formatter (21.4.1)
82
+ cucumber-html-formatter (21.5.0)
83
83
  cucumber-messages (> 19, < 25)
84
84
  cucumber-messages (22.0.0)
85
85
  cucumber-tag-expressions (6.1.0)
@@ -107,7 +107,7 @@ GEM
107
107
  ffi (1.17.0-x86_64-darwin)
108
108
  ffi (1.17.0-x86_64-linux-gnu)
109
109
  gli (2.21.5)
110
- hashdiff (1.1.0)
110
+ hashdiff (1.1.1)
111
111
  i18n (1.14.5)
112
112
  concurrent-ruby (~> 1.0)
113
113
  io-console (0.7.2)
@@ -120,7 +120,7 @@ GEM
120
120
  loofah (2.22.0)
121
121
  crass (~> 1.0.2)
122
122
  nokogiri (>= 1.12.0)
123
- loog (0.5.3)
123
+ loog (0.6.0)
124
124
  mini_mime (1.1.5)
125
125
  minitest (5.24.1)
126
126
  minitest-reporters (1.7.1)
data/assets/index.xsl CHANGED
@@ -66,6 +66,12 @@ SOFTWARE.
66
66
  article { border: none; }
67
67
  header img { width: 3em; height: 3em; }
68
68
  .sorter { cursor: pointer; }
69
+ .S { color: #196F3D; }
70
+ .T { color: #2471A3; }
71
+ .I { color: #212F3C; }
72
+ .F { color: #E74C3C; }
73
+ .BR { color: gray; }
74
+ .hidden { color: gray; }
69
75
  </style>
70
76
  <script type="text/javascript">
71
77
  $(function() {
@@ -97,6 +103,12 @@ SOFTWARE.
97
103
  <xsl:value-of select="$date"/>
98
104
  <xsl:text>.</xsl:text>
99
105
  <br/>
106
+ <xsl:text>Properties with columns: </xsl:text>
107
+ <xsl:value-of select="$columns"/>
108
+ <br/>
109
+ <xsl:text>Hidden properties: </xsl:text>
110
+ <xsl:value-of select="$hidden"/>
111
+ <br/>
100
112
  <a href="https://github.com/yegor256/factbase">
101
113
  <xsl:text>Factbase</xsl:text>
102
114
  </a>
@@ -177,14 +189,14 @@ SOFTWARE.
177
189
  <td>
178
190
  <xsl:for-each select="$f/*">
179
191
  <xsl:text> </xsl:text>
180
- <xsl:variable name="visible" select="string-length(substring-before(concat(',', $hidden, ','), concat(',', name(), ','))) = 0"/>
192
+ <xsl:variable name="visible" select="string-length(substring-before(concat(' ,', $hidden, ','), concat(',', name(), ','))) = 0"/>
181
193
  <xsl:if test="string-length(substring-before(concat(',', $columns, ','), concat(',', name(), ','))) = 0">
182
194
  <xsl:choose>
183
195
  <xsl:when test="$visible">
184
196
  <xsl:value-of select="name()"/>
185
197
  </xsl:when>
186
198
  <xsl:otherwise>
187
- <span style="color:gray;">
199
+ <span class="hidden" title="{.}">
188
200
  <xsl:value-of select="name()"/>
189
201
  </span>
190
202
  </xsl:otherwise>
@@ -218,25 +230,30 @@ SOFTWARE.
218
230
  </xsl:when>
219
231
  <xsl:otherwise>
220
232
  <span>
221
- <xsl:attribute name="style">
222
- <xsl:text>color:</xsl:text>
223
- <xsl:choose>
224
- <xsl:when test="$v/@t = 'S'">
225
- <xsl:text>#196F3D</xsl:text>
226
- </xsl:when>
227
- <xsl:when test="$v/@t = 'T'">
228
- <xsl:text>#2471A3</xsl:text>
229
- </xsl:when>
230
- <xsl:when test="$v/@t = 'I'">
231
- <xsl:text>#212F3C</xsl:text>
232
- </xsl:when>
233
- <xsl:when test="$v/@t = 'F'">
234
- <xsl:text>#E74C3C</xsl:text>
235
- </xsl:when>
236
- </xsl:choose>
233
+ <xsl:attribute name="class">
234
+ <xsl:value-of select="$v/@t"/>
237
235
  </xsl:attribute>
238
- <xsl:value-of select="$v"/>
236
+ <xsl:call-template name="just-value">
237
+ <xsl:with-param name="v" select="$v"/>
238
+ </xsl:call-template>
239
+ </span>
240
+ </xsl:otherwise>
241
+ </xsl:choose>
242
+ </xsl:template>
243
+ <xsl:template name="just-value">
244
+ <xsl:param name="v"/>
245
+ <xsl:choose>
246
+ <xsl:when test="string-length($v) &gt; 64">
247
+ <xsl:value-of select="substring($v, 0, 64)"/>
248
+ <span class="BR">
249
+ <xsl:text>-</xsl:text>
239
250
  </span>
251
+ <xsl:call-template name="just-value">
252
+ <xsl:with-param name="v" select="substring($v, 64)"/>
253
+ </xsl:call-template>
254
+ </xsl:when>
255
+ <xsl:otherwise>
256
+ <xsl:value-of select="$v"/>
240
257
  </xsl:otherwise>
241
258
  </xsl:choose>
242
259
  </xsl:template>
data/judges.gemspec CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
26
26
  s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
27
27
  s.required_ruby_version = '>=3.2'
28
28
  s.name = 'judges'
29
- s.version = '0.22.0'
29
+ s.version = '0.22.1'
30
30
  s.license = 'MIT'
31
31
  s.summary = 'Command-Line Tool for a Factbase'
32
32
  s.description =
data/lib/judges/baza.rb CHANGED
@@ -147,12 +147,12 @@ class Judges::Baza
147
147
  with_retries(max_tries: @retries) do
148
148
  checked(
149
149
  Typhoeus::Request.get(
150
- home.append('stdout').append(id).to_s,
150
+ home.append('stdout').append("#{id}.txt").to_s,
151
151
  headers:
152
152
  )
153
153
  )
154
154
  end
155
- ret.body
155
+ stdout = ret.body
156
156
  throw :"The stdout of the job ##{id} has #{stdout.split("\n")} lines"
157
157
  end
158
158
  stdout
@@ -168,7 +168,7 @@ class Judges::Baza
168
168
  with_retries(max_tries: @retries) do
169
169
  checked(
170
170
  Typhoeus::Request.get(
171
- home.append('exit').append(id).to_s,
171
+ home.append('exit').append("#{id}.txt").to_s,
172
172
  headers:
173
173
  )
174
174
  )
data/lib/judges.rb CHANGED
@@ -25,5 +25,5 @@
25
25
  # Copyright:: Copyright (c) 2024 Yegor Bugayenko
26
26
  # License:: MIT
27
27
  module Judges
28
- VERSION = '0.22.0'
28
+ VERSION = '0.22.1'
29
29
  end
@@ -50,11 +50,13 @@ class TestPrint < Minitest::Test
50
50
  fb = Factbase.new
51
51
  10.times do
52
52
  f = fb.insert
53
+ f._id = 44
53
54
  f.what = SecureRandom.hex(10)
54
55
  f.when = Time.now
55
56
  f.details = 'hey, друг'
56
57
  f.ticket = 42
57
58
  f.ticket = 55
59
+ f.long_property = 'test_' * 100
58
60
  end
59
61
  Dir.mktmpdir do |d|
60
62
  f = File.join(d, 'base.fb')
@@ -38,7 +38,7 @@ class TestPull < Minitest::Test
38
38
  stub_request(:get, 'http://example.org/exists/foo').to_return(body: 'yes')
39
39
  stub_request(:get, 'http://example.org/recent/foo.txt').to_return(body: '42')
40
40
  stub_request(:get, 'http://example.org/finished/42').to_return(body: 'yes')
41
- stub_request(:get, 'http://example.org/exit/42').to_return(body: '0')
41
+ stub_request(:get, 'http://example.org/exit/42.txt').to_return(body: '0')
42
42
  fb = Factbase.new
43
43
  fb.insert.foo = 42
44
44
  stub_request(:get, 'http://example.org/pull/42.fb').to_return(body: fb.export)
@@ -66,8 +66,8 @@ class TestPull < Minitest::Test
66
66
  stub_request(:get, 'http://example.org/exists/foo').to_return(body: 'yes')
67
67
  stub_request(:get, 'http://example.org/recent/foo.txt').to_return(body: '42')
68
68
  stub_request(:get, 'http://example.org/finished/42').to_return(body: 'yes')
69
- stub_request(:get, 'http://example.org/exit/42').to_return(body: '1')
70
- stub_request(:get, 'http://example.org/stdout/42').to_return(body: 'oops, some trouble here')
69
+ stub_request(:get, 'http://example.org/exit/42.txt').to_return(body: '1')
70
+ stub_request(:get, 'http://example.org/stdout/42.txt').to_return(body: 'oops, some trouble here')
71
71
  Dir.mktmpdir do |d|
72
72
  file = File.join(d, 'base.fb')
73
73
  e =
data/test/test_baza.rb CHANGED
@@ -67,6 +67,26 @@ class TestBaza < Minitest::Test
67
67
  )
68
68
  end
69
69
 
70
+ def test_exit_code_check
71
+ WebMock.disable_net_connect!
72
+ stub_request(:get, 'https://example.org/exit/42.txt').to_return(
73
+ status: 200, body: '0'
74
+ )
75
+ assert(
76
+ Judges::Baza.new('example.org', 443, '000').exit_code(42).zero?
77
+ )
78
+ end
79
+
80
+ def test_stdout_read
81
+ WebMock.disable_net_connect!
82
+ stub_request(:get, 'https://example.org/stdout/42.txt').to_return(
83
+ status: 200, body: 'hello!'
84
+ )
85
+ assert(
86
+ !Judges::Baza.new('example.org', 443, '000').stdout(42).empty?
87
+ )
88
+ end
89
+
70
90
  def test_simple_pull
71
91
  WebMock.disable_net_connect!
72
92
  stub_request(:get, 'https://example.org/pull/333.fb').to_return(
@@ -110,6 +130,7 @@ class TestBaza < Minitest::Test
110
130
  end
111
131
 
112
132
  def test_push_compressed_content
133
+ skip # this test is not stable, see https://github.com/yegor256/judges/issues/105
113
134
  req =
114
135
  with_http_server(200, 'yes') do |baza|
115
136
  baza.push('simple', 'hello, world!', %w[meta1 meta2 meta3])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: judges
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.22.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko