Skip to content

Commit

Permalink
Prepare for v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jodosha committed Dec 19, 2014
1 parent ce56fdb commit f8e0a79
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 116 deletions.
159 changes: 54 additions & 105 deletions CHANGELOG.md
@@ -1,105 +1,54 @@
## v0.2.0
### Jun 23, 2014

f053805 2014-06-20 **Luca Guidi** [breaking] Make Rendering::TemplatesFinder to look recursively for templates, starting from the root

5a5ed1b 2014-06-18 **Luca Guidi** Depend on lotus-utils ~> 0.2

d7858df 2014-06-18 **Luca Guidi** Ensure to handle correctly the namespace for views, when it's configured as nil

8f9e876 2014-06-18 **Luca Guidi** Renamed Lotus::View methods: .duplicate => .dupe, .generate => .duplicate

199c1d6 2014-06-11 **Luca Guidi** Introducing Lotus::View.generate as shortcut for .duplicate and .configure

d3e65d9 2014-06-11 **Luca Guidi** Ensure lazy loading and correct namespace of the layout class when using configuration's "layout" DSL

850c9b9 2014-06-11 **Luca Guidi** Specify different scenario for template name in a standalone application

6199419 2014-06-06 **Luca Guidi** Ensure to return the correct template name for namespaced views

71d502f 2014-06-06 **Luca Guidi** Ensure independent configurations between the framework, the views and its children. Lotus::View::Dsl.root now internally uses the configuration.

dd0ec4c 2014-06-06 **Luca Guidi** Lazily load layout for Configuration. This mechanism solves eventual race conditions between the loading of the framework and the application.

d2e0775 2014-06-05 **Luca Guidi** [breaking] Lotus::View can be safely duplicated. Moved views and layout registries into Configuration. Configuration is now able to duplicated and (un)load itself. Layouts can be looked up in a given Ruby namespace.

a619bd2 2014-06-05 **Luca Guidi** Implemented Lotus::View::Configuration#views and #layouts

e4e892e 2014-06-04 **Luca Guidi** [breaking] Removed Lotus::View's class accessor for root, in favor of the API of Lotus::View::Configuration

1aa68c6 2014-06-04 **Luca Guidi** [breaking] Removed Lotus::View's class accessor for layout, in favor of the API of Lotus::View::Configuration

da9bee4 2014-06-04 **Luca Guidi** Implemented Lotus::View::Configuration#layout

da31e3e 2014-06-04 **Luca Guidi** Implemented Lotus::View::Configuration#load_paths

1471cdd 2014-06-03 **Luca Guidi** Introduced Lotus::View::Configuration with a bare minimum behavior

425c79e 2014-05-21 **Grant Ammons** Support arguments for methods inside templates

d4d407b 2014-05-10 **Luca Guidi** Support Ruby 2.1.2

593f1a5 2014-04-07 **Luca Guidi** Ensure outermost locals to not shadow innermost inside templates/partials. Closes #3

## v0.1.0
### Mar 23, 2014

af70191 2014-03-22 **Luca Guidi** Introduced Lotus::View::MissingFormatError in order to force a rendering context to specify the requested format (mime type)

320f322 2014-03-22 **Luca Guidi** Changed signature of Lotus::View.render: it now accepts only a context for the view

9d5de63 2014-03-21 **Luca Guidi** Test with other engines than ERb, HAML in this case.

a5ade35 2014-03-21 **Luca Guidi** Erubis is no longer a dependency.

257e342 2014-03-21 **Luca Guidi** Performance: prefer `Hash#fetch(key) { default }`, over `#fetch(key, default)`.

426eaf7 2014-03-21 **Luca Guidi** Allow custom rendering policies. Views can override #render and decide how to return the output.

b2759f8 2014-03-18 **Luca Guidi** Lotus::View::Layout => Lotus::Layout

c0c04a8 2014-03-17 **Luca Guidi** Remove private method for Presenter: #object

74ca485 2014-03-13 **Luca Guidi** Introduced Lotus::Presenter

0ee9c10 2014-03-13 **Luca Guidi** Render partial from a layout

dc4a74f 2014-03-12 **Luca Guidi** Support for Tilt 2.0

728fe70 2014-02-20 **Luca Guidi** Added Lotus::View#locals

11c7e5a 2013-08-08 **Luca Guidi** Don't use global class vars.

570a20c 2013-08-07 **Luca Guidi** Scope templates discovery to registered engines

4b45b11 2013-08-06 **Luca Guidi** Added support for layouts.

96a2c66 2013-08-02 **Luca Guidi** Allow templates to be rendered from templates.

ba5acdc 2013-08-01 **Luca Guidi** Allow partials to be rendered from templates.

04474d4 2013-08-01 **Luca Guidi** Render template in the Lotus::View::Rendering::Scope context

d108767 2013-08-01 **Luca Guidi** Freeze at subclasses level too

04a3093 2013-08-01 **Luca Guidi** Let views to specify relative template filename

e7c832d 2013-08-01 **Luca Guidi** Lotus::View::Rendering::Template => Lotus::View::Template

f603ea9 2013-08-01 **Luca Guidi** Rework

5df49f1 2013-07-23 **Luca Guidi** Removed unnecessary indirection

683741c 2013-07-22 **Luca Guidi** Views can now transparently inheriths variables from locals, in order to reuse them.

3a31f63 2013-07-19 **Luca Guidi** Removed templates as class variable for views: introduced a registry for runtime resolution

f27e19f 2013-07-18 **Luca Guidi** WIP rendering resolver

05e1d8c 2013-07-18 **Luca Guidi** Allow views inheritance.

8236523 2013-07-18 **Luca Guidi** Refactoring: Engine is not relevant, let Tilt to deal with it. View has multiple templates. Intoduced DSL for format. Introduced resolver for runtime rendering. Dependency injection. :tophat:

f7f3d25 2013-07-17 **Luca Guidi** Extracted Lotus::View::Template::Finder

11d3c47 2013-07-15 **Luca Guidi** Initial mess
# Lotus::View
View layer for Lotus

## v0.3.0 - 2014-12-23
### Added
- [Trung Lê] When duplicate the framework, also duplicate `Presenter`
- [Benny Klotz] Introduced `Scope#class`, `#inspect`, `LayoutScope#class` and `#inspect`
- [Alfonso Uceda Pompa & Trung Lê] Introduced `Configuration#prepare`
- [Luca Guidi] Implemented "respond to" logic for `Lotus::View::Scope` (`respond_to?` and `respond_to_missing?`)
- [Luca Guidi] Implemented "respond to" logic for `Lotus::Layout` (`respond_to?` and `respond_to_missing?`)
- [Jeremy Stephens] Allow view concrete methods that accept a block to be invoked from templates
- [Peter Suschlik] Implemented "respond to" logic for `Lotus::Presenter` (`respond_to?` and `respond_to_missing?`)

### Changed
- [Alfonso Uceda Pompa] Raise an exception when a layout doesn't have an associated template

### Fixed
- [Luca Guidi] Ensure that concrete methods in layouts are available in templates
- [Luca Guidi] Ensure to associate the right layout to a view in case fo duplicated framework
- [Luca Guidi] Safe override of Ruby's top level methods in Scope. (Eg. use `select` from a view, not from `::Kernel`)

## v0.2.0 - 2014-06-23
### Added
- [Luca Guidi] Introduced `Configuration#duplicate`
- [Luca Guidi] Introduced `Configuration#layout` to define the layout that all the views will use
- [Luca Guidi] Introduced `Configuration#load_paths` to define several sources where to lookup for templates
- [Luca Guidi] Introduced `Configuration#root` to define the root path where to find templates
- [Luca Guidi] Introduced `Lotus::View::Configuration`
- [Grant Ammons] Allow view concrete methods with arity > 0 to be invoked from templates
- [Luca Guidi] Official support for Ruby 2.1

### Changed
- [Luca Guidi] `Rendering::TemplatesFinder` now look recursively for templates, starting from the root.
- [Luca Guidi] Removed `View.layout=`
- [Luca Guidi] Removed `View.root=`

### Fixed
- [Luca Guidi] Ensure outermost locals to not shadow innermost inside templates/partials

## v0.1.0 - 2014-03-23
### Added
- [Luca Guidi] Allow custom rendering policy via `Action#render` override. This bypasses the template lookup and rendering.
- [Luca Guidi] Introduced `Lotus::Presenter`
- [Luca Guidi] Introduced templates rendering from templates and layouts
- [Luca Guidi] Introduced partials rendering from templates and layouts
- [Luca Guidi] Introduced layouts support
- [Luca Guidi] Introduced `Lotus::View.load!` as entry point to load views and templates
- [Luca Guidi] Allow to setup template name via `View.template`
- [Luca Guidi] Rendering context also considers locals passed to the constructor
- [Luca Guidi] Introduced `View.format` as DSL to declare which format to handle
- [Luca Guidi] Introduced view subclasses as way to handle different formats (mime types)
- [Luca Guidi] Introduced multiple templates per each View
- [Luca Guidi] Implemented basic rendering with templates
- [Luca Guidi] Official support for Ruby 2.0
6 changes: 5 additions & 1 deletion lib/lotus/presenter.rb
Expand Up @@ -59,6 +59,10 @@ def initialize(object)
end

protected
# Override Ruby's method_missing
#
# @api private
# @since 0.1.0
def method_missing(m, *args, &blk)
if @object.respond_to?(m)
@object.__send__ m, *args, &blk
Expand All @@ -70,7 +74,7 @@ def method_missing(m, *args, &blk)
# Override Ruby's respond_to_missing? in order to support proper delegation
#
# @api private
# @since x.x.x
# @since 0.3.0
def respond_to_missing?(m, include_private = false)
@object.respond_to?(m, include_private)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/lotus/view/rendering/layout_registry.rb
Expand Up @@ -8,7 +8,7 @@ module Rendering
#
# This is raised at the runtime when Lotus::Layout cannot find it's template.
#
# @since x.x.x
# @since 0.3.0
class MissingTemplateLayoutError < ::StandardError
def initialize(template)
super("Can't find layout template '#{ template }'")
Expand Down
8 changes: 4 additions & 4 deletions lib/lotus/view/rendering/layout_scope.rb
Expand Up @@ -21,7 +21,7 @@ def initialize(layout, scope)
#
# @return classname
#
# @since x.x.x
# @since 0.3.0
def class
(class << self; self end).superclass
end
Expand All @@ -30,7 +30,7 @@ def class
#
# @return [String] inspect String (contains classname, objectid in hex, available ivars)
#
# @since x.x.x
# @since 0.3.0
def inspect
base = "#<#{ self.class }:#{'%x' % (self.object_id << 1)}"
base << " @layout=\"#{@layout}\"" if @layout
Expand Down Expand Up @@ -115,7 +115,7 @@ def locals
#
# @return [TrueClass,FalseClass]
#
# @since x.x.x
# @since 0.3.0
#
# @see http://ruby-doc.org/core/Object.html#method-i-respond_to-3F
def respond_to?(m, include_all = false)
Expand All @@ -126,7 +126,7 @@ def respond_to?(m, include_all = false)
#
# @return [TrueClass,FalseClass]
#
# @since x.x.x
# @since 0.3.0
# @api private
#
# @see http://ruby-doc.org/core/Object.html#method-i-respond_to_missing-3F
Expand Down
4 changes: 2 additions & 2 deletions lib/lotus/view/rendering/scope.rb
Expand Up @@ -27,7 +27,7 @@ def initialize(view, locals = {})
#
# @return [String] inspect String (contains classname, objectid in hex, available ivars)
#
# @since x.x.x
# @since 0.3.0
def inspect
base = "#<#{ self.class }: #{'%x' % (self.object_id << 1)}"
base << " @view=\"#{@view}\"" if @view
Expand All @@ -48,7 +48,7 @@ def format
#
# @return [TrueClass,FalseClass]
#
# @since x.x.x
# @since 0.3.0
# @api private
#
# @see http://ruby-doc.org/core/Object.html#method-i-respond_to_missing-3F
Expand Down
2 changes: 1 addition & 1 deletion lib/lotus/view/version.rb
Expand Up @@ -3,6 +3,6 @@ module View
# Defines the version
#
# @since 0.1.0
VERSION = '0.3.0.dev'.freeze
VERSION = '0.3.0'.freeze
end
end
2 changes: 1 addition & 1 deletion lotus-view.gemspec
Expand Up @@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
spec.required_ruby_version = '>= 2.0.0'

spec.add_runtime_dependency 'tilt', '~> 2.0', '>= 2.0.1'
spec.add_runtime_dependency 'lotus-utils', '~> 0.3', '>= 0.3.0.dev'
spec.add_runtime_dependency 'lotus-utils', '~> 0.3', '>= 0.3.2'

spec.add_development_dependency 'bundler', '~> 1.5'
spec.add_development_dependency 'minitest', '~> 5'
Expand Down
2 changes: 1 addition & 1 deletion test/version_test.rb
Expand Up @@ -2,6 +2,6 @@

describe Lotus::View::VERSION do
it 'returns current version' do
Lotus::View::VERSION.must_equal '0.3.0.dev'
Lotus::View::VERSION.must_equal '0.3.0'
end
end

0 comments on commit f8e0a79

Please sign in to comment.