starter-template_generator 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -0
- data/Manifest +32 -0
- data/README.markdown +76 -0
- data/Rakefile +26 -0
- data/TODO +8 -0
- data/VERSION.yml +4 -0
- data/rails_generators/shoulda_model/USAGE +27 -0
- data/rails_generators/shoulda_model/shoulda_model_generator.rb +49 -0
- data/rails_generators/shoulda_model/templates/factory.rb +5 -0
- data/rails_generators/shoulda_model/templates/fixtures.yml +19 -0
- data/rails_generators/shoulda_model/templates/migration.rb +16 -0
- data/rails_generators/shoulda_model/templates/model.rb +2 -0
- data/rails_generators/shoulda_model/templates/unit_test.rb +7 -0
- data/rails_generators/shoulda_scaffold/USAGE +34 -0
- data/rails_generators/shoulda_scaffold/shoulda_scaffold_generator.rb +160 -0
- data/rails_generators/shoulda_scaffold/templates/blueprint/ie.css +35 -0
- data/rails_generators/shoulda_scaffold/templates/blueprint/print.css +30 -0
- data/rails_generators/shoulda_scaffold/templates/blueprint/screen.css +256 -0
- data/rails_generators/shoulda_scaffold/templates/controller.rb +65 -0
- data/rails_generators/shoulda_scaffold/templates/erb/_form.html.erb +8 -0
- data/rails_generators/shoulda_scaffold/templates/erb/edit.html.erb +12 -0
- data/rails_generators/shoulda_scaffold/templates/erb/index.html.erb +24 -0
- data/rails_generators/shoulda_scaffold/templates/erb/layout.html.erb +22 -0
- data/rails_generators/shoulda_scaffold/templates/erb/new.html.erb +8 -0
- data/rails_generators/shoulda_scaffold/templates/erb/show.html.erb +14 -0
- data/rails_generators/shoulda_scaffold/templates/functional_test/basic.rb +66 -0
- data/rails_generators/shoulda_scaffold/templates/haml/_form.html.haml +7 -0
- data/rails_generators/shoulda_scaffold/templates/haml/edit.html.haml +11 -0
- data/rails_generators/shoulda_scaffold/templates/haml/index.html.haml +23 -0
- data/rails_generators/shoulda_scaffold/templates/haml/new.html.haml +9 -0
- data/rails_generators/shoulda_scaffold/templates/haml/show.html.haml +11 -0
- data/rails_generators/shoulda_scaffold/templates/helper.rb +2 -0
- data/test/fixtures/about_yml_plugins/bad_about_yml/about.yml +1 -0
- data/test/fixtures/about_yml_plugins/bad_about_yml/init.rb +1 -0
- data/test/fixtures/about_yml_plugins/plugin_without_about_yml/init.rb +1 -0
- data/test/fixtures/eager/zoo.rb +3 -0
- data/test/fixtures/eager/zoo/reptile_house.rb +2 -0
- data/test/fixtures/environment_with_constant.rb +1 -0
- data/test/fixtures/lib/generators/missing_class/missing_class_generator.rb +0 -0
- data/test/fixtures/lib/generators/working/working_generator.rb +2 -0
- data/test/fixtures/plugins/alternate/a/generators/a_generator/a_generator.rb +4 -0
- data/test/fixtures/plugins/default/gemlike/init.rb +1 -0
- data/test/fixtures/plugins/default/gemlike/lib/gemlike.rb +2 -0
- data/test/fixtures/plugins/default/gemlike/rails/init.rb +7 -0
- data/test/fixtures/plugins/default/plugin_with_no_lib_dir/init.rb +0 -0
- data/test/fixtures/plugins/default/stubby/about.yml +2 -0
- data/test/fixtures/plugins/default/stubby/generators/stubby_generator/stubby_generator.rb +4 -0
- data/test/fixtures/plugins/default/stubby/init.rb +7 -0
- data/test/fixtures/plugins/default/stubby/lib/stubby_mixin.rb +2 -0
- data/test/rails_generators/shoulda_model_generator_test.rb +39 -0
- data/test/shoulda_macros/generator_macros.rb +36 -0
- data/test/stolen_from_railties.rb +288 -0
- data/test/test_helper.rb +41 -0
- metadata +116 -0
data/test/test_helper.rb
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'ruby-debug'
|
3
|
+
require 'active_support'
|
4
|
+
require 'active_record'
|
5
|
+
require 'action_controller'
|
6
|
+
require 'action_view'
|
7
|
+
|
8
|
+
require 'shoulda'
|
9
|
+
|
10
|
+
require 'mocha'
|
11
|
+
|
12
|
+
require File.join(File.dirname(__FILE__), 'shoulda_macros', 'generator_macros')
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
require File.join(File.dirname(__FILE__), 'stolen_from_railties')
|
17
|
+
|
18
|
+
unless defined?(RAILS_DEFAULT_LOGGER)
|
19
|
+
@test_log = File.join(RAILS_ROOT, 'test.log')
|
20
|
+
RAILS_DEFAULT_LOGGER = Logger.new(@test_log)
|
21
|
+
end
|
22
|
+
|
23
|
+
Rails::Generator::Base.prepend_sources Rails::Generator::PathSource.new(:shoulda_generator, File.join(File.dirname(__FILE__), "..", "rails_generators"))
|
24
|
+
|
25
|
+
class GeneratorTestCase
|
26
|
+
# Asserts that the given factory was created.
|
27
|
+
def assert_generated_factory_for(name)
|
28
|
+
assert_generated_file "test/factories/#{name.to_s.underscore}_factory.rb"
|
29
|
+
end
|
30
|
+
|
31
|
+
# Asserts that the given factory was NOT created.
|
32
|
+
def deny_generated_factory_for(name)
|
33
|
+
deny_file_exists "test/factories/#{name.to_s.underscore}_factory.rb"
|
34
|
+
end
|
35
|
+
|
36
|
+
# asserts that the given file DOES NOT exists
|
37
|
+
def deny_file_exists(path)
|
38
|
+
assert ! File.exist?("#{RAILS_ROOT}/#{path}"),
|
39
|
+
"The file '#{RAILS_ROOT}/#{path}' should not exist"
|
40
|
+
end
|
41
|
+
end
|
metadata
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: starter-template_generator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Luis Prill Sempere
|
13
|
+
- Josh Nichols
|
14
|
+
- Martijn Storck
|
15
|
+
autorequire:
|
16
|
+
bindir: bin
|
17
|
+
cert_chain: []
|
18
|
+
|
19
|
+
date: 2010-03-07 00:00:00 +01:00
|
20
|
+
default_executable:
|
21
|
+
dependencies: []
|
22
|
+
|
23
|
+
description: Like i18n_shoulda_generator, but with implemented cancan. It is mainly used toether with the starter-template_w_cancan.rb
|
24
|
+
email: ovantu@gmail.com
|
25
|
+
executables: []
|
26
|
+
|
27
|
+
extensions: []
|
28
|
+
|
29
|
+
extra_rdoc_files: []
|
30
|
+
|
31
|
+
files:
|
32
|
+
- LICENSE
|
33
|
+
- Manifest
|
34
|
+
- Rakefile
|
35
|
+
- README.markdown
|
36
|
+
- TODO
|
37
|
+
- VERSION.yml
|
38
|
+
- rails_generators/shoulda_model/shoulda_model_generator.rb
|
39
|
+
- rails_generators/shoulda_model/templates/factory.rb
|
40
|
+
- rails_generators/shoulda_model/templates/fixtures.yml
|
41
|
+
- rails_generators/shoulda_model/templates/migration.rb
|
42
|
+
- rails_generators/shoulda_model/templates/model.rb
|
43
|
+
- rails_generators/shoulda_model/templates/unit_test.rb
|
44
|
+
- rails_generators/shoulda_model/USAGE
|
45
|
+
- rails_generators/shoulda_scaffold/shoulda_scaffold_generator.rb
|
46
|
+
- rails_generators/shoulda_scaffold/templates/blueprint/ie.css
|
47
|
+
- rails_generators/shoulda_scaffold/templates/blueprint/print.css
|
48
|
+
- rails_generators/shoulda_scaffold/templates/blueprint/screen.css
|
49
|
+
- rails_generators/shoulda_scaffold/templates/controller.rb
|
50
|
+
- rails_generators/shoulda_scaffold/templates/erb/_form.html.erb
|
51
|
+
- rails_generators/shoulda_scaffold/templates/erb/edit.html.erb
|
52
|
+
- rails_generators/shoulda_scaffold/templates/erb/index.html.erb
|
53
|
+
- rails_generators/shoulda_scaffold/templates/erb/layout.html.erb
|
54
|
+
- rails_generators/shoulda_scaffold/templates/erb/new.html.erb
|
55
|
+
- rails_generators/shoulda_scaffold/templates/erb/show.html.erb
|
56
|
+
- rails_generators/shoulda_scaffold/templates/functional_test/basic.rb
|
57
|
+
- rails_generators/shoulda_scaffold/templates/haml/_form.html.haml
|
58
|
+
- rails_generators/shoulda_scaffold/templates/haml/edit.html.haml
|
59
|
+
- rails_generators/shoulda_scaffold/templates/haml/index.html.haml
|
60
|
+
- rails_generators/shoulda_scaffold/templates/haml/new.html.haml
|
61
|
+
- rails_generators/shoulda_scaffold/templates/haml/show.html.haml
|
62
|
+
- rails_generators/shoulda_scaffold/templates/helper.rb
|
63
|
+
- rails_generators/shoulda_scaffold/USAGE
|
64
|
+
- test/fixtures/about_yml_plugins/bad_about_yml/about.yml
|
65
|
+
- test/fixtures/about_yml_plugins/bad_about_yml/init.rb
|
66
|
+
- test/fixtures/about_yml_plugins/plugin_without_about_yml/init.rb
|
67
|
+
- test/fixtures/eager/zoo/reptile_house.rb
|
68
|
+
- test/fixtures/eager/zoo.rb
|
69
|
+
- test/fixtures/environment_with_constant.rb
|
70
|
+
- test/fixtures/lib/generators/missing_class/missing_class_generator.rb
|
71
|
+
- test/fixtures/lib/generators/working/working_generator.rb
|
72
|
+
- test/fixtures/plugins/alternate/a/generators/a_generator/a_generator.rb
|
73
|
+
- test/fixtures/plugins/default/gemlike/init.rb
|
74
|
+
- test/fixtures/plugins/default/gemlike/lib/gemlike.rb
|
75
|
+
- test/fixtures/plugins/default/gemlike/rails/init.rb
|
76
|
+
- test/fixtures/plugins/default/plugin_with_no_lib_dir/init.rb
|
77
|
+
- test/fixtures/plugins/default/stubby/about.yml
|
78
|
+
- test/fixtures/plugins/default/stubby/generators/stubby_generator/stubby_generator.rb
|
79
|
+
- test/fixtures/plugins/default/stubby/init.rb
|
80
|
+
- test/fixtures/plugins/default/stubby/lib/stubby_mixin.rb
|
81
|
+
- test/rails_generators/shoulda_model_generator_test.rb
|
82
|
+
- test/shoulda_macros/generator_macros.rb
|
83
|
+
- test/stolen_from_railties.rb
|
84
|
+
- test/test_helper.rb
|
85
|
+
has_rdoc: true
|
86
|
+
homepage: http://github.com/LuNiPriSe/shoulda_generator
|
87
|
+
licenses: []
|
88
|
+
|
89
|
+
post_install_message:
|
90
|
+
rdoc_options: []
|
91
|
+
|
92
|
+
require_paths:
|
93
|
+
- lib
|
94
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
segments:
|
99
|
+
- 0
|
100
|
+
version: "0"
|
101
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
segments:
|
106
|
+
- 0
|
107
|
+
version: "0"
|
108
|
+
requirements: []
|
109
|
+
|
110
|
+
rubyforge_project:
|
111
|
+
rubygems_version: 1.3.6
|
112
|
+
signing_key:
|
113
|
+
specification_version: 2
|
114
|
+
summary: Like i18n_shoulda_generator, but with implemented cancan. It is mainly used toether with the starter-template_w_cancan.rb
|
115
|
+
test_files: []
|
116
|
+
|