Sha256: 81119b763a2402be0a2664a28501918ea1b9e57061255a3f52e8f78d6a75393d

Contents?: true

Size: 1.24 KB

Versions: 30

Compression:

Stored size: 1.24 KB

Contents

module PowerStencil
  module CommandProcessors

    class Shell

      include Climatic::Script::UnimplementedProcessor
      include Climatic::Proxy
      include PowerStencil::Project::Proxy


      def execute

        working_universe = if config[:compiled]
                             project.engine.root_universe.compile scenario: config[:scenario]
                           else
                             project.engine.root_universe

                           end

        context = project.engine.running_context working_universe

        require 'pry'

        Pry.hooks.add_hook(:before_session, "startup_message") do
          puts config[:shell_dsl][:session_greetings]
        end

        msg = 'Changes done in PowerStencil shell session.'
        project.track_action_with_git(msg,
                                      user_validation_required: true,
                                      validation_message: 'Would you like to commit your changes ?',
                                      show_files_to_commit: true) do
          Pry.start context,
                    prompt: [proc { config[:shell_dsl][:prompt_level_1] }, proc { config[:shell_dsl][:prompt_level_2] }],
                    quiet: true
        end

      end

    end

  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
power_stencil-0.10.0 lib/power_stencil/command_processors/shell.rb
power_stencil-0.9.8 lib/power_stencil/command_processors/shell.rb
power_stencil-0.9.7 lib/power_stencil/command_processors/shell.rb
power_stencil-0.9.6 lib/power_stencil/command_processors/shell.rb
power_stencil-0.9.5 lib/power_stencil/command_processors/shell.rb
power_stencil-0.9.4 lib/power_stencil/command_processors/shell.rb
power_stencil-0.9.3 lib/power_stencil/command_processors/shell.rb
power_stencil-0.9.2 lib/power_stencil/command_processors/shell.rb
power_stencil-0.9.1 lib/power_stencil/command_processors/shell.rb
power_stencil-0.9.0 lib/power_stencil/command_processors/shell.rb
power_stencil-0.8.14 lib/power_stencil/command_processors/shell.rb
power_stencil-0.8.13 lib/power_stencil/command_processors/shell.rb
power_stencil-0.8.12 lib/power_stencil/command_processors/shell.rb
power_stencil-0.8.11 lib/power_stencil/command_processors/shell.rb
power_stencil-0.8.10 lib/power_stencil/command_processors/shell.rb
power_stencil-0.8.9 lib/power_stencil/command_processors/shell.rb
power_stencil-0.8.8 lib/power_stencil/command_processors/shell.rb
power_stencil-0.8.7 lib/power_stencil/command_processors/shell.rb
power_stencil-0.8.6 lib/power_stencil/command_processors/shell.rb
power_stencil-0.8.5 lib/power_stencil/command_processors/shell.rb