-
-
Save hjanuschka/e1154dde7691376da34963a4bad7caf6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Fastlane | |
class Globals | |
def self.captured_output | |
unless @captured_output | |
@captured_output = "" | |
end | |
@captured_output | |
end | |
def self.verbose(flag) | |
@verbose = flag | |
end | |
def self.verbose? | |
return @verbose | |
end | |
end | |
end | |
module Ext | |
class Mine | |
def initialize(state) | |
puts "Current: " | |
puts Fastlane::Globals.verbose?.inspect | |
Fastlane::Globals.verbose(state) | |
end | |
def output | |
puts Fastlane::Globals.verbose?.inspect | |
end | |
def append(str) | |
Fastlane::Globals.captured_output << str | |
end | |
end | |
end | |
a = Ext::Mine.new(true) | |
b = Ext::Mine.new(false) | |
a.output | |
a.append("Demo a\n") | |
b.append("Demo b\n") | |
Fastlane::Globals.verbose(false) | |
a.output | |
puts Fastlane::Globals.captured_output.inspect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment