motion-xib 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in motion-xib.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Andy Jeffries
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,50 @@
1
+ # Motion::Xib
2
+
3
+ This gem simply adds a new Rake task to RubyMotion projects to create a new Xib file from a template or edit an existing one.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'motion-xib'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install motion-xib
18
+
19
+ ## Usage
20
+
21
+ Run:
22
+ rake xib
23
+
24
+ Within your RubyMotion project and it will give you the option to create a new Xib file in your resources folder (using the "n" option), or to edit an existing Xib using XCode. This is a very simple gem, but hey, I like launching things from the command line and it's a first RubyMotion compatible gem.
25
+
26
+ You can then use the Xib within your controller like this:
27
+
28
+ def loadView
29
+ views = NSBundle.mainBundle.loadNibNamed "fbib", owner:self, options:nil
30
+ self.view = views[0]
31
+ end
32
+
33
+ def viewDidLoad
34
+ @button = view.viewWithTag 1
35
+ @button.addTarget(self, action:'plusTapped:', forControlEvents:UIControlEventTouchUpInside)
36
+ end
37
+
38
+ def plusTapped(sender)
39
+ # ... do whatever ...
40
+ end
41
+
42
+ Make sure all the elements you want to hookup, have a tag.
43
+
44
+ ## Contributing
45
+
46
+ 1. Fork it
47
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
48
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
49
+ 4. Push to the branch (`git push origin my-new-feature`)
50
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,38 @@
1
+ require "motion-xib/version"
2
+
3
+ unless defined?(Motion::Project::Config)
4
+ raise "This file must be required within a RubyMotion project Rakefile."
5
+ end
6
+
7
+ Motion::Project::App.setup do |app|
8
+ #
9
+ end
10
+
11
+ desc "Create/edit a xib file"
12
+ task :xib do
13
+ puts "n) Create a new xib"
14
+ xib_files = {}
15
+ n = 1
16
+ Dir.glob("resources/**/*.xib").each do |xib|
17
+ puts "#{n}) Edit #{xib.gsub(".xib", '').gsub("resources/", '')}"
18
+ xib_files[n] = xib
19
+ n += 1
20
+ end
21
+ print "(n, 1..#{n-1})? "
22
+ choice = STDIN.gets.chomp
23
+ if choice == "n"
24
+ puts "1) iPhone/iPod Touch"
25
+ puts "2) iPad"
26
+ print "(1, 2)? "
27
+ type = STDIN.gets.chomp
28
+ print "Name (without .xib)? "
29
+ name = STDIN.gets.chomp
30
+ if type == "1"
31
+ FileUtils.cp(File.dirname(__FILE__) + "/../templates/iphone.xib", "resources/#{name}.xib")
32
+ elsif type == "2"
33
+ FileUtils.cp(File.dirname(__FILE__) + "/../templates/ipad.xib", "resources/#{name}.xib")
34
+ end
35
+ else
36
+ `open #{xib_files[choice.to_i]} &`
37
+ end
38
+ end
@@ -0,0 +1,5 @@
1
+ module Motion
2
+ module Xib
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'motion-xib/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "motion-xib"
8
+ gem.version = Motion::Xib::VERSION
9
+ gem.authors = ["Andy Jeffries"]
10
+ gem.email = ["andy@andyjeffries.co.uk"]
11
+ gem.description = "A new Rake task for RubyMotion projects to create a new Xib file from a template or edit an existing one"
12
+ gem.summary = "A new Rake task for RubyMotion projects to create a new Xib file from a template or edit an existing one"
13
+ gem.homepage = "http://andyjeffries.co.uk/"
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ["lib"]
19
+ end
@@ -0,0 +1,101 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="8.00">
3
+ <data>
4
+ <int key="IBDocument.SystemTarget">1552</int>
5
+ <string key="IBDocument.SystemVersion">12C60</string>
6
+ <string key="IBDocument.InterfaceBuilderVersion">3084</string>
7
+ <string key="IBDocument.AppKitVersion">1187.34</string>
8
+ <string key="IBDocument.HIToolboxVersion">625.00</string>
9
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
10
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
11
+ <string key="NS.object.0">2083</string>
12
+ </object>
13
+ <array key="IBDocument.IntegratedClassDependencies">
14
+ <string>IBProxyObject</string>
15
+ <string>IBUIView</string>
16
+ </array>
17
+ <array key="IBDocument.PluginDependencies">
18
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
19
+ </array>
20
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
21
+ <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
22
+ <integer value="1" key="NS.object.0"/>
23
+ </object>
24
+ <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
25
+ <object class="IBProxyObject" id="372490531">
26
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
27
+ <string key="targetRuntimeIdentifier">IBIPadFramework</string>
28
+ </object>
29
+ <object class="IBProxyObject" id="975951072">
30
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
31
+ <string key="targetRuntimeIdentifier">IBIPadFramework</string>
32
+ </object>
33
+ <object class="IBUIView" id="191373211">
34
+ <reference key="NSNextResponder"/>
35
+ <int key="NSvFlags">274</int>
36
+ <string key="NSFrame">{{0, 20}, {768, 1004}}</string>
37
+ <reference key="NSSuperview"/>
38
+ <reference key="NSWindow"/>
39
+ <reference key="NSNextKeyView"/>
40
+ <object class="NSColor" key="IBUIBackgroundColor">
41
+ <int key="NSColorSpace">3</int>
42
+ <bytes key="NSWhite">MQA</bytes>
43
+ <object class="NSColorSpace" key="NSCustomColorSpace">
44
+ <int key="NSID">2</int>
45
+ </object>
46
+ </object>
47
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
48
+ <int key="IBUIStatusBarStyle">2</int>
49
+ </object>
50
+ <string key="targetRuntimeIdentifier">IBIPadFramework</string>
51
+ </object>
52
+ </array>
53
+ <object class="IBObjectContainer" key="IBDocument.Objects">
54
+ <array class="NSMutableArray" key="connectionRecords"/>
55
+ <object class="IBMutableOrderedSet" key="objectRecords">
56
+ <array key="orderedObjects">
57
+ <object class="IBObjectRecord">
58
+ <int key="objectID">0</int>
59
+ <array key="object" id="0"/>
60
+ <reference key="children" ref="1000"/>
61
+ <nil key="parent"/>
62
+ </object>
63
+ <object class="IBObjectRecord">
64
+ <int key="objectID">1</int>
65
+ <reference key="object" ref="191373211"/>
66
+ <reference key="parent" ref="0"/>
67
+ </object>
68
+ <object class="IBObjectRecord">
69
+ <int key="objectID">-1</int>
70
+ <reference key="object" ref="372490531"/>
71
+ <reference key="parent" ref="0"/>
72
+ <string key="objectName">File's Owner</string>
73
+ </object>
74
+ <object class="IBObjectRecord">
75
+ <int key="objectID">-2</int>
76
+ <reference key="object" ref="975951072"/>
77
+ <reference key="parent" ref="0"/>
78
+ </object>
79
+ </array>
80
+ </object>
81
+ <dictionary class="NSMutableDictionary" key="flattenedProperties">
82
+ <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
83
+ <string key="-2.CustomClassName">UIResponder</string>
84
+ <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
85
+ <string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
86
+ </dictionary>
87
+ <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
88
+ <nil key="activeLocalization"/>
89
+ <dictionary class="NSMutableDictionary" key="localizations"/>
90
+ <nil key="sourceID"/>
91
+ <int key="maxID">2</int>
92
+ </object>
93
+ <object class="IBClassDescriber" key="IBDocument.Classes"/>
94
+ <int key="IBDocument.localizationMode">0</int>
95
+ <string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
96
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
97
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
98
+ <bool key="IBDocument.UseAutolayout">YES</bool>
99
+ <string key="IBCocoaTouchPluginVersion">2083</string>
100
+ </data>
101
+ </archive>
@@ -0,0 +1,116 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
3
+ <data>
4
+ <int key="IBDocument.SystemTarget">1552</int>
5
+ <string key="IBDocument.SystemVersion">12C60</string>
6
+ <string key="IBDocument.InterfaceBuilderVersion">3084</string>
7
+ <string key="IBDocument.AppKitVersion">1187.34</string>
8
+ <string key="IBDocument.HIToolboxVersion">625.00</string>
9
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
10
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
11
+ <string key="NS.object.0">2083</string>
12
+ </object>
13
+ <array key="IBDocument.IntegratedClassDependencies">
14
+ <string>IBProxyObject</string>
15
+ <string>IBUIView</string>
16
+ </array>
17
+ <array key="IBDocument.PluginDependencies">
18
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
19
+ </array>
20
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
21
+ <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
22
+ <integer value="1" key="NS.object.0"/>
23
+ </object>
24
+ <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
25
+ <object class="IBProxyObject" id="372490531">
26
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
27
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
28
+ </object>
29
+ <object class="IBProxyObject" id="975951072">
30
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
31
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
32
+ </object>
33
+ <object class="IBUIView" id="191373211">
34
+ <reference key="NSNextResponder"/>
35
+ <int key="NSvFlags">274</int>
36
+ <string key="NSFrame">{{0, 20}, {320, 548}}</string>
37
+ <reference key="NSSuperview"/>
38
+ <reference key="NSWindow"/>
39
+ <reference key="NSNextKeyView"/>
40
+ <object class="NSColor" key="IBUIBackgroundColor">
41
+ <int key="NSColorSpace">3</int>
42
+ <bytes key="NSWhite">MQA</bytes>
43
+ <object class="NSColorSpace" key="NSCustomColorSpace">
44
+ <int key="NSID">2</int>
45
+ </object>
46
+ </object>
47
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
48
+ <object class="IBUIScreenMetrics" key="IBUISimulatedDestinationMetrics">
49
+ <string key="IBUISimulatedSizeMetricsClass">IBUIScreenMetrics</string>
50
+ <object class="NSMutableDictionary" key="IBUINormalizedOrientationToSizeMap">
51
+ <bool key="EncodedWithXMLCoder">YES</bool>
52
+ <array key="dict.sortedKeys">
53
+ <integer value="1"/>
54
+ <integer value="3"/>
55
+ </array>
56
+ <array key="dict.values">
57
+ <string>{320, 568}</string>
58
+ <string>{568, 320}</string>
59
+ </array>
60
+ </object>
61
+ <string key="IBUITargetRuntime">IBCocoaTouchFramework</string>
62
+ <string key="IBUIDisplayName">Retina 4 Full Screen</string>
63
+ <int key="IBUIType">2</int>
64
+ </object>
65
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
66
+ </object>
67
+ </array>
68
+ <object class="IBObjectContainer" key="IBDocument.Objects">
69
+ <array class="NSMutableArray" key="connectionRecords"/>
70
+ <object class="IBMutableOrderedSet" key="objectRecords">
71
+ <array key="orderedObjects">
72
+ <object class="IBObjectRecord">
73
+ <int key="objectID">0</int>
74
+ <array key="object" id="0"/>
75
+ <reference key="children" ref="1000"/>
76
+ <nil key="parent"/>
77
+ </object>
78
+ <object class="IBObjectRecord">
79
+ <int key="objectID">1</int>
80
+ <reference key="object" ref="191373211"/>
81
+ <reference key="parent" ref="0"/>
82
+ </object>
83
+ <object class="IBObjectRecord">
84
+ <int key="objectID">-1</int>
85
+ <reference key="object" ref="372490531"/>
86
+ <reference key="parent" ref="0"/>
87
+ <string key="objectName">File's Owner</string>
88
+ </object>
89
+ <object class="IBObjectRecord">
90
+ <int key="objectID">-2</int>
91
+ <reference key="object" ref="975951072"/>
92
+ <reference key="parent" ref="0"/>
93
+ </object>
94
+ </array>
95
+ </object>
96
+ <dictionary class="NSMutableDictionary" key="flattenedProperties">
97
+ <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
98
+ <string key="-2.CustomClassName">UIResponder</string>
99
+ <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
100
+ <string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
101
+ </dictionary>
102
+ <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
103
+ <nil key="activeLocalization"/>
104
+ <dictionary class="NSMutableDictionary" key="localizations"/>
105
+ <nil key="sourceID"/>
106
+ <int key="maxID">2</int>
107
+ </object>
108
+ <object class="IBClassDescriber" key="IBDocument.Classes"/>
109
+ <int key="IBDocument.localizationMode">0</int>
110
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
111
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
112
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
113
+ <bool key="IBDocument.UseAutolayout">YES</bool>
114
+ <string key="IBCocoaTouchPluginVersion">2083</string>
115
+ </data>
116
+ </archive>
metadata ADDED
@@ -0,0 +1,58 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: motion-xib
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Andy Jeffries
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-03-05 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: A new Rake task for RubyMotion projects to create a new Xib file from
15
+ a template or edit an existing one
16
+ email:
17
+ - andy@andyjeffries.co.uk
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - .gitignore
23
+ - Gemfile
24
+ - LICENSE.txt
25
+ - README.md
26
+ - Rakefile
27
+ - lib/motion-xib.rb
28
+ - lib/motion-xib/version.rb
29
+ - motion-xib.gemspec
30
+ - templates/ipad.xib
31
+ - templates/iphone.xib
32
+ homepage: http://andyjeffries.co.uk/
33
+ licenses: []
34
+ post_install_message:
35
+ rdoc_options: []
36
+ require_paths:
37
+ - lib
38
+ required_ruby_version: !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ required_rubygems_version: !ruby/object:Gem::Requirement
45
+ none: false
46
+ requirements:
47
+ - - ! '>='
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ requirements: []
51
+ rubyforge_project:
52
+ rubygems_version: 1.8.24
53
+ signing_key:
54
+ specification_version: 3
55
+ summary: A new Rake task for RubyMotion projects to create a new Xib file from a template
56
+ or edit an existing one
57
+ test_files: []
58
+ has_rdoc: