adminscaffold 1.0.0

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 (95) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +34 -0
  5. data/lib/admin_scaffold/version.rb +3 -0
  6. data/lib/admin_scaffold.rb +6 -0
  7. data/lib/adminscaffold.rb +1 -0
  8. data/lib/generators/admin_scaffold/admin_scaffold_generator.rb +24 -0
  9. data/lib/generators/admin_scaffold/install_generator.rb +19 -0
  10. data/lib/generators/admin_scaffold/templates/admin.css +4 -0
  11. data/lib/generators/admin_scaffold/templates/admin.html.erb.tt +14 -0
  12. data/lib/generators/admin_scaffold/templates/admin.js +4 -0
  13. data/lib/generators/admin_scaffold/templates/admin_controller.rb +3 -0
  14. data/lib/tasks/admin_scaffold_tasks.rake +4 -0
  15. data/test/admin_scaffold_test.rb +7 -0
  16. data/test/dummy/README.rdoc +28 -0
  17. data/test/dummy/Rakefile +6 -0
  18. data/test/dummy/app/assets/javascripts/admin/books.js +2 -0
  19. data/test/dummy/app/assets/javascripts/admin.js +4 -0
  20. data/test/dummy/app/assets/javascripts/application.js +13 -0
  21. data/test/dummy/app/assets/stylesheets/admin/books.css +4 -0
  22. data/test/dummy/app/assets/stylesheets/admin.css +4 -0
  23. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  24. data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
  25. data/test/dummy/app/controllers/admin/books_controller.rb +58 -0
  26. data/test/dummy/app/controllers/admin_controller.rb +3 -0
  27. data/test/dummy/app/controllers/application_controller.rb +5 -0
  28. data/test/dummy/app/helpers/admin/books_helper.rb +2 -0
  29. data/test/dummy/app/helpers/application_helper.rb +2 -0
  30. data/test/dummy/app/models/admin/book.rb +2 -0
  31. data/test/dummy/app/models/book.rb +2 -0
  32. data/test/dummy/app/views/admin/books/_form.html.erb +29 -0
  33. data/test/dummy/app/views/admin/books/edit.html.erb +6 -0
  34. data/test/dummy/app/views/admin/books/index.html.erb +31 -0
  35. data/test/dummy/app/views/admin/books/new.html.erb +5 -0
  36. data/test/dummy/app/views/admin/books/show.html.erb +19 -0
  37. data/test/dummy/app/views/layouts/admin.html.erb +14 -0
  38. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  39. data/test/dummy/bin/bundle +3 -0
  40. data/test/dummy/bin/rails +4 -0
  41. data/test/dummy/bin/rake +4 -0
  42. data/test/dummy/bin/setup +29 -0
  43. data/test/dummy/config/application.rb +26 -0
  44. data/test/dummy/config/boot.rb +5 -0
  45. data/test/dummy/config/database.yml +85 -0
  46. data/test/dummy/config/environment.rb +5 -0
  47. data/test/dummy/config/environments/development.rb +41 -0
  48. data/test/dummy/config/environments/production.rb +79 -0
  49. data/test/dummy/config/environments/test.rb +42 -0
  50. data/test/dummy/config/initializers/assets.rb +12 -0
  51. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  52. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  53. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  54. data/test/dummy/config/initializers/inflections.rb +16 -0
  55. data/test/dummy/config/initializers/mime_types.rb +4 -0
  56. data/test/dummy/config/initializers/session_store.rb +3 -0
  57. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  58. data/test/dummy/config/locales/en.yml +23 -0
  59. data/test/dummy/config/routes.rb +60 -0
  60. data/test/dummy/config/secrets.yml +22 -0
  61. data/test/dummy/config.ru +4 -0
  62. data/test/dummy/db/migrate/20150205063647_create_books.rb +11 -0
  63. data/test/dummy/db/schema.rb +27 -0
  64. data/test/dummy/log/development.log +122 -0
  65. data/test/dummy/log/test.log +156 -0
  66. data/test/dummy/public/404.html +67 -0
  67. data/test/dummy/public/422.html +67 -0
  68. data/test/dummy/public/500.html +66 -0
  69. data/test/dummy/public/favicon.ico +0 -0
  70. data/test/dummy/test/fixtures/books.yml +11 -0
  71. data/test/dummy/test/models/book_test.rb +7 -0
  72. data/test/dummy/tmp/cache/assets/development/sprockets/01abf17de4892ee0547ad83c30695a01 +0 -0
  73. data/test/dummy/tmp/cache/assets/development/sprockets/0e2a64fc0b20a44edef0e893fe02bb8b +0 -0
  74. data/test/dummy/tmp/cache/assets/development/sprockets/27184889e78dc5a556f3c7567afbef63 +0 -0
  75. data/test/dummy/tmp/cache/assets/development/sprockets/28d0ee5d51a1686dbfab844d57224241 +0 -0
  76. data/test/dummy/tmp/cache/assets/development/sprockets/3b33c918bc770b5c08f9a754758bc4e6 +0 -0
  77. data/test/dummy/tmp/cache/assets/development/sprockets/5953ddd4e0ec1b5b73fbed29804c11b3 +0 -0
  78. data/test/dummy/tmp/cache/assets/development/sprockets/5d4bd56a9d4de4d2e6d0cfb68c8af8e8 +0 -0
  79. data/test/dummy/tmp/cache/assets/development/sprockets/6609ee9da4eaea9b8d8137fbcfce6fdd +0 -0
  80. data/test/dummy/tmp/cache/assets/development/sprockets/6f2cc8e9b9b8a6b61af4dd957ad61f3e +0 -0
  81. data/test/dummy/tmp/cache/assets/development/sprockets/7aa90d1a0cd25a99c81ace73df870a64 +0 -0
  82. data/test/dummy/tmp/cache/assets/development/sprockets/7cc8464f262e75d9f3d931e2616dd878 +0 -0
  83. data/test/dummy/tmp/cache/assets/development/sprockets/86bf772f4327364a1dad3a4b3051c844 +0 -0
  84. data/test/dummy/tmp/cache/assets/development/sprockets/9085b07723908dd6995971c4f3c933ad +0 -0
  85. data/test/dummy/tmp/cache/assets/development/sprockets/97a02c0a737b9c49960349900e5474c3 +0 -0
  86. data/test/dummy/tmp/cache/assets/development/sprockets/b660bba6001bad109fa661da993b1414 +0 -0
  87. data/test/dummy/tmp/cache/assets/development/sprockets/cc70a8a06744e45cd5d774b3f5760aea +0 -0
  88. data/test/dummy/tmp/cache/assets/development/sprockets/d125916fa47fe25c811ff41c3e47b1dc +0 -0
  89. data/test/dummy/tmp/cache/assets/development/sprockets/e2c4bbeb230c9445cd39fac60f905174 +0 -0
  90. data/test/dummy/tmp/cache/assets/development/sprockets/f6db94d89ef810b760500ac4d6d7f631 +0 -0
  91. data/test/dummy/tmp/cache/assets/development/sprockets/f8160f91b680b2f94df78cefd5abc06e +0 -0
  92. data/test/dummy/tmp/cache/assets/development/sprockets/fdcd9c4f2824a62f9858c5b88e2f8185 +0 -0
  93. data/test/dummy/tmp/pids/server.pid +1 -0
  94. data/test/test_helper.rb +18 -0
  95. metadata +245 -0
@@ -0,0 +1,156 @@
1
+  (150.5ms) DROP DATABASE IF EXISTS "dummy_test"
2
+  (280.9ms) CREATE DATABASE "dummy_test" ENCODING = 'unicode'
3
+  (0.2ms) BEGIN
4
+ -----------------------------
5
+ AdminScaffoldTest: test_truth
6
+ -----------------------------
7
+  (0.1ms) ROLLBACK
8
+  (123.4ms) DROP DATABASE IF EXISTS "dummy_test"
9
+  (476.0ms) CREATE DATABASE "dummy_test" ENCODING = 'unicode'
10
+ SQL (0.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
11
+  (6.0ms) CREATE TABLE "books" ("id" serial primary key, "name" character varying, "desc" text, "publish_at" date, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
12
+  (3.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
13
+  (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
14
+  (0.3ms) SELECT version FROM "schema_migrations"
15
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20150205063647')
16
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
17
+  (0.1ms) BEGIN
18
+ ------------------------------------------------
19
+ Admin::BooksControllerTest: test_should_get_edit
20
+ ------------------------------------------------
21
+  (0.1ms) ROLLBACK
22
+  (0.1ms) BEGIN
23
+ ----------------------------------------------------------
24
+ Admin::BooksControllerTest: test_should_destroy_admin_book
25
+ ----------------------------------------------------------
26
+  (0.1ms) ROLLBACK
27
+  (0.1ms) BEGIN
28
+ -------------------------------------------------------
29
+ Admin::BooksControllerTest: test_should_show_admin_book
30
+ -------------------------------------------------------
31
+  (0.2ms) ROLLBACK
32
+  (0.1ms) BEGIN
33
+ ---------------------------------------------------------
34
+ Admin::BooksControllerTest: test_should_create_admin_book
35
+ ---------------------------------------------------------
36
+  (0.1ms) ROLLBACK
37
+  (0.1ms) BEGIN
38
+ -------------------------------------------------
39
+ Admin::BooksControllerTest: test_should_get_index
40
+ -------------------------------------------------
41
+  (0.1ms) ROLLBACK
42
+  (0.1ms) BEGIN
43
+ -----------------------------------------------
44
+ Admin::BooksControllerTest: test_should_get_new
45
+ -----------------------------------------------
46
+  (0.1ms) ROLLBACK
47
+  (0.1ms) BEGIN
48
+ ---------------------------------------------------------
49
+ Admin::BooksControllerTest: test_should_update_admin_book
50
+ ---------------------------------------------------------
51
+  (0.1ms) ROLLBACK
52
+  (0.1ms) BEGIN
53
+ -----------------------------
54
+ AdminScaffoldTest: test_truth
55
+ -----------------------------
56
+  (0.1ms) ROLLBACK
57
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
58
+  (0.1ms) BEGIN
59
+ ----------------------------------------------------------
60
+ Admin::BooksControllerTest: test_should_destroy_admin_book
61
+ ----------------------------------------------------------
62
+  (0.1ms) ROLLBACK
63
+  (0.1ms) BEGIN
64
+ ------------------------------------------------
65
+ Admin::BooksControllerTest: test_should_get_edit
66
+ ------------------------------------------------
67
+  (0.1ms) ROLLBACK
68
+  (0.1ms) BEGIN
69
+ ---------------------------------------------------------
70
+ Admin::BooksControllerTest: test_should_create_admin_book
71
+ ---------------------------------------------------------
72
+  (0.1ms) ROLLBACK
73
+  (0.0ms) BEGIN
74
+ -------------------------------------------------------
75
+ Admin::BooksControllerTest: test_should_show_admin_book
76
+ -------------------------------------------------------
77
+  (0.1ms) ROLLBACK
78
+  (0.1ms) BEGIN
79
+ -------------------------------------------------
80
+ Admin::BooksControllerTest: test_should_get_index
81
+ -------------------------------------------------
82
+  (0.1ms) ROLLBACK
83
+  (0.1ms) BEGIN
84
+ -----------------------------------------------
85
+ Admin::BooksControllerTest: test_should_get_new
86
+ -----------------------------------------------
87
+  (0.1ms) ROLLBACK
88
+  (0.1ms) BEGIN
89
+ ---------------------------------------------------------
90
+ Admin::BooksControllerTest: test_should_update_admin_book
91
+ ---------------------------------------------------------
92
+  (0.1ms) ROLLBACK
93
+  (0.0ms) BEGIN
94
+ -----------------------------
95
+ AdminScaffoldTest: test_truth
96
+ -----------------------------
97
+  (0.1ms) ROLLBACK
98
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
99
+  (0.1ms) BEGIN
100
+ -----------------------------
101
+ AdminScaffoldTest: test_truth
102
+ -----------------------------
103
+  (0.1ms) ROLLBACK
104
+  (0.1ms) BEGIN
105
+ ---------------------------------------------------------
106
+ Admin::BooksControllerTest: test_should_create_admin_book
107
+ ---------------------------------------------------------
108
+  (0.1ms) ROLLBACK
109
+  (0.1ms) BEGIN
110
+ ----------------------------------------------------------
111
+ Admin::BooksControllerTest: test_should_destroy_admin_book
112
+ ----------------------------------------------------------
113
+  (0.1ms) ROLLBACK
114
+  (0.1ms) BEGIN
115
+ -------------------------------------------------
116
+ Admin::BooksControllerTest: test_should_get_index
117
+ -------------------------------------------------
118
+  (0.1ms) ROLLBACK
119
+  (0.1ms) BEGIN
120
+ ---------------------------------------------------------
121
+ Admin::BooksControllerTest: test_should_update_admin_book
122
+ ---------------------------------------------------------
123
+  (0.1ms) ROLLBACK
124
+  (0.1ms) BEGIN
125
+ -------------------------------------------------------
126
+ Admin::BooksControllerTest: test_should_show_admin_book
127
+ -------------------------------------------------------
128
+  (0.1ms) ROLLBACK
129
+  (0.1ms) BEGIN
130
+ -----------------------------------------------
131
+ Admin::BooksControllerTest: test_should_get_new
132
+ -----------------------------------------------
133
+  (0.1ms) ROLLBACK
134
+  (0.1ms) BEGIN
135
+ ------------------------------------------------
136
+ Admin::BooksControllerTest: test_should_get_edit
137
+ ------------------------------------------------
138
+  (0.1ms) ROLLBACK
139
+ ActiveRecord::SchemaMigration Load (1.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
140
+  (0.1ms) BEGIN
141
+ -----------------------------
142
+ AdminScaffoldTest: test_truth
143
+ -----------------------------
144
+  (0.1ms) ROLLBACK
145
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
146
+  (0.2ms) BEGIN
147
+ -----------------------------
148
+ AdminScaffoldTest: test_truth
149
+ -----------------------------
150
+  (0.1ms) ROLLBACK
151
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
152
+  (0.1ms) BEGIN
153
+ -----------------------------
154
+ AdminScaffoldTest: test_truth
155
+ -----------------------------
156
+  (0.1ms) ROLLBACK
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</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/404.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The page you were looking for doesn't exist.</h1>
62
+ <p>You may have mistyped the address or the page may have moved.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,67 @@
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>
@@ -0,0 +1,66 @@
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
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ one:
4
+ name: MyString
5
+ desc: MyText
6
+ publish_at: 2015-02-05
7
+
8
+ two:
9
+ name: MyString
10
+ desc: MyText
11
+ publish_at: 2015-02-05
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class BookTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1 @@
1
+ 72019
@@ -0,0 +1,18 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
5
+ ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
6
+ require "rails/test_help"
7
+
8
+ # Filter out Minitest backtrace while allowing backtrace from other libraries
9
+ # to be shown.
10
+ Minitest.backtrace_filter = Minitest::BacktraceFilter.new
11
+
12
+ # Load support files
13
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
14
+
15
+ # Load fixtures from the engine
16
+ if ActiveSupport::TestCase.respond_to?(:fixture_path=)
17
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
18
+ end