bowline 0.6.3 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -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, "../assets/jquery.js", "public/javascripts/jquery.js"
44
- file :chainjs, "../assets/jquery.chain.js", "public/javascripts/jquery.chain.js"
45
- file :json2js, "../assets/json2.js", "public/javascripts/json2.js"
46
- file :bowlinejs, "../assets/bowline.js", "public/javascripts/bowline.js"
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
- if local
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"
@@ -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
- require(Bowline.root.join(*%w{config environments}, Bowline.env))
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
- initialize_marshal
370
-
371
- load_application_environment
363
+
372
364
  load_application_initializers
373
365
  load_application_first_run
374
366
 
@@ -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("**/**").to_s]
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")
@@ -1,8 +1,8 @@
1
1
  module Bowline
2
2
  module Version #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 6
5
- TINY = 3
4
+ MINOR = 9
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
 
@@ -1,7 +1,6 @@
1
1
  # Edit this Gemfile to bundle your application's dependencies.
2
+ source 'http://rubygems.org'
2
3
 
3
- gem "rubygems-update", "= 1.3.5"
4
- gem "bundler08"
5
4
  gem "bowline"
6
5
 
7
6
  ## Bundle the gems you use:
@@ -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
@@ -1,4 +1,2 @@
1
- <%- with_modules(modules) do -%>
2
1
  class <%= class_name %>
3
- end
4
- <%- end -%>
2
+ end
@@ -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
- <script src="javascripts/json2.js" type="text/javascript" charset="utf-8"></script>
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').bowlineBind('TweetsBinder');
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
- - 6
8
- - 3
9
- version: 0.6.3
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-04-06 00:00:00 +01:00
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: supermodel
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
- version: "0"
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/animations.css
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
@@ -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
- }
@@ -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
- };