pear-programmer 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cli/actions.rb +25 -1
- data/lib/cli/version.rb +1 -1
- data/lib/cli.rb +4 -0
- data/lib/pairprogrammer/api/coder.rb +2 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 34ac3b10571708853a88b57e0b2c828e6ae3dcc72d9640003fe6d702a8a766f3
         | 
| 4 | 
            +
              data.tar.gz: 41a342a7514aa53a43059691a603fb1f9e1b89e8cb6c3e5a8a4dd7544706aa14
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 89a51c5f77a5292443ad510cda1b3a5ec7676393d95f6c5127aa205e8aa0110b1be106fd92e6aa2a1a704ba22357c1bfd2f3b66608fe0c84fa083cb76acebdf5
         | 
| 7 | 
            +
              data.tar.gz: 8b318fc5d9c84fd55637a36d3bb6d3e20fa61f666807cfc6d26fc5850c18da4159fde8a6b506a1a52b49c895cae241910c22bdd7d9b118187b26305526a43c41
         | 
    
        data/lib/cli/actions.rb
    CHANGED
    
    | @@ -65,6 +65,22 @@ module Cli | |
| 65 65 | 
             
                        Cli::Display.info_message "  pear-on coding list (list all requirements)"
         | 
| 66 66 | 
             
                    end
         | 
| 67 67 |  | 
| 68 | 
            +
                    def self.create_and_run_remember(options)
         | 
| 69 | 
            +
                        requirements = Cli::Display.get_input("what would you like to remember?: ")
         | 
| 70 | 
            +
                        config = Cli::Configuration.new
         | 
| 71 | 
            +
                        context = config.default_context
         | 
| 72 | 
            +
                        id = PairProgrammer::Api::Coder.create([], context, requirements, "remember")
         | 
| 73 | 
            +
                        run_coder({ id: id })
         | 
| 74 | 
            +
                    end
         | 
| 75 | 
            +
             | 
| 76 | 
            +
                    def self.create_and_run_recall(options)
         | 
| 77 | 
            +
                        requirements = Cli::Display.get_input("what would you like to recall?: ")
         | 
| 78 | 
            +
                        config = Cli::Configuration.new
         | 
| 79 | 
            +
                        context = config.default_context
         | 
| 80 | 
            +
                        id = PairProgrammer::Api::Coder.create([], context, requirements, "recall")
         | 
| 81 | 
            +
                        run_coder({ id: id })
         | 
| 82 | 
            +
                    end
         | 
| 83 | 
            +
             | 
| 68 84 | 
             
                    # CODER
         | 
| 69 85 | 
             
                    def self.create_coder(options)
         | 
| 70 86 | 
             
                        config = Cli::Configuration.new
         | 
| @@ -85,7 +101,7 @@ module Cli | |
| 85 101 | 
             
                            end
         | 
| 86 102 | 
             
                        end
         | 
| 87 103 |  | 
| 88 | 
            -
                        id = PairProgrammer::Api::Coder.create(tasks, context, requirements)
         | 
| 104 | 
            +
                        id = PairProgrammer::Api::Coder.create(tasks, context, requirements, nil)
         | 
| 89 105 | 
             
                        Cli::Display.success_message("Done")
         | 
| 90 106 | 
             
                        Cli::Display.info_message("You can now run pear-on coding start")
         | 
| 91 107 | 
             
                    end
         | 
| @@ -98,6 +114,11 @@ module Cli | |
| 98 114 | 
             
                            id = options[:id]
         | 
| 99 115 | 
             
                        else
         | 
| 100 116 | 
             
                            coders = PairProgrammer::Api::Coder.list
         | 
| 117 | 
            +
                            if coders.empty?
         | 
| 118 | 
            +
                                Cli::Display.error_message("you have not created any requirements yet")
         | 
| 119 | 
            +
                                return
         | 
| 120 | 
            +
                            end
         | 
| 121 | 
            +
             | 
| 101 122 | 
             
                            id = Cli::Display.select("Select which requirements you would like to work on", coders.inject({}) { |hash, coder| hash[coder["requirements"]] = coder["id"]; hash })
         | 
| 102 123 | 
             
                        end
         | 
| 103 124 |  | 
| @@ -135,6 +156,9 @@ module Cli | |
| 135 156 | 
             
                            end
         | 
| 136 157 |  | 
| 137 158 | 
             
                            system_message = response["system_message"]
         | 
| 159 | 
            +
                            if system_message.nil?
         | 
| 160 | 
            +
                                next
         | 
| 161 | 
            +
                            end
         | 
| 138 162 |  | 
| 139 163 | 
             
                            response_required = true
         | 
| 140 164 | 
             
                            # TODO if there is explanation but no command then response is required
         | 
    
        data/lib/cli/version.rb
    CHANGED
    
    
    
        data/lib/cli.rb
    CHANGED
    
    
| @@ -3,11 +3,12 @@ require_relative 'client' | |
| 3 3 | 
             
            module PairProgrammer
         | 
| 4 4 | 
             
                module Api
         | 
| 5 5 | 
             
                    class Coder
         | 
| 6 | 
            -
                        def self.create(tasks, context, requirements)
         | 
| 6 | 
            +
                        def self.create(tasks, context, requirements, recipe=nil)
         | 
| 7 7 | 
             
                            body = {
         | 
| 8 8 | 
             
                                tasks: tasks,
         | 
| 9 9 | 
             
                                context: context,
         | 
| 10 10 | 
             
                                requirements: requirements,
         | 
| 11 | 
            +
                                recipe: recipe
         | 
| 11 12 | 
             
                            }
         | 
| 12 13 | 
             
                            response = Client.new.post('/api/v1/coder', body)
         | 
| 13 14 | 
             
                            response["id"]
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: pear-programmer
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.11
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Sam Edelstein
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2023-06- | 
| 11 | 
            +
            date: 2023-06-28 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: open3
         |