eyeballs 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ Sun Aug 1
2
+ - - - - -
3
+ - Bring the scaffold generator up to date
4
+
1
5
  Tue Jul 27
2
6
  - - - - - -
3
7
  - Event Delegation bug causing the default bit not to return false
data/README.md CHANGED
@@ -257,17 +257,17 @@ Tasty!
257
257
 
258
258
  To bind events to these controller actions, use the data-bind attribute:
259
259
 
260
- <a href="/posts/new" data-controller="posts#new">Click me!</a>
260
+ <a href="/posts/new" data-bind="posts#new">Click me!</a>
261
261
 
262
262
  This binds all clicks on this element to the new action on the PostsController. By default, if you add these attributes to a form, the action is bound to the submit event; to all other elements it binds to a click.
263
263
 
264
264
  It also returns false, canceling out the default behavior. If you want the default behavior, prefix with `+` to "add" the action to the propagation chain:
265
265
 
266
- <a href="/posts/new" data-controller="+posts#new">Click me!</a>
266
+ <a href="/posts/new" data-bind="+posts#new">Click me!</a>
267
267
 
268
268
  You can also bind to custom events:
269
269
 
270
- <a href="/posts/new" data-controller="+mouseover:posts#new">Hover over me!</a>
270
+ <a href="/posts/new" data-bind="+mouseover:posts#new">Hover over me!</a>
271
271
 
272
272
  You can bind multiple events and actions to a single element:
273
273
 
data/Rakefile CHANGED
@@ -27,7 +27,7 @@ begin
27
27
  require 'jeweler'
28
28
  Jeweler::Tasks.new do |s|
29
29
  s.name = "eyeballs"
30
- s.version = "0.5.2"
30
+ s.version = "0.5.3"
31
31
  s.author = "Paul Campbell"
32
32
  s.email = "paul@rslw.com"
33
33
  s.homepage = "http://www.github.com/paulca/eyeballs.js"
data/eyeballs.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{eyeballs}
8
- s.version = "0.5.2"
8
+ s.version = "0.5.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Paul Campbell"]
12
- s.date = %q{2010-07-27}
12
+ s.date = %q{2010-08-01}
13
13
  s.default_executable = %q{eyeballs}
14
14
  s.email = %q{paul@rslw.com}
15
15
  s.executables = ["eyeballs"]
@@ -20,6 +20,18 @@ module Eyeballs
20
20
  end
21
21
  end
22
22
 
23
+ def public_path
24
+ @public_path ||= if rack_app?
25
+ 'public'
26
+ else
27
+ '.'
28
+ end
29
+ end
30
+
31
+ def prefix
32
+ '/public/' if rack_app?
33
+ end
34
+
23
35
  def rack_app?
24
36
  File.exists?('public')
25
37
  end
@@ -29,9 +29,9 @@ module Eyeballs
29
29
  end
30
30
 
31
31
  def build_the_views
32
- template "templates/scaffold_index.html", "#{app_path}/#{name.downcase.pluralize}.html"
32
+ template "templates/scaffold_index.html", "#{public_path}/#{name.downcase.pluralize}.html"
33
33
  template "templates/scaffold_partial.html.mustache", "#{app_path}/app/views/#{name.downcase.pluralize}/_#{name.downcase}.html.mustache"
34
- template "#{app_path}/templates/scaffold_edit.html.mustache", "app/views/#{name.downcase.pluralize}/edit.html.mustache"
34
+ template "templates/scaffold_edit.html.mustache", "#{app_path}/app/views/#{name.downcase.pluralize}/edit.html.mustache"
35
35
  end
36
36
 
37
37
  def farewell
@@ -1,4 +1,8 @@
1
1
  // This is a very handy place to put any initial logic
2
2
  // For example, choosing your adapter
3
+ <% if rack_app? %>
3
4
  o_O.model.adapter = o_O.rest;
4
- o_O.config.authenticity_token = $('meta[name=csrf-token]').attr('content')
5
+ o_O.config.authenticity_token = $('meta[name=csrf-token]').attr('content')
6
+ <% else %>
7
+ o_O.model.adapter = o_O.localstorage;
8
+ <% end %>
@@ -1,5 +1,5 @@
1
1
  <div class="edit-<%= name.downcase %>">
2
- <form data-id="{{id}}" data-controller="<%= name.downcase.pluralize %>" data-action="update">
2
+ <form data-id="{{id}}" data-bind="<%= name.downcase.pluralize %>#update">
3
3
  <%- attributes.each do |attribute| %>
4
4
  <label for="<%= name.downcase %>-<%= attribute.name %>"><%= attribute.name.titlecase %></label><br />
5
5
  <%- if attribute.type == 'text' %>
@@ -8,6 +8,8 @@
8
8
  <input type="text" name="<%= attribute.name %>" value="{{<%= attribute.name %>}}" data-attribute="<%= attribute.name %>"><br />
9
9
  <%- end -%>
10
10
  <%- end -%>
11
- <input type="submit" name="commit" value="Save"> or <a href="#" data-controller="<%= name.downcase.pluralize %>" data-action="cancel_edit">Cancel</a>
11
+ <input type="submit" name="commit" value="Save">
12
+ or
13
+ <a href="#" data-controller="<%= name.downcase.pluralize %>#cancel_edit">Cancel</a>
12
14
  </form>
13
15
  </div>
@@ -28,17 +28,19 @@
28
28
 
29
29
  </div>
30
30
  </body>
31
- <script src="vendor/jquery/jquery-1.4.2.min.js"></script>
32
- <script src="vendor/jquery/jquery.livequery.js"></script>
33
- <script src="vendor/mustache/mustache.js"></script>
34
- <script src="vendor/eyeballs/o_O.js"></script>
35
- <script src="vendor/eyeballs/jquery.o_O.js"></script>
36
- <script src="vendor/eyeballs/o_O.localstorage.js"></script>
37
- <script type="text/javascript" charset="utf-8">
38
- o_O.model.adapter = o_O.localstorage;
39
- </script>
40
- <script src="app/models/<%= name.downcase %>.js"></script>
41
- <script src="app/controllers/<%= name.downcase.pluralize %>_controller.js"></script>
31
+ <script src="<%= prefix %>vendor/jquery/jquery-1.4.2.min.js"></script>
32
+ <script src="<%= prefix %>vendor/mustache/mustache.0.2.3.js"></script>
33
+ <script src="<%= prefix %>vendor/eyeballs/o_O.js"></script>
34
+ <script src="<%= prefix %>vendor/eyeballs/modules/o_O.model.js"></script>
35
+ <script src="<%= prefix %>vendor/eyeballs/modules/o_O.validations.js"></script>
36
+ <script src="<%= prefix %>vendor/eyeballs/drivers/jquery/modules/o_O.controller.js"></script>
37
+ <script src="<%= prefix %>vendor/eyeballs/drivers/jquery/modules/o_O.routes.js"></script>
38
+ <script src="<%= prefix %>vendor/eyeballs/drivers/jquery/modules/o_O.support.js"></script>
39
+ <script src="<%= prefix %>vendor/eyeballs/adapters/o_O.localstorage.js"></script>
40
+ <script src="<%= prefix %>config/initializer.js"></script>
41
+ <script src="<%= prefix %>config/routes.js"></script>
42
+ <script src="<%= prefix %>app/models/<%= name.downcase %>.js"></script>
43
+ <script src="<%= prefix %>app/controllers/<%= name.downcase.pluralize %>_controller.js"></script>
42
44
  <script type="text/javascript" charset="utf-8">
43
45
  $(function(){
44
46
  <%= name.capitalize.pluralize %>Controller.index();
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eyeballs
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 2
10
- version: 0.5.2
9
+ - 3
10
+ version: 0.5.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Paul Campbell
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-27 00:00:00 +01:00
18
+ date: 2010-08-01 00:00:00 +01:00
19
19
  default_executable: eyeballs
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency