motion-xray 1.0.4 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: objective-c
2
+ before_install: rvm use 1.9.3
3
+ before_script: sudo chown -R travis ~/Library/RubyMotion
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- motion-xray (1.0.3)
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.10.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.1)
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
- Features
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! :-D
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
- - `edit(target)` - called when a new view is double-tapped in the UI picker.
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
- if MFMailComposeViewController.canSendMail
107
- email_button = UIButton.custom
108
- email_button.setImage('xray_email_button'.uiimage, forState: :normal.uicontrolstate)
109
- email_button.frame = [[@toggle_actions_button.frame.width, button_y], [ActionsWidth, ActionsWidth]]
110
- email_button.on :touch {
111
- mail_view_controller = MFMailComposeViewController.new
112
- mail_view_controller.mailComposeDelegate = self
113
- mail_view_controller.setSubject('From Motion-Xray.')
114
- mail_view_controller.setMessageBody(
115
- '<pre>' << LogPlugin.log.map{ |line|
116
- line[:date].string_with_format('HH:mm:ss.SSS') << ' ' << line[:message].string
117
- }.join("\n") << '</pre>', isHTML: true)
118
- SugarCube::Modal.present_modal mail_view_controller
119
- }
120
- actions_container << email_button
121
- button_y += ActionsWidth
122
- end
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
 
@@ -1,5 +1,5 @@
1
1
  module Motion
2
2
  module Xray
3
- Version = '1.0.4'
3
+ Version = '1.0.6'
4
4
  end
5
5
  end
@@ -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
- String.should === first[0]
31
- Hash.should === first[1]
30
+ first[0].should.is_a?(String)
31
+ first[1].should.is_a?(Hash)
32
32
  first_editor = first[1].first
33
- Symbol.should === first_editor[0]
34
- Hash.should === first_editor[1]
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
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: 2013-04-02 00:00:00.000000000 Z
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:
data/vendor/Podfile.lock DELETED
@@ -1,11 +0,0 @@
1
-
2
- PODS:
3
- - CocoaLumberjack (1.6)
4
-
5
- DEPENDENCIES:
6
- - CocoaLumberjack
7
-
8
- SPEC CHECKSUMS:
9
- CocoaLumberjack: 0f2fa7090a23f13261072d882e017c688300efbe
10
-
11
- COCOAPODS: 0.16.2