motion-acknowledgements 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 26674ec6e14fa029dbfc00d7d55a76449926f57e
4
+ data.tar.gz: e60190ae05a57950eded2812685f9ba554d452fb
5
+ SHA512:
6
+ metadata.gz: 416499b2c1e055cebdf61179ee24473ab0005921b5dc2f3eb2e7adbb812e877c8114cc5900be3f1412a678ee88aadee16b52307db7c3c03cbb28f451c59e20f3
7
+ data.tar.gz: f0688d1f4da791623e2cbe046ad19ed4b8c11520a41ba46fdfe614f423b58092f69dfa86aee1139fc1951d717b7cebcbe911105f2cd55c51cb574dd23157a65f
data/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # motion-acknowledgements
2
+
3
+ This RubyMotion specific gem makes it easy to include the CocoaPods acknowledgements file in your application. Simply add to your bundle file, run `rake acknowledgements:generate` and each time you build your application, the CocoaPods acknowledgements file will be copied over to your Settings.bundle. This then adds an entry for your app into the system's Settings.app with an 'Acknowledgements' submenu.
4
+
5
+ [Read more about the CocoaPods acknowledgement file here.](https://github.com/CocoaPods/CocoaPods/wiki/Acknowledgements)
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ gem 'motion-acknowledgements'
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install motion-acknowledgements
20
+
21
+ ## Usage
22
+
23
+ If you don't have a `resources/Settings.bundle` file, this gem can create one for you.
24
+
25
+ Run `rake acknowledgements:generate` and a `resources/Settings.bundle/Root.plist` will be created with the proper content. Feel free to edit this file, but watch out - running that rake command again will undo your changes.
26
+
27
+ ## Automation
28
+
29
+ `motion-acknowledgements` extends your app's build process to copy over the `vendor/Pods/Pods-acknowledgements.plist` file to your compiled binary (into the `Settings.bundle` file) at the end of the build process. This acknowledgements file is [automatically generated](https://github.com/CocoaPods/CocoaPods/wiki/Acknowledgements) by the `rake pod:install` command.
30
+
31
+ ## Screenshots
32
+
33
+ ![ios simulator screen shot nov 23 2013 11 58 35 am](https://f.cloud.github.com/assets/139261/1606878/a8ba7e02-5460-11e3-83ef-627ae62308c6.png) ![ios simulator screen shot nov 23 2013 11 58 41 am](https://f.cloud.github.com/assets/139261/1606879/aa33e142-5460-11e3-932a-a5bc2d5f8208.png)
34
+ ![ios simulator screen shot nov 23 2013 11 58 43 am](https://f.cloud.github.com/assets/139261/1606880/acfb72a0-5460-11e3-8fcc-895b88c40f0d.png) ![ios simulator screen shot nov 23 2013 11 58 45 am](https://f.cloud.github.com/assets/139261/1606881/aecacd88-5460-11e3-98c1-521ec29d84d8.png)
35
+
36
+ ## Contributing
37
+
38
+ 1. Fork it
39
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
40
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
41
+ 4. Push to the branch (`git push origin my-new-feature`)
42
+ 5. Create new Pull Request
@@ -0,0 +1,32 @@
1
+ class Motion::Project::App
2
+ class << self
3
+ #
4
+ # The original `build' method can be found here:
5
+ # https://github.com/HipByte/RubyMotion/blob/master/lib/motion/project/app.rb#L75-L77
6
+ #
7
+ alias_method :build_before_copy_acknowledgements, :build
8
+ def build platform, options = {}
9
+ acknowledgements = MotionAcknowledgements::Settings.new
10
+ root_path = acknowledgements.plist_file
11
+
12
+ unless File.exist? root_path
13
+ warn 'Please run: `rake acknowledgements:generate` in order to create a Settings.bundle or remove the motion-acknowledgements gem from your project.'
14
+ abort
15
+ end
16
+
17
+ # Run thenormal build process.
18
+ build_before_copy_acknowledgements(platform, options)
19
+ # Now the app is built, but not codesigned yet.
20
+
21
+ destination = File.join(config.app_bundle(platform), 'Settings.bundle/Acknowledgements.plist')
22
+ pods_path = 'vendor/Pods/Pods-acknowledgements.plist'
23
+
24
+ if File.exist? pods_path
25
+ info 'Copy', destination
26
+ FileUtils.cp_r(pods_path, destination, :remove_destination => true)
27
+ else
28
+ warn 'Could not find CocoaPods Acnkowledgement file.'
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,60 @@
1
+ module MotionAcknowledgements
2
+ class Settings
3
+ attr_accessor :resources_path
4
+
5
+ def initialize options={}
6
+ @resources_path = options[:resources_path] || "resources"
7
+ end
8
+
9
+ def write
10
+ if should_write?
11
+ puts "\nCreating the Settings.bundle folder in your resources folder with a Root.plist"
12
+ puts "The acknowledgements file generated by CocoaPods (rake pod:install) will be copied to your app each time you run `rake`"
13
+ FileUtils.mkpath settings_bundle
14
+ File.open(plist_file, 'w') {|f| f.write(plist_content) }
15
+ else
16
+ puts "Warning: There is already a Settings.bundle file in your resources folder."
17
+ puts "Please remove it or manually add the acknowledgements to your current Root.plist file."
18
+ puts ""
19
+ puts "More info here: https://github.com/CocoaPods/CocoaPods/wiki/Acknowledgements"
20
+ end
21
+ end
22
+
23
+ def should_write?
24
+ !File.exist? settings_bundle
25
+ end
26
+
27
+ def settings_bundle
28
+ "#{resources_path}/Settings.bundle"
29
+ end
30
+
31
+ def plist_file
32
+ settings_bundle << "/Root.plist"
33
+ end
34
+
35
+ def plist_content
36
+ <<"PLIST"
37
+ <?xml version="1.0" encoding="UTF-8"?>
38
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
39
+ <plist version="1.0">
40
+ <dict>
41
+ <key>StringsTable</key>
42
+ <string>Root</string>
43
+ <key>PreferenceSpecifiers</key>
44
+ <array>
45
+ <dict>
46
+ <key>Type</key>
47
+ <string>PSChildPaneSpecifier</string>
48
+ <key>Title</key>
49
+ <string>Acknowledgements</string>
50
+ <key>File</key>
51
+ <string>Acknowledgements</string>
52
+ </dict>
53
+ </array>
54
+ </dict>
55
+ </plist>
56
+ PLIST
57
+ end
58
+
59
+ end
60
+ end
@@ -0,0 +1,9 @@
1
+ require 'rake' unless defined? Rake
2
+
3
+ namespace :acknowledgements do
4
+ desc "Generates Settings.bundle if one does not already exist"
5
+ task :generate do
6
+ MotionAcknowledgements::Settings.new.write
7
+ end
8
+
9
+ end
@@ -0,0 +1,3 @@
1
+ module MotionAcknowledgements
2
+ VERSION = '0.0.2'
3
+ end
@@ -0,0 +1,14 @@
1
+ unless defined?(Motion::Project::Config)
2
+ raise "This file must be required within a RubyMotion project Rakefile."
3
+ end
4
+
5
+ Motion::Project::App.setup do |app|
6
+ require 'acknowledgements/resources'
7
+ end
8
+
9
+ module MotionAcknowledgements
10
+ end
11
+
12
+ require 'fileutils'
13
+ require 'acknowledgements/settings'
14
+ require 'acknowledgements/tasks'
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: motion-acknowledgements
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Mark Rickert
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-11-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: This RubyMotion specific gem makes it easy to include the CocoaPods acknowledgements
28
+ file in your application. Simply add to your bundle file, run `rake acknowledgements:generate`
29
+ and each time you build your application, the CocoaPods acknowledgements file will
30
+ be copied over to your Settings.bundle. This then adds an entry for your app into
31
+ the system's Settings.app with an 'Acknowledgements' submenu.
32
+ email:
33
+ - mjar81@gmail.com
34
+ executables: []
35
+ extensions: []
36
+ extra_rdoc_files: []
37
+ files:
38
+ - README.md
39
+ - lib/acknowledgements/resources.rb
40
+ - lib/acknowledgements/settings.rb
41
+ - lib/acknowledgements/tasks.rb
42
+ - lib/acknowledgements/version.rb
43
+ - lib/motion-acknowledgements.rb
44
+ homepage: https://github.com/MohawkApps/motion-acknowledgements
45
+ licenses:
46
+ - MIT
47
+ metadata: {}
48
+ post_install_message:
49
+ rdoc_options: []
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - '>='
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ requirements: []
63
+ rubyforge_project:
64
+ rubygems_version: 2.0.3
65
+ signing_key:
66
+ specification_version: 4
67
+ summary: This RubyMotion specific gem makes it easy to include the CocoaPods acknowledgements
68
+ file in your application.
69
+ test_files: []