flake 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/flake.gemspec +1 -1
- data/lib/flake/mustache.rb +5 -5
- data/lib/flake/version.rb +1 -1
- data/spec/flake/mustache_spec.rb +10 -9
- metadata +7 -8
data/flake.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = Flake::VERSION
|
8
8
|
s.authors = ["Jeremy Ruppel"]
|
9
9
|
s.email = ["jeremy.ruppel@gmail.com"]
|
10
|
-
s.homepage = ""
|
10
|
+
s.homepage = "https://github.com/jeremyruppel/flake"
|
11
11
|
s.summary = %q{A simple mustache'd proxy object}
|
12
12
|
s.description = %q{A simple mustache'd proxy object'}
|
13
13
|
|
data/lib/flake/mustache.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
module Flake
|
2
2
|
class Mustache
|
3
|
-
|
3
|
+
|
4
4
|
def initialize( options={} )
|
5
5
|
@options = options
|
6
6
|
end
|
7
|
-
|
7
|
+
|
8
8
|
def method_missing( method, *args, &blk )
|
9
|
-
@options[ method ]
|
9
|
+
@options.has_key?( method ) ? @options[ method ] : template_for( method )
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
protected
|
13
|
-
|
13
|
+
|
14
14
|
def template_for( method )
|
15
15
|
method.bang? ? "{{{#{method.unbang}}}}" : "{{#{method}}}"
|
16
16
|
end
|
data/lib/flake/version.rb
CHANGED
data/spec/flake/mustache_spec.rb
CHANGED
@@ -1,34 +1,35 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Flake::Mustache do
|
4
|
-
|
4
|
+
|
5
5
|
context 'a default mustache flake' do
|
6
|
-
|
6
|
+
|
7
7
|
before do
|
8
8
|
@flake = Flake::Mustache.new
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
it 'should return a mustached string of any property' do
|
12
12
|
@flake.testing.should eq( '{{testing}}' )
|
13
13
|
@flake.whatevs.should eq( '{{whatevs}}' )
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
it 'should triple-mustache any banged properties' do
|
17
17
|
@flake.testing!.should eq( '{{{testing}}}' )
|
18
18
|
@flake.whatevs!.should eq( '{{{whatevs}}}' )
|
19
19
|
end
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
context 'a mustache proxy with overrides' do
|
23
|
-
|
23
|
+
|
24
24
|
before do
|
25
|
-
@flake = Flake::Mustache.new :status => 'baller', :drinks => 'beers'
|
25
|
+
@flake = Flake::Mustache.new :status => 'baller', :drinks => 'beers', :chump? => false
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
it 'should return the overridden property' do
|
29
29
|
@flake.status.should eq( 'baller' )
|
30
30
|
@flake.drinks.should eq( 'beers' )
|
31
|
+
@flake.chump?.should eq( false )
|
31
32
|
end
|
32
33
|
end
|
33
|
-
|
34
|
+
|
34
35
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 0.0.3
|
10
|
+
version: 0.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jeremy Ruppel
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
19
|
-
default_executable:
|
18
|
+
date: 2012-02-03 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: rspec
|
@@ -60,8 +59,7 @@ files:
|
|
60
59
|
- spec/flake/core_ext/symbol_spec.rb
|
61
60
|
- spec/flake/mustache_spec.rb
|
62
61
|
- spec/spec_helper.rb
|
63
|
-
|
64
|
-
homepage: ""
|
62
|
+
homepage: https://github.com/jeremyruppel/flake
|
65
63
|
licenses: []
|
66
64
|
|
67
65
|
post_install_message:
|
@@ -90,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
88
|
requirements: []
|
91
89
|
|
92
90
|
rubyforge_project: flake
|
93
|
-
rubygems_version: 1.
|
91
|
+
rubygems_version: 1.8.15
|
94
92
|
signing_key:
|
95
93
|
specification_version: 3
|
96
94
|
summary: A simple mustache'd proxy object
|
@@ -99,3 +97,4 @@ test_files:
|
|
99
97
|
- spec/flake/core_ext/symbol_spec.rb
|
100
98
|
- spec/flake/mustache_spec.rb
|
101
99
|
- spec/spec_helper.rb
|
100
|
+
has_rdoc:
|