under-os 1.3.0 → 1.4.0
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.
- checksums.yaml +4 -4
- data/Gemfile +4 -0
- data/Gemfile.lock +25 -2
- data/README.md +1 -1
- data/Rakefile +2 -4
- data/lib/under-os.rb +3 -8
- data/under-os.gemspec +6 -2
- metadata +47 -191
- data/lib/assets/fontawesome-webfont.ttf +0 -0
- data/lib/assets/under-os.css +0 -115
- data/lib/under_os.rb +0 -41
- data/lib/under_os/app.rb +0 -33
- data/lib/under_os/color.rb +0 -184
- data/lib/under_os/config.rb +0 -33
- data/lib/under_os/core/array.rb +0 -5
- data/lib/under_os/core/hash.rb +0 -10
- data/lib/under_os/core/json.rb +0 -19
- data/lib/under_os/core/kernel.rb +0 -16
- data/lib/under_os/core/numeric.rb +0 -23
- data/lib/under_os/core/object.rb +0 -9
- data/lib/under_os/core/string.rb +0 -80
- data/lib/under_os/delegate.rb +0 -10
- data/lib/under_os/events.rb +0 -85
- data/lib/under_os/file.rb +0 -110
- data/lib/under_os/history.rb +0 -53
- data/lib/under_os/http.rb +0 -31
- data/lib/under_os/http/cookies.rb +0 -30
- data/lib/under_os/http/receiver.rb +0 -44
- data/lib/under_os/http/request.rb +0 -106
- data/lib/under_os/http/response.rb +0 -28
- data/lib/under_os/http/session.rb +0 -49
- data/lib/under_os/page.rb +0 -169
- data/lib/under_os/page/builder.rb +0 -96
- data/lib/under_os/page/layout.rb +0 -43
- data/lib/under_os/page/matcher.rb +0 -128
- data/lib/under_os/page/stylesheet.rb +0 -67
- data/lib/under_os/parser.rb +0 -24
- data/lib/under_os/parser/css.rb +0 -37
- data/lib/under_os/parser/html.rb +0 -97
- data/lib/under_os/point.rb +0 -47
- data/lib/under_os/screen.rb +0 -9
- data/lib/under_os/timer.rb +0 -65
- data/lib/under_os/ui.rb +0 -3
- data/lib/under_os/ui/alert.rb +0 -52
- data/lib/under_os/ui/button.rb +0 -42
- data/lib/under_os/ui/collection.rb +0 -65
- data/lib/under_os/ui/collection/cell.rb +0 -21
- data/lib/under_os/ui/collection/delegate.rb +0 -70
- data/lib/under_os/ui/collection/item.rb +0 -32
- data/lib/under_os/ui/collection/layout.rb +0 -43
- data/lib/under_os/ui/collection/styles.rb +0 -15
- data/lib/under_os/ui/div.rb +0 -3
- data/lib/under_os/ui/form.rb +0 -60
- data/lib/under_os/ui/icon.rb +0 -61
- data/lib/under_os/ui/icon/awesome.rb +0 -376
- data/lib/under_os/ui/icon/engine.rb +0 -10
- data/lib/under_os/ui/image.rb +0 -31
- data/lib/under_os/ui/input.rb +0 -140
- data/lib/under_os/ui/label.rb +0 -21
- data/lib/under_os/ui/locker.rb +0 -42
- data/lib/under_os/ui/navbar.rb +0 -123
- data/lib/under_os/ui/progress.rb +0 -17
- data/lib/under_os/ui/scroll.rb +0 -41
- data/lib/under_os/ui/select.rb +0 -95
- data/lib/under_os/ui/sidebar.rb +0 -45
- data/lib/under_os/ui/slider.rb +0 -37
- data/lib/under_os/ui/spinner.rb +0 -23
- data/lib/under_os/ui/style.rb +0 -21
- data/lib/under_os/ui/style/fonts.rb +0 -54
- data/lib/under_os/ui/style/margins.rb +0 -164
- data/lib/under_os/ui/style/outlining.rb +0 -170
- data/lib/under_os/ui/style/positioning.rb +0 -169
- data/lib/under_os/ui/switch.rb +0 -26
- data/lib/under_os/ui/textarea.rb +0 -19
- data/lib/under_os/ui/utils/animation.rb +0 -99
- data/lib/under_os/ui/utils/commons.rb +0 -70
- data/lib/under_os/ui/utils/dimensions.rb +0 -37
- data/lib/under_os/ui/utils/events.rb +0 -170
- data/lib/under_os/ui/utils/manipulation.rb +0 -44
- data/lib/under_os/ui/utils/position.rb +0 -21
- data/lib/under_os/ui/utils/size.rb +0 -21
- data/lib/under_os/ui/utils/styles.rb +0 -89
- data/lib/under_os/ui/utils/traversing.rb +0 -44
- data/lib/under_os/ui/utils/wrap.rb +0 -77
- data/lib/under_os/ui/view.rb +0 -31
- data/resources/test.png +0 -0
- data/spec/assets/app.css +0 -13
- data/spec/assets/test.css +0 -7
- data/spec/assets/test.html +0 -3
- data/spec/assets/test_page.rb +0 -2
- data/spec/lib/core/hash_spec.rb +0 -19
- data/spec/lib/core/json_spec.rb +0 -32
- data/spec/lib/core/numeric_spec.rb +0 -37
- data/spec/lib/core/string_spec.rb +0 -121
- data/spec/lib/under_os/color_spec.rb +0 -133
- data/spec/lib/under_os/events_spec.rb +0 -71
- data/spec/lib/under_os/file_spec.rb +0 -98
- data/spec/lib/under_os/http/cookies_spec.rb +0 -13
- data/spec/lib/under_os/http/request_spec.rb +0 -44
- data/spec/lib/under_os/http_spec.rb +0 -20
- data/spec/lib/under_os/page/builder_spec.rb +0 -128
- data/spec/lib/under_os/page/layout_spec.rb +0 -18
- data/spec/lib/under_os/page/matcher_spec.rb +0 -260
- data/spec/lib/under_os/page/stylesheet_spec.rb +0 -83
- data/spec/lib/under_os/page_spec.rb +0 -5
- data/spec/lib/under_os/parser/css_spec.rb +0 -77
- data/spec/lib/under_os/parser/html_spec.rb +0 -152
- data/spec/lib/under_os/parser_spec.rb +0 -16
- data/spec/lib/under_os/point_spec.rb +0 -54
- data/spec/lib/under_os/screen_spec.rb +0 -11
- data/spec/lib/under_os/timer_spec.rb +0 -93
- data/spec/lib/under_os/ui/button_spec.rb +0 -50
- data/spec/lib/under_os/ui/collection_spec.rb +0 -19
- data/spec/lib/under_os/ui/div_spec.rb +0 -24
- data/spec/lib/under_os/ui/form_spec.rb +0 -156
- data/spec/lib/under_os/ui/icon_spec.rb +0 -57
- data/spec/lib/under_os/ui/image_spec.rb +0 -39
- data/spec/lib/under_os/ui/input_spec.rb +0 -109
- data/spec/lib/under_os/ui/label_spec.rb +0 -22
- data/spec/lib/under_os/ui/locker_spec.rb +0 -31
- data/spec/lib/under_os/ui/progress_spec.rb +0 -31
- data/spec/lib/under_os/ui/scroll_spec.rb +0 -40
- data/spec/lib/under_os/ui/select_spec.rb +0 -135
- data/spec/lib/under_os/ui/sidebar_spec.rb +0 -35
- data/spec/lib/under_os/ui/slider_spec.rb +0 -69
- data/spec/lib/under_os/ui/spinner_spec.rb +0 -57
- data/spec/lib/under_os/ui/style/fonts_spec.rb +0 -73
- data/spec/lib/under_os/ui/style/margins_spec.rb +0 -106
- data/spec/lib/under_os/ui/style/outlining_spec.rb +0 -101
- data/spec/lib/under_os/ui/style/positioning_spec.rb +0 -69
- data/spec/lib/under_os/ui/style_spec.rb +0 -19
- data/spec/lib/under_os/ui/switch_spec.rb +0 -60
- data/spec/lib/under_os/ui/textarea_spec.rb +0 -34
- data/spec/lib/under_os/ui/utils/commons_spec.rb +0 -81
- data/spec/lib/under_os/ui/utils/events_spec.rb +0 -87
- data/spec/lib/under_os/ui/utils/manipulation_spec.rb +0 -130
- data/spec/lib/under_os/ui/utils/styles_spec.rb +0 -140
- data/spec/lib/under_os/ui/utils/traversing_spec.rb +0 -124
- data/spec/lib/under_os/ui/utils/wrap_spec.rb +0 -69
- data/spec/lib/under_os/ui/view_spec.rb +0 -39
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
describe UnderOs::UI::Wrap do
|
|
2
|
-
|
|
3
|
-
describe 'with raw iOS ui instances' do
|
|
4
|
-
def wrap_class_for(raw_class)
|
|
5
|
-
raw = raw_class.alloc.initWithFrame([[0,0],[0,0]])
|
|
6
|
-
UnderOs::UI::View.new(raw).class
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
it "should wrap correctly simple views" do
|
|
10
|
-
wrap_class_for(UIView).should == UnderOs::UI::View
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
it "should wrap buttons correctly" do
|
|
14
|
-
wrap_class_for(UIButton).should == UnderOs::UI::Button
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
it "should wrap labels correctly" do
|
|
18
|
-
wrap_class_for(UILabel).should == UnderOs::UI::Label
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it "should wrap images correctly" do
|
|
22
|
-
wrap_class_for(UIImageView).should == UnderOs::UI::Image
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it "should return the same wrapper for the same uiview all the time" do
|
|
26
|
-
raw = UIView.alloc.initWithFrame([[0,0],[0,0]])
|
|
27
|
-
inst = UnderOs::UI::View.new(raw)
|
|
28
|
-
|
|
29
|
-
UnderOs::UI::View.new(raw).should.be.same_as inst
|
|
30
|
-
UnderOs::UI::View.new(raw).should.be.same_as inst
|
|
31
|
-
UnderOs::UI::View.new(raw).should.be.same_as inst
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
describe 'initialization' do
|
|
36
|
-
before do
|
|
37
|
-
@view = UnderOs::UI::View.new
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
it "should build a raw uiview object" do
|
|
41
|
-
@view._.class.should == UIView
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
it "should register the raw view in the cache" do
|
|
45
|
-
UnderOs::UI::View.new(@view._).should.be.same_as @view
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
describe 'weird subclasses' do
|
|
50
|
-
|
|
51
|
-
class WeirdView < UnderOs::UI::View
|
|
52
|
-
attr_reader :a, :b, :c
|
|
53
|
-
def initialize(a,b,c)
|
|
54
|
-
super({})
|
|
55
|
-
@a = a
|
|
56
|
-
@b = b
|
|
57
|
-
@c = c
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
it "should anny arguments for the constructor" do
|
|
62
|
-
view = WeirdView.new(1, 2, 3)
|
|
63
|
-
view.a.should == 1
|
|
64
|
-
view.b.should == 2
|
|
65
|
-
view.c.should == 3
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
end
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
describe UnderOs::UI::View do
|
|
2
|
-
before do
|
|
3
|
-
@view = UnderOs::UI::View.new
|
|
4
|
-
end
|
|
5
|
-
|
|
6
|
-
describe '#initialize' do
|
|
7
|
-
it "should make UnderOs::UI::View instances" do
|
|
8
|
-
@view.class.should == UnderOs::UI::View
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
it "should wrap an UIView instance" do
|
|
12
|
-
@view._.class.should == UIView
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
it "should say its tag name is 'VIEW'" do
|
|
16
|
-
@view.tagName.should == 'VIEW'
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
it "should allow build views with IDs" do
|
|
20
|
-
view = UnderOs::UI::View.new(id: 'my-view')
|
|
21
|
-
view.id.should == 'my-view'
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
it "should allow build views with class names" do
|
|
25
|
-
view = UnderOs::UI::View.new(class: 'my-class another-class')
|
|
26
|
-
view.className.should == 'my-class another-class'
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it "should accept the 'data' option" do
|
|
30
|
-
view = UnderOs::UI::View.new(data: {some: 'value'})
|
|
31
|
-
view.data.should == {some: 'value'}
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
it "should accept the 'style' option" do
|
|
35
|
-
view = UnderOs::UI::View.new(style: {width: 200})
|
|
36
|
-
view.style.width.should == 200
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|