active_leonardo 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +48 -43
  3. data/LICENSE +19 -19
  4. data/README.md +173 -173
  5. data/active_template.rb +157 -141
  6. data/lib/generators/active_leonardo.rb +383 -383
  7. data/lib/generators/erb/leosca/leosca_generator.rb +122 -122
  8. data/lib/generators/leolay/USAGE +21 -21
  9. data/lib/generators/leolay/leolay_generator.rb +420 -420
  10. data/lib/generators/leolay/templates/app/admin/users.rb +87 -87
  11. data/lib/generators/leolay/templates/spec/helpers/application_helpers.rb +13 -13
  12. data/lib/generators/leolay/templates/spec/support/devise.rb +4 -4
  13. data/lib/generators/leolay/templates/styles/active/stylesheets/app/custom_active_admin.css.scss +27 -27
  14. data/lib/generators/leosca/USAGE +23 -23
  15. data/lib/generators/rails/leosca/USAGE +39 -39
  16. data/lib/generators/rails/leosca/leosca_generator.rb +55 -55
  17. data/lib/generators/rails/leosca/templates/leosca.css +56 -56
  18. data/lib/generators/rails/leosca_controller/USAGE +23 -23
  19. data/lib/generators/rails/leosca_controller/leosca_controller_generator.rb +192 -192
  20. data/lib/generators/rails/leosca_controller/templates/controller.rb +3 -3
  21. data/lib/generators/rspec/leointegration/leointegration_generator.rb +35 -35
  22. data/lib/generators/rspec/leointegration/templates/admin/feature.rb +67 -67
  23. data/lib/generators/rspec/leointegration/templates/feature.rb +9 -9
  24. data/lib/generators/rspec/leosca/leosca_generator.rb +57 -57
  25. data/lib/generators/rspec/leosca/templates/admin/controller_spec.rb +181 -181
  26. data/lib/generators/rspec/leosca/templates/admin/edit_spec.rb +31 -31
  27. data/lib/generators/rspec/leosca/templates/admin/index_spec.rb +32 -32
  28. data/lib/generators/rspec/leosca/templates/admin/new_spec.rb +30 -30
  29. data/lib/generators/rspec/leosca/templates/admin/routing_spec.rb +39 -39
  30. data/lib/generators/rspec/leosca/templates/admin/show_spec.rb +28 -28
  31. data/lib/generators/rspec/leosca/templates/controller_spec.rb +168 -168
  32. data/lib/generators/rspec/leosca/templates/edit_spec.rb +31 -31
  33. data/lib/generators/rspec/leosca/templates/index_spec.rb +32 -32
  34. data/lib/generators/rspec/leosca/templates/new_spec.rb +30 -30
  35. data/lib/generators/rspec/leosca/templates/routing_spec.rb +39 -39
  36. data/lib/generators/rspec/leosca/templates/show_spec.rb +28 -28
  37. metadata +3 -3
@@ -1,31 +1,31 @@
1
- require 'spec_helper'
2
-
3
- <% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
4
- describe "<%= ns_table_name %>/edit" do
5
- before(:each) do
6
- @<%= ns_file_name %> = assign(:<%= ns_file_name %>, stub_model(<%= class_name %><%= output_attributes.empty? ? '))' : ',' %>
7
- <% output_attributes.each_with_index do |attribute, attribute_index| -%>
8
- :<%= attribute.name %> => <%= attribute.default.inspect %><%= attribute_index == output_attributes.length - 1 ? '' : ','%>
9
- <% end -%>
10
- <%= output_attributes.empty? ? "" : " ))\n" -%>
11
- end
12
-
13
- it "renders the edit <%= ns_file_name %> form" do
14
- render
15
-
16
- <% if webrat? -%>
17
- rendered.should have_selector("form", :action => <%= ns_file_name %>_path(@<%= ns_file_name %>), :method => "post") do |form|
18
- <% for attribute in output_attributes -%>
19
- form.should have_selector("<%= attribute.input_type -%>#<%= ns_file_name %>_<%= attribute.name %>", :name => "<%= ns_file_name %>[<%= attribute.name %>]")
20
- <% end -%>
21
- end
22
- <% else -%>
23
- # Run the generator again with the --webrat flag if you want to use webrat matchers
24
- assert_select "form", :action => <%= index_helper %>_path(@<%= ns_file_name %>), :method => "post" do
25
- <% for attribute in output_attributes -%>
26
- assert_select "<%= attribute.input_type -%>#<%= ns_file_name %>_<%= attribute.name %>", :name => "<%= ns_file_name %>[<%= attribute.name %>]"
27
- <% end -%>
28
- end
29
- <% end -%>
30
- end
31
- end
1
+ require 'spec_helper'
2
+
3
+ <% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
4
+ describe "<%= ns_table_name %>/edit" do
5
+ before(:each) do
6
+ @<%= ns_file_name %> = assign(:<%= ns_file_name %>, stub_model(<%= class_name %><%= output_attributes.empty? ? '))' : ',' %>
7
+ <% output_attributes.each_with_index do |attribute, attribute_index| -%>
8
+ :<%= attribute.name %> => <%= attribute.default.inspect %><%= attribute_index == output_attributes.length - 1 ? '' : ','%>
9
+ <% end -%>
10
+ <%= output_attributes.empty? ? "" : " ))\n" -%>
11
+ end
12
+
13
+ it "renders the edit <%= ns_file_name %> form" do
14
+ render
15
+
16
+ <% if webrat? -%>
17
+ rendered.should have_selector("form", :action => <%= ns_file_name %>_path(@<%= ns_file_name %>), :method => "post") do |form|
18
+ <% for attribute in output_attributes -%>
19
+ form.should have_selector("<%= attribute.input_type -%>#<%= ns_file_name %>_<%= attribute.name %>", :name => "<%= ns_file_name %>[<%= attribute.name %>]")
20
+ <% end -%>
21
+ end
22
+ <% else -%>
23
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
24
+ assert_select "form", :action => <%= index_helper %>_path(@<%= ns_file_name %>), :method => "post" do
25
+ <% for attribute in output_attributes -%>
26
+ assert_select "<%= attribute.input_type -%>#<%= ns_file_name %>_<%= attribute.name %>", :name => "<%= ns_file_name %>[<%= attribute.name %>]"
27
+ <% end -%>
28
+ end
29
+ <% end -%>
30
+ end
31
+ end
@@ -1,32 +1,32 @@
1
- require 'spec_helper'
2
-
3
- <% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
4
- describe "<%= ns_table_name %>/index" do
5
- before(:each) do
6
- assign(:<%= table_name %>, [
7
- <% [1,2].each_with_index do |id, model_index| -%>
8
- stub_model(<%= class_name %><%= output_attributes.empty? ? (model_index == 1 ? ')' : '),') : ',' %>
9
- <% output_attributes.each_with_index do |attribute, attribute_index| -%>
10
- :<%= attribute.name %> => <%= value_for(attribute) %><%= attribute_index == output_attributes.length - 1 ? '' : ','%>
11
- <% end -%>
12
- <% if !output_attributes.empty? -%>
13
- <%= model_index == 1 ? ')' : '),' %>
14
- <% end -%>
15
- <% end -%>
16
- ])
17
- end
18
-
19
- it "renders a list of <%= ns_table_name %>" do
20
- render
21
- <% unless webrat? -%>
22
- # Run the generator again with the --webrat flag if you want to use webrat matchers
23
- <% end -%>
24
- <% for attribute in output_attributes -%>
25
- <% if webrat? -%>
26
- rendered.should have_selector("tr>td", :content => <%= value_for(attribute) %>.to_s, :count => 2)
27
- <% else -%>
28
- assert_select "tr>td", :text => <%= value_for(attribute) %>.to_s, :count => 2
29
- <% end -%>
30
- <% end -%>
31
- end
32
- end
1
+ require 'spec_helper'
2
+
3
+ <% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
4
+ describe "<%= ns_table_name %>/index" do
5
+ before(:each) do
6
+ assign(:<%= table_name %>, [
7
+ <% [1,2].each_with_index do |id, model_index| -%>
8
+ stub_model(<%= class_name %><%= output_attributes.empty? ? (model_index == 1 ? ')' : '),') : ',' %>
9
+ <% output_attributes.each_with_index do |attribute, attribute_index| -%>
10
+ :<%= attribute.name %> => <%= value_for(attribute) %><%= attribute_index == output_attributes.length - 1 ? '' : ','%>
11
+ <% end -%>
12
+ <% if !output_attributes.empty? -%>
13
+ <%= model_index == 1 ? ')' : '),' %>
14
+ <% end -%>
15
+ <% end -%>
16
+ ])
17
+ end
18
+
19
+ it "renders a list of <%= ns_table_name %>" do
20
+ render
21
+ <% unless webrat? -%>
22
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
23
+ <% end -%>
24
+ <% for attribute in output_attributes -%>
25
+ <% if webrat? -%>
26
+ rendered.should have_selector("tr>td", :content => <%= value_for(attribute) %>.to_s, :count => 2)
27
+ <% else -%>
28
+ assert_select "tr>td", :text => <%= value_for(attribute) %>.to_s, :count => 2
29
+ <% end -%>
30
+ <% end -%>
31
+ end
32
+ end
@@ -1,30 +1,30 @@
1
- require 'spec_helper'
2
-
3
- <% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
4
- describe "<%= ns_table_name %>/new" do
5
- before(:each) do
6
- assign(:<%= ns_file_name %>, stub_model(<%= class_name %><%= output_attributes.empty? ? ').as_new_record)' : ',' %>
7
- <% output_attributes.each_with_index do |attribute, attribute_index| -%>
8
- :<%= attribute.name %> => <%= attribute.default.inspect %><%= attribute_index == output_attributes.length - 1 ? '' : ','%>
9
- <% end -%>
10
- <%= !output_attributes.empty? ? " ).as_new_record)\n end" : " end" %>
11
-
12
- it "renders new <%= ns_file_name %> form" do
13
- render
14
-
15
- <% if webrat? -%>
16
- rendered.should have_selector("form", :action => <%= table_name %>_path, :method => "post") do |form|
17
- <% for attribute in output_attributes -%>
18
- form.should have_selector("<%= attribute.input_type -%>#<%= ns_file_name %>_<%= attribute.name %>", :name => "<%= ns_file_name %>[<%= attribute.name %>]")
19
- <% end -%>
20
- end
21
- <% else -%>
22
- # Run the generator again with the --webrat flag if you want to use webrat matchers
23
- assert_select "form", :action => <%= index_helper %>_path, :method => "post" do
24
- <% for attribute in output_attributes -%>
25
- assert_select "<%= attribute.input_type -%>#<%= ns_file_name %>_<%= attribute.name %>", :name => "<%= ns_file_name %>[<%= attribute.name %>]"
26
- <% end -%>
27
- end
28
- <% end -%>
29
- end
30
- end
1
+ require 'spec_helper'
2
+
3
+ <% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
4
+ describe "<%= ns_table_name %>/new" do
5
+ before(:each) do
6
+ assign(:<%= ns_file_name %>, stub_model(<%= class_name %><%= output_attributes.empty? ? ').as_new_record)' : ',' %>
7
+ <% output_attributes.each_with_index do |attribute, attribute_index| -%>
8
+ :<%= attribute.name %> => <%= attribute.default.inspect %><%= attribute_index == output_attributes.length - 1 ? '' : ','%>
9
+ <% end -%>
10
+ <%= !output_attributes.empty? ? " ).as_new_record)\n end" : " end" %>
11
+
12
+ it "renders new <%= ns_file_name %> form" do
13
+ render
14
+
15
+ <% if webrat? -%>
16
+ rendered.should have_selector("form", :action => <%= table_name %>_path, :method => "post") do |form|
17
+ <% for attribute in output_attributes -%>
18
+ form.should have_selector("<%= attribute.input_type -%>#<%= ns_file_name %>_<%= attribute.name %>", :name => "<%= ns_file_name %>[<%= attribute.name %>]")
19
+ <% end -%>
20
+ end
21
+ <% else -%>
22
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
23
+ assert_select "form", :action => <%= index_helper %>_path, :method => "post" do
24
+ <% for attribute in output_attributes -%>
25
+ assert_select "<%= attribute.input_type -%>#<%= ns_file_name %>_<%= attribute.name %>", :name => "<%= ns_file_name %>[<%= attribute.name %>]"
26
+ <% end -%>
27
+ end
28
+ <% end -%>
29
+ end
30
+ end
@@ -1,39 +1,39 @@
1
- require "spec_helper"
2
-
3
- <% module_namespacing do -%>
4
- describe <%= controller_class_name %>Controller do
5
- describe "routing" do
6
-
7
- <% unless options[:singleton] -%>
8
- it "routes to #index" do
9
- get("/<%= ns_table_name %>").should route_to("<%= ns_table_name %>#index")
10
- end
11
-
12
- <% end -%>
13
- it "routes to #new" do
14
- get("/<%= ns_table_name %>/new").should route_to("<%= ns_table_name %>#new")
15
- end
16
-
17
- it "routes to #show" do
18
- get("/<%= ns_table_name %>/1").should route_to("<%= ns_table_name %>#show", :id => "1")
19
- end
20
-
21
- it "routes to #edit" do
22
- get("/<%= ns_table_name %>/1/edit").should route_to("<%= ns_table_name %>#edit", :id => "1")
23
- end
24
-
25
- it "routes to #create" do
26
- post("/<%= ns_table_name %>").should route_to("<%= ns_table_name %>#create")
27
- end
28
-
29
- it "routes to #update" do
30
- put("/<%= ns_table_name %>/1").should route_to("<%= ns_table_name %>#update", :id => "1")
31
- end
32
-
33
- it "routes to #destroy" do
34
- delete("/<%= ns_table_name %>/1").should route_to("<%= ns_table_name %>#destroy", :id => "1")
35
- end
36
-
37
- end
38
- end
39
- <% end -%>
1
+ require "spec_helper"
2
+
3
+ <% module_namespacing do -%>
4
+ describe <%= controller_class_name %>Controller do
5
+ describe "routing" do
6
+
7
+ <% unless options[:singleton] -%>
8
+ it "routes to #index" do
9
+ get("/<%= ns_table_name %>").should route_to("<%= ns_table_name %>#index")
10
+ end
11
+
12
+ <% end -%>
13
+ it "routes to #new" do
14
+ get("/<%= ns_table_name %>/new").should route_to("<%= ns_table_name %>#new")
15
+ end
16
+
17
+ it "routes to #show" do
18
+ get("/<%= ns_table_name %>/1").should route_to("<%= ns_table_name %>#show", :id => "1")
19
+ end
20
+
21
+ it "routes to #edit" do
22
+ get("/<%= ns_table_name %>/1/edit").should route_to("<%= ns_table_name %>#edit", :id => "1")
23
+ end
24
+
25
+ it "routes to #create" do
26
+ post("/<%= ns_table_name %>").should route_to("<%= ns_table_name %>#create")
27
+ end
28
+
29
+ it "routes to #update" do
30
+ put("/<%= ns_table_name %>/1").should route_to("<%= ns_table_name %>#update", :id => "1")
31
+ end
32
+
33
+ it "routes to #destroy" do
34
+ delete("/<%= ns_table_name %>/1").should route_to("<%= ns_table_name %>#destroy", :id => "1")
35
+ end
36
+
37
+ end
38
+ end
39
+ <% end -%>
@@ -1,28 +1,28 @@
1
- require 'spec_helper'
2
-
3
- <% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
4
- describe "<%= ns_table_name %>/show" do
5
- before(:each) do
6
- @<%= ns_file_name %> = assign(:<%= ns_file_name %>, stub_model(<%= class_name %><%= output_attributes.empty? ? '))' : ',' %>
7
- <% output_attributes.each_with_index do |attribute, attribute_index| -%>
8
- :<%= attribute.name %> => <%= value_for(attribute) %><%= attribute_index == output_attributes.length - 1 ? '' : ','%>
9
- <% end -%>
10
- <% if !output_attributes.empty? -%>
11
- ))
12
- <% end -%>
13
- end
14
-
15
- it "renders attributes in <p>" do
16
- render
17
- <% unless webrat? -%>
18
- # Run the generator again with the --webrat flag if you want to use webrat matchers
19
- <% end -%>
20
- <% for attribute in output_attributes -%>
21
- <% if webrat? -%>
22
- rendered.should contain(<%= value_for(attribute) %>.to_s)
23
- <% else -%>
24
- rendered.should match(/<%= eval(value_for(attribute)) %>/)
25
- <% end -%>
26
- <% end -%>
27
- end
28
- end
1
+ require 'spec_helper'
2
+
3
+ <% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
4
+ describe "<%= ns_table_name %>/show" do
5
+ before(:each) do
6
+ @<%= ns_file_name %> = assign(:<%= ns_file_name %>, stub_model(<%= class_name %><%= output_attributes.empty? ? '))' : ',' %>
7
+ <% output_attributes.each_with_index do |attribute, attribute_index| -%>
8
+ :<%= attribute.name %> => <%= value_for(attribute) %><%= attribute_index == output_attributes.length - 1 ? '' : ','%>
9
+ <% end -%>
10
+ <% if !output_attributes.empty? -%>
11
+ ))
12
+ <% end -%>
13
+ end
14
+
15
+ it "renders attributes in <p>" do
16
+ render
17
+ <% unless webrat? -%>
18
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
19
+ <% end -%>
20
+ <% for attribute in output_attributes -%>
21
+ <% if webrat? -%>
22
+ rendered.should contain(<%= value_for(attribute) %>.to_s)
23
+ <% else -%>
24
+ rendered.should match(/<%= eval(value_for(attribute)) %>/)
25
+ <% end -%>
26
+ <% end -%>
27
+ end
28
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_leonardo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Mastrodonato, Marco Longhitano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-06 00:00:00.000000000 Z
11
+ date: 2014-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  requirements:
125
125
  - Start a new app with the active_template.rb inside root folder
126
126
  rubyforge_project:
127
- rubygems_version: 2.1.9
127
+ rubygems_version: 2.0.14
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: This gem provides a new customized scaffold generator to combine with active