confluence 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.3
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "confluence"
8
- s.version = "1.0.2"
8
+ s.version = "1.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Thomas Chen"]
@@ -10,8 +10,8 @@ module Confluence
10
10
  handler = _get_handler_from_nothing
11
11
  source = _get_source_from_path(partial_path)
12
12
  identifier = _get_identifier name, prefix
13
- _get_templates( source, identifier, handler, details )
14
-
13
+ normalized_details = _normalize_details(partial_path, details)
14
+ _get_templates( source, identifier, handler, normalized_details )
15
15
  else
16
16
  []
17
17
  end
@@ -19,6 +19,10 @@ module Confluence
19
19
 
20
20
  private
21
21
 
22
+ def _normalize_details( path, details )
23
+ details.merge( :virtual_path => path )
24
+ end
25
+
22
26
  def _checks
23
27
  @_checks ||= [
24
28
  lambda do |not_null|
@@ -25,6 +25,23 @@ describe Confluence::Railties::Resolver do
25
25
 
26
26
  end
27
27
 
28
+ describe "#_normalize_details" do
29
+ let(:get) { lambda { |path, details| resolver.send("_normalize_details",path,details ) } }
30
+
31
+ context "expected usage" do
32
+ let(:details) { {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :raw, :ruby, :jbuilder, :coffee, :haml]} }
33
+ let(:transform) { get.call "dog/cat/bat/bird", details }
34
+ [:virtual_path, :locale, :formats, :handlers].each do |key|
35
+ it "should have the #{key} key" do
36
+ transform.should_not be_empty
37
+ transform.should have_key key
38
+ transform[key].should_not be_nil
39
+ transform[key].should_not be_empty
40
+ end
41
+ end
42
+ end
43
+ end
44
+
28
45
  describe "#_get_gem_directory" do
29
46
  let(:get) { lambda { |parameter| resolver.send("_get_gem_directory", parameter) } }
30
47
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: confluence
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -380,7 +380,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
380
380
  version: '0'
381
381
  segments:
382
382
  - 0
383
- hash: -620723431868669143
383
+ hash: -2048542954068152514
384
384
  required_rubygems_version: !ruby/object:Gem::Requirement
385
385
  none: false
386
386
  requirements: