teacup 2.1.13 → 2.1.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. data/lib/teacup-ios/handler.rb +1 -1
  2. data/lib/teacup-osx/handler.rb +1 -1
  3. data/lib/teacup/calculations.rb +2 -2
  4. data/lib/teacup/core_extensions/view_getters.rb +2 -2
  5. data/lib/teacup/layout.rb +1 -1
  6. data/lib/teacup/stylesheet_extensions/constraints.rb +14 -2
  7. data/lib/teacup/teacup_controller.rb +1 -1
  8. data/lib/teacup/teacup_view.rb +3 -3
  9. data/lib/teacup/version.rb +1 -1
  10. data/spec/ios/calculations_spec.rb +5 -1
  11. data/spec/ios/layout_module_spec.rb +2 -2
  12. metadata +24 -79
  13. data/.gitignore +0 -8
  14. data/.travis.yml +0 -3
  15. data/CHANGES.md +0 -26
  16. data/Gemfile +0 -9
  17. data/Gemfile.lock +0 -18
  18. data/LICENSE +0 -26
  19. data/README.md +0 -1527
  20. data/Rakefile +0 -18
  21. data/resources/Default-568h@2x.png +0 -0
  22. data/samples/README.md +0 -15
  23. data/samples/ios/AutoLayout/Gemfile +0 -1
  24. data/samples/ios/AutoLayout/Gemfile.lock +0 -13
  25. data/samples/ios/AutoLayout/Rakefile +0 -13
  26. data/samples/ios/AutoLayout/app/app_delegate.rb +0 -12
  27. data/samples/ios/AutoLayout/app/root_controller.rb +0 -16
  28. data/samples/ios/AutoLayout/app/styles/root.rb +0 -29
  29. data/samples/ios/AutoLayout/lib/dummy.rb +0 -2
  30. data/samples/ios/AutoLayout/lib/handlers.rb +0 -3
  31. data/samples/ios/AutoLayout/lib/styles/base.rb +0 -33
  32. data/samples/ios/Hai/.gitignore +0 -5
  33. data/samples/ios/Hai/Gemfile +0 -1
  34. data/samples/ios/Hai/Gemfile.lock +0 -13
  35. data/samples/ios/Hai/Rakefile +0 -12
  36. data/samples/ios/Hai/app/app_delegate.rb +0 -9
  37. data/samples/ios/Hai/app/hai_controller.rb +0 -13
  38. data/samples/ios/Hai/app/styles/iphone.rb +0 -47
  39. data/samples/ios/Hai/resources/Default-568h@2x.png +0 -0
  40. data/samples/ios/sweettea-example/Gemfile +0 -5
  41. data/samples/ios/sweettea-example/Gemfile.lock +0 -23
  42. data/samples/ios/sweettea-example/Rakefile +0 -11
  43. data/samples/ios/sweettea-example/app/app_delegate.rb +0 -43
  44. data/samples/ios/sweettea-example/resources/Default-568h@2x.png +0 -0
  45. data/samples/osx/Tweets/Gemfile +0 -1
  46. data/samples/osx/Tweets/Gemfile.lock +0 -13
  47. data/samples/osx/Tweets/README +0 -7
  48. data/samples/osx/Tweets/Rakefile +0 -10
  49. data/samples/osx/Tweets/app/app_delegate.rb +0 -18
  50. data/samples/osx/Tweets/app/data_parser.rb +0 -10
  51. data/samples/osx/Tweets/app/json_parser.rb +0 -12
  52. data/samples/osx/Tweets/app/main_window.rb +0 -99
  53. data/samples/osx/Tweets/app/menu.rb +0 -108
  54. data/samples/osx/Tweets/app/stylesheet.rb +0 -21
  55. data/samples/osx/Tweets/app/tweet.rb +0 -11
  56. data/samples/osx/Tweets/resources/Credits.rtf +0 -29
  57. data/samples/osx/simple/.gitignore +0 -1
  58. data/samples/osx/simple/Gemfile +0 -1
  59. data/samples/osx/simple/Gemfile.lock +0 -16
  60. data/samples/osx/simple/Rakefile +0 -9
  61. data/samples/osx/simple/app/app_delegate.rb +0 -21
  62. data/samples/osx/simple/app/controller.rb +0 -11
  63. data/samples/osx/simple/app/menu.rb +0 -108
  64. data/samples/osx/simple/app/window.rb +0 -12
  65. data/samples/osx/simple/resources/Credits.rtf +0 -29
  66. data/samples/osx/simple/resources/teacup.png +0 -0
  67. data/teacup.gemspec +0 -25
data/Rakefile DELETED
@@ -1,18 +0,0 @@
1
- $:.unshift('/Library/RubyMotion/lib')
2
- if ENV.fetch('platform', 'ios') == 'ios'
3
- require 'motion/project/template/ios'
4
- elsif ENV['platform'] == 'osx'
5
- require 'motion/project/template/osx'
6
- else
7
- raise "Unsupported platform #{ENV['platform']}"
8
- end
9
- require 'bundler'
10
- Bundler.require
11
-
12
-
13
- Motion::Project::App.setup do |app|
14
- # Use `rake config' to see complete project settings.
15
- app.name = 'teacup'
16
- app.identifier = 'com.rubymotion.teacup'
17
- app.specs_dir = "spec/#{app.template}/"
18
- end
Binary file
data/samples/README.md DELETED
@@ -1,15 +0,0 @@
1
- Samples
2
- =======
3
-
4
- Welcome to the Teacup samples directory. Place sample apps using Teacup here.
5
-
6
- # iOS
7
-
8
- * Hai - a very simple teacup demo
9
- * AutoLayout - demonstrates the constraints DSL
10
- * Sweettea Example - uses SugarCube, Sweettea, and the constraints DSL
11
-
12
- # OS X
13
-
14
- * Teacup OSX - the original "hey, it works!" project
15
- * Tweets - a port of the RubyMotionSample app
@@ -1 +0,0 @@
1
- gem 'teacup', :path => '../../..'
@@ -1,13 +0,0 @@
1
- PATH
2
- remote: ../..
3
- specs:
4
- teacup (2.0.2)
5
-
6
- GEM
7
- specs:
8
-
9
- PLATFORMS
10
- ruby
11
-
12
- DEPENDENCIES
13
- teacup!
@@ -1,13 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- $:.unshift("/Library/RubyMotion/lib")
3
- require 'motion/project'
4
- require 'bundler'
5
- Bundler.require
6
-
7
- Motion::Project::App.setup do |app|
8
- # Use `rake config' to see complete project settings.
9
- app.name = 'AutoLayout'
10
-
11
- #include styles
12
- app.files += Dir.glob(File.join(app.project_dir, 'lib/**/*.rb'))
13
- end
@@ -1,12 +0,0 @@
1
- class AppDelegate
2
- def application(application, didFinishLaunchingWithOptions:launchOptions)
3
- @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
4
- myNavController = RootController.alloc.init
5
-
6
- @window.rootViewController = UINavigationController.alloc.initWithRootViewController(myNavController)
7
- @window.rootViewController.wantsFullScreenLayout = true
8
- @window.makeKeyAndVisible
9
-
10
- true
11
- end
12
- end
@@ -1,16 +0,0 @@
1
- class RootController < UIViewController
2
- stylesheet :root
3
-
4
- layout :root do
5
- @label = subview(UILabel, :label)
6
- @button = subview(UIButton.buttonWithType(UIButtonTypeRoundedRect), :button)
7
- @switch = subview(UISwitch, :switch)
8
- end
9
-
10
- def viewDidLoad
11
- super
12
- # Title for this view
13
- self.title = "Autolayout Example"
14
- end
15
-
16
- end
@@ -1,29 +0,0 @@
1
- Teacup::Stylesheet.new :root do
2
- import :base
3
-
4
- v_padding = 10
5
-
6
- style :label, extends: :custom_label,
7
- constraints: [
8
- :full_width,
9
- constrain_top(50)
10
- ],
11
- backgroundColor: UIColor.clearColor
12
-
13
- style :button, extends: :custom_button,
14
- constraints: [
15
- constrain_below(:label).plus(v_padding),
16
- # Position at half of middle (q1)
17
- constrain(:center_x).equals(:superview, :center_x).times(0.5),
18
- constrain(:left).equals(:superview, :left).plus(10)
19
- ]
20
-
21
- style :switch, extends: :custom_switch,
22
- constraints: [
23
- constrain_below(:label).plus(v_padding * 2),
24
- # Position at Middle + half (75%)
25
- constrain(:center_x).equals(:superview, :center_x).times(1.5)
26
- ]
27
-
28
- end
29
-
@@ -1,2 +0,0 @@
1
- # for when I come across one of those silly precompile issues
2
- # that is not yet supported by teacup
@@ -1,3 +0,0 @@
1
- Teacup.handler UIView, :nav_btn_tint do |color|
2
- UIBarButtonItem.appearance.setTintColor(color)
3
- end
@@ -1,33 +0,0 @@
1
- Teacup::Stylesheet.new :base do
2
- back_color = UIColor.grayColor
3
- dark_color = UIColor.blackColor
4
- mid_color = UIColor.redColor
5
-
6
- style UIView,
7
- backgroundColor: back_color,
8
- nav_btn_tint: mid_color
9
-
10
- style :custom_label,
11
- text: 'App Stuff!',
12
- backgroundColor: UIColor.clearColor,
13
- numberOfLines: 0,
14
- font: UIFont.boldSystemFontOfSize(40),
15
- textColor: UIColor.whiteColor,
16
- shadowColor: UIColor.blackColor,
17
- textAlignment: UITextAlignmentCenter,
18
- layer: {
19
- transform: identity,
20
- shadowRadius: 20,
21
- shadowOpacity: 0.5,
22
- masksToBounds: false
23
- }
24
-
25
- style :custom_button,
26
- width: 142,
27
- height: 34,
28
- title: "Button"
29
-
30
- style :custom_switch,
31
- on: true
32
-
33
- end
@@ -1,5 +0,0 @@
1
- .repl_history
2
- build
3
- resources/*.nib
4
- resources/*.momd
5
- resources/*.storyboardc
@@ -1 +0,0 @@
1
- gem 'teacup', :path => '../../..'
@@ -1,13 +0,0 @@
1
- PATH
2
- remote: ../..
3
- specs:
4
- teacup (2.0.2)
5
-
6
- GEM
7
- specs:
8
-
9
- PLATFORMS
10
- ruby
11
-
12
- DEPENDENCIES
13
- teacup!
@@ -1,12 +0,0 @@
1
- $:.unshift("/Library/RubyMotion/lib")
2
- require 'motion/project/template/ios'
3
- require 'bundler'
4
- Bundler.require
5
-
6
-
7
- Motion::Project::App.setup do |app|
8
- app.name = 'Hai'
9
- app.identifier = 'com.rubymotion.Hai'
10
-
11
- app.device_family = :iphone
12
- end
@@ -1,9 +0,0 @@
1
- class AppDelegate
2
- def application(application, didFinishLaunchingWithOptions:launchOptions)
3
- @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
4
- @window.rootViewController = HaiViewController.alloc.init
5
- @window.makeKeyAndVisible
6
-
7
- true
8
- end
9
- end
@@ -1,13 +0,0 @@
1
- class HaiViewController < UIViewController
2
- stylesheet :iphone
3
-
4
- layout :hai do
5
- @a = subview(UILabel, :label)
6
- @b = subview(UILabel, :footer)
7
- end
8
-
9
- def shouldAutorotateToInterfaceOrientation(orientation)
10
- autorotateToOrientation(orientation)
11
- end
12
-
13
- end
@@ -1,47 +0,0 @@
1
-
2
- Teacup::Stylesheet.new(:iphone) do
3
- label_color = UIColor.blueColor
4
-
5
- style :hai,
6
- landscape: true
7
-
8
- style UILabel,
9
- textColor: label_color
10
-
11
- style :label,
12
- text: 'Hai!',
13
- backgroundColor: UIColor.whiteColor,
14
- portrait: {
15
- layer: {
16
- transform: transform_layer.identity,
17
- },
18
- top: 10,
19
- left: 100,
20
- height: 20,
21
- width: 50
22
- },
23
- landscape_left: {
24
- layer: {
25
- transform: transform_layer.rotate(pi/6, 0.3, 0.3, 0.3)
26
- },
27
- top: 40,
28
- left: 100,
29
- height: 20,
30
- width: 75
31
- }
32
-
33
- style :footer,
34
- text: 'brought to you by teacup',
35
- backgroundColor: UIColor.lightGrayColor,
36
- width: 200,
37
- height: 20,
38
- portrait: {
39
- top: 440,
40
- left: 120,
41
- },
42
- landscape: {
43
- top: 280,
44
- left: 280,
45
- }
46
-
47
- end
@@ -1,5 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'teacup', :path => '../../..'
4
- gem 'sugarcube'
5
- gem 'sweettea'
@@ -1,23 +0,0 @@
1
- PATH
2
- remote: ../..
3
- specs:
4
- teacup (2.0.2)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- rake (10.0.4)
10
- sugarcube (0.20.18)
11
- sweettea (0.5.6)
12
- rake
13
- sugarcube
14
- teacup
15
-
16
- PLATFORMS
17
- ruby
18
-
19
- DEPENDENCIES
20
- rake
21
- sugarcube
22
- sweettea
23
- teacup!
@@ -1,11 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- $:.unshift("/Library/RubyMotion/lib")
3
- require 'motion/project/template/ios'
4
- require 'bundler'
5
- Bundler.require
6
-
7
-
8
- Motion::Project::App.setup do |app|
9
- # Use `rake config' to see complete project settings.
10
- app.name = 'Sweettea Example'
11
- end
@@ -1,43 +0,0 @@
1
- include SugarCube::Adjust
2
-
3
- class AppDelegate
4
- def application(application, didFinishLaunchingWithOptions:launchOptions)
5
- @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
6
- ctlr = MyController.new
7
- first = UINavigationController.alloc.initWithRootViewController(ctlr)
8
- @window.rootViewController = first
9
- @window.makeKeyAndVisible
10
-
11
- true
12
- end
13
- end
14
-
15
-
16
- Teacup::Stylesheet.new(:teacup) do
17
- style :label,
18
- color: :white,
19
- background: :clear,
20
- constraints: [
21
- :center_x,
22
- :center_y,
23
- ]
24
-
25
- style :button,
26
- title: 'neat.',
27
- constraints: [
28
- :center_x,
29
- constrain_below(:label).plus(0),
30
- ]
31
-
32
- end
33
-
34
-
35
- class MyController < UIViewController
36
- stylesheet :teacup
37
-
38
- layout do
39
- @label = subview(UILabel, :label, text: 'nifty?')
40
- @button = subview(UIButton.rounded, :button)
41
- end
42
-
43
- end
@@ -1 +0,0 @@
1
- gem 'teacup', :path => '../../..'
@@ -1,13 +0,0 @@
1
- PATH
2
- remote: ../..
3
- specs:
4
- teacup (2.0.2)
5
-
6
- GEM
7
- specs:
8
-
9
- PLATFORMS
10
- ruby
11
-
12
- DEPENDENCIES
13
- teacup!
@@ -1,7 +0,0 @@
1
- Tweets.app
2
-
3
- This sample demonstrates the following concepts: NSTableView, NSImageCell,
4
- JSON parsing and Grand Central Dispatch.
5
-
6
- The data_parser.rb, tweet.rb and json_parser.rb files are exactly the same
7
- as in the ios/Tweets sample.
@@ -1,10 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- $:.unshift("/Library/RubyMotion/lib")
3
- require 'motion/project/template/osx'
4
- require 'bundler'
5
- Bundler.require
6
-
7
- Motion::Project::App.setup do |app|
8
- # Use `rake config' to see complete project settings.
9
- app.name = 'Tweets'
10
- end
@@ -1,18 +0,0 @@
1
- class AppDelegate
2
- def applicationDidFinishLaunching(notification)
3
- buildMenu
4
- buildWindow
5
- end
6
-
7
- def buildWindow
8
- @controller = MainController.new
9
- @mainWindow = @controller.window
10
- # @mainWindow = NSWindow.alloc.initWithContentRect([[240, 180], [480, 360]],
11
- # styleMask: NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask,
12
- # backing: NSBackingStoreBuffered,
13
- # defer: false)
14
- @mainWindow.title = NSBundle.mainBundle.infoDictionary['CFBundleName']
15
- @mainWindow.orderFrontRegardless
16
- end
17
-
18
- end