cocoapods-terra-bom 0.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 17fdce4ad4e3176ea46eb7d7fbda33efdc0e5aba4ff6b420e4362178b05230d0
4
+ data.tar.gz: ed54712caeb12b105b3f61a6591e72db289457143f21acb5d1ff0541c4468f1f
5
+ SHA512:
6
+ metadata.gz: 025757637db52c86668f080c65c6f428a24c0eae9978fe551f96798aa806e9fae75ac1359c61a25ae2926970d51ccac4291eece09947999c1cfcca6c3f7e4ebc
7
+ data.tar.gz: accfcbfa267810621b9537f4cb28307df5f44d5925ffab681c1b7e75f3f928c4e3a61d24a8413e10acb6b72ecac54dfc8d7587cf74db99b67659ea7a46b4766d
@@ -0,0 +1,17 @@
1
+ module Pod
2
+ class Command
3
+ class Bom < Command
4
+ self.summary = <<-SUMMARY
5
+ Syncs hooks between team members
6
+ SUMMARY
7
+ self.description = <<-DESC
8
+ CocoaPods plugins that syncs git-hooks placed in .git-hooks directory between team members
9
+ DESC
10
+ self.arguments = []
11
+
12
+ def run
13
+ puts 'Bom running'
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1 @@
1
+ require 'cocoapods-terra-bom/command/bom'
@@ -0,0 +1,3 @@
1
+ module CocoapodsTerraBom
2
+ VERSION = "0.0.2"
3
+ end
@@ -0,0 +1,56 @@
1
+ require 'fileutils'
2
+ require 'open-uri'
3
+
4
+ module Pod
5
+ class Command
6
+ module BomPodCommand
7
+
8
+ TERRA_SPECS_SOURCE_URL = "https://raw.githubusercontent.com/teko-vn/Specs-ios/master"
9
+ BOM_SPEC_NAME = "TerraBOM"
10
+
11
+ def self.get_version(name)
12
+ source_url = self.get_terra_bom_podspec_url
13
+
14
+ unless source_url.nil?
15
+ contents = open(source_url, 'Authorization' => 'Bearer ' + ENV['GITHUB_USER_TOKEN']) {|f| f.read }
16
+
17
+ lines = contents.split(/\n/)
18
+ matches = lines.select { |line| line[/dependency \'#{name}\'/i] }
19
+ if matches.length() > 0
20
+ substrings = matches[0].scan(/'(.*?)'/).flatten
21
+ if substrings.length() > 1
22
+ version = substrings[1]
23
+ version.gsub!(/'/, "")
24
+ version
25
+ else
26
+ nil
27
+ end
28
+ else
29
+ nil
30
+ end
31
+ else
32
+ nil
33
+ end
34
+ end
35
+
36
+ def self.get_terra_bom_podspec_url
37
+ pod_file_content = open('Podfile') { |f| f.read }
38
+ lines = pod_file_content.split(/\n/)
39
+ matches = lines.select { |line| line[/TerraBomVersion/i] }
40
+ if matches.length() > 0
41
+ substrings = matches[0].split(/=/)
42
+ version = substrings[1]
43
+ version.strip!
44
+ version.gsub!(/'/, "")
45
+ TERRA_SPECS_SOURCE_URL + '/' + BOM_SPEC_NAME + '/' + version + '/' + BOM_SPEC_NAME + '.podspec'
46
+ else
47
+ nil
48
+ end
49
+ end
50
+
51
+ def self.print(message)
52
+ UI.puts("#{BOM_SPEC_NAME.cyan} #{message}")
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,23 @@
1
+ require_relative 'bom'
2
+
3
+ module Pod
4
+ class Podfile
5
+ module DSL
6
+ alias_method :real_pod, :pod
7
+
8
+ def pod(name = nil, *requirements, &block)
9
+ if requirements.length() > 0
10
+ real_pod(name, *requirements, &block)
11
+ else
12
+ version = Pod::Command::BomPodCommand.get_version(name)
13
+
14
+ unless version.nil?
15
+ real_pod(name, version, &block)
16
+ else
17
+ real_pod(name, *requirements, &block)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1 @@
1
+ require 'cocoapods-terra-bom/gem_version'
@@ -0,0 +1,2 @@
1
+ require 'cocoapods-terra-bom/command'
2
+ require 'cocoapods-terra-bom/pod/pod'
metadata ADDED
@@ -0,0 +1,78 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cocoapods-terra-bom
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Tung Nguyen
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-10-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: TerraBOM cocoapods plugin
42
+ email:
43
+ - tung.nx@teko.vn
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - lib/cocoapods-terra-bom.rb
49
+ - lib/cocoapods-terra-bom/command.rb
50
+ - lib/cocoapods-terra-bom/command/bom.rb
51
+ - lib/cocoapods-terra-bom/gem_version.rb
52
+ - lib/cocoapods-terra-bom/pod/bom.rb
53
+ - lib/cocoapods-terra-bom/pod/pod.rb
54
+ - lib/cocoapods_plugin.rb
55
+ homepage: https://github.com/teko-vn/Specs-ios
56
+ licenses:
57
+ - MIT
58
+ metadata: {}
59
+ post_install_message:
60
+ rdoc_options: []
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ requirements: []
74
+ rubygems_version: 3.0.3
75
+ signing_key:
76
+ specification_version: 4
77
+ summary: TerraBOM cocoapods plugin
78
+ test_files: []