Skip to content

Commit

Permalink
Only require "cwm/widget" lazily, to prevent cyclic requires
Browse files Browse the repository at this point in the history
For backward compatibility we require cwm/tabs from cwm/widgets
  • Loading branch information
mvidner committed May 23, 2017
1 parent c3f06e0 commit 20d59b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions library/cwm/src/modules/CWM.rb
Expand Up @@ -30,8 +30,6 @@
#
require "yast"

require "cwm/widget"

module Yast
class CWMClass < Module
def main
Expand Down Expand Up @@ -1086,6 +1084,8 @@ def validate_current_widgets(event)

# @return [Array<::CWM::AbstractWidget>]
def widgets_in_contents(contents)
require "cwm/widget"

contents.each_with_object([]) do |arg, res|
case arg
when ::CWM::CustomWidget then res.concat(arg.nested_widgets) << arg
Expand All @@ -1098,6 +1098,8 @@ def widgets_in_contents(contents)
# @param [::CWM::WidgetTerm] contents
# @return [::CWM::StringTerm]
def widgets_contents(contents)
require "cwm/widget"

res = contents.clone

(0..(res.size - 1)).each do |index|
Expand Down

0 comments on commit 20d59b6

Please sign in to comment.