resource_defaults 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +6 -3
- data/README.rdoc +1 -1
- data/Rakefile +0 -2
- data/VERSION +1 -1
- data/lib/resource_defaults.rb +10 -2
- data/resource_defaults.gemspec +60 -0
- data/spec/resource_defaults_spec.rb +2 -0
- metadata +28 -25
- data/.gitignore +0 -22
data/Gemfile
CHANGED
data/README.rdoc
CHANGED
data/Rakefile
CHANGED
@@ -13,8 +13,6 @@ begin
|
|
13
13
|
gem.email = "stalkingtiger@gmail.com"
|
14
14
|
gem.homepage = "http://github.com/aughr/resource_defaults"
|
15
15
|
gem.authors = ["Andrew Bloomgarden"]
|
16
|
-
gem.add_development_dependency "rspec-rails", ">= 2.0.0.beta.9.1"
|
17
|
-
gem.add_runtime_dependency "rails", ">= 3.0.0.beta3"
|
18
16
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
19
17
|
end
|
20
18
|
Jeweler::GemcutterTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
data/lib/resource_defaults.rb
CHANGED
@@ -2,11 +2,19 @@ module ResourceDefaults
|
|
2
2
|
class Railtie < Rails::Railtie
|
3
3
|
initializer 'resource_defaults.load', :before => 'action_dispatch.prepare_dispatcher' do
|
4
4
|
ActionDispatch::Routing::Mapper.send :include, ResourceDefaults
|
5
|
+
ActionDispatch::Routing::Mapper.extend ResourceDefaults::ClassMethods
|
5
6
|
end
|
6
7
|
end
|
7
8
|
|
8
|
-
|
9
|
-
|
9
|
+
module ClassMethods
|
10
|
+
def new(*args)
|
11
|
+
object = super
|
12
|
+
object.initialize_resource_defaults
|
13
|
+
object
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def initialize_resource_defaults
|
10
18
|
@scope[:resource_defaults] = {}
|
11
19
|
@scope[:resource_defaults_in_progress] = []
|
12
20
|
end
|
@@ -0,0 +1,60 @@
|
|
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{resource_defaults}
|
8
|
+
s.version = "1.0.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Andrew Bloomgarden"]
|
12
|
+
s.date = %q{2011-09-01}
|
13
|
+
s.description = %q{If you have resources accessible from multiple routes, it's useful to be able to set default actions. This gem makes that possible.}
|
14
|
+
s.email = %q{stalkingtiger@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".rspec",
|
22
|
+
"Gemfile",
|
23
|
+
"LICENSE",
|
24
|
+
"README.rdoc",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"lib/resource_defaults.rb",
|
28
|
+
"resource_defaults.gemspec",
|
29
|
+
"spec/resource_defaults_spec.rb",
|
30
|
+
"spec/spec_helper.rb"
|
31
|
+
]
|
32
|
+
s.homepage = %q{http://github.com/aughr/resource_defaults}
|
33
|
+
s.require_paths = ["lib"]
|
34
|
+
s.rubygems_version = %q{1.3.7}
|
35
|
+
s.summary = %q{Allows setting defaults for resources in Rails routing}
|
36
|
+
s.test_files = [
|
37
|
+
"spec/resource_defaults_spec.rb",
|
38
|
+
"spec/spec_helper.rb"
|
39
|
+
]
|
40
|
+
|
41
|
+
if s.respond_to? :specification_version then
|
42
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
43
|
+
s.specification_version = 3
|
44
|
+
|
45
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
46
|
+
s.add_runtime_dependency(%q<rails>, [">= 3"])
|
47
|
+
s.add_development_dependency(%q<rspec-rails>, ["~> 2.0.0"])
|
48
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
49
|
+
else
|
50
|
+
s.add_dependency(%q<rails>, [">= 3"])
|
51
|
+
s.add_dependency(%q<rspec-rails>, ["~> 2.0.0"])
|
52
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
53
|
+
end
|
54
|
+
else
|
55
|
+
s.add_dependency(%q<rails>, [">= 3"])
|
56
|
+
s.add_dependency(%q<rspec-rails>, ["~> 2.0.0"])
|
57
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
@@ -1,8 +1,10 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
require 'active_support/core_ext/hash/slice'
|
2
3
|
|
3
4
|
describe "ResourceDefaults" do
|
4
5
|
before(:all) do
|
5
6
|
ActionDispatch::Routing::Mapper.send :include, ResourceDefaults
|
7
|
+
ActionDispatch::Routing::Mapper.extend ResourceDefaults::ClassMethods
|
6
8
|
end
|
7
9
|
|
8
10
|
before(:each) do
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resource_defaults
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 23
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 1
|
8
7
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
8
|
+
- 2
|
9
|
+
version: 1.0.2
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Andrew Bloomgarden
|
@@ -15,45 +14,50 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date:
|
17
|
+
date: 2011-09-01 00:00:00 -07:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
21
|
+
name: rails
|
22
22
|
requirement: &id001 !ruby/object:Gem::Requirement
|
23
23
|
none: false
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
|
27
|
+
segments:
|
28
|
+
- 3
|
29
|
+
version: "3"
|
30
|
+
type: :runtime
|
31
|
+
prerelease: false
|
32
|
+
version_requirements: *id001
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: rspec-rails
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
28
40
|
segments:
|
29
41
|
- 2
|
30
42
|
- 0
|
31
43
|
- 0
|
32
|
-
|
33
|
-
- 9
|
34
|
-
- 1
|
35
|
-
version: 2.0.0.beta.9.1
|
44
|
+
version: 2.0.0
|
36
45
|
type: :development
|
37
|
-
name: rspec-rails
|
38
46
|
prerelease: false
|
39
|
-
version_requirements: *
|
47
|
+
version_requirements: *id002
|
40
48
|
- !ruby/object:Gem::Dependency
|
41
|
-
|
49
|
+
name: jeweler
|
50
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
42
51
|
none: false
|
43
52
|
requirements:
|
44
53
|
- - ">="
|
45
54
|
- !ruby/object:Gem::Version
|
46
|
-
hash: -1848230021
|
47
55
|
segments:
|
48
|
-
- 3
|
49
56
|
- 0
|
50
|
-
|
51
|
-
|
52
|
-
version: 3.0.0.beta3
|
53
|
-
type: :runtime
|
54
|
-
name: rails
|
57
|
+
version: "0"
|
58
|
+
type: :development
|
55
59
|
prerelease: false
|
56
|
-
version_requirements: *
|
60
|
+
version_requirements: *id003
|
57
61
|
description: If you have resources accessible from multiple routes, it's useful to be able to set default actions. This gem makes that possible.
|
58
62
|
email: stalkingtiger@gmail.com
|
59
63
|
executables: []
|
@@ -65,7 +69,6 @@ extra_rdoc_files:
|
|
65
69
|
- README.rdoc
|
66
70
|
files:
|
67
71
|
- .document
|
68
|
-
- .gitignore
|
69
72
|
- .rspec
|
70
73
|
- Gemfile
|
71
74
|
- LICENSE
|
@@ -73,6 +76,7 @@ files:
|
|
73
76
|
- Rakefile
|
74
77
|
- VERSION
|
75
78
|
- lib/resource_defaults.rb
|
79
|
+
- resource_defaults.gemspec
|
76
80
|
- spec/resource_defaults_spec.rb
|
77
81
|
- spec/spec_helper.rb
|
78
82
|
has_rdoc: true
|
@@ -80,8 +84,8 @@ homepage: http://github.com/aughr/resource_defaults
|
|
80
84
|
licenses: []
|
81
85
|
|
82
86
|
post_install_message:
|
83
|
-
rdoc_options:
|
84
|
-
|
87
|
+
rdoc_options: []
|
88
|
+
|
85
89
|
require_paths:
|
86
90
|
- lib
|
87
91
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -89,7 +93,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
89
93
|
requirements:
|
90
94
|
- - ">="
|
91
95
|
- !ruby/object:Gem::Version
|
92
|
-
hash:
|
96
|
+
hash: 4247503272883900706
|
93
97
|
segments:
|
94
98
|
- 0
|
95
99
|
version: "0"
|
@@ -98,7 +102,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
102
|
requirements:
|
99
103
|
- - ">="
|
100
104
|
- !ruby/object:Gem::Version
|
101
|
-
hash: 3
|
102
105
|
segments:
|
103
106
|
- 0
|
104
107
|
version: "0"
|