bowline 0.6.3 → 0.9.1
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.
- data/README.txt +8 -4
- data/Rakefile +3 -2
- data/TODO +1 -4
- data/VERSION +1 -1
- data/assets/application.js +0 -0
- data/assets/bowline.chain.js +87 -0
- data/assets/bowline.js +144 -300
- data/assets/superclass.js +93 -0
- data/bowline.gemspec +11 -12
- data/examples/example.js +1 -1
- data/examples/twitter.html +1 -2
- data/lib/bowline/app_config.rb +11 -1
- data/lib/bowline/binders.rb +31 -12
- data/lib/bowline/desktop/bridge.rb +1 -1
- data/lib/bowline/desktop/js.rb +3 -3
- data/lib/bowline/desktop/window.rb +3 -3
- data/lib/bowline/desktop/window_manager.rb +7 -2
- data/lib/bowline/desktop/window_methods.rb +1 -1
- data/lib/bowline/generators.rb +45 -13
- data/lib/bowline/generators/application.rb +6 -4
- data/lib/bowline/generators/model.rb +1 -6
- data/lib/bowline/initializer.rb +8 -16
- data/lib/bowline/tasks/app.rake +11 -2
- data/lib/bowline/version.rb +2 -2
- data/templates/Gemfile +1 -2
- data/templates/config/boot.rb +3 -2
- data/templates/model.rb +1 -3
- data/templates/public/index.html +3 -2
- metadata +25 -13
- data/assets/animations.css +0 -92
- data/assets/bowline.menu.js +0 -81
- data/assets/bowline.state.js +0 -66
- data/assets/bowline.test.js +0 -86
- data/assets/bowline.view.js +0 -108
- data/assets/jquery.dataset.js +0 -167
- data/assets/json2.js +0 -479
@@ -39,11 +39,13 @@ module Bowline::Generators
|
|
39
39
|
glob! "public/stylesheets"
|
40
40
|
|
41
41
|
glob! "script", [nil]
|
42
|
+
chmod "script", :mode => 0755
|
42
43
|
|
43
|
-
file :jquery,
|
44
|
-
file :chainjs,
|
45
|
-
file :
|
46
|
-
file :bowlinejs,
|
44
|
+
file :jquery, "../assets/jquery.js", "public/javascripts/jquery.js"
|
45
|
+
file :chainjs, "../assets/jquery.chain.js", "public/javascripts/jquery.chain.js"
|
46
|
+
file :superclassjs, "../assets/superclass.js", "public/javascripts/superclass.js"
|
47
|
+
file :bowlinejs, "../assets/bowline.js", "public/javascripts/bowline.js"
|
48
|
+
file :bowlinechainjs, "../assets/bowline.chain.js", "public/javascripts/bowline.chain.js"
|
47
49
|
|
48
50
|
empty_directory :app, "app"
|
49
51
|
empty_directory :models, "app/models"
|
@@ -5,11 +5,7 @@ module Bowline::Generators
|
|
5
5
|
DESC
|
6
6
|
|
7
7
|
def class_name
|
8
|
-
|
9
|
-
super + " < SuperModel::Base"
|
10
|
-
else
|
11
|
-
super + " < ActiveRecord::Base"
|
12
|
-
end
|
8
|
+
super + " < SuperModel::Base"
|
13
9
|
end
|
14
10
|
|
15
11
|
def modules
|
@@ -17,7 +13,6 @@ module Bowline::Generators
|
|
17
13
|
end
|
18
14
|
|
19
15
|
first_argument :name, :required => true, :desc => "model name"
|
20
|
-
second_argument :local, :required => false
|
21
16
|
|
22
17
|
template :model do |template|
|
23
18
|
template.source = "model.rb"
|
data/lib/bowline/initializer.rb
CHANGED
@@ -7,6 +7,7 @@ module Bowline
|
|
7
7
|
def configuration
|
8
8
|
@@configuration
|
9
9
|
end
|
10
|
+
alias_method :conf, :configuration
|
10
11
|
|
11
12
|
def configuration=(configuration) #:nodoc:
|
12
13
|
@@configuration = configuration
|
@@ -227,7 +228,9 @@ module Bowline
|
|
227
228
|
end
|
228
229
|
|
229
230
|
def load_application_environment
|
230
|
-
|
231
|
+
config = configuration
|
232
|
+
path = Bowline.root.join(*%w{config environments}, Bowline.env + ".rb").to_s
|
233
|
+
eval(IO.read(path), binding, path)
|
231
234
|
end
|
232
235
|
|
233
236
|
def load_application_initializers
|
@@ -269,17 +272,6 @@ module Bowline
|
|
269
272
|
end
|
270
273
|
end
|
271
274
|
|
272
|
-
# For Ruby 1.8, this initialization sets $KCODE to 'u' to enable the
|
273
|
-
# multibyte safe operations. Plugin authors supporting other encodings
|
274
|
-
# should override this behaviour and set the relevant +default_charset+
|
275
|
-
# on ActionController::Base.
|
276
|
-
#
|
277
|
-
# For Ruby 1.9, this does nothing. Specify the default encoding in the Ruby
|
278
|
-
# shebang line if you don't want UTF-8.
|
279
|
-
def initialize_encoding
|
280
|
-
$KCODE='u' if RUBY_VERSION < '1.9'
|
281
|
-
end
|
282
|
-
|
283
275
|
def initialize_name
|
284
276
|
unless configuration.name
|
285
277
|
raise "You must provide an application name in environment.rb"
|
@@ -337,13 +329,14 @@ module Bowline
|
|
337
329
|
set_load_path
|
338
330
|
load_gems
|
339
331
|
|
332
|
+
load_application_environment
|
333
|
+
|
340
334
|
require_frameworks
|
341
335
|
set_autoload_paths
|
342
336
|
add_plugin_load_paths
|
343
337
|
initialize_dependency_mechanism
|
344
338
|
disable_dependency_loading
|
345
339
|
|
346
|
-
initialize_encoding
|
347
340
|
initialize_database
|
348
341
|
|
349
342
|
initialize_logger
|
@@ -363,12 +356,11 @@ module Bowline
|
|
363
356
|
load_application_helpers
|
364
357
|
|
365
358
|
initialize_desktop
|
359
|
+
initialize_marshal
|
366
360
|
initialize_windows
|
367
361
|
initialize_trap
|
368
362
|
initialize_path
|
369
|
-
|
370
|
-
|
371
|
-
load_application_environment
|
363
|
+
|
372
364
|
load_application_initializers
|
373
365
|
load_application_first_run
|
374
366
|
|
data/lib/bowline/tasks/app.rake
CHANGED
@@ -19,11 +19,16 @@ namespace :app do
|
|
19
19
|
app_path = File.join(build_path, "#{config.name}.zip")
|
20
20
|
FileUtils.rm_rf(app_path)
|
21
21
|
|
22
|
-
dirs = Dir[Bowline.root.join("
|
23
|
-
dirs.delete(build_path)
|
22
|
+
dirs = Dir[Bowline.root.join("**").to_s]
|
23
|
+
dirs.delete(build_path.to_s)
|
24
24
|
dirs.delete(Bowline.root.join("log").to_s)
|
25
25
|
dirs.delete(Bowline.root.join(*%w{db migrate}).to_s)
|
26
26
|
dirs.delete_if {|i| i =~ /\.svn|\.DS_Store|\.git/ }
|
27
|
+
|
28
|
+
bundle_dir = Bowline.root.join(".bundle")
|
29
|
+
dirs += bundle_dir if bundle_dir.exist?
|
30
|
+
|
31
|
+
dirs = Dir[*dirs.map {|d| "#{d}/**/**" }]
|
27
32
|
|
28
33
|
Zip::ZipFile.open(app_path, Zip::ZipFile::CREATE) do |zf|
|
29
34
|
# This is horrible - but RubyZIP's API sucks
|
@@ -80,6 +85,10 @@ namespace :app do
|
|
80
85
|
dirs.delete(File.join(APP_ROOT, "log"))
|
81
86
|
dirs.delete(File.join(APP_ROOT, *%w{db migrate}))
|
82
87
|
dirs.delete_if {|i| i =~ /\.svn|\.DS_Store|\.git/ }
|
88
|
+
|
89
|
+
bundle_dir = File.join(APP_ROOT, ".bundle")
|
90
|
+
dirs << bundle_dir if File.exist?(bundle_dir)
|
91
|
+
|
83
92
|
FileUtils.cp_r(dirs, ".")
|
84
93
|
|
85
94
|
FileUtils.touch("app_production")
|
data/lib/bowline/version.rb
CHANGED
data/templates/Gemfile
CHANGED
data/templates/config/boot.rb
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), "..")) unless defined?(APP_ROOT)
|
2
2
|
|
3
|
+
require "rubygems"
|
4
|
+
|
3
5
|
# Use Bundler (preferred)
|
4
6
|
environment = File.expand_path("../../vendor/gems/environment", __FILE__)
|
5
7
|
if File.exist?("#{environment}.rb")
|
6
8
|
require environment
|
7
9
|
|
8
10
|
# Use RubyGems
|
9
|
-
else
|
10
|
-
require "rubygems"
|
11
|
+
else
|
11
12
|
require "bundler"
|
12
13
|
Bundler.setup
|
13
14
|
end
|
data/templates/model.rb
CHANGED
data/templates/public/index.html
CHANGED
@@ -6,13 +6,14 @@
|
|
6
6
|
<link rel="stylesheet" href="stylesheets/application.css" type="text/css" charset="utf-8">
|
7
7
|
<script src="javascripts/jquery.js" type="text/javascript" charset="utf-8"></script>
|
8
8
|
<script src="javascripts/jquery.chain.js" type="text/javascript" charset="utf-8"></script>
|
9
|
-
|
9
|
+
<script src="javascripts/superclass.js" type="text/javascript" charset="utf-8"></script>
|
10
10
|
<script src="javascripts/bowline.js" type="text/javascript" charset="utf-8"></script>
|
11
|
+
<script src="javascripts/bowline.chain.js" type="text/javascript" charset="utf-8"></script>
|
11
12
|
<script src="javascripts/application.js" type="text/javascript" charset="utf-8"></script>
|
12
13
|
<script type="text/javascript" charset="utf-8">
|
13
14
|
// Binder Example:
|
14
15
|
// jQuery(function($){
|
15
|
-
// $('#tweets').
|
16
|
+
// $('#tweets').bowlineChain('TweetsBinder');
|
16
17
|
// });
|
17
18
|
</script>
|
18
19
|
</head>
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
7
|
+
- 9
|
8
|
+
- 1
|
9
|
+
version: 0.9.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Alex MacCaw
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-05-21 00:00:00 -04:00
|
18
18
|
default_executable: bowline-gen
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -61,7 +61,7 @@ dependencies:
|
|
61
61
|
type: :runtime
|
62
62
|
version_requirements: *id003
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
|
-
name:
|
64
|
+
name: bundler08
|
65
65
|
prerelease: false
|
66
66
|
requirement: &id004 !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
@@ -69,9 +69,25 @@ dependencies:
|
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
segments:
|
71
71
|
- 0
|
72
|
-
|
72
|
+
- 8
|
73
|
+
- 5
|
74
|
+
version: 0.8.5
|
73
75
|
type: :runtime
|
74
76
|
version_requirements: *id004
|
77
|
+
- !ruby/object:Gem::Dependency
|
78
|
+
name: supermodel
|
79
|
+
prerelease: false
|
80
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
segments:
|
85
|
+
- 0
|
86
|
+
- 1
|
87
|
+
- 3
|
88
|
+
version: 0.1.3
|
89
|
+
type: :runtime
|
90
|
+
version_requirements: *id005
|
75
91
|
description: Ruby/JS GUI framework
|
76
92
|
email: alex@leadthinking.com
|
77
93
|
executables:
|
@@ -89,19 +105,15 @@ files:
|
|
89
105
|
- Rakefile
|
90
106
|
- TODO
|
91
107
|
- VERSION
|
92
|
-
- assets/
|
108
|
+
- assets/application.js
|
109
|
+
- assets/bowline.chain.js
|
93
110
|
- assets/bowline.js
|
94
|
-
- assets/bowline.menu.js
|
95
|
-
- assets/bowline.state.js
|
96
|
-
- assets/bowline.test.js
|
97
|
-
- assets/bowline.view.js
|
98
111
|
- assets/jquery.chain.js
|
99
|
-
- assets/jquery.dataset.js
|
100
112
|
- assets/jquery.js
|
101
|
-
- assets/json2.js
|
102
113
|
- assets/osx/Info.plist.erb
|
103
114
|
- assets/osx/bowline.png
|
104
115
|
- assets/osx/makeicns
|
116
|
+
- assets/superclass.js
|
105
117
|
- bin/bowline-gen
|
106
118
|
- bowline.gemspec
|
107
119
|
- examples/example.js
|
data/assets/animations.css
DELETED
@@ -1,92 +0,0 @@
|
|
1
|
-
.drag {
|
2
|
-
-webkit-user-drag: element;
|
3
|
-
-webkit-user-select: none;
|
4
|
-
}
|
5
|
-
|
6
|
-
.in, .out {
|
7
|
-
-webkit-animation-timing-function: ease-in-out;
|
8
|
-
-webkit-animation-duration: 350ms;
|
9
|
-
}
|
10
|
-
|
11
|
-
.slideup.in {
|
12
|
-
-webkit-animation-name: slideupbottom;
|
13
|
-
z-index: 10;
|
14
|
-
}
|
15
|
-
|
16
|
-
.slideup.out {
|
17
|
-
-webkit-animation-name: slideuptop;
|
18
|
-
z-index: 0;
|
19
|
-
}
|
20
|
-
|
21
|
-
.slidedown.in {
|
22
|
-
-webkit-animation-name: slidedowntop;
|
23
|
-
z-index: 10;
|
24
|
-
}
|
25
|
-
|
26
|
-
.slidedown.out {
|
27
|
-
-webkit-animation-name: slidedownbottom;
|
28
|
-
z-index: 0;
|
29
|
-
}
|
30
|
-
|
31
|
-
@-webkit-keyframes dontmove {
|
32
|
-
from { opacity: 1; }
|
33
|
-
to { opacity: 1; }
|
34
|
-
}
|
35
|
-
|
36
|
-
@-webkit-keyframes slideuptop {
|
37
|
-
from { -webkit-transform: translateY(0); }
|
38
|
-
to { -webkit-transform: translateY(-100%); }
|
39
|
-
}
|
40
|
-
|
41
|
-
@-webkit-keyframes slideupbottom {
|
42
|
-
from { -webkit-transform: translateY(100%); }
|
43
|
-
to { -webkit-transform: translateY(0); }
|
44
|
-
}
|
45
|
-
|
46
|
-
@-webkit-keyframes slidedowntop {
|
47
|
-
from { -webkit-transform: translateY(-100%); }
|
48
|
-
to { -webkit-transform: translateY(0); }
|
49
|
-
}
|
50
|
-
|
51
|
-
@-webkit-keyframes slidedownbottom {
|
52
|
-
from { -webkit-transform: translateY(0); }
|
53
|
-
to { -webkit-transform: translateY(100%); }
|
54
|
-
}
|
55
|
-
|
56
|
-
.explode.in {
|
57
|
-
-webkit-animation-name: explodein;
|
58
|
-
}
|
59
|
-
|
60
|
-
.explode.out {
|
61
|
-
-webkit-animation-name: explodeout;
|
62
|
-
}
|
63
|
-
|
64
|
-
@-webkit-keyframes explodein {
|
65
|
-
from { -webkit-transform: scale(1.3); opacity: 0; }
|
66
|
-
to { -webkit-transform: scale(1); opacity: 1; }
|
67
|
-
}
|
68
|
-
|
69
|
-
@-webkit-keyframes explodeout {
|
70
|
-
from { -webkit-transform: scale(1); opacity: 1; }
|
71
|
-
to { -webkit-transform: scale(1.3); opacity: 0; }
|
72
|
-
}
|
73
|
-
|
74
|
-
.fade.in {
|
75
|
-
z-index: 10;
|
76
|
-
-webkit-animation-name: fadein;
|
77
|
-
}
|
78
|
-
|
79
|
-
.fade.out {
|
80
|
-
z-index: 0;
|
81
|
-
-webkit-animation-name: fadeout;
|
82
|
-
}
|
83
|
-
|
84
|
-
@-webkit-keyframes fadein {
|
85
|
-
from { opacity: 0; }
|
86
|
-
to { opacity: 1; }
|
87
|
-
}
|
88
|
-
|
89
|
-
@-webkit-keyframes fadeout {
|
90
|
-
from { opacity: 1; }
|
91
|
-
to { opacity: 0; }
|
92
|
-
}
|
data/assets/bowline.menu.js
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
var BowlineMenu = function(element, options){
|
2
|
-
var defaults = {childSelector: "li", trace: false};
|
3
|
-
this.options = jQuery.extend({}, defaults, options);
|
4
|
-
|
5
|
-
this.element = jQuery(element);
|
6
|
-
|
7
|
-
if(this.options.current) this.change(this.options.current);
|
8
|
-
|
9
|
-
var self = this;
|
10
|
-
this.elements().click(function(){
|
11
|
-
var view = self.viewName(this);
|
12
|
-
self.change(view);
|
13
|
-
});
|
14
|
-
};
|
15
|
-
|
16
|
-
BowlineMenu.fn = BowlineMenu.prototype;
|
17
|
-
|
18
|
-
BowlineMenu.fn.log = function(){
|
19
|
-
if( !this.options.trace ) return;
|
20
|
-
var args = jQuery.makeArray(arguments);
|
21
|
-
args.unshift("(BowlineMenu)");
|
22
|
-
console.log.apply(console, args);
|
23
|
-
};
|
24
|
-
|
25
|
-
BowlineMenu.fn.onChange = function(func){
|
26
|
-
this.element.bind("change.bowline", func);
|
27
|
-
};
|
28
|
-
|
29
|
-
BowlineMenu.fn.triggerChange = function(data){
|
30
|
-
this.element.trigger("change.bowline", data);
|
31
|
-
};
|
32
|
-
|
33
|
-
BowlineMenu.fn.viewName = function(element){
|
34
|
-
return jQuery(element).dataset("view");
|
35
|
-
};
|
36
|
-
|
37
|
-
BowlineMenu.fn.currentName = function(){
|
38
|
-
return this.viewName(this.current);
|
39
|
-
};
|
40
|
-
|
41
|
-
BowlineMenu.fn.elements = function(){
|
42
|
-
return this.element.find(this.options.childSelector);
|
43
|
-
};
|
44
|
-
|
45
|
-
BowlineMenu.fn.elementFor = function(name){
|
46
|
-
return this.element.find(
|
47
|
-
"[data-view='" + name + "']:first"
|
48
|
-
);
|
49
|
-
};
|
50
|
-
|
51
|
-
BowlineMenu.fn.items = function(){
|
52
|
-
var self = this;
|
53
|
-
return jQuery.map(this.elements(), function(n){
|
54
|
-
return self.viewName(n);
|
55
|
-
});
|
56
|
-
};
|
57
|
-
|
58
|
-
BowlineMenu.fn.change = function(name){
|
59
|
-
if(name != false && jQuery.inArray(name, this.items()) == -1) return false;
|
60
|
-
|
61
|
-
var fromView = this.current;
|
62
|
-
var fromViewName = this.viewName(fromView);
|
63
|
-
|
64
|
-
var toView = this.elementFor(name);
|
65
|
-
var toViewName = name;
|
66
|
-
|
67
|
-
this.log("changing:", fromViewName, toViewName);
|
68
|
-
|
69
|
-
this.elements().removeClass("current");
|
70
|
-
if(toView) {
|
71
|
-
this.current = toView;
|
72
|
-
toView.addClass("current");
|
73
|
-
}
|
74
|
-
|
75
|
-
this.triggerChange({
|
76
|
-
toView: toView,
|
77
|
-
toViewName: toViewName,
|
78
|
-
fromView: fromView,
|
79
|
-
fromViewName: fromViewName
|
80
|
-
});
|
81
|
-
};
|