joosy-rails 1.0.0.alpha.3 → 1.0.0.alpha.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4a8b9c0f802b879c17f1d69c1287d2066696922f
4
- data.tar.gz: bbc6bfb8d528523ff26a3ab471ce31418b604b9d
3
+ metadata.gz: d97d285b9b7bd10b7817b37c9891081348603389
4
+ data.tar.gz: b58084afe8f93527ef5c278e8585c4147f024a45
5
5
  SHA512:
6
- metadata.gz: d0471a7cdd9b2641c0ecd59d1ef5fbf7c34e0431d074ef5264ec94cb341e570b6cd0f069e990b15216b56d25cbac22c6c1cb3ec7b18297037dc95dfec7d5bf60
7
- data.tar.gz: fde08a4178ca82459f61657becaa776ad42a4fe517e2759b125d485a45c7b391834080502ba128cbaf6b7beb65f7750a222f1d51238cc64d43e01e1157566b85
6
+ metadata.gz: 77d1101c8e2c2e51d8618a725ae1bd3fd8ea73e8104a353c675fc4b254376630c6067934dbd0fbd588944fe26ad3bf448066bdb60b2a38ec383b41e8195bd4ad
7
+ data.tar.gz: 8f7c0078e7fb50ee4d00a2ff66203fa9403d0d2c58813616cf836ab3d40a73b571a82ba89223b5545639fd952ecd20d8c33151df05b1c058ddf0e9f0671e6f5f
@@ -0,0 +1,13 @@
1
+ module Joosy
2
+ module Rails
3
+ class ServeController < ActionController::Base
4
+ def index
5
+ @base = request.env['SCRIPT_NAME']
6
+ layout = 'joosy'
7
+ layout << "/#{params[:application]}" if params[:application]
8
+
9
+ render text: '', layout: layout
10
+ end
11
+ end
12
+ end
13
+ end
@@ -10,3 +10,17 @@ module Joosy
10
10
  end
11
11
  end
12
12
 
13
+ module ActionDispatch::Routing
14
+ class Mapper
15
+ def joosy(route, options={})
16
+ extender = route.last == '/' ? '(*x)' : '(/*x)'
17
+
18
+ match route => 'joosy/rails/serve#index',
19
+ via: :get,
20
+ as: (options[:application] ? "joosy_#{options[:application]}" : "joosy"),
21
+ defaults: {route: route, application: options[:application]},
22
+ anchor: false,
23
+ format: false
24
+ end
25
+ end
26
+ end
@@ -1,5 +1,5 @@
1
1
  module Joosy
2
2
  module Rails
3
- VERSION = "1.0.0.alpha.3"
3
+ VERSION = "1.0.0.alpha.4"
4
4
  end
5
5
  end
data/lib/joosy/rails.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require 'sugar-rails'
2
2
  require 'jquery-form-rails'
3
+ require 'haml_coffee_assets'
3
4
  require 'joosy'
4
5
 
5
6
  require 'joosy/rails/version'
7
+ require 'joosy/rails/controller'
6
8
  require 'joosy/rails/engine'
@@ -5,7 +5,7 @@ module Joosy
5
5
  class ApplicationGenerator < Base
6
6
  argument :name, type: :string, optional: true
7
7
 
8
- def create_files
8
+ def create_application
9
9
  dependencies = <<-COFFEE
10
10
  #= require jquery
11
11
  #= require jquery.form
@@ -16,6 +16,26 @@ module Joosy
16
16
  self.destination_root = ::Rails.root.join('app/assets/javascripts/').join(name || '')
17
17
  run Joosy::Generators.pregenerate('project/base', {name: name, dependencies: dependencies})
18
18
  end
19
+
20
+ def create_bindings
21
+ self.destination_root = ::Rails.root
22
+
23
+ if !name
24
+ index = ::Rails.root.join('app/assets/javascripts/application.js')
25
+
26
+ if File.exists?(index)
27
+ copy_file index, 'app/assets/javascripts/application.bak'
28
+ remove_file index
29
+ end
30
+ end
31
+
32
+ layout = 'joosy'
33
+ layout << "/#{name}" if name
34
+ template File.expand_path('../templates/layout.html.erb', __FILE__), "app/views/layouts/#{layout}.html.erb"
35
+
36
+ application = name ? ", application: '#{name}'" : ''
37
+ route "joosy '/'#{application}"
38
+ end
19
39
  end
20
40
  end
21
41
  end
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title></title>
5
+ <script type="text/javascript">
6
+ window.JoosyEnvironment = {
7
+ router: {
8
+ base: <%= '<%= raw @base.to_json %'+'>' %>
9
+ }
10
+ }
11
+ </script>
12
+
13
+ <%= "<%= stylesheet_link_tag 'application', :media => 'all' %"+'>' %>
14
+ <%= "<%= javascript_include_tag '#{name}#{'/' if name}application' %"+'>' %>
15
+ <%= '<%= csrf_meta_tags %'+'>' %>
16
+ </head>
17
+ <body>
18
+ </body>
19
+ </html>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: joosy-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha.3
4
+ version: 1.0.0.alpha.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boris Staal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-23 00:00:00.000000000 Z
11
+ date: 2013-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: joosy
@@ -109,12 +109,14 @@ files:
109
109
  - joosy-rails.gemspec
110
110
  - lib/joosy/generators.rb
111
111
  - lib/joosy/rails.rb
112
+ - lib/joosy/rails/controller.rb
112
113
  - lib/joosy/rails/engine.rb
113
114
  - lib/joosy/rails/version.rb
114
115
  - lib/rails/generators/joosy/application_generator.rb
115
116
  - lib/rails/generators/joosy/base.rb
116
117
  - lib/rails/generators/joosy/layout_generator.rb
117
118
  - lib/rails/generators/joosy/page_generator.rb
119
+ - lib/rails/generators/joosy/templates/layout.html.erb
118
120
  - lib/rails/generators/joosy/widget_generator.rb
119
121
  homepage: http://github.com/joosy/rails
120
122
  licenses: