MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / execute

Method execute

ruby/engine/openstudio_cli.rb:1747–1772  ·  view source on GitHub ↗

Executes the commands to get into an IRB prompt @param [Array] sub_argv Options passed to the interactive_ruby command from the user input @return [Fixnum] Return status

(sub_argv)

Source from the content-addressed store, hash-verified

1745 # @return [Fixnum] Return status
1746 #
1747 def execute(sub_argv)
1748 require 'irb'
1749
1750 $logger.info "InteractiveRubyShell, sub_argv = #{sub_argv}"
1751
1752 options = {}
1753
1754 opts = OptionParser.new do |o|
1755 o.banner = 'Usage: openstudio interactive_ruby'
1756 end
1757
1758 # Parse the options
1759 argv = parse_options(opts, sub_argv)
1760 return 0 if argv == nil
1761
1762 $logger.debug("InteractiveRubyShell command: #{argv.inspect} #{options.inspect}")
1763
1764 unless argv == []
1765 $logger.error 'Extra arguments passed to the i command.'
1766 return 1
1767 end
1768
1769 IRB.start_session(binding)
1770
1771 0
1772 end
1773end
1774
1775# Class to return the packaged OpenStudio version

Callers

nothing calls this directly

Calls 5

parse_optionsFunction · 0.85
infoMethod · 0.80
debugMethod · 0.80
start_sessionMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected