parent_resource 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +8 -44
  3. data/lib/parent_resource.rb +29 -5
  4. data/lib/parent_resource/controller_methods.rb +19 -18
  5. data/lib/parent_resource/version.rb +3 -0
  6. data/lib/tasks/parent_resource_tasks.rake +4 -0
  7. data/spec/dummy/README.rdoc +28 -0
  8. data/spec/dummy/Rakefile +6 -0
  9. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  10. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  11. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  12. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  13. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  14. data/spec/dummy/bin/bundle +3 -0
  15. data/spec/dummy/bin/rails +4 -0
  16. data/spec/dummy/bin/rake +4 -0
  17. data/spec/dummy/config.ru +4 -0
  18. data/spec/dummy/config/application.rb +22 -0
  19. data/spec/dummy/config/boot.rb +5 -0
  20. data/spec/dummy/config/database.yml +25 -0
  21. data/spec/dummy/config/environment.rb +5 -0
  22. data/spec/dummy/config/environments/development.rb +37 -0
  23. data/spec/dummy/config/environments/production.rb +78 -0
  24. data/spec/dummy/config/environments/test.rb +39 -0
  25. data/spec/dummy/config/initializers/assets.rb +8 -0
  26. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  27. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  28. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  29. data/spec/dummy/config/initializers/inflections.rb +16 -0
  30. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  31. data/spec/dummy/config/initializers/session_store.rb +3 -0
  32. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  33. data/spec/dummy/config/locales/en.yml +23 -0
  34. data/spec/dummy/config/routes.rb +56 -0
  35. data/spec/dummy/config/secrets.yml +22 -0
  36. data/spec/dummy/public/404.html +67 -0
  37. data/spec/dummy/public/422.html +67 -0
  38. data/spec/dummy/public/500.html +66 -0
  39. data/spec/dummy/public/favicon.ico +0 -0
  40. data/spec/parent_resource_spec.rb +36 -2
  41. data/spec/spec_helper.rb +10 -11
  42. metadata +228 -116
  43. data/.document +0 -5
  44. data/Gemfile +0 -11
  45. data/Gemfile.lock +0 -90
  46. data/LICENSE.txt +0 -20
  47. data/README.rdoc +0 -39
  48. data/VERSION +0 -1
  49. data/parent_resource.gemspec +0 -69
  50. data/uninstall.rb +0 -1
@@ -1,20 +0,0 @@
1
- Copyright (c) 2010 masarakki
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,39 +0,0 @@
1
- = parent_resource
2
- in the controller of recursive resource, auto load parent resource
3
-
4
- == example
5
-
6
- === config/routes.rb
7
- resources :members
8
- resources :projects do
9
- resources :members
10
- end
11
-
12
- === app/controller/members_controller.rb
13
- # auto load @project when like /projects/1/members
14
- # not load when /members
15
- class MembersController < ActionController::Base
16
- parent_resource :project
17
- end
18
-
19
- === app/view/members/new.html.erb
20
- # you can support both /projects/1/members/new and /members/new with single file
21
- <% form_for([@project, @member]) do |f| %>
22
- ...
23
- <% end %>
24
-
25
- == Contributing to auto_mock
26
-
27
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
28
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
29
- * Fork the project
30
- * Start a feature/bugfix branch
31
- * Commit and push until you are happy with your contribution
32
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
33
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
34
-
35
- == Copyright
36
-
37
- Copyright (c) 2010 masarakki. See LICENSE.txt for
38
- further details.
39
-
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.1.1
@@ -1,69 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
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{parent_resource}
8
- s.version = "0.1.1"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["masarakki"]
12
- s.date = %q{2010-12-14}
13
- s.description = %q{auto set parent_resources in controller}
14
- s.email = %q{masaki@hisme.net}
15
- s.extra_rdoc_files = [
16
- "LICENSE.txt",
17
- "README.rdoc"
18
- ]
19
- s.files = [
20
- ".document",
21
- "Gemfile",
22
- "Gemfile.lock",
23
- "LICENSE.txt",
24
- "README.rdoc",
25
- "Rakefile",
26
- "VERSION",
27
- "lib/parent_resource.rb",
28
- "lib/parent_resource/controller_methods.rb",
29
- "parent_resource.gemspec",
30
- "spec/parent_resource_spec.rb",
31
- "spec/spec_helper.rb",
32
- "uninstall.rb"
33
- ]
34
- s.homepage = %q{http://github.com/masarakki/parent_resource}
35
- s.licenses = ["MIT"]
36
- s.require_paths = ["lib"]
37
- s.rubygems_version = %q{1.3.7}
38
- s.summary = %q{auto set parent_resources in controller}
39
- s.test_files = [
40
- "spec/parent_resource_spec.rb",
41
- "spec/spec_helper.rb"
42
- ]
43
-
44
- if s.respond_to? :specification_version then
45
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
46
- s.specification_version = 3
47
-
48
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
49
- s.add_runtime_dependency(%q<rails>, [">= 0"])
50
- s.add_development_dependency(%q<rspec>, [">= 0"])
51
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
52
- s.add_development_dependency(%q<jeweler>, ["~> 1.5.1"])
53
- s.add_development_dependency(%q<rcov>, [">= 0"])
54
- else
55
- s.add_dependency(%q<rails>, [">= 0"])
56
- s.add_dependency(%q<rspec>, [">= 0"])
57
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
58
- s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
59
- s.add_dependency(%q<rcov>, [">= 0"])
60
- end
61
- else
62
- s.add_dependency(%q<rails>, [">= 0"])
63
- s.add_dependency(%q<rspec>, [">= 0"])
64
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
65
- s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
66
- s.add_dependency(%q<rcov>, [">= 0"])
67
- end
68
- end
69
-
@@ -1 +0,0 @@
1
- # Uninstall hook code here