blockpile 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.5.0
data/blockpile.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{blockpile}
8
- s.version = "0.4.1"
8
+ s.version = "0.5.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tyler Flint"]
12
- s.date = %q{2010-08-23}
12
+ s.date = %q{2010-08-31}
13
13
  s.description = %q{This module attempts to create structured view helpers. Essentially, a blockpile consists of a ruby class file, and a template. This allows for isolated blocks of view logic, that can maintain a clean separation of markup language from ruby code. Blocks can be inherited from to DRY up view logic.}
14
14
  s.email = %q{tylerflint@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -1,10 +1,7 @@
1
1
  class Blockpile::Base
2
2
 
3
- def initialize(helper, session, params, template, *args, &block)
3
+ def initialize(helper, *args, &block)
4
4
  @helper = helper
5
- @session = session
6
- @params = params
7
- @template = template
8
5
  build *args
9
6
  @content = capture(self, &block) if block_given?
10
7
  end
@@ -5,12 +5,18 @@ module Blockpile
5
5
  ActiveSupport::Dependencies.autoload_paths << File.dirname(file)
6
6
  file_name = file.split(/\//).pop.gsub(/\.rb/, '')
7
7
  class_name = file_name.classify
8
- ActionView::Base.class_eval %{
8
+ pile_methods = %{
9
9
  def #{file_name.gsub(/\_pile/, '')}(*args, &block)
10
- blockpile = #{class_name}.new(self, session, params, '#{file_name}', *args, &block)
11
- raw blockpile.to_html
10
+ blockpile = #{class_name}.new(self, *args, &block)
11
+ raw blockpile.to_html
12
+ end
13
+
14
+ def #{file_name.gsub(/\_pile/, '')}_instance(*args, &block)
15
+ #{class_name}.new(self, *args, &block)
12
16
  end
13
17
  }
18
+ ActionView::Base.class_eval pile_methods
19
+ ActionController::Base.class_eval pile_methods
14
20
  end
15
21
  end
16
22
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 4
8
- - 1
9
- version: 0.4.1
7
+ - 5
8
+ - 0
9
+ version: 0.5.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Tyler Flint
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-23 00:00:00 -06:00
17
+ date: 2010-08-31 00:00:00 -06:00
18
18
  default_executable:
19
19
  dependencies: []
20
20