view_models 2.0.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. data/.bundle/config +2 -0
  2. data/.gitignore +8 -0
  3. data/.rspec +2 -0
  4. data/.rvmrc +1 -0
  5. data/.travis.yml +19 -0
  6. data/.yardoc/checksums +13 -0
  7. data/.yardoc/object_types +0 -0
  8. data/.yardoc/objects/root.dat +0 -0
  9. data/.yardoc/proxy_types +0 -0
  10. data/Appraisals +15 -0
  11. data/CHANGELOG +31 -0
  12. data/Gemfile +13 -0
  13. data/Gemfile.lock +174 -0
  14. data/MIT-LICENSE +20 -0
  15. data/README.textile +199 -0
  16. data/Rakefile +24 -0
  17. data/doc/ModulesInRenderHierarchy.html +186 -0
  18. data/doc/ModulesInRenderHierarchy/ClassMethods.html +188 -0
  19. data/doc/ViewModels.html +202 -0
  20. data/doc/ViewModels/Base.html +1342 -0
  21. data/doc/ViewModels/ContextExtractor.html +406 -0
  22. data/doc/ViewModels/Extensions.html +128 -0
  23. data/doc/ViewModels/Extensions/ModelReader.html +255 -0
  24. data/doc/ViewModels/Extensions/ModelReader/FilteredDelegationInstaller.html +908 -0
  25. data/doc/ViewModels/Extensions/ModelReader/Options.html +551 -0
  26. data/doc/ViewModels/Extensions/View.html +303 -0
  27. data/doc/ViewModels/Helpers.html +129 -0
  28. data/doc/ViewModels/Helpers/Mapping.html +562 -0
  29. data/doc/ViewModels/Helpers/Mapping/Collection.html +844 -0
  30. data/doc/ViewModels/Helpers/View.html +287 -0
  31. data/doc/ViewModels/PathStore.html +745 -0
  32. data/doc/ViewModels/RenderOptions.html +126 -0
  33. data/doc/ViewModels/RenderOptions/Base.html +1187 -0
  34. data/doc/ViewModels/RenderOptions/Partial.html +231 -0
  35. data/doc/ViewModels/RenderOptions/Template.html +231 -0
  36. data/doc/ViewModels/View.html +414 -0
  37. data/doc/ViewModelsGenerator.html +410 -0
  38. data/doc/_index.html +317 -0
  39. data/doc/class_list.html +53 -0
  40. data/doc/css/common.css +1 -0
  41. data/doc/css/full_list.css +57 -0
  42. data/doc/css/style.css +328 -0
  43. data/doc/file.README.html +113 -0
  44. data/doc/file_list.html +55 -0
  45. data/doc/frames.html +28 -0
  46. data/doc/index.html +113 -0
  47. data/doc/js/app.js +214 -0
  48. data/doc/js/full_list.js +173 -0
  49. data/doc/js/jquery.js +4 -0
  50. data/doc/method_list.html +628 -0
  51. data/doc/top-level-namespace.html +114 -0
  52. data/feature_support/testapp/app/controllers/heroes_controller.rb +6 -0
  53. data/feature_support/testapp/app/controllers/users_controller.rb +6 -0
  54. data/feature_support/testapp/app/helpers/application_helper.rb +8 -0
  55. data/feature_support/testapp/app/models/hero.rb +8 -0
  56. data/feature_support/testapp/app/models/user.rb +3 -0
  57. data/feature_support/testapp/app/view_models/hero.rb +8 -0
  58. data/feature_support/testapp/app/view_models/test.rb +8 -0
  59. data/feature_support/testapp/app/view_models/user.rb +14 -0
  60. data/feature_support/testapp/app/views/heroes/show.html.slim +6 -0
  61. data/feature_support/testapp/app/views/users/_box.html.slim +8 -0
  62. data/feature_support/testapp/app/views/users/show.html.slim +6 -0
  63. data/feature_support/testapp/config/application.rb +64 -0
  64. data/feature_support/testapp/config/cucumber.yml +8 -0
  65. data/feature_support/testapp/config/database.yml +28 -0
  66. data/feature_support/testapp/config/environments/cucumber.rb +11 -0
  67. data/feature_support/testapp/config/environments/test.rb +27 -0
  68. data/feature_support/testapp/config/routes.rb +4 -0
  69. data/feature_support/testapp/db/migrate/1_create_users.rb +13 -0
  70. data/feature_support/testapp/features/inheritance.feature +16 -0
  71. data/feature_support/testapp/features/step_definitions/testapp_steps.rb +16 -0
  72. data/feature_support/testapp/features/support/env.rb +13 -0
  73. data/feature_support/testapp/features/users.feature +15 -0
  74. data/feature_support/testapp/lib/tasks/cucumber.rake +31 -0
  75. data/feature_support/testapp/spec/factories/heroes.rb +7 -0
  76. data/feature_support/testapp/spec/factories/users.rb +7 -0
  77. data/features/rails_integration.feature +21 -0
  78. data/features/step_definitions/rails_steps.rb +112 -0
  79. data/features/support/env.rb +6 -0
  80. data/gemfiles/3.0.Gemfile +13 -0
  81. data/gemfiles/3.1.Gemfile +15 -0
  82. data/gemfiles/3.2.gemfile +15 -0
  83. data/lib/rails/generators/view_models/USAGE +6 -0
  84. data/lib/rails/generators/view_models/templates/views/_collection.html.erb +6 -0
  85. data/lib/{rails2/generators/view_models/templates/views/view_models/collection → rails/generators/view_models/templates/views}/_collection.html.haml +1 -2
  86. data/lib/rails/generators/view_models/templates/views/_collection.html.slim +6 -0
  87. data/lib/{rails2/generators/view_models/templates/views/_empty.html.haml → rails/generators/view_models/templates/views/_empty.html.erb} +0 -0
  88. data/lib/rails/generators/view_models/templates/views/_empty.html.haml +0 -0
  89. data/lib/rails/generators/view_models/templates/views/_empty.html.slim +0 -0
  90. data/lib/rails/generators/view_models/templates/views/_list.html.erb +6 -0
  91. data/lib/rails/generators/view_models/templates/views/_list.html.haml +4 -0
  92. data/lib/rails/generators/view_models/templates/views/_list.html.slim +5 -0
  93. data/lib/rails/generators/view_models/templates/views/_pagination.html.erb +18 -0
  94. data/lib/{rails2/generators/view_models/templates/views/view_models/collection → rails/generators/view_models/templates/views}/_pagination.html.haml +2 -2
  95. data/lib/rails/generators/view_models/templates/views/_pagination.html.slim +12 -0
  96. data/lib/rails/generators/view_models/templates/views/_table.html.erb +10 -0
  97. data/lib/{rails2/generators/view_models/templates/views/view_models/collection → rails/generators/view_models/templates/views}/_table.html.haml +0 -0
  98. data/lib/rails/generators/view_models/templates/views/_table.html.slim +5 -0
  99. data/lib/rails/generators/view_models/view_models_generator.rb +57 -0
  100. data/lib/view_models.rb +15 -5
  101. data/lib/{shared/lib/view_models → view_models}/base.rb +148 -37
  102. data/lib/{shared/lib/view_models → view_models}/context_extractor.rb +6 -2
  103. data/lib/{shared/lib/view_models → view_models}/extensions/model_reader.rb +27 -13
  104. data/lib/{rails2/lib → view_models}/extensions/view.rb +6 -1
  105. data/lib/view_models/helpers/collection.rb +113 -0
  106. data/lib/{shared/lib/view_models → view_models}/helpers/mapping.rb +12 -15
  107. data/lib/{rails2/lib → view_models}/helpers/view.rb +5 -1
  108. data/lib/{shared/lib/view_models → view_models}/path_store.rb +6 -1
  109. data/lib/{shared/lib/view_models → view_models}/render_options.rb +19 -4
  110. data/lib/view_models/version.rb +5 -0
  111. data/lib/{rails2/lib/view_models → view_models}/view.rb +7 -6
  112. data/spec/{rails2/lib → lib}/view_models/base_spec.rb +38 -5
  113. data/spec/{rails2/lib → lib/view_models}/extensions/model_reader_spec.rb +4 -4
  114. data/spec/{shared/lib → lib/view_models}/helpers/collection_spec.rb +21 -1
  115. data/spec/{shared/lib → lib/view_models}/helpers/mapping_spec.rb +6 -5
  116. data/spec/{rails2/lib → lib/view_models}/helpers/view_spec.rb +1 -1
  117. data/spec/lib/view_models/view_spec.rb +42 -0
  118. data/spec/spec_helper.rb +32 -0
  119. data/spec/spec_helper_extensions.rb +13 -0
  120. data/view_models.gemspec +36 -0
  121. metadata +411 -142
  122. data/lib/init.rb +0 -1
  123. data/lib/padrino/README.textile +0 -3
  124. data/lib/padrino/init.rb +0 -10
  125. data/lib/padrino/lib/helpers/collection.rb +0 -27
  126. data/lib/padrino/lib/padrino/view_models.rb +0 -19
  127. data/lib/padrino/lib/view_models/base.rb +0 -65
  128. data/lib/rails2/README.textile +0 -3
  129. data/lib/rails2/TODO.textile +0 -5
  130. data/lib/rails2/generators/view_models/USAGE +0 -6
  131. data/lib/rails2/generators/view_models/templates/README +0 -1
  132. data/lib/rails2/generators/view_models/templates/spec/view_model_spec.rb +0 -7
  133. data/lib/rails2/generators/view_models/templates/view_models/view_model.rb +0 -5
  134. data/lib/rails2/generators/view_models/templates/views/view_models/collection/_collection.html.erb +0 -1
  135. data/lib/rails2/generators/view_models/templates/views/view_models/collection/_collection.text.erb +0 -6
  136. data/lib/rails2/generators/view_models/templates/views/view_models/collection/_list.html.erb +0 -1
  137. data/lib/rails2/generators/view_models/templates/views/view_models/collection/_list.text.erb +0 -6
  138. data/lib/rails2/generators/view_models/templates/views/view_models/collection/_pagination.text.erb +0 -3
  139. data/lib/rails2/generators/view_models/templates/views/view_models/collection/_table.text.erb +0 -10
  140. data/lib/rails2/generators/view_models/view_models_generator.rb +0 -47
  141. data/lib/rails2/init.rb +0 -18
  142. data/lib/rails2/lib/experimental/README.textile +0 -32
  143. data/lib/rails2/lib/experimental/modules_in_render_hierarchy.rb +0 -21
  144. data/lib/rails2/lib/helpers/collection.rb +0 -27
  145. data/lib/rails2/lib/view_models.rb +0 -1
  146. data/lib/rails2/lib/view_models/base.rb +0 -99
  147. data/lib/shared/README.textile +0 -3
  148. data/lib/shared/init.rb +0 -11
  149. data/lib/shared/lib/view_models.rb +0 -4
  150. data/lib/shared/lib/view_models/extensions/active_record.rb +0 -27
  151. data/lib/shared/lib/view_models/helpers/collection.rb +0 -110
  152. data/spec/padrino/integration/integration_spec.rb +0 -287
  153. data/spec/padrino/lib/helpers/collection_spec.rb +0 -30
  154. data/spec/rails2/integration/integration_spec.rb +0 -279
  155. data/spec/rails2/lib/extensions/active_record_spec.rb +0 -31
  156. data/spec/rails2/lib/helpers/collection_spec.rb +0 -30
  157. data/spec/rails2/lib/view_models/view_spec.rb +0 -12
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), '../../spec_helper')
1
+ require 'spec_helper'
2
2
 
3
3
  describe ViewModels::Helpers::Mapping do
4
4
  include ViewModels::Helpers::Mapping
@@ -8,7 +8,6 @@ describe ViewModels::Helpers::Mapping do
8
8
  class SomeModelClazz; end
9
9
  class ViewModels::SomeModelClazz < ViewModels::Base; end
10
10
  context = stub :context
11
- self.stub! :default_view_model_class_for => ViewModels::SomeModelClazz
12
11
  model = SomeModelClazz.new
13
12
 
14
13
  ViewModels::SomeModelClazz.should_receive(:new).once.with model, context
@@ -19,12 +18,12 @@ describe ViewModels::Helpers::Mapping do
19
18
  it "should return an empty hash by default" do
20
19
  specific_view_model_mapping.should == {}
21
20
  end
22
- it "should raise an ArgumentError on an non-mapped model" do
23
- class SomeViewModelClass; end
21
+ it "should raise an ArgumentError on model that does not support 2 arguments" do
22
+ class SomeViewModelClass; def initialize; end; end
24
23
  specific_view_model_mapping[String] = SomeViewModelClass
25
24
  lambda {
26
25
  view_model_for("Some String")
27
- }.should raise_error(ArgumentError, "wrong number of arguments (2 for 0)")
26
+ }.should raise_error(ArgumentError, /2\sfor\s0|given\s2\,\sexpected\s0/)
28
27
  end
29
28
  end
30
29
  describe "no specific mapping" do
@@ -69,4 +68,6 @@ describe ViewModels::Helpers::Mapping do
69
68
  end
70
69
  end
71
70
 
71
+
72
+
72
73
  end
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), '/../../spec_helper')
1
+ require 'spec_helper'
2
2
 
3
3
  describe ViewModels::Helpers::View do
4
4
 
@@ -0,0 +1,42 @@
1
+ require 'spec_helper'
2
+
3
+ describe ViewModels::View do
4
+ subject do
5
+ controller_class = stub :controller_class, :view_paths => ActionView::PathSet.new
6
+ controller = stub :controller, :class => controller_class, :_prefixes => nil
7
+
8
+ ViewModels::View.new controller, Module.new
9
+ end
10
+
11
+ it "should be initializable" do
12
+ lambda { subject }.should_not raise_error
13
+ end
14
+
15
+ it "should be renderable" do
16
+ options = mock('options', :to_render_options => {:hey => 'hey!'})
17
+ subject.should_receive(:render).with(:hey => 'hey!').once
18
+ subject.render_with(options)
19
+ end
20
+
21
+ describe "finding templates" do
22
+ let(:lookup_context) { mock('lookup_context') }
23
+ let(:template) { mock('template') }
24
+
25
+ before(:each) do
26
+ subject.stub! :lookup_context => lookup_context
27
+ end
28
+ context "without ActionView Errors" do
29
+ it "should find the template via lookup context" do
30
+ lookup_context.should_receive(:find_template).with('PATH').once.and_return(template)
31
+ subject.find_template('PATH').should == template
32
+ end
33
+ end
34
+ context "with ActionView Errors" do
35
+ it "should return nil" do
36
+ lookup_context.should_receive(:find_template).with('PATH').once.and_raise(ActionView::MissingTemplate)
37
+ subject.find_template('PATH').should be_nil
38
+ end
39
+ end
40
+ end
41
+
42
+ end
@@ -0,0 +1,32 @@
1
+ require 'rubygems' #1.8.7
2
+
3
+ # Create Rails environment based on the version given from Appraisal
4
+ TESTAPP_ROOT = File.join(File.dirname(__FILE__), '..', 'tmp', 'aruba', 'testapp')
5
+ FileUtils.rm_rf(TESTAPP_ROOT) if File.exists?(TESTAPP_ROOT)
6
+ `rails new #{TESTAPP_ROOT}`
7
+
8
+ ENV['RAILS_ENV'] = 'test'
9
+ ENV['BUNDLE_GEMFILE'] ||= TESTAPP_ROOT + '/Gemfile'
10
+
11
+ require "#{TESTAPP_ROOT}/config/environment"
12
+ require 'rspec'
13
+ require 'rspec/rails'
14
+ require 'factory_girl'
15
+ require 'factory_girl_rails'
16
+
17
+ require 'spec_helper_extensions'
18
+ include SpecHelperExtensions
19
+
20
+ PROJECT_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')).freeze
21
+
22
+ $LOAD_PATH << File.join(PROJECT_ROOT, 'lib')
23
+
24
+ Dir[File.join(PROJECT_ROOT, 'spec', 'support', '**', '*.rb')].each { |file| require(file) }
25
+
26
+ # Run the migrations
27
+ ActiveRecord::Migration.verbose = false
28
+ ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate")
29
+
30
+ RSpec.configure do |config|
31
+ config.include FactoryGirl::Syntax::Methods
32
+ end
@@ -0,0 +1,13 @@
1
+ module SpecHelperExtensions
2
+
3
+ # Used to test private methods.
4
+ #
5
+ # The idea is to replace instance.send :private_method.
6
+ # Now it is rather like:
7
+ # We have the scenario we are in the given instance.
8
+ #
9
+ def in_the(instance, &block)
10
+ instance.instance_eval(&block)
11
+ end
12
+
13
+ end
@@ -0,0 +1,36 @@
1
+ $LOAD_PATH << File.join(File.dirname(__FILE__), 'lib')
2
+ require 'view_models/version'
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "view_models"
6
+ s.version = ViewModels::VERSION.dup
7
+ s.authors = ["Florian Hanke", "Kaspar Schiess", "Niko Dittmann", "Beat Richartz"]
8
+ s.date = Time.now.strftime("%Y-%m-%d")
9
+ s.email = "support@viewmodels.com"
10
+ s.homepage = "http://florianhanke.com/view_models/"
11
+ s.summary = "The missing R to the Rails MVC"
12
+ s.description = "The missing R to the Rails MVC"
13
+
14
+ s.files = `git ls-files`.split("\n")
15
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
+ s.require_paths = ["lib"]
18
+
19
+ s.add_dependency 'activerecord', '>= 3.0.0'
20
+ s.add_dependency 'actionpack', '>= 3.0.0'
21
+ s.add_dependency 'actionmailer', '>= 3.0.0'
22
+
23
+ s.add_development_dependency 'rake', '>= 0.8.7'
24
+ s.add_development_dependency 'aruba'
25
+ s.add_development_dependency 'yard'
26
+ s.add_development_dependency 'RedCloth'
27
+ s.add_development_dependency 'database_cleaner'
28
+ s.add_development_dependency 'appraisal', '~> 0.4.0'
29
+ s.add_development_dependency 'bundler', '>= 1.1.0'
30
+ s.add_development_dependency 'cucumber-rails'
31
+ s.add_development_dependency 'cucumber'
32
+ s.add_development_dependency 'factory_girl_rails', '~> 1.7.0'
33
+ s.add_development_dependency 'factory_girl', '~> 2.6.4'
34
+ s.add_development_dependency 'slim-rails', '~> 1.0.0'
35
+ s.add_development_dependency 'rspec-rails', '~> 2.11.0'
36
+ end
metadata CHANGED
@@ -1,166 +1,435 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: view_models
3
- version: !ruby/object:Gem::Version
4
- hash: 13
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.0.0
5
5
  prerelease:
6
- segments:
7
- - 2
8
- - 0
9
- - 1
10
- version: 2.0.1
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Florian Hanke
14
9
  - Kaspar Schiess
15
10
  - Niko Dittmann
16
- - Andreas Schacke
11
+ - Beat Richartz
17
12
  autorequire:
18
13
  bindir: bin
19
14
  cert_chain: []
20
-
21
- date: 2011-04-10 00:00:00 +10:00
22
- default_executable:
23
- dependencies:
24
- - !ruby/object:Gem::Dependency
25
- name: activesupport
26
- prerelease: false
27
- requirement: &id001 !ruby/object:Gem::Requirement
28
- none: false
29
- requirements:
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- hash: 7
33
- segments:
34
- - 2
35
- - 2
36
- - 0
37
- version: 2.2.0
15
+ date: 2012-10-30 00:00:00.000000000 Z
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
18
+ name: activerecord
19
+ requirement: !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ! '>='
23
+ - !ruby/object:Gem::Version
24
+ version: 3.0.0
25
+ type: :runtime
26
+ prerelease: false
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: 3.0.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: actionpack
35
+ requirement: !ruby/object:Gem::Requirement
36
+ none: false
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: 3.0.0
41
+ type: :runtime
42
+ prerelease: false
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ none: false
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: 3.0.0
49
+ - !ruby/object:Gem::Dependency
50
+ name: actionmailer
51
+ requirement: !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ! '>='
55
+ - !ruby/object:Gem::Version
56
+ version: 3.0.0
38
57
  type: :runtime
39
- version_requirements: *id001
40
- - !ruby/object:Gem::Dependency
41
- name: rspec
42
- prerelease: false
43
- requirement: &id002 !ruby/object:Gem::Requirement
44
- none: false
45
- requirements:
46
- - - ">="
47
- - !ruby/object:Gem::Version
48
- hash: 13
49
- segments:
50
- - 1
51
- - 2
52
- - 9
53
- version: 1.2.9
58
+ prerelease: false
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ none: false
61
+ requirements:
62
+ - - ! '>='
63
+ - !ruby/object:Gem::Version
64
+ version: 3.0.0
65
+ - !ruby/object:Gem::Dependency
66
+ name: rake
67
+ requirement: !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ! '>='
71
+ - !ruby/object:Gem::Version
72
+ version: 0.8.7
73
+ type: :development
74
+ prerelease: false
75
+ version_requirements: !ruby/object:Gem::Requirement
76
+ none: false
77
+ requirements:
78
+ - - ! '>='
79
+ - !ruby/object:Gem::Version
80
+ version: 0.8.7
81
+ - !ruby/object:Gem::Dependency
82
+ name: aruba
83
+ requirement: !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ! '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ type: :development
90
+ prerelease: false
91
+ version_requirements: !ruby/object:Gem::Requirement
92
+ none: false
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: yard
99
+ requirement: !ruby/object:Gem::Requirement
100
+ none: false
101
+ requirements:
102
+ - - ! '>='
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ none: false
109
+ requirements:
110
+ - - ! '>='
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ - !ruby/object:Gem::Dependency
114
+ name: RedCloth
115
+ requirement: !ruby/object:Gem::Requirement
116
+ none: false
117
+ requirements:
118
+ - - ! '>='
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
121
+ type: :development
122
+ prerelease: false
123
+ version_requirements: !ruby/object:Gem::Requirement
124
+ none: false
125
+ requirements:
126
+ - - ! '>='
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ - !ruby/object:Gem::Dependency
130
+ name: database_cleaner
131
+ requirement: !ruby/object:Gem::Requirement
132
+ none: false
133
+ requirements:
134
+ - - ! '>='
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
137
+ type: :development
138
+ prerelease: false
139
+ version_requirements: !ruby/object:Gem::Requirement
140
+ none: false
141
+ requirements:
142
+ - - ! '>='
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ - !ruby/object:Gem::Dependency
146
+ name: appraisal
147
+ requirement: !ruby/object:Gem::Requirement
148
+ none: false
149
+ requirements:
150
+ - - ~>
151
+ - !ruby/object:Gem::Version
152
+ version: 0.4.0
153
+ type: :development
154
+ prerelease: false
155
+ version_requirements: !ruby/object:Gem::Requirement
156
+ none: false
157
+ requirements:
158
+ - - ~>
159
+ - !ruby/object:Gem::Version
160
+ version: 0.4.0
161
+ - !ruby/object:Gem::Dependency
162
+ name: bundler
163
+ requirement: !ruby/object:Gem::Requirement
164
+ none: false
165
+ requirements:
166
+ - - ! '>='
167
+ - !ruby/object:Gem::Version
168
+ version: 1.1.0
169
+ type: :development
170
+ prerelease: false
171
+ version_requirements: !ruby/object:Gem::Requirement
172
+ none: false
173
+ requirements:
174
+ - - ! '>='
175
+ - !ruby/object:Gem::Version
176
+ version: 1.1.0
177
+ - !ruby/object:Gem::Dependency
178
+ name: cucumber-rails
179
+ requirement: !ruby/object:Gem::Requirement
180
+ none: false
181
+ requirements:
182
+ - - ! '>='
183
+ - !ruby/object:Gem::Version
184
+ version: '0'
185
+ type: :development
186
+ prerelease: false
187
+ version_requirements: !ruby/object:Gem::Requirement
188
+ none: false
189
+ requirements:
190
+ - - ! '>='
191
+ - !ruby/object:Gem::Version
192
+ version: '0'
193
+ - !ruby/object:Gem::Dependency
194
+ name: cucumber
195
+ requirement: !ruby/object:Gem::Requirement
196
+ none: false
197
+ requirements:
198
+ - - ! '>='
199
+ - !ruby/object:Gem::Version
200
+ version: '0'
54
201
  type: :development
55
- version_requirements: *id002
56
- description: "For Padrino and Rails 2 views. Adds the missing R (Representation) to Rails' MVC. Provides simple proxy functionality for your models, thus helps you keep the model and view representation separate. Define focused helper methods on the (view) model, more quickly understood and more easily testable. Also: Hierarchical rendering for your hierarchical models. So, in a nutshell: Polymorphism not just in the model, but also in the view. Have fun!"
57
- email: florian.hanke@gmail.com
202
+ prerelease: false
203
+ version_requirements: !ruby/object:Gem::Requirement
204
+ none: false
205
+ requirements:
206
+ - - ! '>='
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ - !ruby/object:Gem::Dependency
210
+ name: factory_girl_rails
211
+ requirement: !ruby/object:Gem::Requirement
212
+ none: false
213
+ requirements:
214
+ - - ~>
215
+ - !ruby/object:Gem::Version
216
+ version: 1.7.0
217
+ type: :development
218
+ prerelease: false
219
+ version_requirements: !ruby/object:Gem::Requirement
220
+ none: false
221
+ requirements:
222
+ - - ~>
223
+ - !ruby/object:Gem::Version
224
+ version: 1.7.0
225
+ - !ruby/object:Gem::Dependency
226
+ name: factory_girl
227
+ requirement: !ruby/object:Gem::Requirement
228
+ none: false
229
+ requirements:
230
+ - - ~>
231
+ - !ruby/object:Gem::Version
232
+ version: 2.6.4
233
+ type: :development
234
+ prerelease: false
235
+ version_requirements: !ruby/object:Gem::Requirement
236
+ none: false
237
+ requirements:
238
+ - - ~>
239
+ - !ruby/object:Gem::Version
240
+ version: 2.6.4
241
+ - !ruby/object:Gem::Dependency
242
+ name: slim-rails
243
+ requirement: !ruby/object:Gem::Requirement
244
+ none: false
245
+ requirements:
246
+ - - ~>
247
+ - !ruby/object:Gem::Version
248
+ version: 1.0.0
249
+ type: :development
250
+ prerelease: false
251
+ version_requirements: !ruby/object:Gem::Requirement
252
+ none: false
253
+ requirements:
254
+ - - ~>
255
+ - !ruby/object:Gem::Version
256
+ version: 1.0.0
257
+ - !ruby/object:Gem::Dependency
258
+ name: rspec-rails
259
+ requirement: !ruby/object:Gem::Requirement
260
+ none: false
261
+ requirements:
262
+ - - ~>
263
+ - !ruby/object:Gem::Version
264
+ version: 2.11.0
265
+ type: :development
266
+ prerelease: false
267
+ version_requirements: !ruby/object:Gem::Requirement
268
+ none: false
269
+ requirements:
270
+ - - ~>
271
+ - !ruby/object:Gem::Version
272
+ version: 2.11.0
273
+ description: The missing R to the Rails MVC
274
+ email: support@viewmodels.com
58
275
  executables: []
59
-
60
276
  extensions: []
61
-
62
277
  extra_rdoc_files: []
63
-
64
- files:
65
- - lib/init.rb
278
+ files:
279
+ - .bundle/config
280
+ - .gitignore
281
+ - .rspec
282
+ - .rvmrc
283
+ - .travis.yml
284
+ - .yardoc/checksums
285
+ - .yardoc/object_types
286
+ - .yardoc/objects/root.dat
287
+ - .yardoc/proxy_types
288
+ - Appraisals
289
+ - CHANGELOG
290
+ - Gemfile
291
+ - Gemfile.lock
292
+ - MIT-LICENSE
293
+ - README.textile
294
+ - Rakefile
295
+ - doc/ModulesInRenderHierarchy.html
296
+ - doc/ModulesInRenderHierarchy/ClassMethods.html
297
+ - doc/ViewModels.html
298
+ - doc/ViewModels/Base.html
299
+ - doc/ViewModels/ContextExtractor.html
300
+ - doc/ViewModels/Extensions.html
301
+ - doc/ViewModels/Extensions/ModelReader.html
302
+ - doc/ViewModels/Extensions/ModelReader/FilteredDelegationInstaller.html
303
+ - doc/ViewModels/Extensions/ModelReader/Options.html
304
+ - doc/ViewModels/Extensions/View.html
305
+ - doc/ViewModels/Helpers.html
306
+ - doc/ViewModels/Helpers/Mapping.html
307
+ - doc/ViewModels/Helpers/Mapping/Collection.html
308
+ - doc/ViewModels/Helpers/View.html
309
+ - doc/ViewModels/PathStore.html
310
+ - doc/ViewModels/RenderOptions.html
311
+ - doc/ViewModels/RenderOptions/Base.html
312
+ - doc/ViewModels/RenderOptions/Partial.html
313
+ - doc/ViewModels/RenderOptions/Template.html
314
+ - doc/ViewModels/View.html
315
+ - doc/ViewModelsGenerator.html
316
+ - doc/_index.html
317
+ - doc/class_list.html
318
+ - doc/css/common.css
319
+ - doc/css/full_list.css
320
+ - doc/css/style.css
321
+ - doc/file.README.html
322
+ - doc/file_list.html
323
+ - doc/frames.html
324
+ - doc/index.html
325
+ - doc/js/app.js
326
+ - doc/js/full_list.js
327
+ - doc/js/jquery.js
328
+ - doc/method_list.html
329
+ - doc/top-level-namespace.html
330
+ - feature_support/testapp/app/controllers/heroes_controller.rb
331
+ - feature_support/testapp/app/controllers/users_controller.rb
332
+ - feature_support/testapp/app/helpers/application_helper.rb
333
+ - feature_support/testapp/app/models/hero.rb
334
+ - feature_support/testapp/app/models/user.rb
335
+ - feature_support/testapp/app/view_models/hero.rb
336
+ - feature_support/testapp/app/view_models/test.rb
337
+ - feature_support/testapp/app/view_models/user.rb
338
+ - feature_support/testapp/app/views/heroes/show.html.slim
339
+ - feature_support/testapp/app/views/users/_box.html.slim
340
+ - feature_support/testapp/app/views/users/show.html.slim
341
+ - feature_support/testapp/config/application.rb
342
+ - feature_support/testapp/config/cucumber.yml
343
+ - feature_support/testapp/config/database.yml
344
+ - feature_support/testapp/config/environments/cucumber.rb
345
+ - feature_support/testapp/config/environments/test.rb
346
+ - feature_support/testapp/config/routes.rb
347
+ - feature_support/testapp/db/migrate/1_create_users.rb
348
+ - feature_support/testapp/features/inheritance.feature
349
+ - feature_support/testapp/features/step_definitions/testapp_steps.rb
350
+ - feature_support/testapp/features/support/env.rb
351
+ - feature_support/testapp/features/users.feature
352
+ - feature_support/testapp/lib/tasks/cucumber.rake
353
+ - feature_support/testapp/spec/factories/heroes.rb
354
+ - feature_support/testapp/spec/factories/users.rb
355
+ - features/rails_integration.feature
356
+ - features/step_definitions/rails_steps.rb
357
+ - features/support/env.rb
358
+ - gemfiles/3.0.Gemfile
359
+ - gemfiles/3.1.Gemfile
360
+ - gemfiles/3.2.gemfile
361
+ - lib/rails/generators/view_models/USAGE
362
+ - lib/rails/generators/view_models/templates/views/_collection.html.erb
363
+ - lib/rails/generators/view_models/templates/views/_collection.html.haml
364
+ - lib/rails/generators/view_models/templates/views/_collection.html.slim
365
+ - lib/rails/generators/view_models/templates/views/_empty.html.erb
366
+ - lib/rails/generators/view_models/templates/views/_empty.html.haml
367
+ - lib/rails/generators/view_models/templates/views/_empty.html.slim
368
+ - lib/rails/generators/view_models/templates/views/_list.html.erb
369
+ - lib/rails/generators/view_models/templates/views/_list.html.haml
370
+ - lib/rails/generators/view_models/templates/views/_list.html.slim
371
+ - lib/rails/generators/view_models/templates/views/_pagination.html.erb
372
+ - lib/rails/generators/view_models/templates/views/_pagination.html.haml
373
+ - lib/rails/generators/view_models/templates/views/_pagination.html.slim
374
+ - lib/rails/generators/view_models/templates/views/_table.html.erb
375
+ - lib/rails/generators/view_models/templates/views/_table.html.haml
376
+ - lib/rails/generators/view_models/templates/views/_table.html.slim
377
+ - lib/rails/generators/view_models/view_models_generator.rb
66
378
  - lib/view_models.rb
67
- - lib/shared/init.rb
68
- - lib/shared/lib/view_models/base.rb
69
- - lib/shared/lib/view_models/context_extractor.rb
70
- - lib/shared/lib/view_models/extensions/active_record.rb
71
- - lib/shared/lib/view_models/extensions/model_reader.rb
72
- - lib/shared/lib/view_models/helpers/collection.rb
73
- - lib/shared/lib/view_models/helpers/mapping.rb
74
- - lib/shared/lib/view_models/path_store.rb
75
- - lib/shared/lib/view_models/render_options.rb
76
- - lib/shared/lib/view_models.rb
77
- - lib/shared/README.textile
78
- - lib/padrino/init.rb
79
- - lib/padrino/lib/helpers/collection.rb
80
- - lib/padrino/lib/padrino/view_models.rb
81
- - lib/padrino/lib/view_models/base.rb
82
- - lib/padrino/README.textile
83
- - lib/rails2/generators/view_models/templates/README
84
- - lib/rails2/generators/view_models/templates/spec/view_model_spec.rb
85
- - lib/rails2/generators/view_models/templates/view_models/view_model.rb
86
- - lib/rails2/generators/view_models/templates/views/_empty.html.haml
87
- - lib/rails2/generators/view_models/templates/views/view_models/collection/_collection.html.erb
88
- - lib/rails2/generators/view_models/templates/views/view_models/collection/_collection.html.haml
89
- - lib/rails2/generators/view_models/templates/views/view_models/collection/_collection.text.erb
90
- - lib/rails2/generators/view_models/templates/views/view_models/collection/_list.html.erb
91
- - lib/rails2/generators/view_models/templates/views/view_models/collection/_list.text.erb
92
- - lib/rails2/generators/view_models/templates/views/view_models/collection/_pagination.html.haml
93
- - lib/rails2/generators/view_models/templates/views/view_models/collection/_pagination.text.erb
94
- - lib/rails2/generators/view_models/templates/views/view_models/collection/_table.html.haml
95
- - lib/rails2/generators/view_models/templates/views/view_models/collection/_table.text.erb
96
- - lib/rails2/generators/view_models/USAGE
97
- - lib/rails2/generators/view_models/view_models_generator.rb
98
- - lib/rails2/init.rb
99
- - lib/rails2/lib/experimental/modules_in_render_hierarchy.rb
100
- - lib/rails2/lib/experimental/README.textile
101
- - lib/rails2/lib/extensions/view.rb
102
- - lib/rails2/lib/helpers/collection.rb
103
- - lib/rails2/lib/helpers/view.rb
104
- - lib/rails2/lib/view_models/base.rb
105
- - lib/rails2/lib/view_models/view.rb
106
- - lib/rails2/lib/view_models.rb
107
- - lib/rails2/README.textile
108
- - lib/rails2/TODO.textile
109
- - spec/padrino/integration/integration_spec.rb
110
- - spec/padrino/lib/helpers/collection_spec.rb
111
- - spec/rails2/integration/integration_spec.rb
112
- - spec/rails2/lib/extensions/active_record_spec.rb
113
- - spec/rails2/lib/extensions/model_reader_spec.rb
114
- - spec/rails2/lib/helpers/collection_spec.rb
115
- - spec/rails2/lib/helpers/view_spec.rb
116
- - spec/rails2/lib/view_models/base_spec.rb
117
- - spec/rails2/lib/view_models/view_spec.rb
118
- - spec/shared/lib/helpers/collection_spec.rb
119
- - spec/shared/lib/helpers/mapping_spec.rb
120
- has_rdoc: true
121
- homepage: http://floere.github.com/view_models
379
+ - lib/view_models/base.rb
380
+ - lib/view_models/context_extractor.rb
381
+ - lib/view_models/extensions/model_reader.rb
382
+ - lib/view_models/extensions/view.rb
383
+ - lib/view_models/helpers/collection.rb
384
+ - lib/view_models/helpers/mapping.rb
385
+ - lib/view_models/helpers/view.rb
386
+ - lib/view_models/path_store.rb
387
+ - lib/view_models/render_options.rb
388
+ - lib/view_models/version.rb
389
+ - lib/view_models/view.rb
390
+ - spec/lib/view_models/base_spec.rb
391
+ - spec/lib/view_models/extensions/model_reader_spec.rb
392
+ - spec/lib/view_models/helpers/collection_spec.rb
393
+ - spec/lib/view_models/helpers/mapping_spec.rb
394
+ - spec/lib/view_models/helpers/view_spec.rb
395
+ - spec/lib/view_models/view_spec.rb
396
+ - spec/spec_helper.rb
397
+ - spec/spec_helper_extensions.rb
398
+ - view_models.gemspec
399
+ homepage: http://florianhanke.com/view_models/
122
400
  licenses: []
123
-
124
401
  post_install_message:
125
- rdoc_options:
126
- - --inline-source
127
- - --charset=UTF-8
128
- require_paths:
402
+ rdoc_options: []
403
+ require_paths:
129
404
  - lib
130
- required_ruby_version: !ruby/object:Gem::Requirement
405
+ required_ruby_version: !ruby/object:Gem::Requirement
131
406
  none: false
132
- requirements:
133
- - - ">="
134
- - !ruby/object:Gem::Version
135
- hash: 3
136
- segments:
137
- - 0
138
- version: "0"
139
- required_rubygems_version: !ruby/object:Gem::Requirement
407
+ requirements:
408
+ - - ! '>='
409
+ - !ruby/object:Gem::Version
410
+ version: '0'
411
+ required_rubygems_version: !ruby/object:Gem::Requirement
140
412
  none: false
141
- requirements:
142
- - - ">="
143
- - !ruby/object:Gem::Version
144
- hash: 3
145
- segments:
146
- - 0
147
- version: "0"
413
+ requirements:
414
+ - - ! '>='
415
+ - !ruby/object:Gem::Version
416
+ version: '0'
148
417
  requirements: []
149
-
150
418
  rubyforge_project:
151
- rubygems_version: 1.4.2
419
+ rubygems_version: 1.8.24
152
420
  signing_key:
153
421
  specification_version: 3
154
- summary: A model proxy for Rails views. Helps you keep the representation of a model and the model itself separate.
155
- test_files:
156
- - spec/padrino/integration/integration_spec.rb
157
- - spec/padrino/lib/helpers/collection_spec.rb
158
- - spec/rails2/integration/integration_spec.rb
159
- - spec/rails2/lib/extensions/active_record_spec.rb
160
- - spec/rails2/lib/extensions/model_reader_spec.rb
161
- - spec/rails2/lib/helpers/collection_spec.rb
162
- - spec/rails2/lib/helpers/view_spec.rb
163
- - spec/rails2/lib/view_models/base_spec.rb
164
- - spec/rails2/lib/view_models/view_spec.rb
165
- - spec/shared/lib/helpers/collection_spec.rb
166
- - spec/shared/lib/helpers/mapping_spec.rb
422
+ summary: The missing R to the Rails MVC
423
+ test_files:
424
+ - features/rails_integration.feature
425
+ - features/step_definitions/rails_steps.rb
426
+ - features/support/env.rb
427
+ - spec/lib/view_models/base_spec.rb
428
+ - spec/lib/view_models/extensions/model_reader_spec.rb
429
+ - spec/lib/view_models/helpers/collection_spec.rb
430
+ - spec/lib/view_models/helpers/mapping_spec.rb
431
+ - spec/lib/view_models/helpers/view_spec.rb
432
+ - spec/lib/view_models/view_spec.rb
433
+ - spec/spec_helper.rb
434
+ - spec/spec_helper_extensions.rb
435
+ has_rdoc: