attrtastic 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +4 -20
- data/Gemfile +4 -0
- data/Gemfile.lock +50 -0
- data/LICENSE +1 -1
- data/README.md +16 -13
- data/Rakefile +6 -36
- data/attrtastic.gemspec +20 -76
- data/doc/Attrtastic/SemanticAttributesBuilder.html +340 -347
- data/doc/Attrtastic/SemanticAttributesHelper.html +100 -66
- data/doc/Attrtastic.html +29 -12
- data/doc/_index.html +9 -9
- data/doc/class_list.html +3 -3
- data/doc/css/full_list.css +6 -3
- data/doc/css/style.css +51 -9
- data/doc/file.README.html +21 -18
- data/doc/file_list.html +1 -1
- data/doc/frames.html +1 -1
- data/doc/index.html +21 -18
- data/doc/js/app.js +107 -4
- data/doc/js/full_list.js +78 -35
- data/doc/js/jquery.js +150 -15
- data/doc/method_list.html +7 -7
- data/doc/top-level-namespace.html +9 -6
- data/init.rb +2 -0
- data/lib/attrtastic/semantic_attributes_builder.rb +333 -0
- data/lib/attrtastic/semantic_attributes_helper.rb +55 -0
- data/lib/attrtastic/version.rb +3 -0
- data/lib/attrtastic.rb +2 -389
- data/rails/init.rb +1 -2
- data/test/helper.rb +2 -2
- data/test/test_attribute.rb +3 -5
- data/test/test_attributes.rb +26 -54
- data/test/test_attrtastic.rb +9 -8
- data/test/test_semantic_attributes_helper.rb +5 -8
- metadata +97 -32
- data/VERSION +0 -1
data/.gitignore
CHANGED
@@ -1,22 +1,6 @@
|
|
1
|
-
## MAC OS
|
2
|
-
.DS_Store
|
3
|
-
|
4
|
-
## TEXTMATE
|
5
|
-
*.tmproj
|
6
|
-
tmtags
|
7
|
-
|
8
|
-
## EMACS
|
9
|
-
*~
|
10
|
-
\#*
|
11
|
-
.\#*
|
12
|
-
|
13
|
-
## VIM
|
14
|
-
*.swp
|
15
|
-
|
16
|
-
## PROJECT::GENERAL
|
17
|
-
coverage
|
18
|
-
rdoc
|
19
|
-
pkg
|
20
|
-
|
21
1
|
## PROJECT::SPECIFIC
|
22
2
|
.yardoc
|
3
|
+
|
4
|
+
pkg/*
|
5
|
+
*.gem
|
6
|
+
.bundle
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
attrtastic (0.3.0)
|
5
|
+
actionpack (~> 3.0.0)
|
6
|
+
activesupport (~> 3.0.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: http://rubygems.org/
|
10
|
+
specs:
|
11
|
+
abstract (1.0.0)
|
12
|
+
actionpack (3.0.3)
|
13
|
+
activemodel (= 3.0.3)
|
14
|
+
activesupport (= 3.0.3)
|
15
|
+
builder (~> 2.1.2)
|
16
|
+
erubis (~> 2.6.6)
|
17
|
+
i18n (~> 0.4)
|
18
|
+
rack (~> 1.2.1)
|
19
|
+
rack-mount (~> 0.6.13)
|
20
|
+
rack-test (~> 0.5.6)
|
21
|
+
tzinfo (~> 0.3.23)
|
22
|
+
activemodel (3.0.3)
|
23
|
+
activesupport (= 3.0.3)
|
24
|
+
builder (~> 2.1.2)
|
25
|
+
i18n (~> 0.4)
|
26
|
+
activesupport (3.0.3)
|
27
|
+
bluecloth (2.0.9)
|
28
|
+
builder (2.1.2)
|
29
|
+
erubis (2.6.6)
|
30
|
+
abstract (>= 1.0.0)
|
31
|
+
i18n (0.5.0)
|
32
|
+
rack (1.2.1)
|
33
|
+
rack-mount (0.6.13)
|
34
|
+
rack (>= 1.0.0)
|
35
|
+
rack-test (0.5.6)
|
36
|
+
rack (>= 1.0)
|
37
|
+
shoulda (2.11.3)
|
38
|
+
tzinfo (0.3.23)
|
39
|
+
yard (0.6.3)
|
40
|
+
|
41
|
+
PLATFORMS
|
42
|
+
ruby
|
43
|
+
|
44
|
+
DEPENDENCIES
|
45
|
+
actionpack (~> 3.0.0)
|
46
|
+
activesupport (~> 3.0.0)
|
47
|
+
attrtastic!
|
48
|
+
bluecloth (~> 2.0.0)
|
49
|
+
shoulda (~> 2.11.0)
|
50
|
+
yard (~> 0.6.0)
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
# Attrtastic
|
2
2
|
|
3
|
-
Attrtastic
|
4
|
-
|
5
|
-
|
3
|
+
Attrtastic is simple view helper which can be used to create index/show pages
|
4
|
+
for any objects (for example Active Model objects). It helps you display
|
5
|
+
all present attributes of object.
|
6
|
+
|
7
|
+
If you need compatibility with Rails 2.x, then please install version 0.2.2 of
|
8
|
+
this gem.
|
6
9
|
|
7
10
|
## Using
|
8
11
|
|
@@ -10,29 +13,29 @@ Install the gem:
|
|
10
13
|
|
11
14
|
gem install attrtastic
|
12
15
|
|
13
|
-
Add to `
|
16
|
+
Add to your `Gemfile`:
|
14
17
|
|
15
|
-
|
18
|
+
gem "attrtastic"
|
16
19
|
|
17
20
|
And use in your views, for example in user/show.erb
|
18
21
|
|
19
|
-
|
20
|
-
|
22
|
+
<%= semantic_attributes_for @user do |attr| %>
|
23
|
+
<%= attr.attributes "User" do %>
|
21
24
|
<%= attr.attribute :first_name %>
|
22
25
|
<%= attr.attribute :last_name %>
|
23
|
-
|
26
|
+
<%= attr.attribute :avatar do %>
|
24
27
|
<%= image_tag @user.avatar.url %>
|
25
|
-
<%
|
28
|
+
<% end %>
|
26
29
|
<% end %>
|
27
|
-
|
30
|
+
<%= attr.attributes "Contact" do %>
|
28
31
|
<%= attr.attribute :email %>
|
29
32
|
<%= attr.attribute :tel %>
|
30
33
|
<%= attr.attribute :fax %>
|
31
34
|
<% end %>
|
32
35
|
<% end %>
|
33
36
|
|
34
|
-
By default attributes which returns
|
35
|
-
`:display_blank => true` is added to
|
37
|
+
By default attributes which returns `#blank?` value are ommited, unless
|
38
|
+
`:display_blank => true` is added to `#attribute`.
|
36
39
|
|
37
40
|
## Note on Patches/Pull Requests
|
38
41
|
|
@@ -46,4 +49,4 @@ By default attributes which returns #blank? value are ommited, unless
|
|
46
49
|
|
47
50
|
## Copyright
|
48
51
|
|
49
|
-
Copyright (c) 2009 Boruta Miroslaw. See LICENSE for details.
|
52
|
+
Copyright (c) 2009-2010 Boruta Miroslaw. See LICENSE for details.
|
data/Rakefile
CHANGED
@@ -1,31 +1,9 @@
|
|
1
|
-
require
|
2
|
-
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'jeweler'
|
6
|
-
Jeweler::Tasks.new do |gem|
|
7
|
-
gem.name = "attrtastic"
|
8
|
-
gem.summary = %Q{Helps display attributes of AR record}
|
9
|
-
gem.description = <<-EODESC
|
10
|
-
Attrtastic, in its assumtion, should be similar in usage to formtastic and
|
11
|
-
ease of displaying AR record informations (attributes). It should help
|
12
|
-
scafforld show/index pages.
|
13
|
-
EODESC
|
14
|
-
gem.email = "boruta.miroslaw@gmail.com"
|
15
|
-
gem.homepage = "http://github.com/MBO/attrtastic"
|
16
|
-
gem.authors = ["Boruta Miroslaw"]
|
17
|
-
gem.add_development_dependency "yard", ">= 0"
|
18
|
-
gem.add_development_dependency "shoulda", ">= 0"
|
19
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
20
|
-
end
|
21
|
-
Jeweler::GemcutterTasks.new
|
22
|
-
rescue LoadError
|
23
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
24
|
-
end
|
1
|
+
require "bundler"
|
2
|
+
Bundler::GemHelper.install_tasks
|
25
3
|
|
26
4
|
require 'rake/testtask'
|
27
5
|
Rake::TestTask.new(:test) do |test|
|
28
|
-
test.libs << '
|
6
|
+
test.libs << 'test'
|
29
7
|
test.pattern = 'test/**/test_*.rb'
|
30
8
|
test.verbose = true
|
31
9
|
end
|
@@ -39,19 +17,11 @@ begin
|
|
39
17
|
end
|
40
18
|
rescue LoadError
|
41
19
|
task :rcov do
|
42
|
-
abort "RCov is not available. In order to run rcov, you must: sudo
|
20
|
+
abort "RCov is not available. In order to run rcov, you must: sudo install rcov"
|
43
21
|
end
|
44
22
|
end
|
45
23
|
|
46
|
-
|
24
|
+
require 'yard'
|
25
|
+
YARD::Rake::YardocTask.new
|
47
26
|
|
48
27
|
task :default => :test
|
49
|
-
|
50
|
-
begin
|
51
|
-
require 'yard'
|
52
|
-
YARD::Rake::YardocTask.new
|
53
|
-
rescue LoadError
|
54
|
-
task :yardoc do
|
55
|
-
abort "YARD is not available. In order to run yardoc, you must: sudo gem install yard"
|
56
|
-
end
|
57
|
-
end
|
data/attrtastic.gemspec
CHANGED
@@ -1,84 +1,28 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "attrtastic/version"
|
5
4
|
|
6
5
|
Gem::Specification.new do |s|
|
7
|
-
s.name
|
8
|
-
s.version
|
6
|
+
s.name = "attrtastic"
|
7
|
+
s.version = Attrtastic::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Boruta Mirosław"]
|
10
|
+
s.email = ["boruta.miroslaw@gmail.com"]
|
11
|
+
s.homepage = "http://github.com/MBO/attrtastic"
|
12
|
+
s.summary = %q{Rails view helper for scaffolding show/index pages for objects}
|
13
|
+
s.description = %q{Rails view helper for scaffolding show/index pages for objects}
|
9
14
|
|
10
|
-
s.
|
11
|
-
|
12
|
-
s.
|
13
|
-
s.
|
14
|
-
|
15
|
-
scafforld show/index pages.
|
16
|
-
}
|
17
|
-
s.email = %q{boruta.miroslaw@gmail.com}
|
18
|
-
s.extra_rdoc_files = [
|
19
|
-
"LICENSE",
|
20
|
-
"README.md"
|
21
|
-
]
|
22
|
-
s.files = [
|
23
|
-
".document",
|
24
|
-
".gitignore",
|
25
|
-
"LICENSE",
|
26
|
-
"README.md",
|
27
|
-
"Rakefile",
|
28
|
-
"VERSION",
|
29
|
-
"attrtastic.gemspec",
|
30
|
-
"doc/Attrtastic.html",
|
31
|
-
"doc/Attrtastic/SemanticAttributesBuilder.html",
|
32
|
-
"doc/Attrtastic/SemanticAttributesHelper.html",
|
33
|
-
"doc/_index.html",
|
34
|
-
"doc/class_list.html",
|
35
|
-
"doc/css/common.css",
|
36
|
-
"doc/css/full_list.css",
|
37
|
-
"doc/css/style.css",
|
38
|
-
"doc/file.README.html",
|
39
|
-
"doc/file_list.html",
|
40
|
-
"doc/frames.html",
|
41
|
-
"doc/index.html",
|
42
|
-
"doc/js/app.js",
|
43
|
-
"doc/js/full_list.js",
|
44
|
-
"doc/js/jquery.js",
|
45
|
-
"doc/method_list.html",
|
46
|
-
"doc/top-level-namespace.html",
|
47
|
-
"lib/attrtastic.rb",
|
48
|
-
"rails/init.rb",
|
49
|
-
"test/helper.rb",
|
50
|
-
"test/test_attribute.rb",
|
51
|
-
"test/test_attributes.rb",
|
52
|
-
"test/test_attrtastic.rb",
|
53
|
-
"test/test_semantic_attributes_helper.rb"
|
54
|
-
]
|
55
|
-
s.homepage = %q{http://github.com/MBO/attrtastic}
|
56
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
15
|
+
s.rubyforge_project = "attrtastic"
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
57
20
|
s.require_paths = ["lib"]
|
58
|
-
s.rubygems_version = %q{1.3.5}
|
59
|
-
s.summary = %q{Helps display attributes of AR record}
|
60
|
-
s.test_files = [
|
61
|
-
"test/helper.rb",
|
62
|
-
"test/test_attrtastic.rb",
|
63
|
-
"test/test_attribute.rb",
|
64
|
-
"test/test_semantic_attributes_helper.rb",
|
65
|
-
"test/test_attributes.rb"
|
66
|
-
]
|
67
21
|
|
68
|
-
|
69
|
-
|
70
|
-
|
22
|
+
s.add_development_dependency("yard", ["~> 0.6.0"])
|
23
|
+
s.add_development_dependency("bluecloth", ["~>2.0.0"])
|
24
|
+
s.add_development_dependency("shoulda", ["~> 2.11.0"])
|
71
25
|
|
72
|
-
|
73
|
-
|
74
|
-
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
75
|
-
else
|
76
|
-
s.add_dependency(%q<yard>, [">= 0"])
|
77
|
-
s.add_dependency(%q<shoulda>, [">= 0"])
|
78
|
-
end
|
79
|
-
else
|
80
|
-
s.add_dependency(%q<yard>, [">= 0"])
|
81
|
-
s.add_dependency(%q<shoulda>, [">= 0"])
|
82
|
-
end
|
26
|
+
s.add_dependency("activesupport", ["~> 3.0.0"])
|
27
|
+
s.add_dependency("actionpack", ["~> 3.0.0"])
|
83
28
|
end
|
84
|
-
|