motion-ios-devices 0.3.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,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8b85e0ab97d0ca99692fc9c260b68bca0a1e5be8d1da7324b7fcb5e86d14a6f7
4
+ data.tar.gz: 9028a41349c21f6aaf3967e46f04bb593c950e4e0cd67f739bc5653534f97c02
5
+ SHA512:
6
+ metadata.gz: be296564d75982261725459cc050fb865ecac4f2e93003ca13023a3cf6a58313af58ddc3fa90a710820a10fcfeb1f8f572dec20801a28b44f3cbd49ab0c4ce71
7
+ data.tar.gz: 81ff323431f1dd2743a920d72efa743bb29f6df7a1d3a8018d62eec6ec08290c8a43f7527007a77c3328855e77de66f39c6bd62ccf90581a50ed77f1aa59c4bd
@@ -0,0 +1,61 @@
1
+ # motion-ios-devices
2
+
3
+ A simple Gem that makes building and running a RubyMotion iOS application on a specific device simple.
4
+
5
+ This gem was inspired by a blog post written by Dave Kimura of (Drifting Ruby)[https://www.driftingruby.com] you should check it out.
6
+
7
+ The intent is to provide some simple command line target to invoke specific devices when building and compiling RubyMotion/DragonRuby to the iOS simulator. I could never remember the exact syntax and precise string to start the simulator with a specific device and looking up the devices was annoyance and slowed down my workflow.
8
+
9
+ I found Dave Kimura's article (which I cannot locate) that showed how to create tasks in your Rakefile to do:
10
+ ```bash
11
+ $ bundle exec rake iphone7
12
+ ```
13
+ The article included some predefined tasks for various devices. I have been using this in my projects for some time, however I needed to expand the list, make it standard and make it public (so only the maintainers of the gem ever need to research the simulator device strings). The gem is very light-weight with no other dependencies to ensure no problems other than having the up-to-date devices occur from use.
14
+
15
+ This gem is ony suitable for RubyMotion iOS projects.
16
+
17
+ ## Installation
18
+
19
+ Add this line to your application's Gemfile:
20
+
21
+ gem 'motion-ios-devices'
22
+
23
+ And then execute:
24
+
25
+ $ bundle
26
+
27
+ Or install it yourself as:
28
+
29
+ $ gem install motion-ios-devices
30
+
31
+ ## Usage
32
+
33
+ The gem allow the simple specification of the simulator target on the RubyMotion `rake` build command as follows:
34
+
35
+ ```bash
36
+ $ bundle exec rake iphone:7
37
+ ```
38
+
39
+ The rake target is broken into 2 parts, the device class and the device model. The current device classes are `iphone` and `ipad`. To see what models are supported within a class of devices use the target `<device-class>:devices` for example:
40
+ ```bash
41
+ $ bundle exec rake iphone:devices
42
+ ```
43
+ Which will produce a listing like:
44
+ ```bash
45
+ You invoked iphone:devices
46
+
47
+ The full list of device targets under iphone are:
48
+
49
+ iphone:7, iphone:7plus, iphone:x
50
+
51
+ ```
52
+
53
+ *Note* the actual devices models will grow and change over time, the device list functionality enables you to determine what is currently available (and means you don't need to remember all the model names).
54
+
55
+ ## Contributing
56
+
57
+ 1. Fork it
58
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
59
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
60
+ 4. Push to the branch (`git push origin my-new-feature`)
61
+ 5. Create new Pull Request
@@ -0,0 +1,9 @@
1
+ # encoding: utf-8
2
+
3
+ unless defined?(Motion::Project::Config)
4
+ raise "This file must be required within a RubyMotion project Rakefile."
5
+ end
6
+
7
+ lib_dir_path = File.dirname(File.expand_path(__FILE__))
8
+
9
+ require_relative 'tasks/motion-ios-devices'
@@ -0,0 +1,147 @@
1
+ # -*- encoding : utf-8 -*-
2
+ require 'rake' unless defined? Rake
3
+
4
+ namespace :iphone do |ns|
5
+ desc "Run simulator on iPhone 5s"
6
+ task :"5s" do
7
+ exec 'bundle exec rake device_name="iPhone 5s"'
8
+ end
9
+
10
+ desc "Run simulator on iPhone SE"
11
+ task :"SE" do
12
+ exec 'bundle exec rake device_name="iPhone SE"'
13
+ end
14
+
15
+ desc "Run simulator on iPhone 6"
16
+ task :"6" do
17
+ exec 'bundle exec rake device_name="iPhone 6"'
18
+ end
19
+
20
+ desc "Run simulator on iPhone 6 Plus"
21
+ task :"6plus" do
22
+ exec 'bundle exec rake device_name="iPhone 6 Plus"'
23
+ end
24
+
25
+ desc "Run simulator on iPhone 6s"
26
+ task :"6s" do
27
+ exec 'bundle exec rake device_name="iPhone 6s"'
28
+ end
29
+
30
+ desc "Run simulator on iPhone 6s Plus"
31
+ task :"6splus" do
32
+ exec 'bundle exec rake device_name="iPhone 6s Plus"'
33
+ end
34
+
35
+ desc "Run simulator on iPhone 7"
36
+ task :"7" do
37
+ exec 'bundle exec rake device_name="iPhone 7"'
38
+ end
39
+
40
+ desc "Run simulator on iPhone 7 Plus"
41
+ task :"7plus" do
42
+ exec 'bundle exec rake device_name="iPhone 7 Plus"'
43
+ end
44
+ # iPhone 8
45
+ # iPhone 8 Plus
46
+ desc "Run simulator on iPhone 8"
47
+ task :"8" do
48
+ exec 'bundle exec rake device_name="iPhone 8"'
49
+ end
50
+
51
+ desc "Run simulator on iPhone 8 Plus"
52
+ task :"8plus" do
53
+ exec 'bundle exec rake device_name="iPhone 8 Plus"'
54
+ end
55
+
56
+ desc "Run simulator on iPhone X"
57
+ task :"X" do
58
+ exec 'bundle exec rake device_name="iPhone X"'
59
+ end
60
+
61
+ desc "Run simulator on iPhone XR"
62
+ task :"XR" do
63
+ exec 'bundle exec rake device_name="iPhone XR"'
64
+ end
65
+
66
+ desc "Run simulator on iPhone XS"
67
+ task :"XS" do
68
+ exec 'bundle exec rake device_name="iPhone XS"'
69
+ end
70
+
71
+ desc "Run simulator on iPhone XS Max"
72
+ task :"XSmax" do
73
+ exec 'bundle exec rake device_name="iPhone XS Max"'
74
+ end
75
+
76
+ desc 'Get defined devices for iphone'
77
+ task :devices do |t|
78
+ puts "You invoked #{t.name}"
79
+ puts
80
+ puts "The full list of device targets under iphone are:"
81
+ puts
82
+ puts " " + (ns.tasks.delete_if { |tn| t.name.eql?(tn.to_s) }).join(', ')
83
+ puts "\n\n"
84
+ end
85
+ end
86
+
87
+ namespace :ipad do |ns|
88
+ desc "Run simulator in iPad Retina"
89
+ task :retina do
90
+ exec 'bundle exec rake device_name="iPad Retina"'
91
+ end
92
+
93
+ desc "Run simulator in iPad (latest version)"
94
+ task :latest do
95
+ exec 'bundle exec rake device_name="iPad (6th generation)"'
96
+ end
97
+
98
+ desc "Run simulator on iPad Air"
99
+ task :air do
100
+ exec 'bundle exec rake device_name="iPad Air"'
101
+ end
102
+
103
+ desc "Run simulator on iPad Air 2"
104
+ task :air2 do
105
+ exec 'bundle exec rake device_name="iPad Air 2"'
106
+ end
107
+
108
+ desc "Run simulator on iPad Pro 9.7"
109
+ task :pro9 do
110
+ exec 'bundle exec rake device_name="iPad Pro (9.7-inch)"'
111
+ end
112
+
113
+ desc "Run simulator on iPad Pro 10"
114
+ task :pro10 do
115
+ exec 'bundle exec rake device_name="iPad Pro (10.5-inch)"'
116
+ end
117
+
118
+ desc "Run simulator on iPad Pro 11"
119
+ task :pro11 do
120
+ exec 'bundle exec rake device_name="iPad Pro (11-inch)"'
121
+ end
122
+
123
+ desc "Run simulator on iPad Pro 12"
124
+ task :pro12 do
125
+ exec 'bundle exec rake device_name="iPad Pro (12.9-inch)"'
126
+ end
127
+
128
+ desc "Run simulator on iPad Pro 12-2nd gen"
129
+ task :"pro12-2" do
130
+ exec 'bundle exec rake device_name="iPad Pro (12.9-inch) (2nd generation)"'
131
+ end
132
+
133
+ desc "Run simulator on iPad Pro 12-3rd gen"
134
+ task :"pro12-3" do
135
+ exec 'bundle exec rake device_name="iPad Pro (12.9-inch) (3rd generation)"'
136
+ end
137
+
138
+ desc 'Get defined devices for ipad'
139
+ task :devices do |t|
140
+ puts "You invoked #{t.name}"
141
+ puts
142
+ puts "The full list of device targets under ipad are:"
143
+ puts
144
+ puts " " + (ns.tasks.delete_if { |tn| t.name.eql?(tn.to_s) }).join(', ')
145
+ puts "\n\n"
146
+ end
147
+ end
metadata ADDED
@@ -0,0 +1,60 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: motion-ios-devices
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.1
5
+ platform: ruby
6
+ authors:
7
+ - Andy Stechishin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-04-26 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: Simplify RubyMotion build and run on simulator to target specific device
28
+ email:
29
+ - andy@canasoftware.ca
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - README.md
35
+ - lib/motion-ios-devices.rb
36
+ - lib/tasks/motion-ios-devices.rb
37
+ homepage: ''
38
+ licenses:
39
+ - BSD
40
+ metadata: {}
41
+ post_install_message:
42
+ rdoc_options: []
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ requirements: []
56
+ rubygems_version: 3.0.3
57
+ signing_key:
58
+ specification_version: 4
59
+ summary: Run a RubyMotion app on a specific device
60
+ test_files: []