diff options
author | Phil Hughes <me@iamphill.com> | 2017-04-13 20:08:47 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-04-13 20:08:47 +0100 |
commit | 1d99c7755ce337a715847344f4f20df23b29bfc7 (patch) | |
tree | d18b0951f07332939c873e300a4b4079e422ad3c /lib | |
parent | a8b7a4b71760932341b3a58542b5702495d65ba9 (diff) | |
parent | 7d7dfee48b3455eec07968e7517f9d843a04da66 (diff) | |
download | gitlab-ce-notebooklab-in-repo.tar.gz |
Merge branch 'master' into notebooklab-in-reponotebooklab-in-repo
Diffstat (limited to 'lib')
-rw-r--r-- | lib/banzai/filter/issuable_state_filter.rb | 4 | ||||
-rw-r--r-- | lib/container_registry/path.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/ci/trace/stream.rb | 7 |
3 files changed, 7 insertions, 8 deletions
diff --git a/lib/banzai/filter/issuable_state_filter.rb b/lib/banzai/filter/issuable_state_filter.rb index 6b78aa795b4..0b2b8bd7f4d 100644 --- a/lib/banzai/filter/issuable_state_filter.rb +++ b/lib/banzai/filter/issuable_state_filter.rb @@ -13,8 +13,8 @@ module Banzai issuables = extractor.extract([doc]) issuables.each do |node, issuable| - if VISIBLE_STATES.include?(issuable.state) - node.children.last.content += " [#{issuable.state}]" + if VISIBLE_STATES.include?(issuable.state) && node.children.present? + node.add_child(Nokogiri::XML::Text.new(" [#{issuable.state}]", doc)) end end diff --git a/lib/container_registry/path.rb b/lib/container_registry/path.rb index a4b5f2aba6c..4a585996aa5 100644 --- a/lib/container_registry/path.rb +++ b/lib/container_registry/path.rb @@ -15,7 +15,7 @@ module ContainerRegistry LEVELS_SUPPORTED = 3 def initialize(path) - @path = path + @path = path.to_s.downcase end def valid? @@ -25,7 +25,7 @@ module ContainerRegistry end def components - @components ||= @path.to_s.split('/') + @components ||= @path.split('/') end def nodes diff --git a/lib/gitlab/ci/trace/stream.rb b/lib/gitlab/ci/trace/stream.rb index 41dcf846fed..3b335cdfd01 100644 --- a/lib/gitlab/ci/trace/stream.rb +++ b/lib/gitlab/ci/trace/stream.rb @@ -25,11 +25,10 @@ module Gitlab end def limit(last_bytes = LIMIT_SIZE) - stream_size = size - if stream_size < last_bytes - last_bytes = stream_size + if last_bytes < size + stream.seek(-last_bytes, IO::SEEK_END) + stream.readline end - stream.seek(-last_bytes, IO::SEEK_END) end def append(data, offset) |