ninetails 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +27 -4
  3. data/Rakefile +3 -3
  4. data/app/components/ninetails/element.rb +5 -1
  5. data/app/components/ninetails/element_definition.rb +2 -2
  6. data/app/components/ninetails/property_type.rb +0 -2
  7. data/app/components/ninetails/{section_template.rb → section.rb} +6 -8
  8. data/app/controllers/ninetails/application_controller.rb +1 -0
  9. data/app/controllers/ninetails/page_revisions_controller.rb +2 -3
  10. data/app/controllers/ninetails/pages_controller.rb +20 -1
  11. data/app/controllers/ninetails/sections_controller.rb +35 -0
  12. data/app/models/ninetails/page.rb +3 -16
  13. data/app/models/ninetails/page_revision.rb +2 -8
  14. data/app/models/ninetails/page_revision_section.rb +1 -1
  15. data/app/models/ninetails/page_section.rb +40 -0
  16. data/app/views/ninetails/page_revisions/index.json.jbuilder +1 -0
  17. data/app/views/ninetails/pages/_page.json.jbuilder +13 -0
  18. data/app/views/ninetails/pages/index.json.jbuilder +1 -0
  19. data/app/views/ninetails/pages/show.json.jbuilder +1 -0
  20. data/app/views/ninetails/sections/_section.json.jbuilder +1 -0
  21. data/app/views/ninetails/sections/validate.json.jbuilder +3 -0
  22. data/config/routes.rb +9 -5
  23. data/config/spring.rb +1 -0
  24. data/db/migrate/20151120120538_rename_sections_to_page_sections.rb +5 -0
  25. data/lib/ninetails/config.rb +8 -0
  26. data/lib/ninetails/engine.rb +5 -0
  27. data/lib/ninetails/key_conversion.rb +28 -0
  28. data/lib/ninetails/version.rb +1 -1
  29. data/lib/tasks/ninetails_tasks.rake +2 -2
  30. data/spec/components/element_spec.rb +3 -3
  31. data/spec/components/property_spec.rb +2 -2
  32. data/spec/components/property_type_spec.rb +5 -5
  33. data/spec/components/section_spec.rb +2 -2
  34. data/spec/dummy/app/components/{section_template → section}/billboard.rb +2 -2
  35. data/spec/dummy/app/components/{section_template → section}/document_head.rb +2 -2
  36. data/spec/dummy/app/components/section/minimal_billboard.rb +9 -0
  37. data/spec/dummy/bin/rails +5 -0
  38. data/spec/dummy/bin/rake +5 -0
  39. data/spec/dummy/bin/rspec +8 -0
  40. data/spec/dummy/bin/spring +15 -0
  41. data/spec/dummy/config/application.rb +0 -10
  42. data/spec/dummy/config/initializers/ninetails.rb +1 -0
  43. data/spec/dummy/config/spring.rb +1 -0
  44. data/spec/dummy/db/schema.rb +10 -10
  45. data/spec/dummy/log/development.log +2499 -0
  46. data/spec/dummy/log/test.log +55690 -0
  47. data/spec/factories/page_sections.rb +15 -0
  48. data/spec/models/{section_spec.rb → page_section_spec.rb} +17 -36
  49. data/spec/models/page_spec.rb +9 -14
  50. data/spec/requests/middleware_spec.rb +80 -0
  51. data/spec/requests/page_revisions_spec.rb +41 -42
  52. data/spec/requests/pages_spec.rb +54 -1
  53. data/spec/requests/sections_spec.rb +32 -0
  54. data/spec/spec_helper.rb +4 -0
  55. data/spec/support/section_helpers.rb +27 -0
  56. metadata +74 -35
  57. data/app/controllers/ninetails/section_templates_controller.rb +0 -17
  58. data/app/models/ninetails/section.rb +0 -30
  59. data/db/schema.rb +0 -53
  60. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  61. data/spec/dummy/config/initializers/inflections.rb +0 -16
  62. data/spec/dummy/config/initializers/mime_types.rb +0 -4
  63. data/spec/dummy/config/locales/en.yml +0 -23
  64. data/spec/dummy/public/404.html +0 -67
  65. data/spec/dummy/public/422.html +0 -67
  66. data/spec/dummy/public/500.html +0 -66
  67. data/spec/dummy/public/favicon.ico +0 -0
  68. data/spec/factories/sections.rb +0 -15
  69. data/spec/requests/section_templates_spec.rb +0 -17
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- body {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body>
58
- <!-- This file lives in public/422.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The change you wanted was rejected.</h1>
62
- <p>Maybe you tried to change something you didn't have access to.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>
@@ -1,66 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- body {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body>
58
- <!-- This file lives in public/500.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>We're sorry, but something went wrong.</h1>
62
- </div>
63
- <p>If you are the application owner check the logs for more information.</p>
64
- </div>
65
- </body>
66
- </html>
File without changes
@@ -1,15 +0,0 @@
1
- FactoryGirl.define do
2
-
3
- factory :document_head_section, class: Ninetails::Section do
4
- type "DocumentHead"
5
- tags SectionTemplate::DocumentHead.new.tags
6
- elements SectionTemplate::DocumentHead.new.serialize_elements
7
- end
8
-
9
- factory :billboard_section, class: Ninetails::Section do
10
- type "Billboard"
11
- tags SectionTemplate::Billboard.new.tags
12
- elements SectionTemplate::Billboard.new.serialize_elements
13
- end
14
-
15
- end
@@ -1,17 +0,0 @@
1
- require 'rails_helper'
2
-
3
- describe "Section Templates API" do
4
-
5
- it "should list the available templates" do
6
- get "/section_templates"
7
- expect(response).to be_success
8
- expect(json["templates"]).to include "Billboard"
9
- end
10
-
11
- it "should be possible to get a section's structure" do
12
- get "/section_templates/Billboard"
13
- expect(response).to be_success
14
- expect(response.body).to eq SectionTemplate::Billboard.new.serialize.to_json
15
- end
16
-
17
- end