captive-release 0.7.3 → 0.8.0
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: '028b75d95da7f0c5ae533774c1fc1bc353234bd569a58f9c83798e0519a592c2'
|
|
4
|
+
data.tar.gz: bb5a5ffbbaf260dad04cd28afb303c476ae5dff295454bbf1b95708bfba58126
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ee228007f5b5cb48c7d2fb2402a019c287b4d2a8dc1e37df0e6a0f3c159af97ce4aa3e5e95e57d6b1b947538414c081ea78a998a056a8db80770d263ea3371d9
|
|
7
|
+
data.tar.gz: 1a0ae25c85c204a1ac5431a4d1e704b67715b77c281763b103ff90da04a1a8550b628f4f1e3a785d743a1ec78b9c2d02b328ef1bee37ec5955085ad12b59666d
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
module CaptiveRelease
|
|
4
4
|
# Quels fichiers d'un dépôt portent une version, et sous quel format.
|
|
5
5
|
class VersionDetector
|
|
6
|
-
RUBY_VERSION_PATTERN
|
|
7
|
-
|
|
6
|
+
RUBY_VERSION_PATTERN = /VERSION\s*=\s*["'].+?["']/
|
|
7
|
+
EXPO_APP_JSON_PATTERN = /"expo"\s*:.*"version"\s*:/m
|
|
8
|
+
GRADLE_PATH = %w[android app build.gradle].freeze
|
|
8
9
|
|
|
9
10
|
def self.scan(root = ".")
|
|
10
11
|
new(root).scan
|
|
@@ -17,6 +18,7 @@ module CaptiveRelease
|
|
|
17
18
|
def scan
|
|
18
19
|
by_name("package.json", "package_json") +
|
|
19
20
|
by_name("app.config.js", "app_config_js") +
|
|
21
|
+
by_content(%w[** app.json], "app_json", EXPO_APP_JSON_PATTERN) +
|
|
20
22
|
by_content(%w[lib ** version.rb], "ruby_version", RUBY_VERSION_PATTERN) +
|
|
21
23
|
by_name("VERSION", "plain") +
|
|
22
24
|
android_gradle +
|
|
@@ -23,7 +23,7 @@ module CaptiveRelease
|
|
|
23
23
|
|
|
24
24
|
def write(content, old_version, new_version) = @write.call(content, old_version, new_version)
|
|
25
25
|
|
|
26
|
-
#
|
|
26
|
+
# Cinq des sept formats ne diffèrent que par le motif qui capture la version et par la
|
|
27
27
|
# forme du remplacement. Les décrire un par un faisait apparier leurs lambdas par Flay.
|
|
28
28
|
#
|
|
29
29
|
# Le motif qui retrouve la version à remplacer est dérivé de celui qui la capture : le
|
|
@@ -73,6 +73,10 @@ module CaptiveRelease
|
|
|
73
73
|
"app_config_js" => by_label(/version:\s*/, "version: "),
|
|
74
74
|
"android_gradle" => by_label(/versionName\s+/, "versionName "),
|
|
75
75
|
|
|
76
|
+
# Pas de JSON.parse : Expo tolère les virgules finales qu'il refuserait.
|
|
77
|
+
"app_json" => by_pattern(/"version"\s*:\s*"(.+?)"/, %("version": "x.y.z")) \
|
|
78
|
+
{ |_, nouvelle| %("version": "#{nouvelle}") },
|
|
79
|
+
|
|
76
80
|
"ios_plist" => by_pattern(
|
|
77
81
|
%r{<key>CFBundleShortVersionString</key>\s*<string>(.+?)</string>},
|
|
78
82
|
"CFBundleShortVersionString key",
|