motion-xray 1.0.4 → 1.0.6
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.
- data/.travis.yml +3 -0
- data/Gemfile.lock +3 -3
- data/README.md +11 -5
- data/Rakefile +3 -1
- data/lib/motion-xray.rb +2 -2
- data/lib/motion-xray/plugins/log_plugin.rb +21 -17
- data/lib/motion-xray/version.rb +1 -1
- data/spec/xray_view_spec.rb +4 -4
- metadata +3 -3
- data/vendor/Podfile.lock +0 -11
data/.travis.yml
ADDED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
motion-xray (1.0.
|
4
|
+
motion-xray (1.0.6)
|
5
5
|
geomotion (>= 0.10.0)
|
6
6
|
sugarcube (>= 0.20.1)
|
7
7
|
|
@@ -9,7 +9,7 @@ GEM
|
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
11
|
diff-lcs (1.1.3)
|
12
|
-
geomotion (0.
|
12
|
+
geomotion (0.12.1)
|
13
13
|
rspec (2.12.0)
|
14
14
|
rspec-core (~> 2.12.0)
|
15
15
|
rspec-expectations (~> 2.12.0)
|
@@ -18,7 +18,7 @@ GEM
|
|
18
18
|
rspec-expectations (2.12.1)
|
19
19
|
diff-lcs (~> 1.1.3)
|
20
20
|
rspec-mocks (2.12.2)
|
21
|
-
sugarcube (0.20.
|
21
|
+
sugarcube (0.20.25)
|
22
22
|
|
23
23
|
PLATFORMS
|
24
24
|
ruby
|
data/README.md
CHANGED
@@ -11,6 +11,9 @@ TL;DR
|
|
11
11
|
1. `gem install motion-xray`
|
12
12
|
2. Replace `UIWindow` with `Motion::Xray::XrayWindow`
|
13
13
|
|
14
|
+
And if you want the email features, add `app.frameworks << 'MessageUI'` to your
|
15
|
+
Rakefile.
|
16
|
+
|
14
17
|
The Problem
|
15
18
|
-----------
|
16
19
|
|
@@ -39,8 +42,8 @@ inspector, or to monitor the console log, preview how accessibile your app is
|
|
39
42
|
information specifically useful to your app. Below I'll show how to create a
|
40
43
|
new plugin. Check out the [plugins folder][] for some examples.
|
41
44
|
|
42
|
-
|
43
|
-
|
45
|
+
Overview
|
46
|
+
--------
|
44
47
|
|
45
48
|
If you clone and run Xray in the simulator, you will see a very boring app:
|
46
49
|
|
@@ -53,10 +56,10 @@ displays this:
|
|
53
56
|
|
54
57
|
The application shrinks down to a quarter size, and the development environment
|
55
58
|
takes up the remaining space. That is Xray, an in-app debugging and development
|
56
|
-
environment!
|
59
|
+
environment! :smiley:
|
57
60
|
|
58
61
|
Features
|
59
|
-
|
62
|
+
--------
|
60
63
|
|
61
64
|
That's enough to have the `Motion::Xray.toggle` command fired whenever you shake
|
62
65
|
the device. If you want to use some other mechanism that launches Xray (a
|
@@ -384,7 +387,10 @@ methods that you can call, or get called, on a plugin:
|
|
384
387
|
|
385
388
|
- `plugin_view(canvas_view)` - the view returned by this method will be placed
|
386
389
|
in `canvas_view` when your plugin is selected
|
387
|
-
|
390
|
+
|
391
|
+
#### Methods you *can* implement
|
392
|
+
|
393
|
+
- `edit(target)` - called when a new view is chosen in the UI picker.
|
388
394
|
You should call `super`, which assigns this view to the `target` property.
|
389
395
|
Then you can update `self.view` with any changes that you need to apply.
|
390
396
|
- `show` - called when your plugin is selected (this will always be after
|
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
$:.unshift("/Library/RubyMotion/lib")
|
3
|
-
require 'motion/project'
|
3
|
+
require 'motion/project/template/ios'
|
4
4
|
require './lib/motion-xray'
|
5
5
|
|
6
6
|
|
@@ -8,4 +8,6 @@ Motion::Project::App.setup do |app|
|
|
8
8
|
# Use `rake config' to see complete project settings.
|
9
9
|
app.name = 'motion-xray'
|
10
10
|
app.detect_dependencies = false
|
11
|
+
app.frameworks << 'MessageUI'
|
12
|
+
app.device_family = [:iphone, :ipad]
|
11
13
|
end
|
data/lib/motion-xray.rb
CHANGED
@@ -2,7 +2,8 @@ unless defined?(Motion::Project::Config)
|
|
2
2
|
raise "The motion-xray gem must be required within a RubyMotion project Rakefile."
|
3
3
|
end
|
4
4
|
|
5
|
-
require 'sugarcube'
|
5
|
+
require 'sugarcube-core'
|
6
|
+
require 'sugarcube-image'
|
6
7
|
require 'geomotion'
|
7
8
|
|
8
9
|
Motion::Project::App.setup do |app|
|
@@ -33,5 +34,4 @@ Motion::Project::App.setup do |app|
|
|
33
34
|
end
|
34
35
|
|
35
36
|
app.resources_dirs << File.join(File.dirname(__FILE__), 'resources')
|
36
|
-
app.frameworks << 'MessageUI'
|
37
37
|
end
|
@@ -103,23 +103,27 @@ module Motion ; module Xray
|
|
103
103
|
button_y += ActionsWidth
|
104
104
|
|
105
105
|
# send email button
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
106
|
+
email_button = UIButton.custom
|
107
|
+
email_button.setImage('xray_email_button'.uiimage, forState: :normal.uicontrolstate)
|
108
|
+
email_button.frame = [[@toggle_actions_button.frame.width, button_y], [ActionsWidth, ActionsWidth]]
|
109
|
+
email_button.on :touch {
|
110
|
+
if defined? MFMailComposeViewController
|
111
|
+
if MFMailComposeViewController.canSendMail
|
112
|
+
mail_view_controller = MFMailComposeViewController.new
|
113
|
+
mail_view_controller.mailComposeDelegate = self
|
114
|
+
mail_view_controller.setSubject('From Motion-Xray.')
|
115
|
+
mail_view_controller.setMessageBody(
|
116
|
+
'<pre>' << LogPlugin.log.map{ |line|
|
117
|
+
line[:date].string_with_format('HH:mm:ss.SSS') << ' ' << line[:message].string
|
118
|
+
}.join("\n") << '</pre>', isHTML: true)
|
119
|
+
SugarCube::Modal.present_modal mail_view_controller
|
120
|
+
end
|
121
|
+
else
|
122
|
+
UIAlertView.alert "Email features require the MessageUI framework", "Add this to your Rakefile:\napp.frameworks << 'MessageUI'"
|
123
|
+
end
|
124
|
+
}
|
125
|
+
actions_container << email_button
|
126
|
+
button_y += ActionsWidth
|
123
127
|
end
|
124
128
|
@actions_container << @toggle_actions_button
|
125
129
|
|
data/lib/motion-xray/version.rb
CHANGED
data/spec/xray_view_spec.rb
CHANGED
@@ -27,11 +27,11 @@ describe "Xray view extensions" do
|
|
27
27
|
|
28
28
|
it "should have xray properties that are {section: {property: Editor}}" do
|
29
29
|
first = @view_a.xray.first
|
30
|
-
|
31
|
-
|
30
|
+
first[0].should.is_a?(String)
|
31
|
+
first[1].should.is_a?(Hash)
|
32
32
|
first_editor = first[1].first
|
33
|
-
|
34
|
-
|
33
|
+
first_editor[0].should.is_a?(Symbol)
|
34
|
+
first_editor[1].should < Motion::Xray::Editor
|
35
35
|
end
|
36
36
|
|
37
37
|
it "should merge xray properties" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-xray
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-02-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sugarcube
|
@@ -95,6 +95,7 @@ extensions: []
|
|
95
95
|
extra_rdoc_files: []
|
96
96
|
files:
|
97
97
|
- .gitignore
|
98
|
+
- .travis.yml
|
98
99
|
- Gemfile
|
99
100
|
- Gemfile.lock
|
100
101
|
- README.md
|
@@ -148,7 +149,6 @@ files:
|
|
148
149
|
- motion-xray.gemspec
|
149
150
|
- resources/Default-568h@2x.png
|
150
151
|
- spec/xray_view_spec.rb
|
151
|
-
- vendor/Podfile.lock
|
152
152
|
homepage: https://github.com/colinta/motion-xray
|
153
153
|
licenses: []
|
154
154
|
post_install_message:
|