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)
| 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 |
| 1773 | end |
| 1774 | |
| 1775 | # Class to return the packaged OpenStudio version |
nothing calls this directly
no test coverage detected