content_blocks 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +52 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +35 -0
- data/Rakefile +54 -0
- data/VERSION +1 -0
- data/content_blocks.gemspec +103 -0
- data/lib/content_blocks/snippet.rb +47 -0
- data/lib/content_blocks.rb +3 -0
- data/lib/generators/content_blocks/snippet_generator.rb +17 -0
- data/lib/generators/content_blocks/templates/migration.rb +14 -0
- data/spec/schema/schema.rb +8 -0
- data/spec/snippet_spec.rb +73 -0
- data/spec/spec_helper.rb +28 -0
- metadata +313 -0
data/.document
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/Gemfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
gem "activerecord", "~> 3.0.3"
|
4
|
+
gem "RedCloth"
|
5
|
+
gem "aasm"
|
6
|
+
|
7
|
+
group :development do
|
8
|
+
gem "rspec-rails", "~> 2.1.0"
|
9
|
+
gem "rspec", "~> 2.1.0"
|
10
|
+
gem "bundler", "~> 1.0.0"
|
11
|
+
gem "jeweler", "~> 1.5.1"
|
12
|
+
gem "rcov", ">= 0"
|
13
|
+
gem "sqlite3-ruby", :require => 'sqlite3'
|
14
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
RedCloth (4.2.3)
|
5
|
+
aasm (2.2.0)
|
6
|
+
activemodel (3.0.3)
|
7
|
+
activesupport (= 3.0.3)
|
8
|
+
builder (~> 2.1.2)
|
9
|
+
i18n (~> 0.4)
|
10
|
+
activerecord (3.0.3)
|
11
|
+
activemodel (= 3.0.3)
|
12
|
+
activesupport (= 3.0.3)
|
13
|
+
arel (~> 2.0.2)
|
14
|
+
tzinfo (~> 0.3.23)
|
15
|
+
activesupport (3.0.3)
|
16
|
+
arel (2.0.6)
|
17
|
+
builder (2.1.2)
|
18
|
+
diff-lcs (1.1.2)
|
19
|
+
git (1.2.5)
|
20
|
+
i18n (0.5.0)
|
21
|
+
jeweler (1.5.1)
|
22
|
+
bundler (~> 1.0.0)
|
23
|
+
git (>= 1.2.5)
|
24
|
+
rake
|
25
|
+
rake (0.8.7)
|
26
|
+
rcov (0.9.9)
|
27
|
+
rspec (2.1.0)
|
28
|
+
rspec-core (~> 2.1.0)
|
29
|
+
rspec-expectations (~> 2.1.0)
|
30
|
+
rspec-mocks (~> 2.1.0)
|
31
|
+
rspec-core (2.1.0)
|
32
|
+
rspec-expectations (2.1.0)
|
33
|
+
diff-lcs (~> 1.1.2)
|
34
|
+
rspec-mocks (2.1.0)
|
35
|
+
rspec-rails (2.1.0)
|
36
|
+
rspec (~> 2.1.0)
|
37
|
+
sqlite3-ruby (1.3.2)
|
38
|
+
tzinfo (0.3.23)
|
39
|
+
|
40
|
+
PLATFORMS
|
41
|
+
ruby
|
42
|
+
|
43
|
+
DEPENDENCIES
|
44
|
+
RedCloth
|
45
|
+
aasm
|
46
|
+
activerecord (~> 3.0.3)
|
47
|
+
bundler (~> 1.0.0)
|
48
|
+
jeweler (~> 1.5.1)
|
49
|
+
rcov
|
50
|
+
rspec (~> 2.1.0)
|
51
|
+
rspec-rails (~> 2.1.0)
|
52
|
+
sqlite3-ruby
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 Paweł Pacana
|
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.
|
data/README.rdoc
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
= Content Blocks
|
2
|
+
|
3
|
+
Content Blocks aims to be a tiny set of reusable AR models for site fragments. Currently it consists of only one model: Snippet. The following usage example will tell you more.
|
4
|
+
|
5
|
+
== Installation
|
6
|
+
|
7
|
+
As a gem in your Gemfile:
|
8
|
+
|
9
|
+
gem 'content_blocks'
|
10
|
+
|
11
|
+
== Usage
|
12
|
+
|
13
|
+
Given:
|
14
|
+
|
15
|
+
ContentBlocks::Snippet.create :label => :label_for_snippet, :content => 'h2. Title'
|
16
|
+
ContentBlocks::Snippet[:label_for_snippet].publish!
|
17
|
+
|
18
|
+
When:
|
19
|
+
|
20
|
+
<%= ContentBlocks::Snippet[:label_for_snippet].content %>
|
21
|
+
|
22
|
+
Then it will render textilized content column from Snippet model:
|
23
|
+
|
24
|
+
<h2>Title</h2>
|
25
|
+
|
26
|
+
I you'd rather like to access content without textilization, use:
|
27
|
+
|
28
|
+
<%= ContentBlocks::Snippet[:label_for_snippet].raw_content %>
|
29
|
+
|
30
|
+
You can have multiple snippets with the same label, only one can be published at the same time though. Snippets are also automatically created on first access if they don't exist.
|
31
|
+
|
32
|
+
== Copyright
|
33
|
+
|
34
|
+
Copyright (c) 2010 Paweł Pacana. Released under MIT license.
|
35
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'rake'
|
11
|
+
|
12
|
+
require 'jeweler'
|
13
|
+
Jeweler::Tasks.new do |gem|
|
14
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
+
gem.name = "content_blocks"
|
16
|
+
gem.homepage = "http://github.com/pawelpacana/content_blocks"
|
17
|
+
gem.license = "MIT"
|
18
|
+
gem.summary = %Q{Content parts models for your site.}
|
19
|
+
gem.description = %Q{Content blocks are commonly used models representing editable page partials.}
|
20
|
+
gem.email = "pawel.pacana@gmail.com"
|
21
|
+
gem.authors = ["Paweł Pacana"]
|
22
|
+
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
23
|
+
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
24
|
+
gem.add_runtime_dependency 'aasm', '~> 2.2.0'
|
25
|
+
gem.add_runtime_dependency 'RedCloth', '~> 4.2.3'
|
26
|
+
gem.add_runtime_dependency 'activerecord', '>= 3.0'
|
27
|
+
gem.add_development_dependency 'rspec', '>= 2.1.0'
|
28
|
+
gem.add_development_dependency 'rspec-rails', '>= 2.1.0'
|
29
|
+
gem.add_development_dependency 'sqlite3-ruby'
|
30
|
+
end
|
31
|
+
Jeweler::RubygemsDotOrgTasks.new
|
32
|
+
|
33
|
+
require 'rspec/core'
|
34
|
+
require 'rspec/core/rake_task'
|
35
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
36
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
37
|
+
end
|
38
|
+
|
39
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
40
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
41
|
+
spec.rcov = true
|
42
|
+
end
|
43
|
+
|
44
|
+
task :default => :spec
|
45
|
+
|
46
|
+
require 'rake/rdoctask'
|
47
|
+
Rake::RDocTask.new do |rdoc|
|
48
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
49
|
+
|
50
|
+
rdoc.rdoc_dir = 'rdoc'
|
51
|
+
rdoc.title = "content_blocks #{version}"
|
52
|
+
rdoc.rdoc_files.include('README*')
|
53
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
54
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.2.0
|
@@ -0,0 +1,103 @@
|
|
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{content_blocks}
|
8
|
+
s.version = "0.2.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Pawe\305\202 Pacana"]
|
12
|
+
s.date = %q{2010-12-20}
|
13
|
+
s.description = %q{Content blocks are commonly used models representing editable page partials.}
|
14
|
+
s.email = %q{pawel.pacana@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".rspec",
|
22
|
+
"Gemfile",
|
23
|
+
"Gemfile.lock",
|
24
|
+
"LICENSE.txt",
|
25
|
+
"README.rdoc",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"content_blocks.gemspec",
|
29
|
+
"lib/content_blocks.rb",
|
30
|
+
"lib/content_blocks/snippet.rb",
|
31
|
+
"lib/generators/content_blocks/snippet_generator.rb",
|
32
|
+
"lib/generators/content_blocks/templates/migration.rb",
|
33
|
+
"spec/schema/schema.rb",
|
34
|
+
"spec/snippet_spec.rb",
|
35
|
+
"spec/spec_helper.rb"
|
36
|
+
]
|
37
|
+
s.homepage = %q{http://github.com/pawelpacana/content_blocks}
|
38
|
+
s.licenses = ["MIT"]
|
39
|
+
s.require_paths = ["lib"]
|
40
|
+
s.rubygems_version = %q{1.3.7}
|
41
|
+
s.summary = %q{Content parts models for your site.}
|
42
|
+
s.test_files = [
|
43
|
+
"spec/schema/schema.rb",
|
44
|
+
"spec/snippet_spec.rb",
|
45
|
+
"spec/spec_helper.rb"
|
46
|
+
]
|
47
|
+
|
48
|
+
if s.respond_to? :specification_version then
|
49
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
50
|
+
s.specification_version = 3
|
51
|
+
|
52
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
53
|
+
s.add_runtime_dependency(%q<activerecord>, ["~> 3.0.3"])
|
54
|
+
s.add_runtime_dependency(%q<RedCloth>, [">= 0"])
|
55
|
+
s.add_runtime_dependency(%q<aasm>, [">= 0"])
|
56
|
+
s.add_development_dependency(%q<rspec-rails>, ["~> 2.1.0"])
|
57
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.1.0"])
|
58
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
59
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.5.1"])
|
60
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
61
|
+
s.add_development_dependency(%q<sqlite3-ruby>, [">= 0"])
|
62
|
+
s.add_runtime_dependency(%q<aasm>, ["~> 2.2.0"])
|
63
|
+
s.add_runtime_dependency(%q<RedCloth>, ["~> 4.2.3"])
|
64
|
+
s.add_runtime_dependency(%q<activerecord>, [">= 3.0"])
|
65
|
+
s.add_development_dependency(%q<rspec>, [">= 2.1.0"])
|
66
|
+
s.add_development_dependency(%q<rspec-rails>, [">= 2.1.0"])
|
67
|
+
s.add_development_dependency(%q<sqlite3-ruby>, [">= 0"])
|
68
|
+
else
|
69
|
+
s.add_dependency(%q<activerecord>, ["~> 3.0.3"])
|
70
|
+
s.add_dependency(%q<RedCloth>, [">= 0"])
|
71
|
+
s.add_dependency(%q<aasm>, [">= 0"])
|
72
|
+
s.add_dependency(%q<rspec-rails>, ["~> 2.1.0"])
|
73
|
+
s.add_dependency(%q<rspec>, ["~> 2.1.0"])
|
74
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
75
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
|
76
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
77
|
+
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
|
78
|
+
s.add_dependency(%q<aasm>, ["~> 2.2.0"])
|
79
|
+
s.add_dependency(%q<RedCloth>, ["~> 4.2.3"])
|
80
|
+
s.add_dependency(%q<activerecord>, [">= 3.0"])
|
81
|
+
s.add_dependency(%q<rspec>, [">= 2.1.0"])
|
82
|
+
s.add_dependency(%q<rspec-rails>, [">= 2.1.0"])
|
83
|
+
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
|
84
|
+
end
|
85
|
+
else
|
86
|
+
s.add_dependency(%q<activerecord>, ["~> 3.0.3"])
|
87
|
+
s.add_dependency(%q<RedCloth>, [">= 0"])
|
88
|
+
s.add_dependency(%q<aasm>, [">= 0"])
|
89
|
+
s.add_dependency(%q<rspec-rails>, ["~> 2.1.0"])
|
90
|
+
s.add_dependency(%q<rspec>, ["~> 2.1.0"])
|
91
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
92
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
|
93
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
94
|
+
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
|
95
|
+
s.add_dependency(%q<aasm>, ["~> 2.2.0"])
|
96
|
+
s.add_dependency(%q<RedCloth>, ["~> 4.2.3"])
|
97
|
+
s.add_dependency(%q<activerecord>, [">= 3.0"])
|
98
|
+
s.add_dependency(%q<rspec>, [">= 2.1.0"])
|
99
|
+
s.add_dependency(%q<rspec-rails>, [">= 2.1.0"])
|
100
|
+
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'active_record'
|
2
|
+
require 'aasm'
|
3
|
+
require 'RedCloth'
|
4
|
+
|
5
|
+
module ContentBlocks
|
6
|
+
class Snippet < ActiveRecord::Base
|
7
|
+
include AASM
|
8
|
+
|
9
|
+
set_table_name 'content_blocks_snippets'
|
10
|
+
|
11
|
+
LABEL_FORMAT = /^[a-zA-Z\d_]+$/
|
12
|
+
|
13
|
+
aasm_initial_state :draft
|
14
|
+
aasm_column :status
|
15
|
+
|
16
|
+
aasm_state :draft
|
17
|
+
aasm_state :published
|
18
|
+
|
19
|
+
aasm_event :preview do
|
20
|
+
transitions :from => :published, :to => :draft
|
21
|
+
end
|
22
|
+
|
23
|
+
aasm_event :publish do
|
24
|
+
transitions :from => :draft, :to => :published
|
25
|
+
end
|
26
|
+
|
27
|
+
scope :published, where(:status => 'published')
|
28
|
+
scope :draft, where(:status => 'draft')
|
29
|
+
|
30
|
+
validates :label,
|
31
|
+
:presence => true,
|
32
|
+
:format => { :with => LABEL_FORMAT },
|
33
|
+
:uniqueness => { :scope => :status, :if => :published? }
|
34
|
+
|
35
|
+
def self.[](label)
|
36
|
+
find_or_create_by_label(label)
|
37
|
+
end
|
38
|
+
|
39
|
+
def content
|
40
|
+
textilize(raw_content)
|
41
|
+
end
|
42
|
+
|
43
|
+
def raw_content
|
44
|
+
self[:content] if published?
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
require 'rails/generators/active_record'
|
3
|
+
|
4
|
+
module ContentBlocks
|
5
|
+
class SnippetGenerator < Rails::Generators::Base
|
6
|
+
include Rails::Generators::Migration
|
7
|
+
extend ActiveRecord::Generators::Migration
|
8
|
+
|
9
|
+
def self.source_root
|
10
|
+
@source_root ||= File.join(File.dirname(__FILE__), 'templates')
|
11
|
+
end
|
12
|
+
|
13
|
+
def copy_migration_template
|
14
|
+
migration_template 'migration.rb', 'db/migrate/create_content_blocks_snippets'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class ContentBlocksCreateSnippets < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :content_blocks_snippets, :force => true do |t|
|
4
|
+
t.string :label, :null => false
|
5
|
+
t.text :content
|
6
|
+
t.string :status
|
7
|
+
t.timestamps :null => false
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.down
|
12
|
+
drop_table :content_blocks_snippets
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
+
|
3
|
+
describe ContentBlocks::Snippet do
|
4
|
+
before do
|
5
|
+
@valid_attributes = {
|
6
|
+
:label => "sidebar",
|
7
|
+
:content => "h1. Sidebar links"
|
8
|
+
}
|
9
|
+
@snippet = ContentBlocks::Snippet.new(@valid_attributes)
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should be initially draft" do
|
13
|
+
@snippet.save!
|
14
|
+
@snippet.draft?.should be_true
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should be unique when published" do
|
18
|
+
@snippet.save!
|
19
|
+
cloned = ContentBlocks::Snippet.create!(@valid_attributes)
|
20
|
+
@snippet.publish!
|
21
|
+
@snippet.should be_valid
|
22
|
+
@snippet.published?.should be_true
|
23
|
+
cloned.publish!
|
24
|
+
cloned.published?.should be_false
|
25
|
+
@snippet.preview!
|
26
|
+
cloned.publish!
|
27
|
+
cloned.published?.should be_true
|
28
|
+
@snippet.publish!
|
29
|
+
@snippet.published?.should be_false
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should require label" do
|
33
|
+
@snippet.label = nil
|
34
|
+
@snippet.should_not be_valid
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should require valid label" do
|
38
|
+
@snippet.label = "abc_123_AZ"
|
39
|
+
@snippet.should be_valid
|
40
|
+
@snippet.label = "1-2-3"
|
41
|
+
@snippet.should have(1).error_on(:label)
|
42
|
+
end
|
43
|
+
|
44
|
+
context "#raw_content" do
|
45
|
+
it "should show content only if published" do
|
46
|
+
@snippet.save!
|
47
|
+
@snippet.raw_content.should be_nil
|
48
|
+
@snippet.publish!
|
49
|
+
@snippet.raw_content.should_not be_nil
|
50
|
+
end
|
51
|
+
|
52
|
+
it "should preserve unformatted content" do
|
53
|
+
@snippet.save!
|
54
|
+
@snippet.publish!
|
55
|
+
@snippet.raw_content.should == @valid_attributes[:content]
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
context "#content" do
|
60
|
+
it "should show content only if published" do
|
61
|
+
@snippet.save!
|
62
|
+
@snippet.content.should be_nil
|
63
|
+
@snippet.publish!
|
64
|
+
@snippet.content.should_not be_nil
|
65
|
+
end
|
66
|
+
|
67
|
+
it "should textilize content" do
|
68
|
+
@snippet.save!
|
69
|
+
@snippet.publish!
|
70
|
+
@snippet.content.should == "<h1>Sidebar links</h1>"
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'active_record'
|
4
|
+
require 'rspec'
|
5
|
+
require 'rspec/rails/adapters'
|
6
|
+
require 'rspec/rails/extensions'
|
7
|
+
require 'rspec/rails/fixture_support'
|
8
|
+
require 'sqlite3'
|
9
|
+
|
10
|
+
# Requires supporting files with custom matchers and macros, etc,
|
11
|
+
# in ./support/ and its subdirectories.
|
12
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
13
|
+
|
14
|
+
RSpec.configure do |config|
|
15
|
+
config.use_transactional_fixtures = true
|
16
|
+
end
|
17
|
+
|
18
|
+
ActiveRecord::Base.configurations = {
|
19
|
+
'content_blocks_test' => {
|
20
|
+
:adapter => 'sqlite3',
|
21
|
+
:database => 'content_blocks_test.db',
|
22
|
+
:min_messages => 'warning'
|
23
|
+
}
|
24
|
+
}
|
25
|
+
ActiveRecord::Base.establish_connection 'content_blocks_test'
|
26
|
+
load File.join(File.dirname(__FILE__), 'schema', 'schema.rb')
|
27
|
+
|
28
|
+
require 'content_blocks'
|
metadata
ADDED
@@ -0,0 +1,313 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: content_blocks
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 0.2.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- "Pawe\xC5\x82 Pacana"
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-12-20 00:00:00 +01:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
name: activerecord
|
25
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
hash: 1
|
31
|
+
segments:
|
32
|
+
- 3
|
33
|
+
- 0
|
34
|
+
- 3
|
35
|
+
version: 3.0.3
|
36
|
+
requirement: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
name: RedCloth
|
41
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
hash: 3
|
47
|
+
segments:
|
48
|
+
- 0
|
49
|
+
version: "0"
|
50
|
+
requirement: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
type: :runtime
|
53
|
+
prerelease: false
|
54
|
+
name: aasm
|
55
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
hash: 3
|
61
|
+
segments:
|
62
|
+
- 0
|
63
|
+
version: "0"
|
64
|
+
requirement: *id003
|
65
|
+
- !ruby/object:Gem::Dependency
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
name: rspec-rails
|
69
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
71
|
+
requirements:
|
72
|
+
- - ~>
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
hash: 11
|
75
|
+
segments:
|
76
|
+
- 2
|
77
|
+
- 1
|
78
|
+
- 0
|
79
|
+
version: 2.1.0
|
80
|
+
requirement: *id004
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
name: rspec
|
85
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
86
|
+
none: false
|
87
|
+
requirements:
|
88
|
+
- - ~>
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
hash: 11
|
91
|
+
segments:
|
92
|
+
- 2
|
93
|
+
- 1
|
94
|
+
- 0
|
95
|
+
version: 2.1.0
|
96
|
+
requirement: *id005
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
type: :development
|
99
|
+
prerelease: false
|
100
|
+
name: bundler
|
101
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
102
|
+
none: false
|
103
|
+
requirements:
|
104
|
+
- - ~>
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
hash: 23
|
107
|
+
segments:
|
108
|
+
- 1
|
109
|
+
- 0
|
110
|
+
- 0
|
111
|
+
version: 1.0.0
|
112
|
+
requirement: *id006
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
type: :development
|
115
|
+
prerelease: false
|
116
|
+
name: jeweler
|
117
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
118
|
+
none: false
|
119
|
+
requirements:
|
120
|
+
- - ~>
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
hash: 1
|
123
|
+
segments:
|
124
|
+
- 1
|
125
|
+
- 5
|
126
|
+
- 1
|
127
|
+
version: 1.5.1
|
128
|
+
requirement: *id007
|
129
|
+
- !ruby/object:Gem::Dependency
|
130
|
+
type: :development
|
131
|
+
prerelease: false
|
132
|
+
name: rcov
|
133
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
134
|
+
none: false
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
hash: 3
|
139
|
+
segments:
|
140
|
+
- 0
|
141
|
+
version: "0"
|
142
|
+
requirement: *id008
|
143
|
+
- !ruby/object:Gem::Dependency
|
144
|
+
type: :development
|
145
|
+
prerelease: false
|
146
|
+
name: sqlite3-ruby
|
147
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
148
|
+
none: false
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
hash: 3
|
153
|
+
segments:
|
154
|
+
- 0
|
155
|
+
version: "0"
|
156
|
+
requirement: *id009
|
157
|
+
- !ruby/object:Gem::Dependency
|
158
|
+
type: :runtime
|
159
|
+
prerelease: false
|
160
|
+
name: aasm
|
161
|
+
version_requirements: &id010 !ruby/object:Gem::Requirement
|
162
|
+
none: false
|
163
|
+
requirements:
|
164
|
+
- - ~>
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
hash: 7
|
167
|
+
segments:
|
168
|
+
- 2
|
169
|
+
- 2
|
170
|
+
- 0
|
171
|
+
version: 2.2.0
|
172
|
+
requirement: *id010
|
173
|
+
- !ruby/object:Gem::Dependency
|
174
|
+
type: :runtime
|
175
|
+
prerelease: false
|
176
|
+
name: RedCloth
|
177
|
+
version_requirements: &id011 !ruby/object:Gem::Requirement
|
178
|
+
none: false
|
179
|
+
requirements:
|
180
|
+
- - ~>
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
hash: 49
|
183
|
+
segments:
|
184
|
+
- 4
|
185
|
+
- 2
|
186
|
+
- 3
|
187
|
+
version: 4.2.3
|
188
|
+
requirement: *id011
|
189
|
+
- !ruby/object:Gem::Dependency
|
190
|
+
type: :runtime
|
191
|
+
prerelease: false
|
192
|
+
name: activerecord
|
193
|
+
version_requirements: &id012 !ruby/object:Gem::Requirement
|
194
|
+
none: false
|
195
|
+
requirements:
|
196
|
+
- - ">="
|
197
|
+
- !ruby/object:Gem::Version
|
198
|
+
hash: 7
|
199
|
+
segments:
|
200
|
+
- 3
|
201
|
+
- 0
|
202
|
+
version: "3.0"
|
203
|
+
requirement: *id012
|
204
|
+
- !ruby/object:Gem::Dependency
|
205
|
+
type: :development
|
206
|
+
prerelease: false
|
207
|
+
name: rspec
|
208
|
+
version_requirements: &id013 !ruby/object:Gem::Requirement
|
209
|
+
none: false
|
210
|
+
requirements:
|
211
|
+
- - ">="
|
212
|
+
- !ruby/object:Gem::Version
|
213
|
+
hash: 11
|
214
|
+
segments:
|
215
|
+
- 2
|
216
|
+
- 1
|
217
|
+
- 0
|
218
|
+
version: 2.1.0
|
219
|
+
requirement: *id013
|
220
|
+
- !ruby/object:Gem::Dependency
|
221
|
+
type: :development
|
222
|
+
prerelease: false
|
223
|
+
name: rspec-rails
|
224
|
+
version_requirements: &id014 !ruby/object:Gem::Requirement
|
225
|
+
none: false
|
226
|
+
requirements:
|
227
|
+
- - ">="
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
hash: 11
|
230
|
+
segments:
|
231
|
+
- 2
|
232
|
+
- 1
|
233
|
+
- 0
|
234
|
+
version: 2.1.0
|
235
|
+
requirement: *id014
|
236
|
+
- !ruby/object:Gem::Dependency
|
237
|
+
type: :development
|
238
|
+
prerelease: false
|
239
|
+
name: sqlite3-ruby
|
240
|
+
version_requirements: &id015 !ruby/object:Gem::Requirement
|
241
|
+
none: false
|
242
|
+
requirements:
|
243
|
+
- - ">="
|
244
|
+
- !ruby/object:Gem::Version
|
245
|
+
hash: 3
|
246
|
+
segments:
|
247
|
+
- 0
|
248
|
+
version: "0"
|
249
|
+
requirement: *id015
|
250
|
+
description: Content blocks are commonly used models representing editable page partials.
|
251
|
+
email: pawel.pacana@gmail.com
|
252
|
+
executables: []
|
253
|
+
|
254
|
+
extensions: []
|
255
|
+
|
256
|
+
extra_rdoc_files:
|
257
|
+
- LICENSE.txt
|
258
|
+
- README.rdoc
|
259
|
+
files:
|
260
|
+
- .document
|
261
|
+
- .rspec
|
262
|
+
- Gemfile
|
263
|
+
- Gemfile.lock
|
264
|
+
- LICENSE.txt
|
265
|
+
- README.rdoc
|
266
|
+
- Rakefile
|
267
|
+
- VERSION
|
268
|
+
- content_blocks.gemspec
|
269
|
+
- lib/content_blocks.rb
|
270
|
+
- lib/content_blocks/snippet.rb
|
271
|
+
- lib/generators/content_blocks/snippet_generator.rb
|
272
|
+
- lib/generators/content_blocks/templates/migration.rb
|
273
|
+
- spec/schema/schema.rb
|
274
|
+
- spec/snippet_spec.rb
|
275
|
+
- spec/spec_helper.rb
|
276
|
+
has_rdoc: true
|
277
|
+
homepage: http://github.com/pawelpacana/content_blocks
|
278
|
+
licenses:
|
279
|
+
- MIT
|
280
|
+
post_install_message:
|
281
|
+
rdoc_options: []
|
282
|
+
|
283
|
+
require_paths:
|
284
|
+
- lib
|
285
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
286
|
+
none: false
|
287
|
+
requirements:
|
288
|
+
- - ">="
|
289
|
+
- !ruby/object:Gem::Version
|
290
|
+
hash: 3
|
291
|
+
segments:
|
292
|
+
- 0
|
293
|
+
version: "0"
|
294
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
295
|
+
none: false
|
296
|
+
requirements:
|
297
|
+
- - ">="
|
298
|
+
- !ruby/object:Gem::Version
|
299
|
+
hash: 3
|
300
|
+
segments:
|
301
|
+
- 0
|
302
|
+
version: "0"
|
303
|
+
requirements: []
|
304
|
+
|
305
|
+
rubyforge_project:
|
306
|
+
rubygems_version: 1.3.7
|
307
|
+
signing_key:
|
308
|
+
specification_version: 3
|
309
|
+
summary: Content parts models for your site.
|
310
|
+
test_files:
|
311
|
+
- spec/schema/schema.rb
|
312
|
+
- spec/snippet_spec.rb
|
313
|
+
- spec/spec_helper.rb
|