vanilla 1.12.4 → 1.12.5

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/Rakefile CHANGED
@@ -24,7 +24,7 @@ if Object.const_defined?(:Gem)
24
24
 
25
25
  # Change these as appropriate
26
26
  s.name = "vanilla"
27
- s.version = "1.12.4"
27
+ s.version = "1.12.5"
28
28
  s.summary = "A bliki-type web content thing."
29
29
  s.author = "James Adam"
30
30
  s.email = "james@lazyatom.com.com"
@@ -115,6 +115,11 @@ if Object.const_defined?(:Gem)
115
115
  raise "Unstaged changes still waiting to be committed"
116
116
  end
117
117
  end
118
+
119
+ desc "Tag and publish the gem to rubygems.org"
120
+ task :publish => :tag do
121
+ `gem push pkg/#{spec.name}-#{spec.version}.gem`
122
+ end
118
123
  else
119
124
  puts "Gem management tasks unavailable, as rubygems was not fully loaded."
120
125
  end
@@ -27,10 +27,16 @@ module Vanilla::Renderers
27
27
  handler_klass.new
28
28
  end
29
29
  instance.enclosing_snip = @enclosing_snip if instance.respond_to?(:enclosing_snip)
30
- if (method = app.request.method) && instance.respond_to?(method)
31
- instance.send(method, *@args).to_s
30
+
31
+ if app.request && (method = app.request.method) && instance.respond_to?(method)
32
+ message = method
33
+ else
34
+ message = :handle
35
+ end
36
+ if @args.is_a?(Array)
37
+ instance.send(message, *@args).to_s
32
38
  else
33
- instance.handle(*@args).to_s
39
+ instance.send(message, @args).to_s
34
40
  end
35
41
  end
36
42
  end
@@ -34,8 +34,15 @@ class SnipReferenceTest < Vanilla::TestCase
34
34
  end
35
35
 
36
36
  should "match snips with ruby 1.9 style hashes" do
37
- create_snip :name => "test", :content => "snip content"
38
- assert_equal "rendering snip content", render("rendering {test x:1}")
37
+ create_snip :name => "test", :content => %{
38
+ class Blah
39
+ def handle(args)
40
+ args.inspect
41
+ end
42
+ self
43
+ end
44
+ }, :render_as => "Ruby"
45
+ assert_equal %{rendering {:x=>"1"}}, render("rendering {test x:1}")
39
46
  end
40
47
 
41
48
  should "ignore references that are rubyish" do
@@ -1,6 +1,7 @@
1
1
  CurrentSnip
2
2
 
3
3
  :render_as: Ruby
4
+ :name: current_snip
4
5
  :usage: |-
5
6
  The current_snip dyna normally returns the result of rendering the snip named by the
6
7
  'snip' value in the parameters. This way, it can be used in templates to place the currently
@@ -11,4 +12,3 @@ CurrentSnip
11
12
  &#123;current_snip name&#125;
12
13
 
13
14
  will output the name of the current snip, or the name of the snip currently being edited.
14
- :name: current_snip
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vanilla
3
3
  version: !ruby/object:Gem::Version
4
- hash: 47
4
+ hash: 45
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 12
9
- - 4
10
- version: 1.12.4
9
+ - 5
10
+ version: 1.12.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - James Adam