enform 0.0.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 (96) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +20 -0
  3. data/README +0 -0
  4. data/Rakefile +32 -0
  5. data/enform.gemspec +17 -0
  6. data/lib/enform.rb +5 -0
  7. data/lib/enform/enform_railtie.rb +7 -0
  8. data/lib/enform/rails/tasks/enform.rake +0 -0
  9. data/lib/enform/version.rb +3 -0
  10. data/lib/generators/enform_generator.rb +60 -0
  11. data/lib/generators/templates/controllers/controller.rb +83 -0
  12. data/lib/generators/templates/views/haml/_form.html.haml +27 -0
  13. data/lib/generators/templates/views/haml/_object.haml +10 -0
  14. data/lib/generators/templates/views/haml/edit.html.haml +8 -0
  15. data/lib/generators/templates/views/haml/new.html.haml +8 -0
  16. data/spec/dummy/Rakefile +7 -0
  17. data/spec/dummy/app/assets/javascripts/application.js +10 -0
  18. data/spec/dummy/app/assets/javascripts/monkeys.js +2 -0
  19. data/spec/dummy/app/assets/stylesheets/application.css +7 -0
  20. data/spec/dummy/app/assets/stylesheets/monkeys.css +4 -0
  21. data/spec/dummy/app/assets/stylesheets/scaffold.css +56 -0
  22. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  23. data/spec/dummy/app/controllers/monkeys_controller.rb +83 -0
  24. data/spec/dummy/app/controllers/posts_controller.rb +83 -0
  25. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  26. data/spec/dummy/app/helpers/monkeys_helper.rb +2 -0
  27. data/spec/dummy/app/mailers/.gitkeep +0 -0
  28. data/spec/dummy/app/models/.gitkeep +0 -0
  29. data/spec/dummy/app/models/author.rb +4 -0
  30. data/spec/dummy/app/models/category.rb +3 -0
  31. data/spec/dummy/app/models/comment.rb +3 -0
  32. data/spec/dummy/app/models/monkey.rb +2 -0
  33. data/spec/dummy/app/models/post.rb +7 -0
  34. data/spec/dummy/app/models/tag_line.rb +3 -0
  35. data/spec/dummy/app/views/layouts/application.html.erb +15 -0
  36. data/spec/dummy/app/views/monkeys/_form.html.erb +21 -0
  37. data/spec/dummy/app/views/monkeys/edit.html.erb +6 -0
  38. data/spec/dummy/app/views/monkeys/index.html.erb +23 -0
  39. data/spec/dummy/app/views/monkeys/new.html.erb +5 -0
  40. data/spec/dummy/app/views/monkeys/show.html.erb +10 -0
  41. data/spec/dummy/app/views/posts/_comment.haml +5 -0
  42. data/spec/dummy/app/views/posts/_comment_fields.haml +6 -0
  43. data/spec/dummy/app/views/posts/_form.html.haml +18 -0
  44. data/spec/dummy/app/views/posts/edit.html.haml +8 -0
  45. data/spec/dummy/app/views/posts/new.html.haml +8 -0
  46. data/spec/dummy/config.ru +4 -0
  47. data/spec/dummy/config/application.rb +45 -0
  48. data/spec/dummy/config/boot.rb +10 -0
  49. data/spec/dummy/config/database.yml +25 -0
  50. data/spec/dummy/config/environment.rb +5 -0
  51. data/spec/dummy/config/environments/development.rb +30 -0
  52. data/spec/dummy/config/environments/production.rb +60 -0
  53. data/spec/dummy/config/environments/test.rb +42 -0
  54. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  55. data/spec/dummy/config/initializers/inflections.rb +10 -0
  56. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  57. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  58. data/spec/dummy/config/initializers/session_store.rb +8 -0
  59. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  60. data/spec/dummy/config/locales/en.yml +5 -0
  61. data/spec/dummy/config/routes.rb +61 -0
  62. data/spec/dummy/db/development.sqlite3 +0 -0
  63. data/spec/dummy/db/migrate/20111025035303_create_posts.rb +10 -0
  64. data/spec/dummy/db/migrate/20111025035331_create_comments.rb +12 -0
  65. data/spec/dummy/db/migrate/20111025042155_create_categories.rb +11 -0
  66. data/spec/dummy/db/migrate/20111025042312_create_authors.rb +10 -0
  67. data/spec/dummy/db/migrate/20111025042701_create_tag_lines.rb +11 -0
  68. data/spec/dummy/db/migrate/20111025061520_create_monkeys.rb +9 -0
  69. data/spec/dummy/db/schema.rb +58 -0
  70. data/spec/dummy/db/test.sqlite3 +0 -0
  71. data/spec/dummy/lib/assets/.gitkeep +0 -0
  72. data/spec/dummy/log/.gitkeep +0 -0
  73. data/spec/dummy/log/development.log +1179 -0
  74. data/spec/dummy/log/test.log +0 -0
  75. data/spec/dummy/public/404.html +26 -0
  76. data/spec/dummy/public/422.html +26 -0
  77. data/spec/dummy/public/500.html +26 -0
  78. data/spec/dummy/public/favicon.ico +0 -0
  79. data/spec/dummy/script/rails +6 -0
  80. data/spec/dummy/test/fixtures/authors.yml +7 -0
  81. data/spec/dummy/test/fixtures/categories.yml +9 -0
  82. data/spec/dummy/test/fixtures/comments.yml +11 -0
  83. data/spec/dummy/test/fixtures/monkeys.yml +7 -0
  84. data/spec/dummy/test/fixtures/posts.yml +9 -0
  85. data/spec/dummy/test/fixtures/tag_lines.yml +9 -0
  86. data/spec/dummy/test/functional/monkeys_controller_test.rb +49 -0
  87. data/spec/dummy/test/unit/author_test.rb +7 -0
  88. data/spec/dummy/test/unit/category_test.rb +7 -0
  89. data/spec/dummy/test/unit/comment_test.rb +7 -0
  90. data/spec/dummy/test/unit/helpers/monkeys_helper_test.rb +4 -0
  91. data/spec/dummy/test/unit/monkey_test.rb +7 -0
  92. data/spec/dummy/test/unit/post_test.rb +7 -0
  93. data/spec/dummy/test/unit/tag_line_test.rb +7 -0
  94. data/spec/enform_spec.rb +5 -0
  95. data/spec/spec_helper.rb +17 -0
  96. metadata +142 -0
File without changes
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
24
+ </div>
25
+ </body>
26
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ name: MyString
5
+
6
+ two:
7
+ name: MyString
@@ -0,0 +1,9 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ post:
5
+ name: MyString
6
+
7
+ two:
8
+ post:
9
+ name: MyString
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ post:
5
+ title: MyString
6
+ body: MyText
7
+
8
+ two:
9
+ post:
10
+ title: MyString
11
+ body: MyText
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ name: MyString
5
+
6
+ two:
7
+ name: MyString
@@ -0,0 +1,9 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ title: MyString
5
+ body: MyText
6
+
7
+ two:
8
+ title: MyString
9
+ body: MyText
@@ -0,0 +1,9 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ author:
5
+ body: MyString
6
+
7
+ two:
8
+ author:
9
+ body: MyString
@@ -0,0 +1,49 @@
1
+ require 'test_helper'
2
+
3
+ class MonkeysControllerTest < ActionController::TestCase
4
+ setup do
5
+ @monkey = monkeys(:one)
6
+ end
7
+
8
+ test "should get index" do
9
+ get :index
10
+ assert_response :success
11
+ assert_not_nil assigns(:monkeys)
12
+ end
13
+
14
+ test "should get new" do
15
+ get :new
16
+ assert_response :success
17
+ end
18
+
19
+ test "should create monkey" do
20
+ assert_difference('Monkey.count') do
21
+ post :create, monkey: @monkey.attributes
22
+ end
23
+
24
+ assert_redirected_to monkey_path(assigns(:monkey))
25
+ end
26
+
27
+ test "should show monkey" do
28
+ get :show, id: @monkey.to_param
29
+ assert_response :success
30
+ end
31
+
32
+ test "should get edit" do
33
+ get :edit, id: @monkey.to_param
34
+ assert_response :success
35
+ end
36
+
37
+ test "should update monkey" do
38
+ put :update, id: @monkey.to_param, monkey: @monkey.attributes
39
+ assert_redirected_to monkey_path(assigns(:monkey))
40
+ end
41
+
42
+ test "should destroy monkey" do
43
+ assert_difference('Monkey.count', -1) do
44
+ delete :destroy, id: @monkey.to_param
45
+ end
46
+
47
+ assert_redirected_to monkeys_path
48
+ end
49
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class AuthorTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class CategoryTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class CommentTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,4 @@
1
+ require 'test_helper'
2
+
3
+ class MonkeysHelperTest < ActionView::TestCase
4
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class MonkeyTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class PostTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class TagLineTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe Enform do
4
+ puts "b"
5
+ end
@@ -0,0 +1,17 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+ require 'rubygems'
3
+ require 'bundler/setup'
4
+
5
+ require 'enform' # and any other gems you need
6
+
7
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
8
+ require "rails/test_help"
9
+
10
+ Rails.backtrace_cleaner.remove_silencers!
11
+
12
+ # Load support files
13
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
14
+
15
+ RSpec.configure do |config|
16
+ # some (optional) config here
17
+ end
metadata ADDED
@@ -0,0 +1,142 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: enform
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Christian Trosclair
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-10-25 00:00:00.000000000Z
13
+ dependencies: []
14
+ description: Create forms for your existing models!
15
+ email:
16
+ - christian.trosclair@gmail.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - .gitignore
22
+ - Gemfile
23
+ - README
24
+ - Rakefile
25
+ - enform.gemspec
26
+ - lib/enform.rb
27
+ - lib/enform/enform_railtie.rb
28
+ - lib/enform/rails/tasks/enform.rake
29
+ - lib/enform/version.rb
30
+ - lib/generators/enform_generator.rb
31
+ - lib/generators/templates/controllers/controller.rb
32
+ - lib/generators/templates/views/haml/_form.html.haml
33
+ - lib/generators/templates/views/haml/_object.haml
34
+ - lib/generators/templates/views/haml/edit.html.haml
35
+ - lib/generators/templates/views/haml/new.html.haml
36
+ - spec/dummy/Rakefile
37
+ - spec/dummy/app/assets/javascripts/application.js
38
+ - spec/dummy/app/assets/javascripts/monkeys.js
39
+ - spec/dummy/app/assets/stylesheets/application.css
40
+ - spec/dummy/app/assets/stylesheets/monkeys.css
41
+ - spec/dummy/app/assets/stylesheets/scaffold.css
42
+ - spec/dummy/app/controllers/application_controller.rb
43
+ - spec/dummy/app/controllers/monkeys_controller.rb
44
+ - spec/dummy/app/controllers/posts_controller.rb
45
+ - spec/dummy/app/helpers/application_helper.rb
46
+ - spec/dummy/app/helpers/monkeys_helper.rb
47
+ - spec/dummy/app/mailers/.gitkeep
48
+ - spec/dummy/app/models/.gitkeep
49
+ - spec/dummy/app/models/author.rb
50
+ - spec/dummy/app/models/category.rb
51
+ - spec/dummy/app/models/comment.rb
52
+ - spec/dummy/app/models/monkey.rb
53
+ - spec/dummy/app/models/post.rb
54
+ - spec/dummy/app/models/tag_line.rb
55
+ - spec/dummy/app/views/layouts/application.html.erb
56
+ - spec/dummy/app/views/monkeys/_form.html.erb
57
+ - spec/dummy/app/views/monkeys/edit.html.erb
58
+ - spec/dummy/app/views/monkeys/index.html.erb
59
+ - spec/dummy/app/views/monkeys/new.html.erb
60
+ - spec/dummy/app/views/monkeys/show.html.erb
61
+ - spec/dummy/app/views/posts/_comment.haml
62
+ - spec/dummy/app/views/posts/_comment_fields.haml
63
+ - spec/dummy/app/views/posts/_form.html.haml
64
+ - spec/dummy/app/views/posts/edit.html.haml
65
+ - spec/dummy/app/views/posts/new.html.haml
66
+ - spec/dummy/config.ru
67
+ - spec/dummy/config/application.rb
68
+ - spec/dummy/config/boot.rb
69
+ - spec/dummy/config/database.yml
70
+ - spec/dummy/config/environment.rb
71
+ - spec/dummy/config/environments/development.rb
72
+ - spec/dummy/config/environments/production.rb
73
+ - spec/dummy/config/environments/test.rb
74
+ - spec/dummy/config/initializers/backtrace_silencers.rb
75
+ - spec/dummy/config/initializers/inflections.rb
76
+ - spec/dummy/config/initializers/mime_types.rb
77
+ - spec/dummy/config/initializers/secret_token.rb
78
+ - spec/dummy/config/initializers/session_store.rb
79
+ - spec/dummy/config/initializers/wrap_parameters.rb
80
+ - spec/dummy/config/locales/en.yml
81
+ - spec/dummy/config/routes.rb
82
+ - spec/dummy/db/development.sqlite3
83
+ - spec/dummy/db/migrate/20111025035303_create_posts.rb
84
+ - spec/dummy/db/migrate/20111025035331_create_comments.rb
85
+ - spec/dummy/db/migrate/20111025042155_create_categories.rb
86
+ - spec/dummy/db/migrate/20111025042312_create_authors.rb
87
+ - spec/dummy/db/migrate/20111025042701_create_tag_lines.rb
88
+ - spec/dummy/db/migrate/20111025061520_create_monkeys.rb
89
+ - spec/dummy/db/schema.rb
90
+ - spec/dummy/db/test.sqlite3
91
+ - spec/dummy/lib/assets/.gitkeep
92
+ - spec/dummy/log/.gitkeep
93
+ - spec/dummy/log/development.log
94
+ - spec/dummy/log/test.log
95
+ - spec/dummy/public/404.html
96
+ - spec/dummy/public/422.html
97
+ - spec/dummy/public/500.html
98
+ - spec/dummy/public/favicon.ico
99
+ - spec/dummy/script/rails
100
+ - spec/dummy/test/fixtures/authors.yml
101
+ - spec/dummy/test/fixtures/categories.yml
102
+ - spec/dummy/test/fixtures/comments.yml
103
+ - spec/dummy/test/fixtures/monkeys.yml
104
+ - spec/dummy/test/fixtures/posts.yml
105
+ - spec/dummy/test/fixtures/tag_lines.yml
106
+ - spec/dummy/test/functional/monkeys_controller_test.rb
107
+ - spec/dummy/test/unit/author_test.rb
108
+ - spec/dummy/test/unit/category_test.rb
109
+ - spec/dummy/test/unit/comment_test.rb
110
+ - spec/dummy/test/unit/helpers/monkeys_helper_test.rb
111
+ - spec/dummy/test/unit/monkey_test.rb
112
+ - spec/dummy/test/unit/post_test.rb
113
+ - spec/dummy/test/unit/tag_line_test.rb
114
+ - spec/enform_spec.rb
115
+ - spec/spec_helper.rb
116
+ homepage: https://github.com/xn/enform
117
+ licenses: []
118
+ post_install_message:
119
+ rdoc_options: []
120
+ require_paths:
121
+ - lib
122
+ required_ruby_version: !ruby/object:Gem::Requirement
123
+ none: false
124
+ requirements:
125
+ - - ! '>='
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ requirements: []
135
+ rubyforge_project:
136
+ rubygems_version: 1.8.11
137
+ signing_key:
138
+ specification_version: 3
139
+ summary: Makes some assupmtions right now for your setup, will be more modular later
140
+ on
141
+ test_files: []
142
+ has_rdoc: