Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend update_plist documentation from 1 to 6 code-examples #15861

Merged
merged 2 commits into from Jan 9, 2020
Merged

Extend update_plist documentation from 1 to 6 code-examples #15861

merged 2 commits into from Jan 9, 2020

Conversation

matthiaszarzecki
Copy link
Contributor

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.

Motivation and Context

It took me a considerable amount of time and trial & error to initially figure out how to actually use the update_plist action to modify the values inside a plist-file, whose functionality was (imho) only sparsely documented.

Description

I added five new examples for the basic functionality of this action in the documentation, in addition to the one (more complicated and highly specific) example already present, to improve understandability and readability in the future.

I also slightly adapted self.details in order to differentiate this action from the (similar but different in usage) update_info_plist action.

Testing Steps

In addition to running bundle exec rspec and bundle exec rubocop -a succesfully I tested all of the example-codes and checked the plist-file in XCode afterwards to make sure the values were correctly set. See encompassing testing-code and result-image below:

lane :test_update_plist do |options|
  options[:environment] = "development"

  # Updates values in Firebase-plist
  update_plist(
    plist_path: "GoogleService-Info.plist",
    block: proc do |plist|
      if options[:environment] == "production"
        plist[:boolean_entry] = true
        plist[:number_entry] = 13
        plist[:array_entry] = ["entry_01", true, 1243]
      else
        plist[:boolean_entry] = false
        plist[:number_entry] = 27
        plist[:array_entry] = ["entry_02", false, 4265]
      end
    end
  )
end

update_plist_test_results

It took me some time and trial & error to figure out how to use this action to modify the values inside a plist-file, whose functionality was (imho) only sparsely documented.
I added 5 new examples for the basic functionality of this action, in addition to the one (more complicated and highly specific) example already present, to improve understandability and readability in the future. I also slightly adapted the details in order to differentiate this action from the `update_info_plist`action.
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@matthiaszarzecki
Copy link
Contributor Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Jan 7, 2020
Copy link
Member

@joshdholtz joshdholtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually really excited about this addition 😊 I always need to look up how I've used this in the past when I want to use it again. Thanks for the contribution ❤️

@joshdholtz joshdholtz merged commit b8f958e into fastlane:master Jan 9, 2020
@matthiaszarzecki
Copy link
Contributor Author

@joshdholtz Thank you! Super-glad to hear you like it <3

@fastlane-bot
Copy link

Hey @matthiaszarzecki 👋

Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉
The code change now lives in the master branch, however it wasn't released to RubyGems yet.
We usually ship about once a week, and your PR will be included in the next one.

Please let us know if this change requires an immediate release by adding a comment here 👍
We'll notify you once we shipped a new release with your changes 🚀

@fastlane fastlane locked and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants