gfsm 0.3.0 → 0.3.2
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/gfsm.rb +2 -2
 - data/lib/tools/current_version_loader.rb +3 -7
 - data/lib/tools/{commits_extractor.rb → git_utilities.rb} +17 -5
 - data/lib/tools/version_bumper.rb +3 -1
 - metadata +3 -3
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: a3daf635392e3b39f025cb94e1a4d73b6d28be9a763e2772b125926414197a81
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 417a58de2b92bdefd1328ea4ebd812dcc9d2576456e69ad5076eb8ec0eb9ae69
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: bb531a7d063939b9aa8da7b00ae64f9050c5da0000540e9b8284415006608ff33d7e528e1f02a2e5ab7150879c807272690fb1394e9f8e7da8e36596fa57af26
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 04da15d2f22e288c0caa21d52788807364762ff8ce88edcabe5677ff4c2c29ed3fbc56a553424d246560eec9ccd25704a1d9750e8244ada5c35e7d5f23fbc8c4
         
     | 
    
        data/lib/gfsm.rb
    CHANGED
    
    | 
         @@ -7,11 +7,11 @@ require 'data/configuration' 
     | 
|
| 
       7 
7 
     | 
    
         
             
            require 'data/version'
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
            # Load the tools
         
     | 
| 
       10 
     | 
    
         
            -
            require 'tools/commits_extractor'
         
     | 
| 
       11 
10 
     | 
    
         
             
            require 'tools/commits_subdivider'
         
     | 
| 
       12 
11 
     | 
    
         
             
            require 'tools/current_version_loader'
         
     | 
| 
       13 
     | 
    
         
            -
            require 'tools/ 
     | 
| 
      
 12 
     | 
    
         
            +
            require 'tools/git_utilities'
         
     | 
| 
       14 
13 
     | 
    
         
             
            require 'tools/output'
         
     | 
| 
      
 14 
     | 
    
         
            +
            require 'tools/version_bumper'
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
16 
     | 
    
         
             
            # Load the commands
         
     | 
| 
       17 
17 
     | 
    
         
             
            require 'commands/base_command'
         
     | 
| 
         @@ -7,13 +7,9 @@ module GFSM 
     | 
|
| 
       7 
7 
     | 
    
         
             
              module Tools
         
     | 
| 
       8 
8 
     | 
    
         
             
                class CurrentVersionLoader
         
     | 
| 
       9 
9 
     | 
    
         
             
                  def self.load_current_version(repo_path = ".")
         
     | 
| 
       10 
     | 
    
         
            -
                     
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
                     
     | 
| 
       13 
     | 
    
         
            -
                      last_tag_name = repo.describe(nil, { :tags => true, :abbrev => 0 })
         
     | 
| 
       14 
     | 
    
         
            -
                    rescue
         
     | 
| 
       15 
     | 
    
         
            -
                      last_tag_name = nil
         
     | 
| 
       16 
     | 
    
         
            -
                    end
         
     | 
| 
      
 10 
     | 
    
         
            +
                    last_tag_name = GFSM::Tools::GitUtilities.extract_last_tag_name(
         
     | 
| 
      
 11 
     | 
    
         
            +
                      GFSM::Tools::GitUtilities.load_repo(repo_path)
         
     | 
| 
      
 12 
     | 
    
         
            +
                    )
         
     | 
| 
       17 
13 
     | 
    
         | 
| 
       18 
14 
     | 
    
         
             
                    return GFSM::Data::Version.new("0.0.0") unless last_tag_name
         
     | 
| 
       19 
15 
     | 
    
         | 
| 
         @@ -4,17 +4,29 @@ require 'git' 
     | 
|
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
            module GFSM
         
     | 
| 
       6 
6 
     | 
    
         
             
              module Tools
         
     | 
| 
       7 
     | 
    
         
            -
                class  
     | 
| 
      
 7 
     | 
    
         
            +
                class GitUtilities
         
     | 
| 
       8 
8 
     | 
    
         
             
                  CHANGELOG_TRAILER_REGEX = /^(?<name>Changelog):\s*(?<category>.+)$/i
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
     | 
    
         
            -
                  def self. 
     | 
| 
       11 
     | 
    
         
            -
                     
     | 
| 
      
 10 
     | 
    
         
            +
                  def self.load_repo(repo_path)
         
     | 
| 
      
 11 
     | 
    
         
            +
                    Git.open(repo_path)
         
     | 
| 
      
 12 
     | 
    
         
            +
                  end
         
     | 
| 
       12 
13 
     | 
    
         | 
| 
      
 14 
     | 
    
         
            +
                  def self.extract_last_tag_name(repo)
         
     | 
| 
       13 
15 
     | 
    
         
             
                    begin
         
     | 
| 
       14 
     | 
    
         
            -
                       
     | 
| 
      
 16 
     | 
    
         
            +
                      current_sort_order = repo.config("tag.sort")
         
     | 
| 
      
 17 
     | 
    
         
            +
                      repo.fetch(tags: true)
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                      repo.config("tag.sort", "-v:refname")
         
     | 
| 
      
 20 
     | 
    
         
            +
                      tags = repo.tags
         
     | 
| 
      
 21 
     | 
    
         
            +
                      repo.config("tag.sort", current_sort_order)
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
                      tags[0].name if !tags.empty?
         
     | 
| 
       15 
24 
     | 
    
         
             
                    rescue
         
     | 
| 
       16 
     | 
    
         
            -
                      last_tag_name = nil
         
     | 
| 
       17 
25 
     | 
    
         
             
                    end
         
     | 
| 
      
 26 
     | 
    
         
            +
                  end
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
                  def self.extract_commits_with_changelog_trailer(repo)
         
     | 
| 
      
 29 
     | 
    
         
            +
                    last_tag_name = self.extract_last_tag_name(repo)
         
     | 
| 
       18 
30 
     | 
    
         | 
| 
       19 
31 
     | 
    
         
             
                    begin
         
     | 
| 
       20 
32 
     | 
    
         
             
                      commits = last_tag_name ? repo.log.between(last_tag_name, 'HEAD') : repo.log
         
     | 
    
        data/lib/tools/version_bumper.rb
    CHANGED
    
    | 
         @@ -10,7 +10,9 @@ module GFSM 
     | 
|
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
                  def compute_version!(force, prerelease, prerelease_name, repository_path, configuration_file_path)
         
     | 
| 
       12 
12 
     | 
    
         
             
                    configuration = GFSM::Data::Configuration.new(configuration_file_path)
         
     | 
| 
       13 
     | 
    
         
            -
                    changelog_commits = GFSM::Tools:: 
     | 
| 
      
 13 
     | 
    
         
            +
                    changelog_commits = GFSM::Tools::GitUtilities.extract_commits_with_changelog_trailer(
         
     | 
| 
      
 14 
     | 
    
         
            +
                      GFSM::Tools::GitUtilities.load_repo(repository_path)
         
     | 
| 
      
 15 
     | 
    
         
            +
                    )
         
     | 
| 
       14 
16 
     | 
    
         | 
| 
       15 
17 
     | 
    
         
             
                    @version = GFSM::Tools::CurrentVersionLoader.load_current_version(repository_path)
         
     | 
| 
       16 
18 
     | 
    
         
             
                    @subdivisions = GFSM::Tools::CommitsSubdivider.subdivide_commits(configuration, changelog_commits)
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: gfsm
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.3. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.3.2
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Zille Marco
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2022- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2022-09-29 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: yaml
         
     | 
| 
         @@ -81,9 +81,9 @@ files: 
     | 
|
| 
       81 
81 
     | 
    
         
             
            - lib/data/configuration.rb
         
     | 
| 
       82 
82 
     | 
    
         
             
            - lib/data/version.rb
         
     | 
| 
       83 
83 
     | 
    
         
             
            - lib/gfsm.rb
         
     | 
| 
       84 
     | 
    
         
            -
            - lib/tools/commits_extractor.rb
         
     | 
| 
       85 
84 
     | 
    
         
             
            - lib/tools/commits_subdivider.rb
         
     | 
| 
       86 
85 
     | 
    
         
             
            - lib/tools/current_version_loader.rb
         
     | 
| 
      
 86 
     | 
    
         
            +
            - lib/tools/git_utilities.rb
         
     | 
| 
       87 
87 
     | 
    
         
             
            - lib/tools/output.rb
         
     | 
| 
       88 
88 
     | 
    
         
             
            - lib/tools/version_bumper.rb
         
     | 
| 
       89 
89 
     | 
    
         
             
            homepage: https://gitlab.com/zillemarco/gitlab-flavored-semantic-versioning
         
     |