frizz 1.3.2 → 1.3.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/lib/frizz/environment.rb +3 -5
- data/lib/frizz/middleman/view_helpers.rb +24 -1
- data/lib/frizz/version.rb +1 -1
- metadata +3 -3
data/lib/frizz/environment.rb
CHANGED
@@ -17,10 +17,8 @@ module Frizz
|
|
17
17
|
@bucket ||= @host
|
18
18
|
end
|
19
19
|
|
20
|
-
#
|
21
|
-
#
|
22
|
-
def method_missing(meth, *args, &block)
|
23
|
-
"#{name}?" == meth.to_s
|
24
|
-
end
|
20
|
+
# Don't raise on undefined methods. Allows for flexible use of frizz.yml
|
21
|
+
# attributes.
|
22
|
+
def method_missing(meth, *args, &block); end
|
25
23
|
end
|
26
24
|
end
|
@@ -2,7 +2,30 @@ module Frizz
|
|
2
2
|
module Middleman
|
3
3
|
module ViewHelpers
|
4
4
|
def frizz
|
5
|
-
Frizz.configuration
|
5
|
+
@frizz ||= EnvironmentDecorator.new(Frizz.configuration)
|
6
|
+
end
|
7
|
+
|
8
|
+
class EnvironmentDecorator
|
9
|
+
attr_accessor :config
|
10
|
+
|
11
|
+
def initialize(config)
|
12
|
+
@config = config
|
13
|
+
define_environment_helpers!
|
14
|
+
end
|
15
|
+
|
16
|
+
def method_missing(meth, *args, &block)
|
17
|
+
config.environment.send(meth) # pass thru to environment attrs
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def define_environment_helpers!
|
23
|
+
config.environments.each do |name, env|
|
24
|
+
self.class.send :define_method, "#{env.name}?" do
|
25
|
+
env == config.environment
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
6
29
|
end
|
7
30
|
end
|
8
31
|
end
|
data/lib/frizz/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: frizz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.3.
|
5
|
+
version: 1.3.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- patbenatar
|
@@ -144,7 +144,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
segments:
|
146
146
|
- 0
|
147
|
-
hash: -
|
147
|
+
hash: -2310730605007625868
|
148
148
|
version: '0'
|
149
149
|
none: false
|
150
150
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
153
|
- !ruby/object:Gem::Version
|
154
154
|
segments:
|
155
155
|
- 0
|
156
|
-
hash: -
|
156
|
+
hash: -2310730605007625868
|
157
157
|
version: '0'
|
158
158
|
none: false
|
159
159
|
requirements: []
|