joosy-rails 1.0.0.alpha.1 → 1.0.0.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/joosy-rails.gemspec +3 -2
- data/lib/joosy/generators.rb +1 -2
- data/lib/joosy/rails/sprockets.rb +14 -14
- data/lib/joosy/rails/version.rb +1 -1
- data/lib/joosy/rails.rb +16 -14
- data/lib/rails/generators/joosy/application_generator.rb +10 -21
- data/lib/rails/generators/joosy/base.rb +31 -0
- data/lib/rails/generators/joosy/layout_generator.rb +15 -0
- data/lib/rails/generators/joosy/page_generator.rb +15 -0
- data/lib/rails/generators/joosy/widget_generator.rb +15 -0
- metadata +23 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54ad98d6fb23fa2f83b2f6f57a3f6835b270b289
|
4
|
+
data.tar.gz: 6f472e036bb1bc2d98c18eb0b7899742946ebce5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d17afb743f8852df262d4244ac09f513fd0c9ef98b3b6012236d942d6aa6327b7bbe729e373e94e1dd33584cf1a76d18b744b22f93fc092941e88f0c0e27e5d
|
7
|
+
data.tar.gz: d6c86518ace45287eae139e83e759d5dd28bb65a932816afe35eddb08a05c1001ce9938608db6c50ef6080d68c802d3b33a6083627803d5d67d3edeab28b83da
|
data/joosy-rails.gemspec
CHANGED
@@ -18,10 +18,11 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_dependency 'joosy', '>= 1.2.0.alpha'
|
21
|
+
spec.add_dependency 'joosy', '>= 1.2.0.alpha.10'
|
22
22
|
spec.add_dependency 'sprockets'
|
23
23
|
spec.add_dependency 'execjs'
|
24
24
|
spec.add_dependency 'ejs'
|
25
25
|
|
26
|
-
spec.
|
26
|
+
spec.add_dependency 'sugar-rails'
|
27
|
+
spec.add_dependency 'jquery-form-rails'
|
27
28
|
end
|
data/lib/joosy/generators.rb
CHANGED
@@ -14,8 +14,7 @@ module Joosy
|
|
14
14
|
Generator.prototype.version = function(){return '#{Joosy::VERSION}'};
|
15
15
|
JS
|
16
16
|
|
17
|
-
|
18
|
-
ExecJS.compile(source).eval("new Generator('#{arguments}').generate()")
|
17
|
+
ExecJS.compile(source).eval("new Generator(#{arguments.to_json}).generate()")
|
19
18
|
end
|
20
19
|
end
|
21
20
|
end
|
@@ -1,15 +1,15 @@
|
|
1
|
-
module Joosy
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
# module Joosy
|
2
|
+
# module Rails
|
3
|
+
# module Sprockets
|
4
|
+
# module Asset
|
5
|
+
# def dependencies_with_sizes
|
6
|
+
# dependencies = to_a.map do |dependency|
|
7
|
+
# [dependency.logical_path, dependency.to_s.length]
|
8
|
+
# end
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
end
|
10
|
+
# Hash[*dependencies.flatten]
|
11
|
+
# end
|
12
|
+
# end
|
13
|
+
# end
|
14
|
+
# end
|
15
|
+
# end
|
data/lib/joosy/rails/version.rb
CHANGED
data/lib/joosy/rails.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'sugar-rails'
|
2
|
+
require 'jquery-form-rails'
|
1
3
|
require 'joosy'
|
2
4
|
|
3
5
|
require 'joosy/rails/version'
|
@@ -6,19 +8,19 @@ require 'joosy/rails/engine'
|
|
6
8
|
|
7
9
|
module Joosy
|
8
10
|
module Rails
|
9
|
-
def self.resources(namespaces=nil)
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
11
|
+
# def self.resources(namespaces=nil)
|
12
|
+
# predefined = {}
|
13
|
+
# filtered_resources = Joosy::Rails::Engine.resources
|
14
|
+
# if namespaces
|
15
|
+
# namespaces = Array.wrap namespaces
|
16
|
+
# filtered_resources = filtered_resources.select{|key, _| namespaces.include? key }
|
17
|
+
# end
|
18
|
+
# filtered_resources.each do |namespace, resources|
|
19
|
+
# next unless resources && resources.size > 0
|
20
|
+
# joosy_namespace = namespace.to_s.camelize.split('::').join('.')
|
21
|
+
# predefined[joosy_namespace] = resources
|
22
|
+
# end
|
23
|
+
# predefined
|
24
|
+
# end
|
23
25
|
end
|
24
26
|
end
|
@@ -1,30 +1,19 @@
|
|
1
|
-
|
1
|
+
require_relative './base'
|
2
2
|
|
3
3
|
module Joosy
|
4
4
|
module Generators
|
5
|
-
class ApplicationGenerator <
|
6
|
-
|
7
|
-
|
8
|
-
argument :name, :type => :string
|
5
|
+
class ApplicationGenerator < Base
|
6
|
+
argument :name, type: :string, optional: true
|
9
7
|
|
10
8
|
def create_files
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
when 'file'
|
17
|
-
create_file i[1]
|
18
|
-
when 'copy'
|
19
|
-
copy_file i[2], i[1]
|
20
|
-
when 'template'
|
21
|
-
source = File.expand_path(find_in_source_paths(i[2]))
|
9
|
+
dependencies = <<-COFFEE
|
10
|
+
#= require jquery
|
11
|
+
#= require jquery.form
|
12
|
+
#= require sugar
|
13
|
+
COFFEE
|
22
14
|
|
23
|
-
|
24
|
-
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
15
|
+
self.destination_root = ::Rails.root.join('app/assets/javascripts/').join(name || '')
|
16
|
+
run Joosy::Generators.pregenerate('project/base', {name: name, dependencies: dependencies})
|
28
17
|
end
|
29
18
|
end
|
30
19
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'joosy/generators'
|
2
|
+
require 'ejs'
|
3
|
+
|
4
|
+
module Joosy
|
5
|
+
module Generators
|
6
|
+
class Base < ::Rails::Generators::Base
|
7
|
+
protected
|
8
|
+
|
9
|
+
def self.source_root
|
10
|
+
Joosy.templates_path
|
11
|
+
end
|
12
|
+
|
13
|
+
def run(instructions)
|
14
|
+
instructions.each do |i|
|
15
|
+
case i[0]
|
16
|
+
when 'file'
|
17
|
+
create_file i[1]
|
18
|
+
when 'copy'
|
19
|
+
copy_file i[2], i[1]
|
20
|
+
when 'template'
|
21
|
+
source = File.expand_path(find_in_source_paths(i[2]))
|
22
|
+
|
23
|
+
create_file i[1] do
|
24
|
+
EJS.evaluate(File.read(source), i[3])
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require_relative './base'
|
2
|
+
|
3
|
+
module Joosy
|
4
|
+
module Generators
|
5
|
+
class LayoutGenerator < Base
|
6
|
+
argument :name, type: :string
|
7
|
+
argument :project, type: :string, optional: true
|
8
|
+
|
9
|
+
def create_files
|
10
|
+
self.destination_root = ::Rails.root.join('app/assets/javascripts/').join(project || '')
|
11
|
+
run Joosy::Generators.pregenerate('layout', {name: name})
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require_relative './base'
|
2
|
+
|
3
|
+
module Joosy
|
4
|
+
module Generators
|
5
|
+
class PageGenerator < Base
|
6
|
+
argument :name, type: :string
|
7
|
+
argument :project, type: :string, optional: true
|
8
|
+
|
9
|
+
def create_files
|
10
|
+
self.destination_root = ::Rails.root.join('app/assets/javascripts/').join(project || '')
|
11
|
+
run Joosy::Generators.pregenerate('page', {name: name})
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require_relative './base'
|
2
|
+
|
3
|
+
module Joosy
|
4
|
+
module Generators
|
5
|
+
class WidgetGenerator < Base
|
6
|
+
argument :name, type: :string
|
7
|
+
argument :project, type: :string, optional: true
|
8
|
+
|
9
|
+
def create_files
|
10
|
+
self.destination_root = ::Rails.root.join('app/assets/javascripts/').join(project || '')
|
11
|
+
run Joosy::Generators.pregenerate('widget', {name: name})
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: joosy-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.alpha.
|
4
|
+
version: 1.0.0.alpha.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boris Staal
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.2.0.alpha
|
19
|
+
version: 1.2.0.alpha.10
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.2.0.alpha
|
26
|
+
version: 1.2.0.alpha.10
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sprockets
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,13 +67,27 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: sugar-rails
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
|
-
type: :
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: jquery-form-rails
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
@@ -100,6 +114,10 @@ files:
|
|
100
114
|
- lib/joosy/rails/sprockets.rb
|
101
115
|
- lib/joosy/rails/version.rb
|
102
116
|
- lib/rails/generators/joosy/application_generator.rb
|
117
|
+
- lib/rails/generators/joosy/base.rb
|
118
|
+
- lib/rails/generators/joosy/layout_generator.rb
|
119
|
+
- lib/rails/generators/joosy/page_generator.rb
|
120
|
+
- lib/rails/generators/joosy/widget_generator.rb
|
103
121
|
homepage: http://github.com/joosy/rails
|
104
122
|
licenses:
|
105
123
|
- MIT
|