rz_shoutout 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/rz_shoutout.rb +86 -0
  3. metadata +59 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0b66d55d2829642271da809f8231030aef13a721
4
+ data.tar.gz: 53a78c2ebe245664d8c3ab0ff7bcbefa6cffc10f
5
+ SHA512:
6
+ metadata.gz: 1e442402fbfaf26824822057dc490d3225b7fee889866198456f81876adfa6a0be346f70a87342fb59a3604ff7b1daf5d966a2eb684a371b0de5ebb8bef19355
7
+ data.tar.gz: e1410e122571d79ef5822172f1759524f7565e5ac39249a84d8edcf78f6e52367dfb1c06b538a8ff0284e0fa9ce3a325e4e336c211d375284b2e6e3d1a86f2cc
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # RZShoutOut
4
+ #
5
+ # This script takes as input the acknowledgements.plist built by CocoaPods 'install', and
6
+ # converts it to hierarchical form.
7
+ #
8
+ # Usage:
9
+ # RZShoutOut -i <pods-TARGET-acknowledgement.plist>
10
+ # RZShoutOut -i <pods-TARGET-acknowledgement.plist> -o <output directory path>
11
+ #
12
+ # The 1 parameter format is designed to be used inside an Xcode run-script build phase,
13
+ # where it will determine the output path of the Settings.bundle from environment variables.
14
+ #
15
+
16
+ require 'xcodeproj'
17
+ require 'optparse'
18
+
19
+ def childPane( title )
20
+ Hash["Title" => title, :File => title, "Type" => "PSChildPaneSpecifier" ]
21
+ end
22
+
23
+ def groupItem( title = nil, footer=nil )
24
+ result = Hash[ "Type" => "PSGroupSpecifier" ]
25
+ if ( title ) then
26
+ result["Title" => title]
27
+ end
28
+ if ( footer ) then
29
+ result["FooterText"] = footer
30
+ end
31
+ return result
32
+ end
33
+
34
+ def rz_shoutout()
35
+
36
+ options = {}
37
+ OptionParser.new do |opts|
38
+ opts.banner = "Usage: $PROGRAM_NAME [options]"
39
+
40
+ opts.on("-o path", "target's settings bundle") do |v|
41
+ options[:output_path] = v
42
+ end
43
+
44
+ opts.on("-i acknowledgements_plist", "acknowledgements_plist") do |v|
45
+ options[:ack_path] = v
46
+ end
47
+
48
+ end.parse!
49
+
50
+ if (!options[:output_path] && ENV["BUILT_PRODUCTS_DIR"]) then
51
+ p = Pathname(ENV["BUILT_PRODUCTS_DIR"])
52
+ p += ENV["UNLOCALIZED_RESOURCES_FOLDER_PATH"] + "/Settings.bundle"
53
+
54
+ print "using default output_path = #{p}\n"
55
+
56
+ options[:output_path] = p
57
+ end
58
+
59
+ fail "#{options[:ack_path]} doesn't exist" if ! File.exist?(options[:ack_path])
60
+ fail "#{options[:output_path]} doesn't exist" if ! File.exist?(options[:output_path])
61
+
62
+
63
+ ack = Xcodeproj::PlistHelper.read( options[:ack_path] )
64
+ fail "can't parse #{options[:ack_path]} as a plist" if !ack
65
+
66
+ items = ack["PreferenceSpecifiers"]
67
+
68
+ new_items = []
69
+ items.delete_at(0)
70
+ items.each { |item|
71
+ sub_ack = ack.clone
72
+ sub_ack["PreferenceSpecifiers"] = Array[ item ]
73
+ sub_file = options[:output_path] + ( item["Title"] + ".plist" )
74
+ Xcodeproj::PlistHelper.write( sub_ack, sub_file )
75
+
76
+ new_items.push( childPane(item["Title"]) )
77
+ }
78
+ new_items.sort_by { |hsh| hsh["Title"] }
79
+ new_items.insert(0, groupItem(nil, "This application makes use of the following third party software:"), groupItem(nil, nil))
80
+
81
+ new_ack = ack.clone
82
+ new_ack["PreferenceSpecifiers"] = new_items
83
+ Xcodeproj::PlistHelper.write( new_ack, options[:output_path] + "Acknowledgements.plist" )
84
+ end
85
+
86
+ :rz_shoutout
metadata ADDED
@@ -0,0 +1,59 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rz_shoutout
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Eric Slosser
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-01-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: xcodeproj
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.28.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.28.2
27
+ description: Hierarchical attributions in your iOS app's Settings bundle of the CocoaPods
28
+ used
29
+ email: eric.slosser@raizlabs.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - lib/rz_shoutout.rb
35
+ homepage: http://rubygems.org/gems/rz_shoutout
36
+ licenses:
37
+ - MIT
38
+ metadata: {}
39
+ post_install_message:
40
+ rdoc_options: []
41
+ require_paths:
42
+ - lib
43
+ required_ruby_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ requirements: []
54
+ rubyforge_project:
55
+ rubygems_version: 2.4.5.1
56
+ signing_key:
57
+ specification_version: 4
58
+ summary: Hierarchical attribution
59
+ test_files: []