fastlane-craft 1.2.5 → 1.2.6

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: 79cf9934116aa72a5f5c920913971d8a2eedbcd2488b567a198f8bfc41c9ff34
4
- data.tar.gz: a0e421bca8a4669f4548606e8f249973387d979fd052b9a1e105a7e7341e325f
3
+ metadata.gz: 1216e7d0b50f97ec058d9aa832105008d1699c1da9c165f8448c77e1d4c5caf0
4
+ data.tar.gz: 431a60e6656082fc6242d3af38fdb66d49f5c32b19cdeffea650d44ed05ca03f
5
5
  SHA512:
6
- metadata.gz: 1e3996451bb9a8a764ce8d9805783761ff0c468e7d59c57959815f84d0a2b47c7e8cd297a4980e75db761106b979aa585bb9e8ddafb03de70b49de58d88100c1
7
- data.tar.gz: '0186e2bfaf6b5bda81b1b305b28b4bdb1759400ba6cb1088f3fc007b41f50e367ed83c9a83e44506d62f51dddd606be3fcd7d583d1566f826deed2a15073be79'
6
+ metadata.gz: 3c856abd6bdca5679d355524334cc44373112ee4af050ba2709a12e395f9b8af9df0c76669f5c650716a197812661d9b8f5fd8c6a7db5d771d2af18c531a83c1
7
+ data.tar.gz: f7101aa4b85eb07dc278f659a32a254a083f4c861d9aef0827b88c9768360b1d5a2705d6645d88903aee3759d5d35670f44b0336d0cbec1b7120d9b638b97451
@@ -1,4 +1,4 @@
1
- require_relative 'fastlane_craft/telegram'
1
+ require_relative 'fastlane_craft/tag_release_manager'
2
2
  require_relative 'fastlane_craft/telegram_notifier'
3
3
  require_relative 'fastlane_craft/version'
4
4
 
@@ -0,0 +1,70 @@
1
+ require 'plist'
2
+
3
+ module FastlaneCraft
4
+ class InfoPlistController
5
+ include Gem
6
+
7
+ def initialize(info_plist, extra_info_plists = [])
8
+ raise 'Invalid Info Plist Path' if info_plist.empty?
9
+ raise TypeError unless info_plist.is_a? String
10
+ @info_plist = info_plist
11
+ @extra_info_plists = extra_info_plists
12
+ end
13
+
14
+ def bump_build_version_patch
15
+ value = build_version.to_s
16
+ value[-1] = (value[-1].to_i + 1).to_s
17
+ set_build_version(Version.new(value))
18
+ end
19
+
20
+ def set_version(v)
21
+ info_plists.each do |path|
22
+ set_plist_value_for(path, v.to_s, version_key)
23
+ end
24
+ end
25
+
26
+ def set_build_version(v)
27
+ info_plists.each do |path|
28
+ set_plist_value_for(path, v.to_s, build_version_key)
29
+ end
30
+ end
31
+
32
+ def version
33
+ value = plist_value_for(@info_plist, version_key)
34
+ Version.new(value)
35
+ end
36
+
37
+ def build_version
38
+ value = plist_value_for(@info_plist, build_version_key)
39
+ Version.new(value)
40
+ end
41
+
42
+ private
43
+
44
+ def set_plist_value_for(plist_path, value, key)
45
+ plist = Plist.parse_xml(plist_path)
46
+ plist[key] = value
47
+ File.write(plist_path, Plist::Emit.dump(plist))
48
+ end
49
+
50
+ def plist_value_for(plist_path, key)
51
+ Plist.parse_xml(plist_path)[key]
52
+ end
53
+
54
+ def extra_plists
55
+ extra_plists.map { |p| Plist.parse_xml(p) }
56
+ end
57
+
58
+ def info_plists
59
+ [@info_plist] + @extra_info_plists
60
+ end
61
+
62
+ def version_key
63
+ 'CFBundleShortVersionString'
64
+ end
65
+
66
+ def build_version_key
67
+ 'CFBundleVersion'
68
+ end
69
+ end
70
+ end
@@ -2,7 +2,7 @@ require_relative 'tag_release_manager'
2
2
 
3
3
  module Fastlane
4
4
  module Actions
5
- class TelegramAction < Action
5
+ class TagReleaseAction < Action
6
6
  include FastlaneCraft
7
7
 
8
8
  def self.run(params)
@@ -1,9 +1,10 @@
1
+ require_relative 'info_plist_controller'
2
+
1
3
  module FastlaneCraft
2
4
  class TagReleaseManager
3
- def initialize(info_plist_path, target_suffix = nil)
4
- raise 'Invalid Info Plist Path' if info_plist_path.empty?
5
- @info_plist_path = info_plist_path
5
+ def initialize(info_plist, extra_info_plists, target_suffix = nil)
6
6
  @target_suffix = target_suffix
7
+ @plist_controller = InfoPlistController.new(info_plist, extra_info_plists)
7
8
  end
8
9
 
9
10
  def release
@@ -52,52 +53,8 @@ end
52
53
  # broadcast_release
53
54
  # end
54
55
  #
55
- # def bumped_version(v)
56
- # value = v.to_s
57
- # value[-1] = (value[-1].to_i + 1).to_s
58
- # Gem::Version.new(value)
59
- # end
60
- #
61
56
  # def tag_version
62
57
  # version_format = /[0-9.]+/
63
58
  # tag = last_git_tag.match(version_format)[0]
64
59
  # Gem::Version.new(tag)
65
60
  # end
66
- #
67
- # def set_app_version(v)
68
- # value = set_info_plist_value(
69
- # path: info_plist_path,
70
- # key: info_plist_version_key,
71
- # value: v.to_s
72
- # )
73
- # end
74
- #
75
- # def set_app_build_version(v)
76
- # value = set_info_plist_value(
77
- # path: info_plist_path,
78
- # key: info_plist_build_version_key,
79
- # value: v.to_s
80
- # )
81
- # end
82
- #
83
- # def app_version
84
- # value = get_info_plist_value(path: info_plist_path, key: info_plist_version_key)
85
- # Gem::Version.new(value)
86
- # end
87
- #
88
- # def app_build_version
89
- # value = get_info_plist_value(path: info_plist_path, key: info_plist_build_version_key)
90
- # Gem::Version.new(value)
91
- # end
92
- #
93
- # def info_plist_version_key
94
- # 'CFBundleShortVersionString'
95
- # end
96
- #
97
- # def info_plist_build_version_key
98
- # 'CFBundleVersion'
99
- # end
100
- #
101
- # def info_plist_path
102
- # File.join(Dir.pwd, '../PixelArt/Supporting Files/Info.plist')
103
- # end
@@ -1,3 +1,3 @@
1
1
  module FastlaneCraft
2
- VERSION = '1.2.5'.freeze
2
+ VERSION = '1.2.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-craft
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - sroik
@@ -11,6 +11,20 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2018-01-12 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: fastlane
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">"
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">"
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
14
28
  - !ruby/object:Gem::Dependency
15
29
  name: bundler
16
30
  requirement: !ruby/object:Gem::Requirement
@@ -102,6 +116,7 @@ extensions: []
102
116
  extra_rdoc_files: []
103
117
  files:
104
118
  - lib/fastlane_craft.rb
119
+ - lib/fastlane_craft/info_plist_controller.rb
105
120
  - lib/fastlane_craft/tag_release.rb
106
121
  - lib/fastlane_craft/tag_release_manager.rb
107
122
  - lib/fastlane_craft/telegram.rb