view_mapper 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. data/.document +5 -0
  2. data/.gitignore +5 -0
  3. data/LICENSE +20 -0
  4. data/README +116 -0
  5. data/Rakefile +57 -0
  6. data/VERSION +1 -0
  7. data/generators/scaffold_for_view/USAGE +1 -0
  8. data/generators/scaffold_for_view/scaffold_for_view_generator.rb +37 -0
  9. data/generators/view_for/USAGE +1 -0
  10. data/generators/view_for/view_for_generator.rb +85 -0
  11. data/lib/view_mapper/auto_complete_templates/controller.rb +88 -0
  12. data/lib/view_mapper/auto_complete_templates/functional_test.rb +45 -0
  13. data/lib/view_mapper/auto_complete_templates/helper.rb +2 -0
  14. data/lib/view_mapper/auto_complete_templates/helper_test.rb +4 -0
  15. data/lib/view_mapper/auto_complete_templates/layout.html.erb +18 -0
  16. data/lib/view_mapper/auto_complete_templates/style.css +54 -0
  17. data/lib/view_mapper/auto_complete_templates/view_edit.html.erb +21 -0
  18. data/lib/view_mapper/auto_complete_templates/view_index.html.erb +24 -0
  19. data/lib/view_mapper/auto_complete_templates/view_new.html.erb +20 -0
  20. data/lib/view_mapper/auto_complete_templates/view_show.html.erb +10 -0
  21. data/lib/view_mapper/auto_complete_view.rb +44 -0
  22. data/lib/view_mapper/editable_manifest.rb +10 -0
  23. data/lib/view_mapper/route_action.rb +32 -0
  24. data/lib/view_mapper/view_mapper.rb +33 -0
  25. data/lib/view_mapper.rb +4 -0
  26. data/test/auto_complete_test.rb +146 -0
  27. data/test/database.yml +3 -0
  28. data/test/editable_manifest_test.rb +32 -0
  29. data/test/expected_templates/auto_complete/edit.html.erb +23 -0
  30. data/test/expected_templates/auto_complete/expected_routes.rb +45 -0
  31. data/test/expected_templates/auto_complete/index.html.erb +24 -0
  32. data/test/expected_templates/auto_complete/new.html.erb +22 -0
  33. data/test/expected_templates/auto_complete/show.html.erb +18 -0
  34. data/test/expected_templates/auto_complete/standard_routes.rb +43 -0
  35. data/test/expected_templates/auto_complete/testies.html.erb +18 -0
  36. data/test/expected_templates/auto_complete/testies_controller.rb +88 -0
  37. data/test/fake/fake_generator.rb +3 -0
  38. data/test/fake_view.rb +7 -0
  39. data/test/rails_generator/base.rb +266 -0
  40. data/test/rails_generator/commands.rb +621 -0
  41. data/test/rails_generator/generated_attribute.rb +46 -0
  42. data/test/rails_generator/generators/components/scaffold/scaffold_generator.rb +102 -0
  43. data/test/rails_generator/lookup.rb +249 -0
  44. data/test/rails_generator/manifest.rb +53 -0
  45. data/test/rails_generator/options.rb +150 -0
  46. data/test/rails_generator/scripts/destroy.rb +29 -0
  47. data/test/rails_generator/scripts/generate.rb +7 -0
  48. data/test/rails_generator/scripts/update.rb +12 -0
  49. data/test/rails_generator/scripts.rb +89 -0
  50. data/test/rails_generator/secret_key_generator.rb +24 -0
  51. data/test/rails_generator/simple_logger.rb +46 -0
  52. data/test/rails_generator/spec.rb +44 -0
  53. data/test/rails_generator.rb +43 -0
  54. data/test/scaffold_for_view_generator_test.rb +77 -0
  55. data/test/test_helper.rb +43 -0
  56. data/test/view_for_generator_test.rb +93 -0
  57. data/test/view_mapper_test.rb +29 -0
  58. data/view_mapper.gemspec +125 -0
  59. metadata +147 -0
@@ -0,0 +1,24 @@
1
+ require 'active_support/deprecation'
2
+
3
+ module Rails
4
+ # A class for creating random secret keys. This class will do its best to create a
5
+ # random secret key that's as secure as possible, using whatever methods are
6
+ # available on the current platform. For example:
7
+ #
8
+ # generator = Rails::SecretKeyGenerator("some unique identifier, such as the application name")
9
+ # generator.generate_secret # => "f3f1be90053fa851... (some long string)"
10
+ #
11
+ # This class is *deprecated* in Rails 2.2 in favor of ActiveSupport::SecureRandom.
12
+ # It is currently a wrapper around ActiveSupport::SecureRandom.
13
+ class SecretKeyGenerator
14
+ def initialize(identifier)
15
+ end
16
+
17
+ # Generate a random secret key with the best possible method available on
18
+ # the current platform.
19
+ def generate_secret
20
+ ActiveSupport::SecureRandom.hex(64)
21
+ end
22
+ deprecate :generate_secret=>"You should use ActiveSupport::SecureRandom.hex(64)"
23
+ end
24
+ end
@@ -0,0 +1,46 @@
1
+ module Rails
2
+ module Generator
3
+ class SimpleLogger # :nodoc:
4
+ attr_reader :out
5
+ attr_accessor :quiet
6
+
7
+ def initialize(out = $stdout)
8
+ @out = out
9
+ @quiet = false
10
+ @level = 0
11
+ end
12
+
13
+ def log(status, message, &block)
14
+ @out.print("%12s %s%s\n" % [status, ' ' * @level, message]) unless quiet
15
+ indent(&block) if block_given?
16
+ end
17
+
18
+ def indent(&block)
19
+ @level += 1
20
+ if block_given?
21
+ begin
22
+ block.call
23
+ ensure
24
+ outdent
25
+ end
26
+ end
27
+ end
28
+
29
+ def outdent
30
+ @level -= 1
31
+ if block_given?
32
+ begin
33
+ block.call
34
+ ensure
35
+ indent
36
+ end
37
+ end
38
+ end
39
+
40
+ private
41
+ def method_missing(method, *args, &block)
42
+ log(method.to_s, args.first, &block)
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,44 @@
1
+ module Rails
2
+ module Generator
3
+ # A spec knows where a generator was found and how to instantiate it.
4
+ # Metadata include the generator's name, its base path, and the source
5
+ # which yielded it (PathSource, GemPathSource, etc.)
6
+ class Spec
7
+ attr_reader :name, :path, :source
8
+
9
+ def initialize(name, path, source)
10
+ @name, @path, @source = name, path, source
11
+ end
12
+
13
+ # Look up the generator class. Require its class file, find the class
14
+ # in ObjectSpace, tag it with this spec, and return.
15
+ def klass
16
+ unless @klass
17
+ require class_file
18
+ @klass = lookup_class
19
+ @klass.spec = self
20
+ end
21
+ @klass
22
+ end
23
+
24
+ def class_file
25
+ "#{path}/#{name}_generator.rb"
26
+ end
27
+
28
+ def class_name
29
+ "#{name.camelize}Generator"
30
+ end
31
+
32
+ private
33
+ # Search for the first Class descending from Rails::Generator::Base
34
+ # whose name matches the requested class name.
35
+ def lookup_class
36
+ ObjectSpace.each_object(Class) do |obj|
37
+ return obj if obj.ancestors.include?(Rails::Generator::Base) and
38
+ obj.name.split('::').last == class_name
39
+ end
40
+ raise NameError, "Missing #{class_name} class in #{class_file}"
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,43 @@
1
+ #--
2
+ # Copyright (c) 2004 Jeremy Kemper
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ #++
23
+
24
+ $:.unshift(File.dirname(__FILE__))
25
+ $:.unshift(File.dirname(__FILE__) + "/../../activesupport/lib")
26
+
27
+ begin
28
+ require 'active_support'
29
+ rescue LoadError
30
+ require 'rubygems'
31
+ gem 'activesupport'
32
+ end
33
+
34
+ require 'rails_generator/base'
35
+ require 'rails_generator/lookup'
36
+ require 'rails_generator/commands'
37
+
38
+ Rails::Generator::Base.send(:include, Rails::Generator::Lookup)
39
+ Rails::Generator::Base.send(:include, Rails::Generator::Commands)
40
+
41
+ # Set up a default logger for convenience.
42
+ require 'rails_generator/simple_logger'
43
+ Rails::Generator::Base.logger = Rails::Generator::SimpleLogger.new(STDOUT)
@@ -0,0 +1,77 @@
1
+ require 'test_helper'
2
+
3
+ class ScaffoldForViewGeneratorTest < Test::Unit::TestCase
4
+
5
+ context "A Rails generator script" do
6
+ setup do
7
+ @generator_script = Rails::Generator::Scripts::Generate.new
8
+ end
9
+
10
+ should "display usage message with no parameters when run on scaffold_for_view" do
11
+ ScaffoldForViewGenerator.any_instance.expects(:usage).raises(Rails::Generator::UsageError, "")
12
+ begin
13
+ @generator_script.run(['scaffold_for_view'])
14
+ rescue SystemExit
15
+ end
16
+ end
17
+
18
+ context "run on a Testy model" do
19
+ should "create a manifest = scaffold for Testy" do
20
+
21
+ directories = [
22
+ 'app/models/',
23
+ 'app/controllers/',
24
+ 'app/helpers/',
25
+ 'app/views/testies',
26
+ 'app/views/layouts/',
27
+ 'test/functional/',
28
+ 'test/unit/',
29
+ 'test/unit/helpers/',
30
+ 'public/stylesheets/'
31
+ ].each { |path| Rails::Generator::Commands::Create.any_instance.expects(:directory).with(path) }
32
+
33
+ templates = {
34
+ 'view_index.html.erb' => 'app/views/testies/index.html.erb',
35
+ 'view_show.html.erb' => 'app/views/testies/show.html.erb',
36
+ 'view_new.html.erb' => 'app/views/testies/new.html.erb',
37
+ 'view_edit.html.erb' => 'app/views/testies/edit.html.erb',
38
+ 'layout.html.erb' => 'app/views/layouts/testies.html.erb',
39
+ 'style.css' => 'public/stylesheets/scaffold.css',
40
+ 'controller.rb' => 'app/controllers/testies_controller.rb',
41
+ 'functional_test.rb' => 'test/functional/testies_controller_test.rb',
42
+ 'helper.rb' => 'app/helpers/testies_helper.rb',
43
+ 'helper_test.rb' => 'test/unit/helpers/testies_helper_test.rb'
44
+ }.each { |template, target| Rails::Generator::Commands::Create.any_instance.expects(:template).with(template, target) }
45
+
46
+ Rails::Generator::Commands::Create.any_instance.expects(:route_resources).with('testies')
47
+ Rails::Generator::Commands::Create.any_instance.expects(:file).never
48
+
49
+ Rails::Generator::Commands::Create.any_instance.stubs(:dependency)
50
+
51
+ @generator_script.run(['scaffold_for_view', 'testy'])
52
+ end
53
+ end
54
+ end
55
+
56
+ context "A scaffold_for_view generator" do
57
+ setup do
58
+ @scaffold_for_view_gen = Rails::Generator::Base.instance('scaffold_for_view', ['testy'] )
59
+ end
60
+
61
+ should "not call any actions when invalid" do
62
+ @scaffold_for_view_gen.expects(:class_collisions).never
63
+ @scaffold_for_view_gen.expects(:directory).never
64
+ @scaffold_for_view_gen.stubs(:template).never
65
+ @scaffold_for_view_gen.stubs(:route_resources).never
66
+ @scaffold_for_view_gen.stubs(:file).never
67
+ @scaffold_for_view_gen.valid = false
68
+ @scaffold_for_view_gen.manifest.replay(@scaffold_for_view_gen)
69
+ end
70
+
71
+ should "return the source root folder for the Rails scaffold generator" do
72
+ assert_equal './test/rails_generator/generators/components/scaffold/templates', @scaffold_for_view_gen.source_root
73
+ end
74
+
75
+ end
76
+
77
+ end
@@ -0,0 +1,43 @@
1
+ require 'ftools'
2
+ require 'rubygems'
3
+ require 'test/unit'
4
+ require 'shoulda'
5
+ require 'mocha'
6
+ require 'activerecord'
7
+
8
+ config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
9
+ ActiveRecord::Base.establish_connection(config['test'])
10
+
11
+ require 'rails_generator'
12
+ require 'rails_generator/scripts'
13
+ require 'rails_generator/scripts/generate'
14
+
15
+ Rails::Generator::Base.reset_sources
16
+ def add_source(path)
17
+ Rails::Generator::Base.append_sources(Rails::Generator::PathSource.new(:builtin, path))
18
+ end
19
+
20
+ add_source(File.dirname(__FILE__) + '/../generators')
21
+ add_source(File.dirname(__FILE__) + '/rails_generator/generators/components')
22
+ add_source(File.dirname(__FILE__))
23
+
24
+ $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib')
25
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
26
+ require 'view_mapper'
27
+ require 'fake_view'
28
+
29
+ def setup_test_model
30
+ unless Object.const_defined?("Testy")
31
+ Object.const_set("Testy", Class.new(ActiveRecord::Base))
32
+ ActiveRecord::Base.connection.create_table :testies, :force => true do |table|
33
+ table.column :first_name, :string
34
+ table.column :last_name, :string
35
+ table.column :address, :string
36
+ end
37
+ end
38
+ Object.const_get("Testy")
39
+ end
40
+
41
+ class Rails::Generator::NamedBase
42
+ public :attributes
43
+ end
@@ -0,0 +1,93 @@
1
+ require 'test_helper'
2
+
3
+ class ViewForGeneratorTest < Test::Unit::TestCase
4
+
5
+ attr_reader :singular_name
6
+ attr_reader :plural_name
7
+ attr_reader :attributes
8
+
9
+ context "A Rails generator script" do
10
+ setup do
11
+ @generator_script = Rails::Generator::Scripts::Generate.new
12
+ end
13
+
14
+ should "display usage message with no parameters when run on view_for" do
15
+ ViewForGenerator.any_instance.expects(:usage).raises(Rails::Generator::UsageError, "")
16
+ begin
17
+ @generator_script.run(['view_for'])
18
+ rescue SystemExit
19
+ end
20
+ end
21
+
22
+ should "display error message with a bad model name when run on view_for" do
23
+ Rails::Generator::Base.logger.expects('error').with('Class \'blah\' does not exist.')
24
+ @generator_script.run(['view_for', 'blah'])
25
+ end
26
+
27
+ should "not call any actions when invalid" do
28
+ Rails::Generator::Base.logger.stubs('error')
29
+ Rails::Generator::Commands::Create.any_instance.expects(:directory).never
30
+ Rails::Generator::Commands::Create.any_instance.expects(:template).never
31
+ Rails::Generator::Commands::Create.any_instance.expects(:route_resources).never
32
+ Rails::Generator::Commands::Create.any_instance.expects(:file).never
33
+ @generator_script.run(['view_for', 'blah'])
34
+ end
35
+
36
+ context "run on a Testy model" do
37
+ setup do
38
+ @model = setup_test_model
39
+ end
40
+
41
+ should "create a manifest = (scaffold for Testy) - (model template)" do
42
+
43
+ directories = [
44
+ 'app/controllers/',
45
+ 'app/helpers/',
46
+ 'app/views/testies',
47
+ 'app/views/layouts/',
48
+ 'test/functional/',
49
+ 'test/unit/',
50
+ 'test/unit/helpers/',
51
+ 'public/stylesheets/'
52
+ ].each { |path| Rails::Generator::Commands::Create.any_instance.expects(:directory).with(path) }
53
+
54
+ templates = {
55
+ 'view_index.html.erb' => 'app/views/testies/index.html.erb',
56
+ 'view_show.html.erb' => 'app/views/testies/show.html.erb',
57
+ 'view_new.html.erb' => 'app/views/testies/new.html.erb',
58
+ 'view_edit.html.erb' => 'app/views/testies/edit.html.erb',
59
+ 'layout.html.erb' => 'app/views/layouts/testies.html.erb',
60
+ 'style.css' => 'public/stylesheets/scaffold.css',
61
+ 'controller.rb' => 'app/controllers/testies_controller.rb',
62
+ 'functional_test.rb' => 'test/functional/testies_controller_test.rb',
63
+ 'helper.rb' => 'app/helpers/testies_helper.rb',
64
+ 'helper_test.rb' => 'test/unit/helpers/testies_helper_test.rb'
65
+ }.each { |template, target| Rails::Generator::Commands::Create.any_instance.expects(:template).with(template, target) }
66
+
67
+ Rails::Generator::Commands::Create.any_instance.expects(:route_resources).with('testies')
68
+ Rails::Generator::Commands::Create.any_instance.expects(:file).never
69
+
70
+ @generator_script.run(['view_for', 'testy'])
71
+ end
72
+ end
73
+ end
74
+
75
+ context "A view_for generator" do
76
+ setup do
77
+ @view_for_gen = Rails::Generator::Base.instance('view_for', ['testy'] )
78
+ @model = setup_test_model
79
+ end
80
+
81
+ should "have the proper model name" do
82
+ assert_equal @model, @view_for_gen.model
83
+ end
84
+
85
+ should "have the proper attributes for ERB" do
86
+ %w{ first_name last_name address }.each_with_index do |col, i|
87
+ assert_equal col, @view_for_gen.attributes[i].name
88
+ assert_equal :string, @view_for_gen.attributes[i].type
89
+ end
90
+ end
91
+
92
+ end
93
+ end
@@ -0,0 +1,29 @@
1
+ require 'test_helper'
2
+
3
+ class ViewMapperTest < Test::Unit::TestCase
4
+
5
+ context "A rails generator script with a view option specified" do
6
+ setup do
7
+ @gen = Rails::Generator::Base.instance('fake', ['testy', 'name:string', '--view', 'fake'])
8
+ end
9
+
10
+ should "use the specified view" do
11
+ assert_equal 'fake', @gen.view_name
12
+ end
13
+
14
+ should "use the templates for the specified view" do
15
+ assert_equal '/some/path/templates', @gen.source_root
16
+ end
17
+ end
18
+
19
+ context "A rails generator script with a view option and parameter specified" do
20
+ setup do
21
+ @gen = Rails::Generator::Base.instance('fake', ['testy', 'name:string', '--view', 'fake:value'])
22
+ end
23
+
24
+ should "pass the view parameter to the specified view" do
25
+ assert_equal 'value', @gen.view_param
26
+ assert_equal 'fake', @gen.view_name
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,125 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{view_mapper}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Pat Shaughnessy"]
12
+ s.date = %q{2009-09-30}
13
+ s.description = %q{Generate complex view code for your models}
14
+ s.email = %q{pat@patshaughnessy.net}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".gitignore",
22
+ "LICENSE",
23
+ "README",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "generators/scaffold_for_view/USAGE",
27
+ "generators/scaffold_for_view/scaffold_for_view_generator.rb",
28
+ "generators/view_for/USAGE",
29
+ "generators/view_for/view_for_generator.rb",
30
+ "lib/view_mapper.rb",
31
+ "lib/view_mapper/auto_complete_templates/controller.rb",
32
+ "lib/view_mapper/auto_complete_templates/functional_test.rb",
33
+ "lib/view_mapper/auto_complete_templates/helper.rb",
34
+ "lib/view_mapper/auto_complete_templates/helper_test.rb",
35
+ "lib/view_mapper/auto_complete_templates/layout.html.erb",
36
+ "lib/view_mapper/auto_complete_templates/style.css",
37
+ "lib/view_mapper/auto_complete_templates/view_edit.html.erb",
38
+ "lib/view_mapper/auto_complete_templates/view_index.html.erb",
39
+ "lib/view_mapper/auto_complete_templates/view_new.html.erb",
40
+ "lib/view_mapper/auto_complete_templates/view_show.html.erb",
41
+ "lib/view_mapper/auto_complete_view.rb",
42
+ "lib/view_mapper/editable_manifest.rb",
43
+ "lib/view_mapper/route_action.rb",
44
+ "lib/view_mapper/view_mapper.rb",
45
+ "test/auto_complete_test.rb",
46
+ "test/database.yml",
47
+ "test/editable_manifest_test.rb",
48
+ "test/expected_templates/auto_complete/edit.html.erb",
49
+ "test/expected_templates/auto_complete/expected_routes.rb",
50
+ "test/expected_templates/auto_complete/index.html.erb",
51
+ "test/expected_templates/auto_complete/new.html.erb",
52
+ "test/expected_templates/auto_complete/show.html.erb",
53
+ "test/expected_templates/auto_complete/standard_routes.rb",
54
+ "test/expected_templates/auto_complete/testies.html.erb",
55
+ "test/expected_templates/auto_complete/testies_controller.rb",
56
+ "test/fake/fake_generator.rb",
57
+ "test/fake_view.rb",
58
+ "test/rails_generator.rb",
59
+ "test/rails_generator/base.rb",
60
+ "test/rails_generator/commands.rb",
61
+ "test/rails_generator/generated_attribute.rb",
62
+ "test/rails_generator/generators/components/scaffold/scaffold_generator.rb",
63
+ "test/rails_generator/lookup.rb",
64
+ "test/rails_generator/manifest.rb",
65
+ "test/rails_generator/options.rb",
66
+ "test/rails_generator/scripts.rb",
67
+ "test/rails_generator/scripts/destroy.rb",
68
+ "test/rails_generator/scripts/generate.rb",
69
+ "test/rails_generator/scripts/update.rb",
70
+ "test/rails_generator/secret_key_generator.rb",
71
+ "test/rails_generator/simple_logger.rb",
72
+ "test/rails_generator/spec.rb",
73
+ "test/scaffold_for_view_generator_test.rb",
74
+ "test/test_helper.rb",
75
+ "test/view_for_generator_test.rb",
76
+ "test/view_mapper_test.rb",
77
+ "view_mapper.gemspec"
78
+ ]
79
+ s.homepage = %q{http://github.com/patshaughnessy/view_mapper}
80
+ s.rdoc_options = ["--charset=UTF-8"]
81
+ s.require_paths = ["lib"]
82
+ s.rubygems_version = %q{1.3.5}
83
+ s.summary = %q{Generate complex view code for your models}
84
+ s.test_files = [
85
+ "test/auto_complete_test.rb",
86
+ "test/editable_manifest_test.rb",
87
+ "test/expected_templates/auto_complete/expected_routes.rb",
88
+ "test/expected_templates/auto_complete/standard_routes.rb",
89
+ "test/expected_templates/auto_complete/testies_controller.rb",
90
+ "test/fake/fake_generator.rb",
91
+ "test/fake_view.rb",
92
+ "test/rails_generator/base.rb",
93
+ "test/rails_generator/commands.rb",
94
+ "test/rails_generator/generated_attribute.rb",
95
+ "test/rails_generator/generators/components/scaffold/scaffold_generator.rb",
96
+ "test/rails_generator/lookup.rb",
97
+ "test/rails_generator/manifest.rb",
98
+ "test/rails_generator/options.rb",
99
+ "test/rails_generator/scripts/destroy.rb",
100
+ "test/rails_generator/scripts/generate.rb",
101
+ "test/rails_generator/scripts/update.rb",
102
+ "test/rails_generator/scripts.rb",
103
+ "test/rails_generator/secret_key_generator.rb",
104
+ "test/rails_generator/simple_logger.rb",
105
+ "test/rails_generator/spec.rb",
106
+ "test/rails_generator.rb",
107
+ "test/scaffold_for_view_generator_test.rb",
108
+ "test/test_helper.rb",
109
+ "test/view_for_generator_test.rb",
110
+ "test/view_mapper_test.rb"
111
+ ]
112
+
113
+ if s.respond_to? :specification_version then
114
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
115
+ s.specification_version = 3
116
+
117
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
118
+ s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
119
+ else
120
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
121
+ end
122
+ else
123
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
124
+ end
125
+ end
metadata ADDED
@@ -0,0 +1,147 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: view_mapper
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Pat Shaughnessy
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-09-30 00:00:00 -04:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: thoughtbot-shoulda
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ description: Generate complex view code for your models
26
+ email: pat@patshaughnessy.net
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - LICENSE
33
+ - README
34
+ files:
35
+ - .document
36
+ - .gitignore
37
+ - LICENSE
38
+ - README
39
+ - Rakefile
40
+ - VERSION
41
+ - generators/scaffold_for_view/USAGE
42
+ - generators/scaffold_for_view/scaffold_for_view_generator.rb
43
+ - generators/view_for/USAGE
44
+ - generators/view_for/view_for_generator.rb
45
+ - lib/view_mapper.rb
46
+ - lib/view_mapper/auto_complete_templates/controller.rb
47
+ - lib/view_mapper/auto_complete_templates/functional_test.rb
48
+ - lib/view_mapper/auto_complete_templates/helper.rb
49
+ - lib/view_mapper/auto_complete_templates/helper_test.rb
50
+ - lib/view_mapper/auto_complete_templates/layout.html.erb
51
+ - lib/view_mapper/auto_complete_templates/style.css
52
+ - lib/view_mapper/auto_complete_templates/view_edit.html.erb
53
+ - lib/view_mapper/auto_complete_templates/view_index.html.erb
54
+ - lib/view_mapper/auto_complete_templates/view_new.html.erb
55
+ - lib/view_mapper/auto_complete_templates/view_show.html.erb
56
+ - lib/view_mapper/auto_complete_view.rb
57
+ - lib/view_mapper/editable_manifest.rb
58
+ - lib/view_mapper/route_action.rb
59
+ - lib/view_mapper/view_mapper.rb
60
+ - test/auto_complete_test.rb
61
+ - test/database.yml
62
+ - test/editable_manifest_test.rb
63
+ - test/expected_templates/auto_complete/edit.html.erb
64
+ - test/expected_templates/auto_complete/expected_routes.rb
65
+ - test/expected_templates/auto_complete/index.html.erb
66
+ - test/expected_templates/auto_complete/new.html.erb
67
+ - test/expected_templates/auto_complete/show.html.erb
68
+ - test/expected_templates/auto_complete/standard_routes.rb
69
+ - test/expected_templates/auto_complete/testies.html.erb
70
+ - test/expected_templates/auto_complete/testies_controller.rb
71
+ - test/fake/fake_generator.rb
72
+ - test/fake_view.rb
73
+ - test/rails_generator.rb
74
+ - test/rails_generator/base.rb
75
+ - test/rails_generator/commands.rb
76
+ - test/rails_generator/generated_attribute.rb
77
+ - test/rails_generator/generators/components/scaffold/scaffold_generator.rb
78
+ - test/rails_generator/lookup.rb
79
+ - test/rails_generator/manifest.rb
80
+ - test/rails_generator/options.rb
81
+ - test/rails_generator/scripts.rb
82
+ - test/rails_generator/scripts/destroy.rb
83
+ - test/rails_generator/scripts/generate.rb
84
+ - test/rails_generator/scripts/update.rb
85
+ - test/rails_generator/secret_key_generator.rb
86
+ - test/rails_generator/simple_logger.rb
87
+ - test/rails_generator/spec.rb
88
+ - test/scaffold_for_view_generator_test.rb
89
+ - test/test_helper.rb
90
+ - test/view_for_generator_test.rb
91
+ - test/view_mapper_test.rb
92
+ - view_mapper.gemspec
93
+ has_rdoc: true
94
+ homepage: http://github.com/patshaughnessy/view_mapper
95
+ licenses: []
96
+
97
+ post_install_message:
98
+ rdoc_options:
99
+ - --charset=UTF-8
100
+ require_paths:
101
+ - lib
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: "0"
107
+ version:
108
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: "0"
113
+ version:
114
+ requirements: []
115
+
116
+ rubyforge_project:
117
+ rubygems_version: 1.3.5
118
+ signing_key:
119
+ specification_version: 3
120
+ summary: Generate complex view code for your models
121
+ test_files:
122
+ - test/auto_complete_test.rb
123
+ - test/editable_manifest_test.rb
124
+ - test/expected_templates/auto_complete/expected_routes.rb
125
+ - test/expected_templates/auto_complete/standard_routes.rb
126
+ - test/expected_templates/auto_complete/testies_controller.rb
127
+ - test/fake/fake_generator.rb
128
+ - test/fake_view.rb
129
+ - test/rails_generator/base.rb
130
+ - test/rails_generator/commands.rb
131
+ - test/rails_generator/generated_attribute.rb
132
+ - test/rails_generator/generators/components/scaffold/scaffold_generator.rb
133
+ - test/rails_generator/lookup.rb
134
+ - test/rails_generator/manifest.rb
135
+ - test/rails_generator/options.rb
136
+ - test/rails_generator/scripts/destroy.rb
137
+ - test/rails_generator/scripts/generate.rb
138
+ - test/rails_generator/scripts/update.rb
139
+ - test/rails_generator/scripts.rb
140
+ - test/rails_generator/secret_key_generator.rb
141
+ - test/rails_generator/simple_logger.rb
142
+ - test/rails_generator/spec.rb
143
+ - test/rails_generator.rb
144
+ - test/scaffold_for_view_generator_test.rb
145
+ - test/test_helper.rb
146
+ - test/view_for_generator_test.rb
147
+ - test/view_mapper_test.rb