Class: Fastlane::Actions::ChangePodspecDependencyVersionAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::ChangePodspecDependencyVersionAction
- Defined in:
- lib/fastlane/plugin/podspec_dependency_versioning/actions/change_podspec_dependency_version.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .return_value ⇒ Object
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
27 28 29 |
# File 'lib/fastlane/plugin/podspec_dependency_versioning/actions/change_podspec_dependency_version.rb', line 27 def self. ["Cole Dunsby"] end |
.available_options ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/fastlane/plugin/podspec_dependency_versioning/actions/change_podspec_dependency_version.rb', line 39 def self. [ FastlaneCore::ConfigItem.new( key: :podspec, env_name: "PODSPEC_PATH", description: "The path of the podspec you wish to modify", optional: false, type: String ), FastlaneCore::ConfigItem.new( key: :dependency, env_name: "DEPENDENCY_NAME", description: "The dependency you wish to modify", optional: false, type: String ), FastlaneCore::ConfigItem.new( key: :version, env_name: "DEPENDENCY_VERSION", description: "The new version to assign to the dependency", optional: false, type: String ) ] end |
.description ⇒ Object
23 24 25 |
# File 'lib/fastlane/plugin/podspec_dependency_versioning/actions/change_podspec_dependency_version.rb', line 23 def self.description "This action will modify the version of a dependency in your podspec." end |
.details ⇒ Object
35 36 37 |
# File 'lib/fastlane/plugin/podspec_dependency_versioning/actions/change_podspec_dependency_version.rb', line 35 def self.details "This action will modify the version of a dependency in your podspec." end |
.is_supported?(platform) ⇒ Boolean
65 66 67 |
# File 'lib/fastlane/plugin/podspec_dependency_versioning/actions/change_podspec_dependency_version.rb', line 65 def self.is_supported?(platform) true end |
.return_value ⇒ Object
31 32 33 |
# File 'lib/fastlane/plugin/podspec_dependency_versioning/actions/change_podspec_dependency_version.rb', line 31 def self.return_value end |
.run(params) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/fastlane/plugin/podspec_dependency_versioning/actions/change_podspec_dependency_version.rb', line 7 def self.run(params) podspec = params[:podspec] dependency = params[:dependency] version = params[:version] podspec_contents = File.read(podspec) podspec_new_contents = podspec_contents.gsub(/(?<=s\.dependency ["']#{dependency}["'], ["'])(.*)(?=["'])/, version) unless podspec_contents == podspec_new_contents File.open(podspec, "w") { |file| file.puts podspec_new_contents } UI.success("successfully modified #{dependency} to version #{version} in #{podspec}") else UI.error("#{dependency} not present or doesn't have an explicit version in #{podspec}") end end |