ProMotion-menu 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: fc35b7957b121ac2a05e893420f5ec279adff29a
4
- data.tar.gz: 31fbd21f28e8cb617f9fc67e8b48fb132a5c174d
2
+ SHA256:
3
+ metadata.gz: 4b46ea03d2025b548c8783224fbd5f0276bc7501f5dbb8f333d5f8ae95bb2a42
4
+ data.tar.gz: a9bea8ce8327771093e223e71a671735a96d5b762bdbf77d1e243fcb29ed46a3
5
5
  SHA512:
6
- metadata.gz: 7e9363a5b97e96c48f11c2189d1fb4bfe8159f1683bbbefc13ce2501726acf548d14fd9189f7fdca3358b893862da9bad77d0e4f8a164f452d5ad98d990b20db
7
- data.tar.gz: 77a145ec8c9a57dc52dcd3efc9c35578f4063184a9c0cbb42ff30e06d4ca358105b8e7866c89e0dcf9ef72e50e23e8ec37e5fedc6325640020e8d72f5e672d03
6
+ metadata.gz: a20cdb731944793963e2b2da0146644370485aac727145dcf0b7b0f2561524ed28fcd64219358bd08b80c1626317c668201b70ea397801467133dbe8c10f994f
7
+ data.tar.gz: 052b93e0d840f97453a593ab75e9fb6add2b83a5a52cad9ffb0cb1727d4c13e49edecbf6521d7cb55fc0bf7f848ebcf93b3673c615298896f7e58cf5d0503542
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
- # ProMotion-menu [![Gem Version](https://badge.fury.io/rb/ProMotion-menu.png)](http://badge.fury.io/rb/ProMotion-menu) [![Build Status](https://travis-ci.org/clearsightstudio/ProMotion-menu.svg?branch=master)](https://travis-ci.org/clearsightstudio/ProMotion-menu) [![Code Climate](https://codeclimate.com/github/clearsightstudio/ProMotion-menu/badges/gpa.svg)](https://codeclimate.com/github/clearsightstudio/ProMotion-menu) [![Test Coverage](https://codeclimate.com/github/clearsightstudio/ProMotion-menu/badges/coverage.svg)](https://codeclimate.com/github/clearsightstudio/ProMotion-menu)
1
+ # ProMotion-menu
2
+ [![Gem Version](https://badge.fury.io/rb/ProMotion-menu.png)](http://badge.fury.io/rb/ProMotion-menu) [![Build Status](https://travis-ci.org/clearsightstudio/ProMotion-menu.svg?branch=master)](https://travis-ci.org/clearsightstudio/ProMotion-menu) [![Code Climate](https://codeclimate.com/github/clearsightstudio/ProMotion-menu/badges/gpa.svg)](https://codeclimate.com/github/clearsightstudio/ProMotion-menu) [![Test Coverage](https://codeclimate.com/github/clearsightstudio/ProMotion-menu/badges/coverage.svg)](https://codeclimate.com/github/clearsightstudio/ProMotion-menu)
2
3
 
3
4
  <p align="center" >
4
5
  <img src="http://mutualmobile.github.io/MMDrawerController/ExampleImages/example1.png" width="266" height="500"/>
@@ -7,7 +8,7 @@
7
8
 
8
9
  ProMotion-menu provides a menu component for the popular RubyMotion gem [ProMotion](https://github.com/clearsightstudio/ProMotion). Utilizing [MMDrawerController](https://github.com/mutualmobile/MMDrawerController) it allows you to easily have a cool Facebook or Path style slide navigation menu, complete with gestures.
9
10
 
10
- The gem was originally named `pro_motion_slide_menu` and authored by [Matt Brewer](https://github.com/macfanatic).
11
+ The gem was originally named `pro_motion_slide_menu` authored by [Matt Brewer](https://github.com/macfanatic) and continuing development was done by [Infinite Red](http://infinite.red), a web and mobile development company based in Portland, OR and San Francisco, CA. While you're welcome to use it, please note that we rely on the community to maintain it. We are happy to merge pull requests and release new versions but are no longer driving primary development.
11
12
 
12
13
  ## Installation
13
14
 
@@ -25,6 +26,18 @@ Install with bundler:
25
26
  bundle install
26
27
  ```
27
28
 
29
+ Install pods:
30
+
31
+ ```ruby
32
+ rake pod:install
33
+ ```
34
+
35
+ If you're encountering errors, try cleaning before installing pods:
36
+
37
+ ```ruby
38
+ rake clean:all
39
+ ```
40
+
28
41
  ### Dependenices
29
42
  This depends on motion-cocoapods and ProMotion.
30
43
 
@@ -188,6 +201,7 @@ class NavigationScreen < ProMotion::TableScreen
188
201
  end
189
202
 
190
203
  def swap_center_controller(screen_class)
204
+ # Just use screen_class if you don't need a navigation bar
191
205
  app_delegate.menu.center_controller = screen_class
192
206
  end
193
207
 
@@ -205,6 +219,8 @@ welcoming to new RubyMotion developers. We don't mind newbie questions.
205
219
 
206
220
  If you need help, feel free to open an issue on GitHub. If we don't respond within a day, tweet us a link to the issue -- sometimes we get busy.
207
221
 
222
+ A [very minimal ProMotion-menu sample](https://github.com/ryanlntn/pm-menu-issue-44) is available for reference.
223
+
208
224
  ### Contributing
209
225
 
210
226
  See [CONTRIBUTING.md](https://github.com/clearsightstudio/ProMotion/blob/master/CONTRIBUTING.md).
@@ -18,7 +18,7 @@ module ProMotion
18
18
  alias_method :has_slide_menu?, :has_menu?
19
19
 
20
20
  def open_menu(content, options={})
21
- self.menu = ProMotion::Menu::Drawer.new(content, options)
21
+ self.menu = ProMotion::Menu::Drawer.new(options.merge(center: content))
22
22
  open_root_screen menu
23
23
  menu
24
24
  end
@@ -6,16 +6,21 @@ module ProMotion
6
6
  include Visibility
7
7
  include Transition
8
8
 
9
- def self.new(center=nil, options={})
9
+ def self.new(options={})
10
10
  menu = alloc.init
11
- menu.send(:auto_setup, center, options)
11
+ menu.send(:auto_setup, options)
12
12
  menu
13
13
  end
14
14
 
15
- def auto_setup(center, options={})
15
+ def init
16
+ super.tap do
17
+ screen_init if respond_to?(:screen_init)
18
+ end
19
+ end
20
+
21
+ def auto_setup(options={})
16
22
  options[:to_show] ||= :pan_bezel
17
23
  options[:to_hide] ||= [:pan_center, :tap_center]
18
- options[:center] ||= center if center
19
24
  shadow = options[:shadow] unless options[:shadow].nil?
20
25
  set_attributes self, options
21
26
  self.send(:setup) if self.respond_to?(:setup)
@@ -77,6 +82,7 @@ module ProMotion
77
82
 
78
83
  def prepare_controller_for_pm(controller)
79
84
  unless controller.nil?
85
+ controller = controller.new if controller.respond_to?(:new)
80
86
  controller = set_up_screen_for_open(controller, {})
81
87
  ensure_wrapper_controller_in_place(controller, {})
82
88
  controller.navigationController || controller
@@ -1,7 +1,7 @@
1
1
  module ProMotion
2
2
  module Menu
3
3
 
4
- VERSION = '1.1.0'
4
+ VERSION = '1.1.1'
5
5
 
6
6
  end
7
7
  end
@@ -8,49 +8,49 @@ describe ProMotion::Menu::Drawer do
8
8
  end
9
9
 
10
10
  it "returns an instance of PM::Menu::Drawer" do
11
- menu = ProMotion::Menu::Drawer.new @content, left: @left
11
+ menu = ProMotion::Menu::Drawer.new center: @content, left: @left
12
12
  menu.should.be.instance_of ProMotion::Menu::Drawer
13
13
  end
14
14
 
15
15
  it "stores menu & content controllers" do
16
- menu = ProMotion::Menu::Drawer.new @content, left: @left
16
+ menu = ProMotion::Menu::Drawer.new center: @content, left: @left
17
17
  menu.left_controller.should == @left
18
18
  menu.center_controller.should == @content
19
19
  end
20
20
 
21
21
  it "allows you to pass class instances" do
22
- menu = ProMotion::Menu::Drawer.new BlankScreen, left: LeftNavScreen
22
+ menu = ProMotion::Menu::Drawer.new center: BlankScreen, left: LeftNavScreen
23
23
  menu.left_controller.should.be.instance_of LeftNavScreen
24
24
  menu.center_controller.should.be.instance_of BlankScreen
25
25
  end
26
26
 
27
27
  it "lets me wrap the content controller in a UINavigationController" do
28
28
  center_controller = BlankScreen.new(nav_bar: true)
29
- menu = ProMotion::Menu::Drawer.new center_controller, left: @left
29
+ menu = ProMotion::Menu::Drawer.new center: center_controller, left: @left
30
30
  menu.center_controller.should.be.instance_of ProMotion::NavigationController
31
31
  end
32
32
 
33
33
  it "lets me set the title on the content controller during creation" do
34
34
  center_controller = BlankScreen.new(title: 'My Title')
35
- menu = ProMotion::Menu::Drawer.new center_controller, left: @left
35
+ menu = ProMotion::Menu::Drawer.new center: center_controller, left: @left
36
36
  menu.center_controller.title.should == 'My Title'
37
37
  end
38
38
 
39
39
  it "accepts a plain UIViewController" do
40
- menu = ProMotion::Menu::Drawer.new @content, left: @left
40
+ menu = ProMotion::Menu::Drawer.new center: @content, left: @left
41
41
  should.not.raise(NoMethodError) { menu.left_controller = UIViewController }
42
42
  menu.left_controller.should.be.instance_of UIViewController
43
43
  end
44
44
 
45
45
  it "allows you to set both a right and left menu controller" do
46
- menu = ProMotion::Menu::Drawer.new @content, left: @left, right: @right
46
+ menu = ProMotion::Menu::Drawer.new center: @content, left: @left, right: @right
47
47
  menu.left_controller.should == @left
48
48
  menu.right_controller.should == @right
49
49
  menu.center_controller.should == @content
50
50
  end
51
51
 
52
52
  it "allows you to set whether or not the drawer has a shadow" do
53
- menu = ProMotion::Menu::Drawer.new @content, left: @left, right: @right, shadow: false
53
+ menu = ProMotion::Menu::Drawer.new center: @content, left: @left, right: @right, shadow: false
54
54
  menu.showsShadow.should == false
55
55
 
56
56
  menu.shadow = true
@@ -58,7 +58,7 @@ describe ProMotion::Menu::Drawer do
58
58
  end
59
59
 
60
60
  it "doesn't crash if you set the left or right controller to nil" do
61
- menu = ProMotion::Menu::Drawer.new(@content, left: nil, right: nil)
61
+ menu = ProMotion::Menu::Drawer.new(center: @content, left: nil, right: nil)
62
62
 
63
63
  menu.left_controller.should == nil
64
64
  menu.right_controller.should == nil
@@ -9,13 +9,13 @@ describe ProMotion::Menu::Visibility do
9
9
 
10
10
  describe "#show" do
11
11
  it "presents the menu controller when requested" do
12
- menu = ProMotion::Menu::Drawer.new @content, left: @left
12
+ menu = ProMotion::Menu::Drawer.new center: @content, left: @left
13
13
  menu.show(:left)
14
14
  wait(0.5) { menu.openSide.should == MMDrawerSideLeft }
15
15
  end
16
16
 
17
17
  it "presents the menu controller without animation when requested" do
18
- menu = ProMotion::Menu::Drawer.new @content, left: @left
18
+ menu = ProMotion::Menu::Drawer.new center: @content, left: @left
19
19
  menu.show(:left, false)
20
20
  wait(0.1) { menu.openSide.should == MMDrawerSideLeft }
21
21
  end
@@ -23,7 +23,7 @@ describe ProMotion::Menu::Visibility do
23
23
 
24
24
  describe "#hide" do
25
25
  it "presents the content controller when requested" do
26
- menu = ProMotion::Menu::Drawer.new @content, left: @left
26
+ menu = ProMotion::Menu::Drawer.new center: @content, left: @left
27
27
  menu.hide
28
28
  wait(0.5) { menu.openSide.should == MMDrawerSideNone }
29
29
  end
@@ -31,7 +31,7 @@ describe ProMotion::Menu::Visibility do
31
31
 
32
32
  describe "#toggle" do
33
33
  before do
34
- @menu = ProMotion::Menu::Drawer.new @content, left: @left, right: @right
34
+ @menu = ProMotion::Menu::Drawer.new center: @content, left: @left, right: @right
35
35
  end
36
36
 
37
37
  describe "from left" do
@@ -81,7 +81,7 @@ describe ProMotion::Menu::Visibility do
81
81
 
82
82
  describe "#max_left_width" do
83
83
  before do
84
- @menu = ProMotion::Menu::Drawer.new @content, left: @left, right: @right
84
+ @menu = ProMotion::Menu::Drawer.new center: @content, left: @left, right: @right
85
85
  end
86
86
 
87
87
  it "returns the maximum width for a given drawer" do
@@ -91,7 +91,7 @@ describe ProMotion::Menu::Visibility do
91
91
 
92
92
  describe "#max_left_width=" do
93
93
  before do
94
- @menu = ProMotion::Menu::Drawer.new @content, left: @left, right: @right
94
+ @menu = ProMotion::Menu::Drawer.new center: @content, left: @left, right: @right
95
95
  end
96
96
 
97
97
  it "sets a maximum drawer width" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ProMotion-menu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brewer
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-02-17 00:00:00.000000000 Z
13
+ date: 2019-10-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: motion-cocoapods
@@ -46,14 +46,14 @@ dependencies:
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: '10'
49
+ version: '12'
50
50
  type: :development
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - "~>"
55
55
  - !ruby/object:Gem::Version
56
- version: '10'
56
+ version: '12'
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: motion-stump
59
59
  requirement: !ruby/object:Gem::Requirement
@@ -113,17 +113,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  - !ruby/object:Gem::Version
114
114
  version: '0'
115
115
  requirements: []
116
- rubyforge_project:
117
- rubygems_version: 2.4.5
116
+ rubygems_version: 3.0.6
118
117
  signing_key:
119
118
  specification_version: 4
120
119
  summary: Provides a facebook/Path style slide menu for ProMotion RubyMotion apps.
121
120
  test_files:
122
- - spec/app_delegate_spec.rb
123
- - spec/drawer_spec.rb
124
121
  - spec/gestures_spec.rb
122
+ - spec/drawer_spec.rb
123
+ - spec/visibility_spec.rb
124
+ - spec/transition_spec.rb
125
+ - spec/app_delegate_spec.rb
125
126
  - spec/helpers/blank_screen.rb
126
- - spec/helpers/left_nav_screen.rb
127
127
  - spec/helpers/right_nav_screen.rb
128
- - spec/transition_spec.rb
129
- - spec/visibility_spec.rb
128
+ - spec/helpers/left_nav_screen.rb