blocks 2.8.0 → 3.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +5 -13
  2. data/.gitignore +4 -4
  3. data/.travis.yml +51 -0
  4. data/Gemfile +15 -2
  5. data/Guardfile +15 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +41 -0
  8. data/Rakefile +3 -7
  9. data/bin/console +14 -0
  10. data/bin/setup +8 -0
  11. data/blocks.gemspec +18 -11
  12. data/gemfiles/Gemfile.rails-3-0-stable +13 -0
  13. data/gemfiles/Gemfile.rails-3-1-stable +13 -0
  14. data/gemfiles/Gemfile.rails-3-2-stable +13 -0
  15. data/gemfiles/Gemfile.rails-4-0-stable +12 -0
  16. data/gemfiles/Gemfile.rails-4-1-stable +12 -0
  17. data/gemfiles/Gemfile.rails-4-2-stable +12 -0
  18. data/gemfiles/Gemfile.rails-5-0-stable +10 -0
  19. data/gemfiles/Gemfile.rails-5-1-stable +10 -0
  20. data/lib/blocks.rb +41 -20
  21. data/lib/blocks/action_view_extensions/view_extensions.rb +26 -0
  22. data/lib/blocks/builders/block_definition.rb +71 -0
  23. data/lib/blocks/builders/builder.rb +159 -0
  24. data/lib/blocks/builders/hook_definition.rb +25 -0
  25. data/lib/blocks/experimental/builder_permissions.rb +52 -0
  26. data/lib/blocks/experimental/invalid_permissions_handler.rb +27 -0
  27. data/lib/blocks/renderers/abstract_renderer.rb +69 -0
  28. data/lib/blocks/renderers/adjacent_blocks_renderer.rb +15 -0
  29. data/lib/blocks/renderers/block_placeholder.rb +13 -0
  30. data/lib/blocks/renderers/block_renderer.rb +13 -0
  31. data/lib/blocks/renderers/block_with_hooks_renderer.rb +35 -0
  32. data/lib/blocks/renderers/collection_renderer.rb +17 -0
  33. data/lib/blocks/renderers/nesting_blocks_renderer.rb +24 -0
  34. data/lib/blocks/renderers/partial_renderer.rb +18 -0
  35. data/lib/blocks/renderers/renderer.rb +43 -0
  36. data/lib/blocks/renderers/runtime_context.rb +193 -0
  37. data/lib/blocks/renderers/wrapper_renderer.rb +19 -0
  38. data/lib/blocks/utilities/configurator.rb +26 -0
  39. data/lib/blocks/utilities/dynamic_configuration.rb +71 -0
  40. data/lib/blocks/utilities/hash_with_caller.rb +73 -0
  41. data/lib/blocks/utilities/hash_with_render_strategy.rb +47 -0
  42. data/lib/blocks/utilities/options_set.rb +95 -0
  43. data/lib/blocks/version.rb +1 -1
  44. metadata +70 -80
  45. data/.ruby-gemset +0 -1
  46. data/.ruby-version +0 -1
  47. data/README.rdoc +0 -99
  48. data/blocks_render_order.graffle +0 -1397
  49. data/blocks_render_order.png +0 -0
  50. data/lib/blocks/base.rb +0 -580
  51. data/lib/blocks/container.rb +0 -5
  52. data/lib/blocks/controller_additions.rb +0 -9
  53. data/lib/blocks/view_additions.rb +0 -10
  54. data/rails/init.rb +0 -1
  55. data/spec/blocks/base_spec.rb +0 -641
  56. data/spec/blocks/blocks_spec.rb +0 -12
  57. data/spec/blocks/view_additions_spec.rb +0 -22
  58. data/spec/spec_helper.rb +0 -22
@@ -1,12 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Blocks do
4
- it "should provide a setup method that can be called from an initializer" do
5
- Blocks.config.partials_folder.should eql("blocks")
6
- Blocks.setup do |config|
7
- config.should be_a(Hashie::Mash)
8
- config.partials_folder = "shared"
9
- end
10
- Blocks.config.partials_folder.should eql("shared")
11
- end
12
- end
@@ -1,22 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Blocks::ViewAdditions do
4
- before(:each) do
5
- @view_class = Class.new
6
- @view = @view_class.new
7
- @view_class.send(:include, Blocks::ViewAdditions)
8
- end
9
-
10
- describe "#blocks" do
11
- it "should pass the view as the only parameter to Blocks::Base initialization" do
12
- Blocks::Base.expects(:new).with {|view| view == @view}
13
- @view.blocks
14
- end
15
-
16
- it "should memoize the Blocks::Base instance for 'blocks' call" do
17
- Blocks::Base.expects(:new).once.with {|view| view == @view}.returns "something"
18
- @view.blocks.should eql "something"
19
- @view.blocks.should eql "something"
20
- end
21
- end
22
- end
data/spec/spec_helper.rb DELETED
@@ -1,22 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler/setup'
3
- require 'ruby-debug'
4
-
5
- require 'blocks' # and any other gems you need
6
-
7
- def print_hash(hash)
8
- hash.inject("") { |s, (k, v)| "#{s} #{k}: #{v}." }
9
- end
10
-
11
- RSpec.configure do |config|
12
- config.mock_with :mocha
13
-
14
- config.before :each do
15
- Blocks.setup do |config|
16
- config.partials_folder = "blocks"
17
- config.wrap_before_and_after_blocks = false
18
- config.use_partials = false
19
- end
20
- end
21
- end
22
-