cocoapods-sync-podspecs 0.1.9 → 0.2.4
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/pod/command/bump-version.rb +7 -7
 - data/lib/pod/command/push-tag.rb +19 -11
 - 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: 9de345a627797c763a42d8b00ae11c8ed0ac6d790d929396542e476ec0050839
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: e326567beb4b6c3beee0afe8848cef3cda75656b2837258e50d710d5b4792423
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 5982e216e64e04ac6531519eeb63f46425d0118312d34a5f98e6206c374ca06d58f29413c0427640df74506f00d147899b7225cb4140503b163acdaf1969627b
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 1412ef4aca07b10262b9a859bc4fd0934a3e7c7429f0e5d41382bb991997a2f0b1f269041c4ac64528951875a705150990b6745f32c445354f8c2a0d54a6a32a
         
     | 
| 
         @@ -48,10 +48,11 @@ module Pod 
     | 
|
| 
       48 
48 
     | 
    
         
             
                            end
         
     | 
| 
       49 
49 
     | 
    
         | 
| 
       50 
50 
     | 
    
         
             
                            def modify_podspec(path, version)
         
     | 
| 
       51 
     | 
    
         
            -
                                unless version =~  
     | 
| 
       52 
     | 
    
         
            -
                                    UI.puts " 
     | 
| 
      
 51 
     | 
    
         
            +
                                unless version =~ /^(\d+\.)?(\d+\.)?(\*|\d+)$/
         
     | 
| 
      
 52 
     | 
    
         
            +
                                    UI.puts "Invalid version #{version}"
         
     | 
| 
       53 
53 
     | 
    
         
             
                                    return 
         
     | 
| 
       54 
54 
     | 
    
         
             
                                end
         
     | 
| 
      
 55 
     | 
    
         
            +
                                
         
     | 
| 
       55 
56 
     | 
    
         
             
                                unless File.exist?path
         
     | 
| 
       56 
57 
     | 
    
         
             
                                    UI.puts "Podspec file not found"
         
     | 
| 
       57 
58 
     | 
    
         
             
                                    return
         
     | 
| 
         @@ -60,13 +61,13 @@ module Pod 
     | 
|
| 
       60 
61 
     | 
    
         
             
                                File.open(path, "r+") do |f|
         
     | 
| 
       61 
62 
     | 
    
         
             
                                    s = ""
         
     | 
| 
       62 
63 
     | 
    
         
             
                                    f.each_line do |line|
         
     | 
| 
       63 
     | 
    
         
            -
                                        if line.to_s =~ /s\.version\s*=\s* 
     | 
| 
       64 
     | 
    
         
            -
                                            line = line.sub( 
     | 
| 
      
 64 
     | 
    
         
            +
                                        if line.to_s =~ /s\.version\s*=\s*'(\d+\.)?(\d+\.)?(\*|\d+)'/
         
     | 
| 
      
 65 
     | 
    
         
            +
                                            line = line.sub(/(\d+\.)?(\d+\.)?(\*|\d+)/) do |match| 
         
     | 
| 
       65 
66 
     | 
    
         
             
                                                version.to_s
         
     | 
| 
       66 
67 
     | 
    
         
             
                                            end
         
     | 
| 
       67 
68 
     | 
    
         
             
                                        end
         
     | 
| 
       68 
     | 
    
         
            -
                                        if line.to_s =~ /s\.version\s*=\s* 
     | 
| 
       69 
     | 
    
         
            -
                                            line = line.sub( 
     | 
| 
      
 69 
     | 
    
         
            +
                                        if line.to_s =~ /s\.version\s*=\s*"(\d+\.)?(\d+\.)?(\*|\d+)"/
         
     | 
| 
      
 70 
     | 
    
         
            +
                                            line = line.sub(/(\d+\.)?(\d+\.)?(\*|\d+)/) do |match| 
         
     | 
| 
       70 
71 
     | 
    
         
             
                                                version.to_s
         
     | 
| 
       71 
72 
     | 
    
         
             
                                            end
         
     | 
| 
       72 
73 
     | 
    
         
             
                                        end
         
     | 
| 
         @@ -74,7 +75,6 @@ module Pod 
     | 
|
| 
       74 
75 
     | 
    
         
             
                                    end
         
     | 
| 
       75 
76 
     | 
    
         
             
                                    File.open(path, "w+") do |f| f.write(s) end
         
     | 
| 
       76 
77 
     | 
    
         
             
                                end	
         
     | 
| 
       77 
     | 
    
         
            -
                                
         
     | 
| 
       78 
78 
     | 
    
         
             
                            end
         
     | 
| 
       79 
79 
     | 
    
         | 
| 
       80 
80 
     | 
    
         
             
                            # @return [Array<Pathname>] The path of the specifications to push.
         
     | 
    
        data/lib/pod/command/push-tag.rb
    CHANGED
    
    | 
         @@ -15,16 +15,18 @@ module Pod 
     | 
|
| 
       15 
15 
     | 
    
         | 
| 
       16 
16 
     | 
    
         
             
                            def self.options
         
     | 
| 
       17 
17 
     | 
    
         
             
                                [
         
     | 
| 
       18 
     | 
    
         
            -
                                    ['--local 
     | 
| 
       19 
     | 
    
         
            -
                                    ['-- 
     | 
| 
       20 
     | 
    
         
            -
                                    ['-- 
     | 
| 
      
 18 
     | 
    
         
            +
                                    ['--commit-local', 'Make commit for bump version'],
         
     | 
| 
      
 19 
     | 
    
         
            +
                                    ['--push-remote', 'Perform the step of pushing REPO to its remote'],
         
     | 
| 
      
 20 
     | 
    
         
            +
                                    ['--continue-if-exists', 'Continues running when tag is existed'],
         
     | 
| 
      
 21 
     | 
    
         
            +
                                    ['--tag-on-change', 'Just push tag when podspec is changed'],
         
     | 
| 
       21 
22 
     | 
    
         
             
                                ].concat(super)
         
     | 
| 
       22 
23 
     | 
    
         
             
                            end
         
     | 
| 
       23 
24 
     | 
    
         | 
| 
       24 
25 
     | 
    
         
             
                            def initialize(argv)
         
     | 
| 
       25 
     | 
    
         
            -
                                @ 
     | 
| 
       26 
     | 
    
         
            -
                                @ 
     | 
| 
       27 
     | 
    
         
            -
                                @ 
     | 
| 
      
 26 
     | 
    
         
            +
                                @commit_local = argv.flag?('commit-local', false)
         
     | 
| 
      
 27 
     | 
    
         
            +
                                @tag_on_change = argv.flag?('tag-on-change', false)
         
     | 
| 
      
 28 
     | 
    
         
            +
                                @continue_if_exists = argv.flag?('continue-if-exists', false)
         
     | 
| 
      
 29 
     | 
    
         
            +
                                @push_remote = argv.flag?('push-remote', false)
         
     | 
| 
       28 
30 
     | 
    
         
             
                                @tag_version = argv.shift_argument
         
     | 
| 
       29 
31 
     | 
    
         
             
                                @current_repo_dir = ''
         
     | 
| 
       30 
32 
     | 
    
         
             
                                super
         
     | 
| 
         @@ -41,17 +43,23 @@ module Pod 
     | 
|
| 
       41 
43 
     | 
    
         
             
                            end
         
     | 
| 
       42 
44 
     | 
    
         | 
| 
       43 
45 
     | 
    
         
             
                            def run
         
     | 
| 
      
 46 
     | 
    
         
            +
                                processedPaths = Array.new
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
       44 
48 
     | 
    
         
             
                                podspec_files.each do |spec_file|
         
     | 
| 
       45 
49 
     | 
    
         
             
                                    spec = Pod::Specification.from_file(spec_file)
         
     | 
| 
       46 
50 
     | 
    
         | 
| 
       47 
51 
     | 
    
         
             
                                    @tag_version = spec.version.to_s unless !@tag_version.nil?
         
     | 
| 
       48 
52 
     | 
    
         
             
                                    @current_repo_dir = Pathname(spec_file).dirname
         
     | 
| 
       49 
53 
     | 
    
         | 
| 
      
 54 
     | 
    
         
            +
                                    next if processedPaths.include?(@current_repo_dir)
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
                                    processedPaths.push(@current_repo_dir)
         
     | 
| 
      
 57 
     | 
    
         
            +
             
     | 
| 
       50 
58 
     | 
    
         
             
                                    # check_repo_status(spec.name, Pathname(spec_file).dirname)
         
     | 
| 
       51 
59 
     | 
    
         
             
                                    # update_repo(spec.name, Pathname(spec_file).dirname)                        
         
     | 
| 
       52 
60 
     | 
    
         | 
| 
       53 
61 
     | 
    
         
             
                                    exists_tag = pod_repo_git('tag').include?(@tag_version)
         
     | 
| 
       54 
     | 
    
         
            -
                                    if exists_tag && !@ 
     | 
| 
      
 62 
     | 
    
         
            +
                                    if exists_tag && !@continue_if_exists
         
     | 
| 
       55 
63 
     | 
    
         
             
                                        raise Informative, "#{spec.name}: tag #{@tag_version} already exists" 
         
     | 
| 
       56 
64 
     | 
    
         
             
                                    end
         
     | 
| 
       57 
65 
     | 
    
         | 
| 
         @@ -67,13 +75,13 @@ module Pod 
     | 
|
| 
       67 
75 
     | 
    
         | 
| 
       68 
76 
     | 
    
         
             
                                # only commit if modified
         
     | 
| 
       69 
77 
     | 
    
         
             
                                if pod_repo_git('status', '--porcelain').include?(podspec_name)
         
     | 
| 
       70 
     | 
    
         
            -
                                    pod_repo_git('add', '*.podspec')
         
     | 
| 
       71 
     | 
    
         
            -
                                    pod_repo_git('commit', '--no-verify', '-m', message)
         
     | 
| 
       72 
     | 
    
         
            -
                                    push_pod_repo(name) unless  
     | 
| 
      
 78 
     | 
    
         
            +
                                    pod_repo_git('add', '*.podspec') unless !@commit_local
         
     | 
| 
      
 79 
     | 
    
         
            +
                                    pod_repo_git('commit', '--no-verify', '-m', message) unless !@commit_local
         
     | 
| 
      
 80 
     | 
    
         
            +
                                    push_pod_repo(name) unless !@push_remote
         
     | 
| 
       73 
81 
     | 
    
         | 
| 
       74 
82 
     | 
    
         
             
                                    pod_repo_git('tag', '-a', @tag_version, '-m', message)
         
     | 
| 
       75 
83 
     | 
    
         
             
                                    push_tag_repo
         
     | 
| 
       76 
     | 
    
         
            -
                                elsif  
     | 
| 
      
 84 
     | 
    
         
            +
                                elsif !@tag_on_change
         
     | 
| 
       77 
85 
     | 
    
         
             
                                    check_repo_status(name, @current_repo_dir)
         
     | 
| 
       78 
86 
     | 
    
         
             
                                    update_repo(name, @current_repo_dir)                        
         
     | 
| 
       79 
87 
     | 
    
         | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: cocoapods-sync-podspecs
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.4
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - quangmv
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2021-01- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2021-01-06 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: cocoapods
         
     |