g_sectioned_shower 1.0.8 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +2 -0
- data/VERSION +1 -1
- data/g_sectioned_shower.gemspec +24 -28
- data/lib/g_sectioned_shower.rb +2 -2
- data/lib/g_sectioned_shower/view_helpers.rb +10 -9
- metadata +50 -23
data/.rvmrc
ADDED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0
|
1
|
+
1.1.0
|
data/g_sectioned_shower.gemspec
CHANGED
@@ -1,50 +1,46 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "1.0
|
7
|
+
s.name = "g_sectioned_shower"
|
8
|
+
s.version = "1.1.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["C. Jason Harrelson (midas)"]
|
12
|
-
s.date =
|
13
|
-
s.description =
|
14
|
-
s.email =
|
12
|
+
s.date = "2012-09-28"
|
13
|
+
s.description = "A Guilded (http://github.com/midas/guilded/tree/master) component that creates adaptable show (detail) views of a single ActiveRecord object."
|
14
|
+
s.email = "jason@lookforwardenterprises.com"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
|
-
|
17
|
+
"README.rdoc"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
|
+
".rvmrc",
|
20
21
|
"History.txt",
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
"test/test_helper.rb"
|
33
|
-
]
|
34
|
-
s.homepage = %q{http://github.com/midas/tester}
|
35
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
36
|
-
s.require_paths = ["lib"]
|
37
|
-
s.rubygems_version = %q{1.3.5}
|
38
|
-
s.summary = %q{A Guilded (http://github.com/midas/guilded/tree/master) component that creates adaptable show (detail) views of a single ActiveRecord object.}
|
39
|
-
s.test_files = [
|
22
|
+
"LICENSE",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"g_sectioned_shower.gemspec",
|
27
|
+
"lib/g_sectioned_shower.rb",
|
28
|
+
"lib/g_sectioned_shower/view_helpers.rb",
|
29
|
+
"script/console",
|
30
|
+
"script/destroy",
|
31
|
+
"script/generate",
|
32
|
+
"tasks/rspec.rake",
|
40
33
|
"test/test_helper.rb"
|
41
34
|
]
|
35
|
+
s.homepage = "http://github.com/midas/tester"
|
36
|
+
s.require_paths = ["lib"]
|
37
|
+
s.rubygems_version = "1.8.10"
|
38
|
+
s.summary = "A Guilded (http://github.com/midas/guilded/tree/master) component that creates adaptable show (detail) views of a single ActiveRecord object."
|
42
39
|
|
43
40
|
if s.respond_to? :specification_version then
|
44
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
45
41
|
s.specification_version = 3
|
46
42
|
|
47
|
-
if Gem::Version.new(Gem::
|
43
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
48
44
|
s.add_runtime_dependency(%q<rails>, [">= 2.2.0"])
|
49
45
|
s.add_runtime_dependency(%q<guilded>, [">= 1.0.0"])
|
50
46
|
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
data/lib/g_sectioned_shower.rb
CHANGED
@@ -4,9 +4,9 @@ $:.unshift(File.dirname(__FILE__)) unless
|
|
4
4
|
require 'g_sectioned_shower/view_helpers'
|
5
5
|
|
6
6
|
module GSectionedShower
|
7
|
-
VERSION = '1.0
|
7
|
+
VERSION = '1.1.0'
|
8
8
|
end
|
9
9
|
|
10
10
|
if defined?( ActionView::Base )
|
11
11
|
ActionView::Base.send( :include, GSectionedShower::ViewHelpers ) unless ActionView::Base.include?( GSectionedShower::ViewHelpers )
|
12
|
-
end
|
12
|
+
end
|
@@ -1,16 +1,16 @@
|
|
1
1
|
module GSectionedShower
|
2
2
|
module ViewHelpers
|
3
|
-
|
3
|
+
|
4
4
|
# GUIlded component.
|
5
5
|
#
|
6
6
|
# *parameters*
|
7
7
|
# ar_obj:: The ActiveRecord object containing the information.
|
8
|
-
#
|
8
|
+
#
|
9
9
|
# *options*
|
10
10
|
# id:: (required) The id of the element. Must be unique on the page.
|
11
11
|
# class::
|
12
12
|
# title_attr:: The attribute to use in the title.
|
13
|
-
# title_pre:: A string to override the first part of the title. defaults to the name
|
13
|
+
# title_pre:: A string to override the first part of the title. defaults to the name
|
14
14
|
# of the active record object's class.
|
15
15
|
# date_format:: A symbol representing the date format to use. Defaults to :default.
|
16
16
|
# attributes:: A list of attributes to include in the main section.
|
@@ -20,10 +20,10 @@ module GSectionedShower
|
|
20
20
|
# title:: The title for this section.
|
21
21
|
# attributes:: List of attibutes to include in this section.
|
22
22
|
# {associated_attribute_name}_attributes:: List of attributes from associated attribute to include.
|
23
|
-
# {associated_attribute_name}_max:: The max number of associated records to show. This will load
|
23
|
+
# {associated_attribute_name}_max:: The max number of associated records to show. This will load
|
24
24
|
# all and display max unless you define a limited named scope on the respective model, allowing
|
25
25
|
# the association to be limited to the max, not returning items that will not be displayed.
|
26
|
-
# links:: A list of fields or field => path_helper to generate links to this item in the associated
|
26
|
+
# links:: A list of fields or field => path_helper to generate links to this item in the associated
|
27
27
|
# object.
|
28
28
|
# list_link:: (Boolean, string, or symbol)
|
29
29
|
#
|
@@ -115,7 +115,7 @@ module GSectionedShower
|
|
115
115
|
end
|
116
116
|
|
117
117
|
protected
|
118
|
-
|
118
|
+
|
119
119
|
def handle_associated( html, ar_obj, section, reflections, methods, index )
|
120
120
|
#TODO handle translation helpers if they exist.
|
121
121
|
reflection = reflections[methods[index].to_sym]
|
@@ -130,9 +130,10 @@ module GSectionedShower
|
|
130
130
|
end
|
131
131
|
|
132
132
|
end
|
133
|
-
|
133
|
+
|
134
134
|
def handle_composed_of( html, ar_obj, methods, index )
|
135
|
-
|
135
|
+
label = ar_obj.class.human_attribute_name( methods[index] ) || methods[index].to_s.humanize
|
136
|
+
html << "<dt>#{label}</dt><dd>#{ar_obj.send( methods[index] ).to_s}</dd>"
|
136
137
|
end
|
137
138
|
|
138
139
|
def handle_associated_single( html, ar_obj, reflection, section, methods, index )
|
@@ -278,4 +279,4 @@ module GSectionedShower
|
|
278
279
|
end
|
279
280
|
|
280
281
|
end
|
281
|
-
end
|
282
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: g_sectioned_shower
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 19
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 1.1.0
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- C. Jason Harrelson (midas)
|
@@ -9,39 +15,54 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date:
|
13
|
-
default_executable:
|
18
|
+
date: 2012-09-28 00:00:00 Z
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: rails
|
17
|
-
|
18
|
-
|
19
|
-
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
20
25
|
requirements:
|
21
26
|
- - ">="
|
22
27
|
- !ruby/object:Gem::Version
|
28
|
+
hash: 7
|
29
|
+
segments:
|
30
|
+
- 2
|
31
|
+
- 2
|
32
|
+
- 0
|
23
33
|
version: 2.2.0
|
24
|
-
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
25
36
|
- !ruby/object:Gem::Dependency
|
26
37
|
name: guilded
|
27
|
-
|
28
|
-
|
29
|
-
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
30
41
|
requirements:
|
31
42
|
- - ">="
|
32
43
|
- !ruby/object:Gem::Version
|
44
|
+
hash: 23
|
45
|
+
segments:
|
46
|
+
- 1
|
47
|
+
- 0
|
48
|
+
- 0
|
33
49
|
version: 1.0.0
|
34
|
-
|
50
|
+
type: :runtime
|
51
|
+
version_requirements: *id002
|
35
52
|
- !ruby/object:Gem::Dependency
|
36
53
|
name: shoulda
|
37
|
-
|
38
|
-
|
39
|
-
|
54
|
+
prerelease: false
|
55
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
40
57
|
requirements:
|
41
58
|
- - ">="
|
42
59
|
- !ruby/object:Gem::Version
|
60
|
+
hash: 3
|
61
|
+
segments:
|
62
|
+
- 0
|
43
63
|
version: "0"
|
44
|
-
|
64
|
+
type: :development
|
65
|
+
version_requirements: *id003
|
45
66
|
description: A Guilded (http://github.com/midas/guilded/tree/master) component that creates adaptable show (detail) views of a single ActiveRecord object.
|
46
67
|
email: jason@lookforwardenterprises.com
|
47
68
|
executables: []
|
@@ -52,6 +73,7 @@ extra_rdoc_files:
|
|
52
73
|
- LICENSE
|
53
74
|
- README.rdoc
|
54
75
|
files:
|
76
|
+
- .rvmrc
|
55
77
|
- History.txt
|
56
78
|
- LICENSE
|
57
79
|
- README.rdoc
|
@@ -65,33 +87,38 @@ files:
|
|
65
87
|
- script/generate
|
66
88
|
- tasks/rspec.rake
|
67
89
|
- test/test_helper.rb
|
68
|
-
has_rdoc: true
|
69
90
|
homepage: http://github.com/midas/tester
|
70
91
|
licenses: []
|
71
92
|
|
72
93
|
post_install_message:
|
73
|
-
rdoc_options:
|
74
|
-
|
94
|
+
rdoc_options: []
|
95
|
+
|
75
96
|
require_paths:
|
76
97
|
- lib
|
77
98
|
required_ruby_version: !ruby/object:Gem::Requirement
|
99
|
+
none: false
|
78
100
|
requirements:
|
79
101
|
- - ">="
|
80
102
|
- !ruby/object:Gem::Version
|
103
|
+
hash: 3
|
104
|
+
segments:
|
105
|
+
- 0
|
81
106
|
version: "0"
|
82
|
-
version:
|
83
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
|
+
none: false
|
84
109
|
requirements:
|
85
110
|
- - ">="
|
86
111
|
- !ruby/object:Gem::Version
|
112
|
+
hash: 3
|
113
|
+
segments:
|
114
|
+
- 0
|
87
115
|
version: "0"
|
88
|
-
version:
|
89
116
|
requirements: []
|
90
117
|
|
91
118
|
rubyforge_project:
|
92
|
-
rubygems_version: 1.
|
119
|
+
rubygems_version: 1.8.10
|
93
120
|
signing_key:
|
94
121
|
specification_version: 3
|
95
122
|
summary: A Guilded (http://github.com/midas/guilded/tree/master) component that creates adaptable show (detail) views of a single ActiveRecord object.
|
96
|
-
test_files:
|
97
|
-
|
123
|
+
test_files: []
|
124
|
+
|