joosy-rails 1.0.0.alpha.4 → 1.0.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +39 -6
- data/lib/joosy/rails/engine.rb +8 -6
- data/lib/joosy/rails/version.rb +1 -1
- data/lib/rails/generators/joosy/application_generator.rb +1 -1
- data/lib/rails/generators/joosy/controller_generator.rb +18 -0
- data/lib/rails/generators/joosy/layout_generator.rb +2 -2
- data/lib/rails/generators/joosy/page_generator.rb +2 -2
- data/lib/rails/generators/joosy/templates/controller.rb +2 -0
- data/lib/rails/generators/joosy/widget_generator.rb +2 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28181f873152cd5891d0e04461a8a4236aea9640
|
4
|
+
data.tar.gz: 4cc04dbc4be50ff8cf976626078492326f6217fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4bcc8ac278cd9993b242c57690d080069da3eb9180c5af362cfd6d718ca4e9e8b11dfce485db78ebd49c8ba9e92392e44f9f1c90cd299ffb0cf95b478d06695
|
7
|
+
data.tar.gz: e9ef56f7a1770998970ecc21a04c8bc82c9de72cd653c7f1956091addcace7c556797d327e5f9cc24a44800071d60f91cfb851020153b519a57fc604657bcd43
|
data/README.md
CHANGED
@@ -1,6 +1,18 @@
|
|
1
|
-
# Joosy::Rails
|
1
|
+
# Joosy::Rails
|
2
2
|
|
3
|
-
|
3
|
+
![Joosy](http://f.cl.ly/items/2N2J453J2B353F1A0t0I/joocy1.1.png)
|
4
|
+
|
5
|
+
Rails ties for the [Joosy](http://joosy.ws) Framework
|
6
|
+
|
7
|
+
[![Gem Version](https://badge.fury.io/rb/joosy-rails.png)](http://badge.fury.io/rb/joosy-rails)
|
8
|
+
[![Dependency Status](https://gemnasium.com/joosy/rails.png)](https://gemnasium.com/joosy/rails)
|
9
|
+
|
10
|
+
On the menu:
|
11
|
+
|
12
|
+
* Full assets integration
|
13
|
+
* Generators
|
14
|
+
* Built-in serving controller
|
15
|
+
* Routes helpers
|
4
16
|
|
5
17
|
## Installation
|
6
18
|
|
@@ -12,13 +24,34 @@ And then execute:
|
|
12
24
|
|
13
25
|
$ bundle
|
14
26
|
|
15
|
-
|
27
|
+
## Usage
|
16
28
|
|
17
|
-
|
29
|
+
### Generators
|
18
30
|
|
19
|
-
|
31
|
+
* `rails g joosy:application :name` – generates basic application and patches routes to make it loadable straight away.<br>
|
32
|
+
**:name** can (and in most cases should) be ommited.<br>
|
33
|
+
|
34
|
+
* `rails g joosy:layout :name (:application)` – generates new `Joosy.Layout`.<br>
|
35
|
+
**:name** can include any namespace (i.e. 'deeply/nested/layout').<br>
|
36
|
+
**:application** is a name of an application.<br>
|
37
|
+
|
38
|
+
* `rails g joosy:page :name (:application)` – generates new `Joosy.Page`.<br>
|
39
|
+
**:name** can include any namespace (i.e. 'deeply/nested/page').<br>
|
40
|
+
**:application** is a name of an application.<br>
|
41
|
+
|
42
|
+
* `rails g joosy:widget :name (:application)` – generates new `Joosy.Widget`.<br>
|
43
|
+
**:name** can include any namespace (i.e. 'deeply/nested/widget').<br>
|
44
|
+
**:application** is a name of an application.
|
45
|
+
|
46
|
+
### Serving controller and helpers
|
47
|
+
|
48
|
+
This gem provides `joosy` routing helper which can be used in the following way:
|
49
|
+
|
50
|
+
```ruby
|
51
|
+
joosy '/', application: 'dummy'
|
52
|
+
```
|
20
53
|
|
21
|
-
|
54
|
+
This will map your `dummy` Joosy application to the root url. Note that `application` option is optional and can be ommited just like `:name` option of the application generator.
|
22
55
|
|
23
56
|
## Contributing
|
24
57
|
|
data/lib/joosy/rails/engine.rb
CHANGED
@@ -15,12 +15,14 @@ module ActionDispatch::Routing
|
|
15
15
|
def joosy(route, options={})
|
16
16
|
extender = route.last == '/' ? '(*x)' : '(/*x)'
|
17
17
|
|
18
|
-
match route
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
match route,
|
19
|
+
controller: options[:controller] || 'joosy/rails/serve',
|
20
|
+
action: options[:action] || 'index',
|
21
|
+
via: :get,
|
22
|
+
as: (options[:application] ? "joosy_#{options[:application]}" : "joosy"),
|
23
|
+
defaults: {route: route, application: options[:application]},
|
24
|
+
anchor: false,
|
25
|
+
format: false
|
24
26
|
end
|
25
27
|
end
|
26
28
|
end
|
data/lib/joosy/rails/version.rb
CHANGED
@@ -34,7 +34,7 @@ module Joosy
|
|
34
34
|
template File.expand_path('../templates/layout.html.erb', __FILE__), "app/views/layouts/#{layout}.html.erb"
|
35
35
|
|
36
36
|
application = name ? ", application: '#{name}'" : ''
|
37
|
-
route "joosy '
|
37
|
+
route "joosy '/#{name}'#{application}"
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require_relative './base'
|
2
|
+
|
3
|
+
module Joosy
|
4
|
+
module Generators
|
5
|
+
class ControllerGenerator < Base
|
6
|
+
argument :name, type: :string
|
7
|
+
class_option :copy, :default => false, :type => :boolean, :desc => 'Indicates whether internal controller should be copied'
|
8
|
+
|
9
|
+
def create_files
|
10
|
+
if options["copy"]
|
11
|
+
template File.expand_path('../../../../joosy/rails/controller.rb', __FILE__), "app/controller/joosy/rails/serve_controller.rb"
|
12
|
+
else
|
13
|
+
template File.expand_path('../templates/controller.rb', __FILE__), "app/controllers/#{name.underscore}_controller.rb"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -4,10 +4,10 @@ module Joosy
|
|
4
4
|
module Generators
|
5
5
|
class LayoutGenerator < Base
|
6
6
|
argument :name, type: :string
|
7
|
-
argument :
|
7
|
+
argument :application, type: :string, optional: true
|
8
8
|
|
9
9
|
def create_files
|
10
|
-
self.destination_root = ::Rails.root.join('app/assets/javascripts/').join(
|
10
|
+
self.destination_root = ::Rails.root.join('app/assets/javascripts/').join(application || '')
|
11
11
|
run Joosy::Generators.pregenerate('layout', {name: name})
|
12
12
|
end
|
13
13
|
end
|
@@ -4,10 +4,10 @@ module Joosy
|
|
4
4
|
module Generators
|
5
5
|
class PageGenerator < Base
|
6
6
|
argument :name, type: :string
|
7
|
-
argument :
|
7
|
+
argument :application, type: :string, optional: true
|
8
8
|
|
9
9
|
def create_files
|
10
|
-
self.destination_root = ::Rails.root.join('app/assets/javascripts/').join(
|
10
|
+
self.destination_root = ::Rails.root.join('app/assets/javascripts/').join(application || '')
|
11
11
|
run Joosy::Generators.pregenerate('page', {name: name})
|
12
12
|
end
|
13
13
|
end
|
@@ -4,10 +4,10 @@ module Joosy
|
|
4
4
|
module Generators
|
5
5
|
class WidgetGenerator < Base
|
6
6
|
argument :name, type: :string
|
7
|
-
argument :
|
7
|
+
argument :application, type: :string, optional: true
|
8
8
|
|
9
9
|
def create_files
|
10
|
-
self.destination_root = ::Rails.root.join('app/assets/javascripts/').join(
|
10
|
+
self.destination_root = ::Rails.root.join('app/assets/javascripts/').join(application || '')
|
11
11
|
run Joosy::Generators.pregenerate('widget', {name: name})
|
12
12
|
end
|
13
13
|
end
|
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.
|
4
|
+
version: 1.0.0.beta.1
|
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-
|
11
|
+
date: 2013-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: joosy
|
@@ -114,8 +114,10 @@ files:
|
|
114
114
|
- lib/joosy/rails/version.rb
|
115
115
|
- lib/rails/generators/joosy/application_generator.rb
|
116
116
|
- lib/rails/generators/joosy/base.rb
|
117
|
+
- lib/rails/generators/joosy/controller_generator.rb
|
117
118
|
- lib/rails/generators/joosy/layout_generator.rb
|
118
119
|
- lib/rails/generators/joosy/page_generator.rb
|
120
|
+
- lib/rails/generators/joosy/templates/controller.rb
|
119
121
|
- lib/rails/generators/joosy/templates/layout.html.erb
|
120
122
|
- lib/rails/generators/joosy/widget_generator.rb
|
121
123
|
homepage: http://github.com/joosy/rails
|