firespring_dev_commands 3.0.1.pre.alpha.0 → 3.0.1.pre.alpha.1
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
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 48ad59bd162ea7856ac6bb8f3e9a6067d9301a27418be50edd318b2412d1e450
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 33a961214d326d72e98ad982cf341518c25988c429b8d14ad7137c76a5b3eda9
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 9a42c56eddfcd4fede54506180ee40707d8282bdee2058f73cb90cecfe2fbe98ca3cd37f5f0224a8337d67bb03b70da860e19590cf9d8a2f46828abd9cb8fd6e
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 5bee09103522ecbfc1388492d29d4351d5807b77b0c59bc3e2f54b907725bf41181a8bf3a7c3a9c59e49684e058fdd82914c93f9ff02a4573e59ddee5b700d08
         
     | 
| 
         @@ -96,7 +96,8 @@ module Dev 
     | 
|
| 
       96 
96 
     | 
    
         
             
                def branch_name(dir: default_project_dir)
         
     | 
| 
       97 
97 
     | 
    
         
             
                  return unless File.exist?(dir)
         
     | 
| 
       98 
98 
     | 
    
         | 
| 
       99 
     | 
    
         
            -
                  ::Git.open(dir) 
     | 
| 
      
 99 
     | 
    
         
            +
                  g = ::Git.open(dir)
         
     | 
| 
      
 100 
     | 
    
         
            +
                  g.current_branch || "HEAD detached at #{g.object('HEAD').sha[0..7]}"
         
     | 
| 
       100 
101 
     | 
    
         
             
                end
         
     | 
| 
       101 
102 
     | 
    
         | 
| 
       102 
103 
     | 
    
         
             
                # Returns true if the remote branch exists, false otherwise
         
     | 
| 
         @@ -424,22 +425,6 @@ module Dev 
     | 
|
| 
       424 
425 
     | 
    
         
             
                  g.fetch('origin', prune: true)
         
     | 
| 
       425 
426 
     | 
    
         
             
                end
         
     | 
| 
       426 
427 
     | 
    
         | 
| 
       427 
     | 
    
         
            -
                def commit_status(repository:, branch:, status:, organization: 'firespring', options: {})
         
     | 
| 
       428 
     | 
    
         
            -
                  token = ENV['GITHUB_TOKEN'].to_s.strip
         
     | 
| 
       429 
     | 
    
         
            -
                  raise 'GITHUB_TOKEN is required' unless token
         
     | 
| 
       430 
     | 
    
         
            -
             
     | 
| 
       431 
     | 
    
         
            -
                  # Set up the GitHub client
         
     | 
| 
       432 
     | 
    
         
            -
                  client = Octokit::Client.new(access_token: token)
         
     | 
| 
       433 
     | 
    
         
            -
             
     | 
| 
       434 
     | 
    
         
            -
                  # Fetch the latest commit SHA for the given branch
         
     | 
| 
       435 
     | 
    
         
            -
                  repo = "#{organization}/#{repository}"
         
     | 
| 
       436 
     | 
    
         
            -
                  ref = "heads/#{branch}"
         
     | 
| 
       437 
     | 
    
         
            -
                  sha = client.ref(repo, ref).object.sha
         
     | 
| 
       438 
     | 
    
         
            -
             
     | 
| 
       439 
     | 
    
         
            -
                  # Create the commit status
         
     | 
| 
       440 
     | 
    
         
            -
                  client.create_status(repo, sha, status, options)
         
     | 
| 
       441 
     | 
    
         
            -
                end
         
     | 
| 
       442 
     | 
    
         
            -
             
     | 
| 
       443 
428 
     | 
    
         
             
                # Builds an ssh repo URL using the org and repo name given
         
     | 
| 
       444 
429 
     | 
    
         
             
                def ssh_repo_url(name, org)
         
     | 
| 
       445 
430 
     | 
    
         
             
                  "git@github.com:#{org}/#{name}.git"
         
     | 
| 
         @@ -159,49 +159,6 @@ module Dev 
     | 
|
| 
       159 
159 
     | 
    
         
             
                      end
         
     | 
| 
       160 
160 
     | 
    
         
             
                    end
         
     | 
| 
       161 
161 
     | 
    
         
             
                  end
         
     | 
| 
       162 
     | 
    
         
            -
             
     | 
| 
       163 
     | 
    
         
            -
                  # Create the rake task for the git commit status task.
         
     | 
| 
       164 
     | 
    
         
            -
                  def create_commit_status_task!
         
     | 
| 
       165 
     | 
    
         
            -
                    # Have to set a local variable to be accessible inside of the instance_eval block
         
     | 
| 
       166 
     | 
    
         
            -
                    exclude = @exclude
         
     | 
| 
       167 
     | 
    
         
            -
             
     | 
| 
       168 
     | 
    
         
            -
                    DEV_COMMANDS_TOP_LEVEL.instance_eval do
         
     | 
| 
       169 
     | 
    
         
            -
                      namespace :git do
         
     | 
| 
       170 
     | 
    
         
            -
                        return if exclude.include?(:commit_status)
         
     | 
| 
       171 
     | 
    
         
            -
             
     | 
| 
       172 
     | 
    
         
            -
                        # TODO: Clean, comments and description
         
     | 
| 
       173 
     | 
    
         
            -
                        desc 'Add status to commit' \
         
     | 
| 
       174 
     | 
    
         
            -
                             "\n\tuse TODO"
         
     | 
| 
       175 
     | 
    
         
            -
             
     | 
| 
       176 
     | 
    
         
            -
                        task :create_commit_status do
         
     | 
| 
       177 
     | 
    
         
            -
                          # Key Values
         
     | 
| 
       178 
     | 
    
         
            -
                          repository = ENV['REPOSITORY'].to_s.strip
         
     | 
| 
       179 
     | 
    
         
            -
                          branch = ENV['BRANCH'].to_s.strip
         
     | 
| 
       180 
     | 
    
         
            -
                          status = ENV['STATUS'].to_s.strip
         
     | 
| 
       181 
     | 
    
         
            -
             
     | 
| 
       182 
     | 
    
         
            -
                          raise 'Repository name is required' unless repository
         
     | 
| 
       183 
     | 
    
         
            -
                          raise 'Branch name is required' unless branch
         
     | 
| 
       184 
     | 
    
         
            -
                          raise 'Status is required' unless status
         
     | 
| 
       185 
     | 
    
         
            -
             
     | 
| 
       186 
     | 
    
         
            -
                          # Validate status
         
     | 
| 
       187 
     | 
    
         
            -
                          valid_statuses = %w(error failure pending success)
         
     | 
| 
       188 
     | 
    
         
            -
                          raise "Invalid status: #{status}. Valid statuses are: #{valid_statuses.join(', ')}" unless valid_statuses.include?(status)
         
     | 
| 
       189 
     | 
    
         
            -
             
     | 
| 
       190 
     | 
    
         
            -
                          # Optional Values
         
     | 
| 
       191 
     | 
    
         
            -
                          context = ENV['CONTEXT'].to_s.strip
         
     | 
| 
       192 
     | 
    
         
            -
                          description = ENV['DESCRIPTION'].to_s.strip
         
     | 
| 
       193 
     | 
    
         
            -
                          target_url = ENV['TARGET_URL'].to_s.strip
         
     | 
| 
       194 
     | 
    
         
            -
             
     | 
| 
       195 
     | 
    
         
            -
                          options = {}
         
     | 
| 
       196 
     | 
    
         
            -
                          options[:context] = context unless context.empty?
         
     | 
| 
       197 
     | 
    
         
            -
                          options[:description] = description unless description.empty?
         
     | 
| 
       198 
     | 
    
         
            -
                          options[:target_url] = target_url unless target_url.empty?
         
     | 
| 
       199 
     | 
    
         
            -
             
     | 
| 
       200 
     | 
    
         
            -
                          Dev::Git.new.commit_status(repository:, branch:, status:, options:)
         
     | 
| 
       201 
     | 
    
         
            -
                        end
         
     | 
| 
       202 
     | 
    
         
            -
                      end
         
     | 
| 
       203 
     | 
    
         
            -
                    end
         
     | 
| 
       204 
     | 
    
         
            -
                  end
         
     | 
| 
       205 
162 
     | 
    
         
             
                end
         
     | 
| 
       206 
163 
     | 
    
         
             
              end
         
     | 
| 
       207 
164 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: firespring_dev_commands
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 3.0.1.pre.alpha. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 3.0.1.pre.alpha.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Firespring
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2024- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2024-05-11 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: activesupport
         
     | 
| 
         @@ -262,20 +262,6 @@ dependencies: 
     | 
|
| 
       262 
262 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       263 
263 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       264 
264 
     | 
    
         
             
                    version: 2.3.0
         
     | 
| 
       265 
     | 
    
         
            -
            - !ruby/object:Gem::Dependency
         
     | 
| 
       266 
     | 
    
         
            -
              name: octokit
         
     | 
| 
       267 
     | 
    
         
            -
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       268 
     | 
    
         
            -
                requirements:
         
     | 
| 
       269 
     | 
    
         
            -
                - - "~>"
         
     | 
| 
       270 
     | 
    
         
            -
                  - !ruby/object:Gem::Version
         
     | 
| 
       271 
     | 
    
         
            -
                    version: '8.1'
         
     | 
| 
       272 
     | 
    
         
            -
              type: :runtime
         
     | 
| 
       273 
     | 
    
         
            -
              prerelease: false
         
     | 
| 
       274 
     | 
    
         
            -
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       275 
     | 
    
         
            -
                requirements:
         
     | 
| 
       276 
     | 
    
         
            -
                - - "~>"
         
     | 
| 
       277 
     | 
    
         
            -
                  - !ruby/object:Gem::Version
         
     | 
| 
       278 
     | 
    
         
            -
                    version: '8.1'
         
     | 
| 
       279 
265 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       280 
266 
     | 
    
         
             
              name: ox
         
     | 
| 
       281 
267 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     |