riot-rails 0.1.0 → 0.2.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/CHANGELOG +150 -0
- data/MIT-LICENSE +20 -0
- data/README.markdown +31 -0
- data/Rakefile +32 -10
- data/VERSION +1 -1
- data/lib/riot/action_controller/context_macros/asserts_response.rb +15 -0
- data/lib/riot/action_controller/context_middleware.rb +48 -0
- data/lib/riot/action_controller/http_methods.rb +19 -0
- data/lib/riot/action_controller.rb +4 -0
- data/lib/riot/active_record/assertion_macros.rb +3 -0
- data/lib/riot/active_record/context_middleware.rb +17 -0
- data/lib/riot/active_record/database_macros.rb +58 -0
- data/lib/riot/active_record/reflection_macros.rb +106 -0
- data/lib/riot/active_record/transactional_middleware.rb +28 -0
- data/lib/riot/active_record/validation_macros.rb +187 -0
- data/lib/riot/active_record.rb +4 -0
- data/lib/riot/rails.rb +1 -0
- data/rails/init.rb +1 -0
- data/riot-rails.gemspec +130 -0
- data/test/action_controller/context_macros/asserts_response_test.rb +35 -0
- data/test/action_controller/context_middleware_test.rb +66 -0
- data/test/action_controller/delete_request_test.rb +45 -0
- data/test/action_controller/get_request_test.rb +37 -0
- data/test/action_controller/post_request_test.rb +45 -0
- data/test/action_controller/put_request_test.rb +45 -0
- data/test/action_controller/restful_delete_request_test.rb +28 -0
- data/test/action_controller/restful_get_request_test.rb +25 -0
- data/test/action_controller/restful_post_request_test.rb +25 -0
- data/test/action_controller/restful_put_request_test.rb +28 -0
- data/test/active_record/allowing_values_test.rb +64 -0
- data/test/active_record/attribute_is_invalid_test.rb +20 -0
- data/test/active_record/belongs_to_test.rb +22 -0
- data/test/active_record/context_middleware_test.rb +18 -0
- data/test/active_record/has_and_belongs_to_many_test.rb +22 -0
- data/test/active_record/has_database_index_on_test.rb +73 -0
- data/test/active_record/has_many_test.rb +22 -0
- data/test/active_record/has_one_test.rb +22 -0
- data/test/active_record/validates_length_of_test.rb +31 -0
- data/test/active_record/validates_presence_of_test.rb +14 -0
- data/test/active_record/validates_uniqueness_of_test.rb +23 -0
- data/test/rails_root/app/controllers/gremlins_controller.rb +21 -0
- data/test/rails_root/app/controllers/parties_controller.rb +17 -0
- data/test/rails_root/app/controllers/rooms_controller.rb +22 -0
- data/{README.md → test/rails_root/app/views/rendered_templates/foo_bar.html.erb} +0 -0
- data/test/rails_root/config/database.yml +4 -0
- data/test/rails_root/config/environment.rb +46 -0
- data/test/rails_root/config/routes.rb +7 -0
- data/test/rails_root/db/schema.rb +8 -0
- data/test/teststrap.rb +84 -0
- data/test/transactional_middleware_test.rb +27 -0
- metadata +154 -26
- data/init.rb +0 -0
- data/install.rb +0 -0
- data/lib/generators/riot_rails/model/model_generator.rb +0 -22
- data/lib/generators/riot_rails/model/templates/fixtures.yml +0 -23
- data/lib/generators/riot_rails/model/templates/riot_test.rb +0 -5
- data/lib/generators/riot_rails.rb +0 -10
metadata
CHANGED
@@ -1,47 +1,143 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riot-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: true
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
- pre
|
10
|
+
version: 0.2.0.pre
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
|
-
-
|
13
|
+
- Justin 'Gus' Knowlden
|
8
14
|
autorequire:
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date: 2010-
|
18
|
+
date: 2010-06-13 00:00:00 -05:00
|
13
19
|
default_executable:
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
22
|
name: riot
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
- 11
|
31
|
+
- 0
|
32
|
+
version: 0.11.0
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: rack-test
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
segments:
|
43
|
+
- 0
|
44
|
+
- 5
|
45
|
+
- 3
|
46
|
+
version: 0.5.3
|
17
47
|
type: :runtime
|
18
|
-
|
19
|
-
|
48
|
+
version_requirements: *id002
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: activerecord
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
segments:
|
57
|
+
- 3
|
58
|
+
- 0
|
59
|
+
- 0
|
60
|
+
- beta3
|
61
|
+
version: 3.0.0.beta3
|
62
|
+
type: :development
|
63
|
+
version_requirements: *id003
|
64
|
+
- !ruby/object:Gem::Dependency
|
65
|
+
name: actionpack
|
66
|
+
prerelease: false
|
67
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
20
68
|
requirements:
|
21
69
|
- - ">="
|
22
70
|
- !ruby/object:Gem::Version
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
71
|
+
segments:
|
72
|
+
- 3
|
73
|
+
- 0
|
74
|
+
- 0
|
75
|
+
- beta3
|
76
|
+
version: 3.0.0.beta3
|
77
|
+
type: :development
|
78
|
+
version_requirements: *id004
|
79
|
+
description: Riot specific test support for Rails apps. Protest the slow app.
|
80
|
+
email: gus@gusg.us
|
27
81
|
executables: []
|
28
82
|
|
29
83
|
extensions: []
|
30
84
|
|
31
85
|
extra_rdoc_files:
|
32
|
-
- README.
|
86
|
+
- README.markdown
|
33
87
|
files:
|
34
|
-
-
|
88
|
+
- .gitignore
|
89
|
+
- CHANGELOG
|
90
|
+
- MIT-LICENSE
|
91
|
+
- README.markdown
|
35
92
|
- Rakefile
|
36
93
|
- VERSION
|
37
|
-
-
|
38
|
-
-
|
39
|
-
- lib/
|
40
|
-
- lib/
|
41
|
-
- lib/
|
42
|
-
- lib/
|
94
|
+
- lib/riot/action_controller.rb
|
95
|
+
- lib/riot/action_controller/context_macros/asserts_response.rb
|
96
|
+
- lib/riot/action_controller/context_middleware.rb
|
97
|
+
- lib/riot/action_controller/http_methods.rb
|
98
|
+
- lib/riot/active_record.rb
|
99
|
+
- lib/riot/active_record/assertion_macros.rb
|
100
|
+
- lib/riot/active_record/context_middleware.rb
|
101
|
+
- lib/riot/active_record/database_macros.rb
|
102
|
+
- lib/riot/active_record/reflection_macros.rb
|
103
|
+
- lib/riot/active_record/transactional_middleware.rb
|
104
|
+
- lib/riot/active_record/validation_macros.rb
|
105
|
+
- lib/riot/rails.rb
|
106
|
+
- rails/init.rb
|
107
|
+
- riot-rails.gemspec
|
108
|
+
- test/action_controller/context_macros/asserts_response_test.rb
|
109
|
+
- test/action_controller/context_middleware_test.rb
|
110
|
+
- test/action_controller/delete_request_test.rb
|
111
|
+
- test/action_controller/get_request_test.rb
|
112
|
+
- test/action_controller/post_request_test.rb
|
113
|
+
- test/action_controller/put_request_test.rb
|
114
|
+
- test/action_controller/restful_delete_request_test.rb
|
115
|
+
- test/action_controller/restful_get_request_test.rb
|
116
|
+
- test/action_controller/restful_post_request_test.rb
|
117
|
+
- test/action_controller/restful_put_request_test.rb
|
118
|
+
- test/active_record/allowing_values_test.rb
|
119
|
+
- test/active_record/attribute_is_invalid_test.rb
|
120
|
+
- test/active_record/belongs_to_test.rb
|
121
|
+
- test/active_record/context_middleware_test.rb
|
122
|
+
- test/active_record/has_and_belongs_to_many_test.rb
|
123
|
+
- test/active_record/has_database_index_on_test.rb
|
124
|
+
- test/active_record/has_many_test.rb
|
125
|
+
- test/active_record/has_one_test.rb
|
126
|
+
- test/active_record/validates_length_of_test.rb
|
127
|
+
- test/active_record/validates_presence_of_test.rb
|
128
|
+
- test/active_record/validates_uniqueness_of_test.rb
|
129
|
+
- test/rails_root/app/controllers/gremlins_controller.rb
|
130
|
+
- test/rails_root/app/controllers/parties_controller.rb
|
131
|
+
- test/rails_root/app/controllers/rooms_controller.rb
|
132
|
+
- test/rails_root/app/views/rendered_templates/foo_bar.html.erb
|
133
|
+
- test/rails_root/config/database.yml
|
134
|
+
- test/rails_root/config/environment.rb
|
135
|
+
- test/rails_root/config/routes.rb
|
136
|
+
- test/rails_root/db/schema.rb
|
137
|
+
- test/teststrap.rb
|
138
|
+
- test/transactional_middleware_test.rb
|
43
139
|
has_rdoc: true
|
44
|
-
homepage: http://github.com/
|
140
|
+
homepage: http://github.com/thumblemonks/riot-rails
|
45
141
|
licenses: []
|
46
142
|
|
47
143
|
post_install_message:
|
@@ -53,20 +149,52 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
53
149
|
requirements:
|
54
150
|
- - ">="
|
55
151
|
- !ruby/object:Gem::Version
|
152
|
+
segments:
|
153
|
+
- 0
|
56
154
|
version: "0"
|
57
|
-
version:
|
58
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
156
|
requirements:
|
60
|
-
- - "
|
157
|
+
- - ">"
|
61
158
|
- !ruby/object:Gem::Version
|
62
|
-
|
63
|
-
|
159
|
+
segments:
|
160
|
+
- 1
|
161
|
+
- 3
|
162
|
+
- 1
|
163
|
+
version: 1.3.1
|
64
164
|
requirements: []
|
65
165
|
|
66
166
|
rubyforge_project:
|
67
|
-
rubygems_version: 1.3.
|
167
|
+
rubygems_version: 1.3.6
|
68
168
|
signing_key:
|
69
169
|
specification_version: 3
|
70
|
-
summary:
|
71
|
-
test_files:
|
72
|
-
|
170
|
+
summary: Riot specific test support for Rails apps
|
171
|
+
test_files:
|
172
|
+
- test/action_controller/context_macros/asserts_response_test.rb
|
173
|
+
- test/action_controller/context_middleware_test.rb
|
174
|
+
- test/action_controller/delete_request_test.rb
|
175
|
+
- test/action_controller/get_request_test.rb
|
176
|
+
- test/action_controller/post_request_test.rb
|
177
|
+
- test/action_controller/put_request_test.rb
|
178
|
+
- test/action_controller/restful_delete_request_test.rb
|
179
|
+
- test/action_controller/restful_get_request_test.rb
|
180
|
+
- test/action_controller/restful_post_request_test.rb
|
181
|
+
- test/action_controller/restful_put_request_test.rb
|
182
|
+
- test/active_record/allowing_values_test.rb
|
183
|
+
- test/active_record/attribute_is_invalid_test.rb
|
184
|
+
- test/active_record/belongs_to_test.rb
|
185
|
+
- test/active_record/context_middleware_test.rb
|
186
|
+
- test/active_record/has_and_belongs_to_many_test.rb
|
187
|
+
- test/active_record/has_database_index_on_test.rb
|
188
|
+
- test/active_record/has_many_test.rb
|
189
|
+
- test/active_record/has_one_test.rb
|
190
|
+
- test/active_record/validates_length_of_test.rb
|
191
|
+
- test/active_record/validates_presence_of_test.rb
|
192
|
+
- test/active_record/validates_uniqueness_of_test.rb
|
193
|
+
- test/rails_root/app/controllers/gremlins_controller.rb
|
194
|
+
- test/rails_root/app/controllers/parties_controller.rb
|
195
|
+
- test/rails_root/app/controllers/rooms_controller.rb
|
196
|
+
- test/rails_root/config/environment.rb
|
197
|
+
- test/rails_root/config/routes.rb
|
198
|
+
- test/rails_root/db/schema.rb
|
199
|
+
- test/teststrap.rb
|
200
|
+
- test/transactional_middleware_test.rb
|
data/init.rb
DELETED
File without changes
|
data/install.rb
DELETED
File without changes
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'generators/riot_rails'
|
2
|
-
|
3
|
-
module RiotRails
|
4
|
-
module Generators
|
5
|
-
class ModelGenerator < Base
|
6
|
-
argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
|
7
|
-
class_option :fixture, :type => :boolean
|
8
|
-
|
9
|
-
def create_test_file
|
10
|
-
template File.join(File.dirname(__FILE__), 'templates', 'riot_test.rb'), File.join('test/unit', class_path, "#{file_name}_test.rb")
|
11
|
-
end
|
12
|
-
|
13
|
-
hook_for :fixture_replacement
|
14
|
-
|
15
|
-
def create_fixture_file
|
16
|
-
if options[:fixture] && options[:fixture_replacement].nil?
|
17
|
-
template File.join(File.dirname(__FILE__), 'templates', 'fixtures.yml'), File.join('test/fixtures', "#{table_name}.yml")
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
2
|
-
|
3
|
-
<% unless attributes.empty? -%>
|
4
|
-
one:
|
5
|
-
<% for attribute in attributes -%>
|
6
|
-
<%= attribute.name %>: <%= attribute.default %>
|
7
|
-
<% end -%>
|
8
|
-
|
9
|
-
two:
|
10
|
-
<% for attribute in attributes -%>
|
11
|
-
<%= attribute.name %>: <%= attribute.default %>
|
12
|
-
<% end -%>
|
13
|
-
<% else -%>
|
14
|
-
# This model initially had no columns defined. If you add columns to the
|
15
|
-
# model remove the '{}' from the fixture names and add the columns immediately
|
16
|
-
# below each fixture, per the syntax in the comments below
|
17
|
-
#
|
18
|
-
one: {}
|
19
|
-
# column: value
|
20
|
-
#
|
21
|
-
two: {}
|
22
|
-
# column: value
|
23
|
-
<% end -%>
|