gonative-cli 1.3.7 → 1.3.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bfed650a535963881f1c80a19d717bb18f60571461a99874052795df20cecd45
4
- data.tar.gz: b7e5e2913f54a4e2c293075a7ffe3e8748e9ce19043d60d0f7ce267c0fa1e986
3
+ metadata.gz: 4a4429a1d50824e2a48f24d4a7e0f5097299712eb2deec5d36f8e9161b929f54
4
+ data.tar.gz: 9e6fc1f60b1b1ecc3bd6fa463c74657f27bc190d75c6304a0dcf3c2c04806288
5
5
  SHA512:
6
- metadata.gz: bcef9d47fd4e11337851590bd57d6b508b59890038bbc65117ac01a1daf39250dcecdb24806908da51c98da4266e97a04df715ff9dffb41d68b45ecc98115b9f
7
- data.tar.gz: 77259fd98da73589ea5783abb851e2c9a3b99b374bb2b5a3923364483de29bb49d7aef9ca2c7e80e2e4038df856edbd6fbaa7c9e454785c0837dbe7c11567443
6
+ metadata.gz: 27c9c14b150a7af8104f8045bd09574936ca7218064c2ab4eece20e12b11ce3e0592ab033864722cf2886eb746bc101955054e2305396db33ef2378c938706ba
7
+ data.tar.gz: d1c32e059b64b1d43693080c2cb65ccc1711f211ea55246c940817ce6afbf456a664a437d81ca37400bde884fbe3bc6a786f67a8d5959f813734a03f74860190
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gonative-cli (1.3.7)
4
+ gonative-cli (1.3.9)
5
5
  activesupport (~> 6.0)
6
6
  cocoapods (~> 1.10)
7
7
  colorize (~> 0.8.0)
@@ -29,10 +29,10 @@ GEM
29
29
  atomos (0.1.3)
30
30
  byebug (11.1.3)
31
31
  claide (1.1.0)
32
- cocoapods (1.14.3)
32
+ cocoapods (1.15.2)
33
33
  addressable (~> 2.8)
34
34
  claide (>= 1.0.2, < 2.0)
35
- cocoapods-core (= 1.14.3)
35
+ cocoapods-core (= 1.15.2)
36
36
  cocoapods-deintegrate (>= 1.0.3, < 2.0)
37
37
  cocoapods-downloader (>= 2.1, < 3.0)
38
38
  cocoapods-plugins (>= 1.0.0, < 2.0)
@@ -47,7 +47,7 @@ GEM
47
47
  nap (~> 1.0)
48
48
  ruby-macho (>= 2.3.0, < 3.0)
49
49
  xcodeproj (>= 1.23.0, < 2.0)
50
- cocoapods-core (1.14.3)
50
+ cocoapods-core (1.15.2)
51
51
  activesupport (>= 5.0, < 8)
52
52
  addressable (~> 2.8)
53
53
  algoliasearch (~> 1.0)
@@ -69,7 +69,7 @@ GEM
69
69
  coderay (1.1.3)
70
70
  colored2 (3.1.2)
71
71
  colorize (0.8.1)
72
- concurrent-ruby (1.2.2)
72
+ concurrent-ruby (1.2.3)
73
73
  diff-lcs (1.4.4)
74
74
  dry-cli (0.7.0)
75
75
  escape (0.0.4)
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GoNative
4
+ module Commands
5
+ module Android
6
+ module Helpers
7
+ module GradleVersionReader
8
+ def gradle_file
9
+ @gradle_file ||= `find . -maxdepth 2 -iname build.gradle`.split("\n").first
10
+ end
11
+
12
+ def version
13
+ return @version if @version
14
+
15
+ str = IO.read(gradle_file)
16
+ @version = str.match(/versionName\s+"(?<version>.+)"/)[:version]
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -5,6 +5,7 @@ module GoNative
5
5
  module Android
6
6
  class Publish < Base
7
7
  desc 'Used to update one of the android internal dependencies'
8
+ include Helpers::GradleVersionReader
8
9
 
9
10
  def call
10
11
  assert_build_file_exists!
@@ -12,36 +13,19 @@ module GoNative
12
13
  end
13
14
 
14
15
  def assert_build_file_exists!
15
- return unless gradle_files.empty?
16
+ return unless gradle_file.empty?
16
17
 
17
- raise Error, "No build.gradle file exists"
18
+ raise Error, 'No build.gradle file exists'
18
19
  end
19
20
 
20
21
  private
21
22
 
22
- def gradle_files
23
- @gradle_files ||= `find . -maxdepth 2 -iname build.gradle`.split("\n")
24
- end
25
-
26
- def version
27
- return @version if @version
28
-
29
- gradle_files.each do |gradle_file|
30
- str = IO.read(gradle_file)
31
- @version = str.match(/versionName\s+\"(?<version>.+)\"/)[:version]
32
-
33
- break if @version
34
- end
35
-
36
- @version
37
- end
38
-
39
23
  def create_and_push_tag!
40
- unless system("git tag | grep #{version} > /dev/null")
41
- system "git add -A && git commit -m \"Releases #{version}.\""
42
- system "git tag #{version}"
43
- system "git push && git push --tags"
44
- end
24
+ return if system("git tag | grep #{version} > /dev/null")
25
+
26
+ system "git add -A && git commit -m \"Releases #{version}.\""
27
+ system "git tag #{version}"
28
+ system 'git push && git push --tags'
45
29
  end
46
30
  end
47
31
  end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GoNative
4
+ module Commands
5
+ module Android
6
+ class Version < Base
7
+ desc 'Used to update one of the android internal dependencies'
8
+ include Helpers::GradleVersionReader
9
+
10
+ def call
11
+ Utils::UI.output(version)
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -17,5 +17,6 @@ module GoNative
17
17
 
18
18
  register 'android create', Android::Create
19
19
  register 'android publish', Android::Publish
20
+ register 'android version', Android::Version
20
21
  end
21
22
  end
@@ -15,6 +15,8 @@ module GoNative
15
15
  end
16
16
 
17
17
  def call
18
+ return unless exists?
19
+
18
20
  proj = Xcodeproj::Project.open('MedianIOS.xcodeproj')
19
21
  file = proj.new_file("#{language}.lproj/Localizable.strings")
20
22
  file.move(localizable_group(proj))
@@ -32,6 +34,12 @@ module GoNative
32
34
 
33
35
  nil
34
36
  end
37
+
38
+ private
39
+
40
+ def exists?
41
+ File.directory?("LeanIOS/#{language}.lproj")
42
+ end
35
43
  end
36
44
  end
37
45
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GoNative
4
- VERSION = '1.3.7'
4
+ VERSION = '1.3.9'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gonative-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.7
4
+ version: 1.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hunaid Hassan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-30 00:00:00.000000000 Z
11
+ date: 2024-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli
@@ -188,7 +188,9 @@ files:
188
188
  - lib/gonative.rb
189
189
  - lib/gonative/commands.rb
190
190
  - lib/gonative/commands/android/create.rb
191
+ - lib/gonative/commands/android/helpers/gradle_version_reader.rb
191
192
  - lib/gonative/commands/android/publish.rb
193
+ - lib/gonative/commands/android/version.rb
192
194
  - lib/gonative/commands/base.rb
193
195
  - lib/gonative/commands/ios/add_language.rb
194
196
  - lib/gonative/commands/ios/create.rb