maccman-bowline 0.3.3 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/assets/jquery.bowline.js +7 -5
- data/bowline.gemspec +3 -1
- data/lib/bowline/async.rb +29 -0
- data/lib/bowline/binders.rb +1 -1
- data/lib/bowline/tasks/app.rake +0 -1
- data/lib/bowline/version.rb +1 -1
- data/lib/bowline/window.rb +19 -0
- data/lib/bowline.rb +5 -10
- metadata +3 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.5
|
data/assets/jquery.bowline.js
CHANGED
@@ -107,10 +107,12 @@
|
|
107
107
|
};
|
108
108
|
|
109
109
|
$(function(){
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
110
|
+
setTimeout(function(){
|
111
|
+
$(document.body).trigger('loading.bowline');
|
112
|
+
var script = $("<script />");
|
113
|
+
script.attr('type', 'text/ruby');
|
114
|
+
script.attr('src', '../script/init');
|
115
|
+
$('head').append(script);
|
116
|
+
}, 100);
|
115
117
|
})
|
116
118
|
})(jQuery)
|
data/bowline.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{bowline}
|
5
|
-
s.version = "0.3.
|
5
|
+
s.version = "0.3.5"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Alex MacCaw"]
|
@@ -32,6 +32,7 @@ Gem::Specification.new do |s|
|
|
32
32
|
"examples/twitter.html",
|
33
33
|
"examples/users.rb",
|
34
34
|
"lib/bowline.rb",
|
35
|
+
"lib/bowline/async.rb",
|
35
36
|
"lib/bowline/binders.rb",
|
36
37
|
"lib/bowline/binders/collection.rb",
|
37
38
|
"lib/bowline/binders/singleton.rb",
|
@@ -74,6 +75,7 @@ Gem::Specification.new do |s|
|
|
74
75
|
"lib/bowline/tasks/log.rake",
|
75
76
|
"lib/bowline/tasks/misc.rake",
|
76
77
|
"lib/bowline/version.rb",
|
78
|
+
"lib/bowline/window.rb",
|
77
79
|
"templates/Rakefile",
|
78
80
|
"templates/binder.rb",
|
79
81
|
"templates/config/application.yml",
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Bowline
|
2
|
+
module Async
|
3
|
+
def self.included(base)
|
4
|
+
base.extend Methods
|
5
|
+
base.send :include, Methods
|
6
|
+
class << base
|
7
|
+
extend Methods
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
module Methods
|
12
|
+
def async(*methods)
|
13
|
+
methods.each {|meth|
|
14
|
+
define_method("#{meth}_with_async") {|*args|
|
15
|
+
callback = nil
|
16
|
+
if(args.last.is_a?(::RubyKMethod))
|
17
|
+
callback = args.pop
|
18
|
+
end
|
19
|
+
Thread.new do
|
20
|
+
res = send("#{meth}_without_async", *args)
|
21
|
+
callback.call(res) if callback
|
22
|
+
end
|
23
|
+
}
|
24
|
+
alias_method_chain meth, :async
|
25
|
+
}
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/bowline/binders.rb
CHANGED
data/lib/bowline/tasks/app.rake
CHANGED
data/lib/bowline/version.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
module Bowline
|
2
|
+
class Window
|
3
|
+
def self.window
|
4
|
+
defined?(Titanium) && Titanium.UI.mainWindow.window
|
5
|
+
end
|
6
|
+
|
7
|
+
def initialize(obj = self.window)
|
8
|
+
@object = obj
|
9
|
+
end
|
10
|
+
|
11
|
+
def method_missing(*args)
|
12
|
+
Bowline.logger.info "Sending to Window: #{args.inspect}"
|
13
|
+
if defined?(Titanium)
|
14
|
+
@object = @object.send(*args)
|
15
|
+
end
|
16
|
+
self
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/bowline.rb
CHANGED
@@ -1,16 +1,9 @@
|
|
1
|
+
Thread.abort_on_exception = true
|
2
|
+
|
1
3
|
module Bowline
|
2
4
|
# The raw JavaScript window object
|
3
5
|
def self.js
|
4
|
-
|
5
|
-
$app_window
|
6
|
-
else
|
7
|
-
Class.new {
|
8
|
-
def self.method_missing(*a)
|
9
|
-
Bowline.logger.info "Sending to Window: #{a.inspect}"
|
10
|
-
self
|
11
|
-
end
|
12
|
-
}
|
13
|
-
end
|
6
|
+
Window.new
|
14
7
|
end
|
15
8
|
|
16
9
|
# Change which page we're on
|
@@ -31,6 +24,8 @@ require 'bowline/ext/array'
|
|
31
24
|
require 'bowline/ext/class'
|
32
25
|
require 'bowline/ext/string'
|
33
26
|
|
27
|
+
require 'bowline/window'
|
28
|
+
require 'bowline/async'
|
34
29
|
require 'bowline/helpers'
|
35
30
|
require 'bowline/dependencies/lib/dependencies'
|
36
31
|
require 'bowline/initializer'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maccman-bowline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex MacCaw
|
@@ -58,6 +58,7 @@ files:
|
|
58
58
|
- examples/twitter.html
|
59
59
|
- examples/users.rb
|
60
60
|
- lib/bowline.rb
|
61
|
+
- lib/bowline/async.rb
|
61
62
|
- lib/bowline/binders.rb
|
62
63
|
- lib/bowline/binders/collection.rb
|
63
64
|
- lib/bowline/binders/singleton.rb
|
@@ -100,6 +101,7 @@ files:
|
|
100
101
|
- lib/bowline/tasks/log.rake
|
101
102
|
- lib/bowline/tasks/misc.rake
|
102
103
|
- lib/bowline/version.rb
|
104
|
+
- lib/bowline/window.rb
|
103
105
|
- templates/Rakefile
|
104
106
|
- templates/binder.rb
|
105
107
|
- templates/config/application.yml
|