blocks 2.6.3 → 2.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +7 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.rdoc +4 -0
- data/Gemfile +1 -15
- data/Rakefile +6 -26
- data/blocks.gemspec +24 -69
- data/lib/blocks/base.rb +10 -10
- data/lib/blocks/version.rb +3 -0
- metadata +41 -41
- data/VERSION +0 -1
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YjAzYTVjNjBiN2UxM2JmNWFlYmFiYjMzMGMwM2UxZDc1MDNjYjViNg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MzAzOWU1NWM1Yzg0M2RlMTAyNDM3NWQwZTYyODdlZDg4NmQ1ZmEwYw==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MDQzZWZkY2YwNDY1M2VlMGY3OWQ5MDdiMWE1Mjg0MzgwZjljNmQzYzFhNTM5
|
10
|
+
NjhhODhiZWY5ZTg0YWU1YjBmYWJhOWU2NzRjZGM1Y2U5Mzc3NWI3MmUzZTVj
|
11
|
+
M2JhYjc3NDg2NTU5N2NkMDVlZGU2YjM0YjY1YTRmY2Q2YWVmNjE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MWE0MTRjZGM3MDY4NjdkYWQwYjZjYWY1OTY2MWYxMjEwYTNmOGQ1NTJmMzVh
|
14
|
+
NjVmMzA0OTI3MDFiODQwMjE0NWRjMzUxYTFlZjFhZTA0NjU1OTBmNGY1NjE2
|
15
|
+
MGZmYzMwYjk1YjhiZGQyOWY4NDNlZWE1YWJhZTM2YmQwYzM4Mzc=
|
data/.gitignore
ADDED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.9.3
|
1
|
+
1.9.3-p484
|
data/CHANGELOG.rdoc
CHANGED
data/Gemfile
CHANGED
@@ -1,17 +1,3 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
|
-
|
4
|
-
gem "call_with_params", "~> 0.0.2"
|
5
|
-
gem "hashie"
|
6
|
-
|
7
|
-
group :development do
|
8
|
-
gem "bundler", "~> 1.3.5"
|
9
|
-
gem "jeweler", "~> 1.6.4"
|
10
|
-
gem "simplecov"
|
11
|
-
end
|
12
|
-
|
13
|
-
group :test do
|
14
|
-
gem "rspec-rails"
|
15
|
-
gem "mocha"
|
16
|
-
gem "debugger"
|
17
|
-
end
|
3
|
+
gemspec
|
data/Rakefile
CHANGED
@@ -1,30 +1,10 @@
|
|
1
1
|
require 'rspec/core/rake_task'
|
2
|
-
|
2
|
+
require 'bundler/gem_tasks'
|
3
3
|
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
require 'bundler'
|
9
|
-
begin
|
10
|
-
Bundler.setup(:default, :development)
|
11
|
-
rescue Bundler::BundlerError => e
|
12
|
-
$stderr.puts e.message
|
13
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
14
|
-
exit e.status_code
|
4
|
+
# Default directory to look in is `/specs`
|
5
|
+
# Run with `rake spec`
|
6
|
+
RSpec::Core::RakeTask.new(:spec) do |task|
|
7
|
+
task.rspec_opts = ['--color', '--format', 'nested']
|
15
8
|
end
|
16
|
-
require 'rake'
|
17
9
|
|
18
|
-
|
19
|
-
Jeweler::Tasks.new do |gem|
|
20
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
21
|
-
gem.name = "blocks"
|
22
|
-
gem.homepage = "http://github.com/hunterae/blocks"
|
23
|
-
gem.license = "MIT"
|
24
|
-
gem.summary = "Blocks is an intricate way of rendering blocks of code and adding several new features that go above and beyond what a simple content_for with yield is capable of doing."
|
25
|
-
gem.description = "Blocks goes beyond blocks and partials"
|
26
|
-
gem.email = "hunterae@gmail.com"
|
27
|
-
gem.authors = ["Andrew Hunter"]
|
28
|
-
# dependencies defined in Gemfile
|
29
|
-
end
|
30
|
-
Jeweler::RubygemsDotOrgTasks.new
|
10
|
+
task :default => :spec
|
data/blocks.gemspec
CHANGED
@@ -1,74 +1,29 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'blocks/version'
|
5
5
|
|
6
|
-
Gem::Specification.new do |
|
7
|
-
|
8
|
-
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "blocks"
|
8
|
+
spec.version = Blocks::VERSION
|
9
|
+
spec.authors = ["Andrew Hunter"]
|
10
|
+
spec.email = ["hunterae@gmail.com"]
|
11
|
+
spec.summary = %q{Blocks goes beyond blocks and partials}
|
12
|
+
spec.description = %q{Blocks goes beyond blocks and partials}
|
13
|
+
spec.homepage = "http://github.com/hunterae/blocks"
|
14
|
+
spec.license = "MIT"
|
9
15
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
s.email = "hunterae@gmail.com"
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"README.rdoc"
|
17
|
-
]
|
18
|
-
s.files = [
|
19
|
-
".rspec",
|
20
|
-
".ruby-gemset",
|
21
|
-
".ruby-version",
|
22
|
-
"CHANGELOG.rdoc",
|
23
|
-
"Gemfile",
|
24
|
-
"README.rdoc",
|
25
|
-
"Rakefile",
|
26
|
-
"VERSION",
|
27
|
-
"blocks.gemspec",
|
28
|
-
"blocks_render_order.graffle",
|
29
|
-
"blocks_render_order.png",
|
30
|
-
"lib/blocks.rb",
|
31
|
-
"lib/blocks/base.rb",
|
32
|
-
"lib/blocks/container.rb",
|
33
|
-
"lib/blocks/controller_additions.rb",
|
34
|
-
"lib/blocks/view_additions.rb",
|
35
|
-
"rails/init.rb",
|
36
|
-
"spec/blocks/base_spec.rb",
|
37
|
-
"spec/blocks/blocks_spec.rb",
|
38
|
-
"spec/blocks/view_additions_spec.rb",
|
39
|
-
"spec/spec_helper.rb"
|
40
|
-
]
|
41
|
-
s.homepage = "http://github.com/hunterae/blocks"
|
42
|
-
s.licenses = ["MIT"]
|
43
|
-
s.require_paths = ["lib"]
|
44
|
-
s.rubygems_version = "1.8.25"
|
45
|
-
s.summary = "Blocks is an intricate way of rendering blocks of code and adding several new features that go above and beyond what a simple content_for with yield is capable of doing."
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
46
20
|
|
47
|
-
|
48
|
-
|
21
|
+
spec.add_dependency "rails", ">= 3.0.0"
|
22
|
+
spec.add_dependency "call_with_params", "~> 0.0.2"
|
23
|
+
spec.add_dependency "hashie"
|
49
24
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
s.add_development_dependency(%q<bundler>, ["~> 1.3.5"])
|
55
|
-
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
56
|
-
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
57
|
-
else
|
58
|
-
s.add_dependency(%q<rails>, [">= 3.0.0"])
|
59
|
-
s.add_dependency(%q<call_with_params>, ["~> 0.0.2"])
|
60
|
-
s.add_dependency(%q<hashie>, [">= 0"])
|
61
|
-
s.add_dependency(%q<bundler>, ["~> 1.3.5"])
|
62
|
-
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
63
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
64
|
-
end
|
65
|
-
else
|
66
|
-
s.add_dependency(%q<rails>, [">= 3.0.0"])
|
67
|
-
s.add_dependency(%q<call_with_params>, ["~> 0.0.2"])
|
68
|
-
s.add_dependency(%q<hashie>, [">= 0"])
|
69
|
-
s.add_dependency(%q<bundler>, ["~> 1.3.5"])
|
70
|
-
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
71
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
72
|
-
end
|
25
|
+
spec.add_development_dependency "simplecov"
|
26
|
+
spec.add_development_dependency "rspec-rails"
|
27
|
+
spec.add_development_dependency "mocha"
|
28
|
+
spec.add_development_dependency "debugger"
|
73
29
|
end
|
74
|
-
|
data/lib/blocks/base.rb
CHANGED
@@ -22,7 +22,7 @@ module Blocks
|
|
22
22
|
# [+name+]
|
23
23
|
# The name of the block to check
|
24
24
|
def defined?(name)
|
25
|
-
!blocks[name
|
25
|
+
!blocks[name].nil?
|
26
26
|
end
|
27
27
|
|
28
28
|
# Define a block, unless a block by the same name is already defined.
|
@@ -34,7 +34,7 @@ module Blocks
|
|
34
34
|
# [+name+]
|
35
35
|
# The name of the block being defined (either a string or a symbol or a Proc)
|
36
36
|
# [+options+]
|
37
|
-
# The default options for the block definition. Any or all of these options may be
|
37
|
+
# The default options for the block definition. Any or all of these options may be overridden by
|
38
38
|
# whomever calls "blocks.render" on this block. If :collection => some_array,
|
39
39
|
# Blocks will assume that the first argument is a Proc and define a block for each object in the
|
40
40
|
# collection
|
@@ -66,12 +66,12 @@ module Blocks
|
|
66
66
|
# [+name+]
|
67
67
|
# The name of the block being defined (either a string or a symbol)
|
68
68
|
# [+options+]
|
69
|
-
# The default options for the block definition. Any or all of these options may be
|
69
|
+
# The default options for the block definition. Any or all of these options may be overridden by
|
70
70
|
# whomever calls "blocks.render" on this block.
|
71
71
|
# [+block+]
|
72
72
|
# The block that is to be rendered when "blocks.render" is called for this block.
|
73
73
|
def replace(name, options={}, &block)
|
74
|
-
blocks[name
|
74
|
+
blocks[name] = nil
|
75
75
|
self.define_block_container(name, options, &block)
|
76
76
|
nil
|
77
77
|
end
|
@@ -89,7 +89,7 @@ module Blocks
|
|
89
89
|
# [+name+]
|
90
90
|
# The name of the block to skip rendering for
|
91
91
|
def skip(name)
|
92
|
-
blocks[name
|
92
|
+
blocks[name] = nil
|
93
93
|
self.define_block_container(name) do
|
94
94
|
end
|
95
95
|
nil
|
@@ -412,15 +412,15 @@ module Blocks
|
|
412
412
|
end
|
413
413
|
end
|
414
414
|
|
415
|
-
protected
|
416
|
-
|
417
415
|
def initialize(view, options={})
|
418
416
|
self.view = view
|
419
417
|
self.global_options = Blocks.config.merge(options)
|
420
|
-
self.blocks =
|
418
|
+
self.blocks = HashWithIndifferentAccess.new
|
421
419
|
self.anonymous_block_number = 0
|
422
420
|
end
|
423
421
|
|
422
|
+
protected
|
423
|
+
|
424
424
|
# Return a unique name for an anonymously defined block (i.e. a block that has not been given a name)
|
425
425
|
def anonymous_block_name
|
426
426
|
self.anonymous_block_number += 1
|
@@ -428,8 +428,8 @@ module Blocks
|
|
428
428
|
end
|
429
429
|
|
430
430
|
def render_block_with_around_blocks(name_or_container, *args, &block)
|
431
|
-
name = name_or_container.is_a?(Blocks::Container) ? name_or_container.name
|
432
|
-
around_name = "around_#{name
|
431
|
+
name = name_or_container.is_a?(Blocks::Container) ? name_or_container.name : name_or_container
|
432
|
+
around_name = "around_#{name}"
|
433
433
|
|
434
434
|
around_blocks = blocks[around_name].present? ? blocks[around_name].clone : []
|
435
435
|
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blocks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
5
|
-
prerelease:
|
4
|
+
version: 2.6.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Andrew Hunter
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-07-22 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rails
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ! '>='
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ! '>='
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: call_with_params
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: hashie
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ! '>='
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,47 +48,55 @@ dependencies:
|
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ! '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
|
-
name:
|
56
|
+
name: simplecov
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - ! '>='
|
68
60
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
61
|
+
version: '0'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - ! '>='
|
76
67
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
68
|
+
version: '0'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
|
-
name:
|
70
|
+
name: rspec-rails
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - ! '>='
|
84
74
|
- !ruby/object:Gem::Version
|
85
|
-
version:
|
75
|
+
version: '0'
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - ! '>='
|
92
81
|
- !ruby/object:Gem::Version
|
93
|
-
version:
|
82
|
+
version: '0'
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
|
-
name:
|
84
|
+
name: mocha
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: debugger
|
96
99
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
100
|
requirements:
|
99
101
|
- - ! '>='
|
100
102
|
- !ruby/object:Gem::Version
|
@@ -102,18 +104,18 @@ dependencies:
|
|
102
104
|
type: :development
|
103
105
|
prerelease: false
|
104
106
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
107
|
requirements:
|
107
108
|
- - ! '>='
|
108
109
|
- !ruby/object:Gem::Version
|
109
110
|
version: '0'
|
110
111
|
description: Blocks goes beyond blocks and partials
|
111
|
-
email:
|
112
|
+
email:
|
113
|
+
- hunterae@gmail.com
|
112
114
|
executables: []
|
113
115
|
extensions: []
|
114
|
-
extra_rdoc_files:
|
115
|
-
- README.rdoc
|
116
|
+
extra_rdoc_files: []
|
116
117
|
files:
|
118
|
+
- .gitignore
|
117
119
|
- .rspec
|
118
120
|
- .ruby-gemset
|
119
121
|
- .ruby-version
|
@@ -121,7 +123,6 @@ files:
|
|
121
123
|
- Gemfile
|
122
124
|
- README.rdoc
|
123
125
|
- Rakefile
|
124
|
-
- VERSION
|
125
126
|
- blocks.gemspec
|
126
127
|
- blocks_render_order.graffle
|
127
128
|
- blocks_render_order.png
|
@@ -129,6 +130,7 @@ files:
|
|
129
130
|
- lib/blocks/base.rb
|
130
131
|
- lib/blocks/container.rb
|
131
132
|
- lib/blocks/controller_additions.rb
|
133
|
+
- lib/blocks/version.rb
|
132
134
|
- lib/blocks/view_additions.rb
|
133
135
|
- rails/init.rb
|
134
136
|
- spec/blocks/base_spec.rb
|
@@ -138,31 +140,29 @@ files:
|
|
138
140
|
homepage: http://github.com/hunterae/blocks
|
139
141
|
licenses:
|
140
142
|
- MIT
|
143
|
+
metadata: {}
|
141
144
|
post_install_message:
|
142
145
|
rdoc_options: []
|
143
146
|
require_paths:
|
144
147
|
- lib
|
145
148
|
required_ruby_version: !ruby/object:Gem::Requirement
|
146
|
-
none: false
|
147
149
|
requirements:
|
148
150
|
- - ! '>='
|
149
151
|
- !ruby/object:Gem::Version
|
150
152
|
version: '0'
|
151
|
-
segments:
|
152
|
-
- 0
|
153
|
-
hash: 4219206689856184029
|
154
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
|
-
none: false
|
156
154
|
requirements:
|
157
155
|
- - ! '>='
|
158
156
|
- !ruby/object:Gem::Version
|
159
157
|
version: '0'
|
160
158
|
requirements: []
|
161
159
|
rubyforge_project:
|
162
|
-
rubygems_version:
|
160
|
+
rubygems_version: 2.2.2
|
163
161
|
signing_key:
|
164
|
-
specification_version:
|
165
|
-
summary: Blocks
|
166
|
-
|
167
|
-
|
168
|
-
|
162
|
+
specification_version: 4
|
163
|
+
summary: Blocks goes beyond blocks and partials
|
164
|
+
test_files:
|
165
|
+
- spec/blocks/base_spec.rb
|
166
|
+
- spec/blocks/blocks_spec.rb
|
167
|
+
- spec/blocks/view_additions_spec.rb
|
168
|
+
- spec/spec_helper.rb
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.6.3
|