Class: Commands::UpdatePlist
- Inherits:
-
Object
- Object
- Commands::UpdatePlist
- Defined in:
- lib/commands/update_plist.rb
Instance Method Summary collapse
-
#options ⇒ Object
holds the options that were passed you can set any initial defaults here.
- #register(opts, global_options) ⇒ Object
-
#required_options ⇒ Object
required options.
-
#run(global_options) ⇒ Object
Getting a plist returned from a mobile provsion file: security cms -D -i eBay_Core_iPad_Enterprise.mobileprovision.
Instance Method Details
#options ⇒ Object
holds the options that were passed you can set any initial defaults here
14 15 16 17 |
# File 'lib/commands/update_plist.rb', line 14 def ||= { } end |
#register(opts, global_options) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/commands/update_plist.rb', line 26 def register(opts, ) opts. = "Usage: update_plist" opts.description = "Updates the specified plist." opts.on('-p', "--plist filename", "Required - Plist file to update") do |v| [:plist] = v end opts.on('-b', "--build number", "Optional - build number used to update plist") do |v| [:build] = v end opts.on('-i', "--identifier bundler identifier", "Optional - Bundle Name to be set") do |v| [:identifier] = v end opts.on('-v', "--verbose", "Display passed data") do |v| [:verbose] = true end end |
#required_options ⇒ Object
required options
20 21 22 23 24 |
# File 'lib/commands/update_plist.rb', line 20 def ||= Set.new [ :plist, ] end |
#run(global_options) ⇒ Object
Getting a plist returned from a mobile provsion file: security cms -D -i eBay_Core_iPad_Enterprise.mobileprovision
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/commands/update_plist.rb', line 47 def run() build = [:build] plist = [:plist] identifier = [:identifier] verbose = [:verbose] puts ". plist....: " + plist if verbose plist_data = Plist::parse_xml(plist) if (build) then plist_data["BuildIdentifier"] = build puts ". buildindentifer....: " + build if verbose end if (identifier) then plist_data["CFBundleIdentifier"] = identifier puts ". Indentifer....: " + identifier if verbose end plist_data.save_plist(plist) end |