dynamics 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/base/Rakefile CHANGED
@@ -10,7 +10,8 @@ require 'dynamics'
10
10
  Motion::Project::App.setup do |app|
11
11
  app.name = ''
12
12
  app.delegate_class = ''
13
-
13
+ app.icons = %w{icon.png}
14
+
14
15
  Dynamics::setup_framework(app, File.dirname(__FILE__))
15
16
  end
16
17
 
@@ -3,6 +3,7 @@ class Application < Dynamics::Application
3
3
 
4
4
  def initialize
5
5
  #super('Navigation')
6
- super('Tab Bar')
6
+ #super('Tab Bar')
7
+ super('Tab Nav')
7
8
  end
8
9
  end
Binary file
@@ -17,7 +17,10 @@ module Dynamics
17
17
  # @@End@@
18
18
  elsif @layout == 'Tab Bar'
19
19
  # @@Tab Bar@@
20
- # @@End@@
20
+ # @@End@@
21
+ elsif @layout == 'Tab Nav'
22
+ # @@Tab Nav@@
23
+ # @@End@@
21
24
  else
22
25
  @window.rootViewController = MainController.alloc.initWithNibName(nil, bundle: nil)
23
26
  end
data/lib/dynamics.rb CHANGED
@@ -69,6 +69,12 @@ module Dynamics
69
69
  f = File.new(File.join(views_dir, 'sub2_view.rb'), 'w+')
70
70
  f.write(render_code(File.join(base_dir, 'app', 'views', 'sub2_view.rb')))
71
71
  f.close
72
+
73
+ # Resources
74
+
75
+ f = File.new(File.join(resources_dir, 'icon.png'), 'w+')
76
+ f.write(render_code(File.join(base_dir, 'resources', 'icon.png')))
77
+ f.close
72
78
  end
73
79
  end
74
80
 
@@ -82,7 +88,8 @@ module Dynamics
82
88
  layout = placeholder.gsub('# @@', '').gsub('@', '')
83
89
  case layout
84
90
  when 'Navigation' then lib_code = lib_code.gsub(block, navigation_code(path))
85
- when 'Tab Bar' then lib_code = lib_code.gsub(block, tab_bar_code(path))
91
+ when 'Tab Bar' then lib_code = lib_code.gsub(block, tab_bar_code(path))
92
+ when 'Tab Nav' then lib_code = lib_code.gsub(block, tab_nav_code(path))
86
93
  end
87
94
  end
88
95
  end
@@ -163,4 +170,25 @@ private
163
170
  code += " @window.rootViewController = tab_controller\n"
164
171
  code += " # @@End@@"
165
172
  end
173
+
174
+ def self.tab_nav_code(path)
175
+ code = "# @@Tab Nav@@\n"
176
+ controllers_list = 'main_nav_controller'
177
+ code += " main_controller = MainController.alloc.initWithNibName(nil, bundle: nil)\n"
178
+ code += " main_controller.title = main_controller.name\n"
179
+ code += " main_nav_controller = UINavigationController.alloc.initWithRootViewController(main_controller)\n"
180
+ i = 1
181
+ controllers = find_controllers(path)
182
+ for controller in controllers
183
+ controllers_list += ", sub#{i}_nav_controller"
184
+ code += " sub#{i}_controller = #{controller[:class_name]}.alloc.initWithNibName(nil, bundle: nil)\n"
185
+ code += " sub#{i}_controller.title = sub#{i}_controller.name\n"
186
+ code += " sub#{i}_nav_controller = UINavigationController.alloc.initWithRootViewController(sub#{i}_controller)\n"
187
+ i += 1
188
+ end
189
+ code += " tab_controller = UITabBarController.alloc.initWithNibName(nil, bundle: nil)\n"
190
+ code += " tab_controller.viewControllers = [#{controllers_list}]\n"
191
+ code += " @window.rootViewController = tab_controller\n"
192
+ code += " # @@End@@"
193
+ end
166
194
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamics
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ng Say Joe
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-08-01 00:00:00 Z
18
+ date: 2012-08-18 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: A framework for developing RubyMotion applications quickly.
@@ -36,6 +36,7 @@ files:
36
36
  - base/app/views/main_view.rb
37
37
  - base/app/views/sub1_view.rb
38
38
  - base/app/views/sub2_view.rb
39
+ - base/resources/icon.png
39
40
  - base/templates/dynamics.rb
40
41
  - bin/dynamics
41
42
  homepage: http://www.dynamics.io/