radiant-library-extension 2.0.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/README.md +112 -0
- data/Rakefile +137 -0
- data/app/models/library_page.rb +61 -0
- data/app/views/admin/assets/_edit_metadata.html.haml +20 -0
- data/app/views/admin/assets/_edit_title.html.haml +31 -0
- data/app/views/admin/tags/_show_assets.html.haml +22 -0
- data/cucumber.yml +1 -0
- data/db/migrate/20091030115120_furniture.rb +9 -0
- data/features/support/env.rb +16 -0
- data/features/support/paths.rb +14 -0
- data/lib/library/library_tag.rb +15 -0
- data/lib/library/library_tags.rb +276 -0
- data/lib/library/link_renderer.rb +22 -0
- data/lib/library/more_asset_tags.rb +151 -0
- data/lib/library/more_tag_tags.rb +179 -0
- data/lib/library/site_controller.rb +33 -0
- data/lib/library/tagged_asset.rb +42 -0
- data/lib/tasks/library_extension_tasks.rake +28 -0
- data/library_extension.rb +24 -0
- data/spec/controllers/library_site_controller_spec.rb +97 -0
- data/spec/datasets/library_pages_dataset.rb +10 -0
- data/spec/datasets/library_sites_dataset.rb +9 -0
- data/spec/datasets/library_tags_dataset.rb +43 -0
- data/spec/models/library_page_spec.rb +47 -0
- data/spec/spec.opts +6 -0
- data/spec/spec_helper.rb +36 -0
- metadata +128 -0
@@ -0,0 +1,47 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
+
|
3
|
+
describe LibraryPage do
|
4
|
+
dataset :library_pages
|
5
|
+
|
6
|
+
it "should be a Page" do
|
7
|
+
page = LibraryPage.new
|
8
|
+
page.is_a?(Page).should be_true
|
9
|
+
end
|
10
|
+
|
11
|
+
describe "on request" do
|
12
|
+
describe "with one tag" do
|
13
|
+
before do
|
14
|
+
@page = Page.find_by_url('/library/colourless')
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should interrupt find_by_url" do
|
18
|
+
@page.should == pages(:library)
|
19
|
+
@page.is_a?(LibraryPage).should be_true
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should set tag context correctly" do
|
23
|
+
@page.requested_tags.should == [tags(:colourless)]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe "with several tags" do
|
28
|
+
before do
|
29
|
+
@page = Page.find_by_url('/library/colourless/green/ideas')
|
30
|
+
end
|
31
|
+
it "should set tag context correctly" do
|
32
|
+
@page.requested_tags.should == [tags(:colourless), tags(:green), tags(:ideas)]
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe "with several tags and one tag negation" do
|
37
|
+
before do
|
38
|
+
@page = Page.find_by_url('/library/colourless/green/ideas/-green')
|
39
|
+
end
|
40
|
+
it "should set tag context correctly" do
|
41
|
+
@page.requested_tags.should == [tags(:colourless), tags(:ideas)]
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
data/spec/spec.opts
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
unless defined? RADIANT_ROOT
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
case
|
4
|
+
when ENV["RADIANT_ENV_FILE"]
|
5
|
+
require ENV["RADIANT_ENV_FILE"]
|
6
|
+
when File.dirname(__FILE__) =~ %r{vendor/radiant/vendor/extensions}
|
7
|
+
require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../../")}/config/environment"
|
8
|
+
else
|
9
|
+
require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../")}/config/environment"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
require "#{RADIANT_ROOT}/spec/spec_helper"
|
13
|
+
|
14
|
+
Dataset::Resolver.default << (File.dirname(__FILE__) + "/datasets")
|
15
|
+
|
16
|
+
if File.directory?(File.dirname(__FILE__) + "/matchers")
|
17
|
+
Dir[File.dirname(__FILE__) + "/matchers/*.rb"].each {|file| require file }
|
18
|
+
end
|
19
|
+
|
20
|
+
Spec::Runner.configure do |config|
|
21
|
+
# config.use_transactional_fixtures = true
|
22
|
+
# config.use_instantiated_fixtures = false
|
23
|
+
# config.fixture_path = RAILS_ROOT + '/spec/fixtures'
|
24
|
+
|
25
|
+
# You can declare fixtures for each behaviour like this:
|
26
|
+
# describe "...." do
|
27
|
+
# fixtures :table_a, :table_b
|
28
|
+
#
|
29
|
+
# Alternatively, if you prefer to declare them only once, you can
|
30
|
+
# do so here, like so ...
|
31
|
+
#
|
32
|
+
# config.global_fixtures = :table_a, :table_b
|
33
|
+
#
|
34
|
+
# If you declare global fixtures, be aware that they will be declared
|
35
|
+
# for all of your examples, even those that don't use them.
|
36
|
+
end
|
metadata
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: radiant-library-extension
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 15
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 2.0.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- spanner
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-09-10 00:00:00 +01:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: radiant
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 59
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 9
|
33
|
+
- 0
|
34
|
+
version: 0.9.0
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: radiant-taggable-extension
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 31
|
46
|
+
segments:
|
47
|
+
- 1
|
48
|
+
- 2
|
49
|
+
- 0
|
50
|
+
version: 1.2.0
|
51
|
+
type: :runtime
|
52
|
+
version_requirements: *id002
|
53
|
+
description: Combines paperclipped and taggable to create a general purpose faceted library
|
54
|
+
email: will@spanner.org
|
55
|
+
executables: []
|
56
|
+
|
57
|
+
extensions: []
|
58
|
+
|
59
|
+
extra_rdoc_files:
|
60
|
+
- README.md
|
61
|
+
files:
|
62
|
+
- README.md
|
63
|
+
- Rakefile
|
64
|
+
- app/models/library_page.rb
|
65
|
+
- app/views/admin/assets/_edit_metadata.html.haml
|
66
|
+
- app/views/admin/assets/_edit_title.html.haml
|
67
|
+
- app/views/admin/tags/_show_assets.html.haml
|
68
|
+
- cucumber.yml
|
69
|
+
- db/migrate/20091030115120_furniture.rb
|
70
|
+
- features/support/env.rb
|
71
|
+
- features/support/paths.rb
|
72
|
+
- lib/library/library_tag.rb
|
73
|
+
- lib/library/library_tags.rb
|
74
|
+
- lib/library/link_renderer.rb
|
75
|
+
- lib/library/more_asset_tags.rb
|
76
|
+
- lib/library/more_tag_tags.rb
|
77
|
+
- lib/library/site_controller.rb
|
78
|
+
- lib/library/tagged_asset.rb
|
79
|
+
- lib/tasks/library_extension_tasks.rake
|
80
|
+
- library_extension.rb
|
81
|
+
- spec/controllers/library_site_controller_spec.rb
|
82
|
+
- spec/datasets/library_pages_dataset.rb
|
83
|
+
- spec/datasets/library_sites_dataset.rb
|
84
|
+
- spec/datasets/library_tags_dataset.rb
|
85
|
+
- spec/models/library_page_spec.rb
|
86
|
+
- spec/spec.opts
|
87
|
+
- spec/spec_helper.rb
|
88
|
+
has_rdoc: true
|
89
|
+
homepage: http://github.com/spanner/radiant-library-extension
|
90
|
+
licenses: []
|
91
|
+
|
92
|
+
post_install_message:
|
93
|
+
rdoc_options:
|
94
|
+
- --charset=UTF-8
|
95
|
+
require_paths:
|
96
|
+
- lib
|
97
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
hash: 3
|
103
|
+
segments:
|
104
|
+
- 0
|
105
|
+
version: "0"
|
106
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
hash: 3
|
112
|
+
segments:
|
113
|
+
- 0
|
114
|
+
version: "0"
|
115
|
+
requirements: []
|
116
|
+
|
117
|
+
rubyforge_project:
|
118
|
+
rubygems_version: 1.3.7
|
119
|
+
signing_key:
|
120
|
+
specification_version: 3
|
121
|
+
summary: Library Extension for Radiant CMS
|
122
|
+
test_files:
|
123
|
+
- spec/controllers/library_site_controller_spec.rb
|
124
|
+
- spec/datasets/library_pages_dataset.rb
|
125
|
+
- spec/datasets/library_sites_dataset.rb
|
126
|
+
- spec/datasets/library_tags_dataset.rb
|
127
|
+
- spec/models/library_page_spec.rb
|
128
|
+
- spec/spec_helper.rb
|