frizz 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -120,11 +120,11 @@ configurations in `frizz.yml` and access them later in your Middleman app's view
120
120
 
121
121
  #### Configuration
122
122
 
123
- Add it to your `config.rb`:
123
+ Active the Extension in your `config.rb`:
124
124
 
125
125
  ```ruby
126
- require "frizz/middleman/view_helpers"
127
- helpers Frizz::Middleman::ViewHelpers
126
+ require "frizz/middleman/extension"
127
+ activate :frizz
128
128
  ```
129
129
 
130
130
  #### Usage
data/frizz.gemspec CHANGED
@@ -24,4 +24,5 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency "s3", "~> 0.3.13"
25
25
  spec.add_dependency "colorize", "~> 0.6.0"
26
26
  spec.add_dependency "mime-types", "~> 1.25"
27
+ spec.add_dependency "listen", "~> 1.2.2"
27
28
  end
@@ -14,7 +14,10 @@ module Frizz
14
14
  self.current_environment = ENV["FRIZZ_ENV"] || "development"
15
15
 
16
16
  # Allow to be overridden in yaml
17
- load_yaml!
17
+ if yaml_exists?
18
+ load_yaml!
19
+ start_yaml_listener
20
+ end
18
21
  end
19
22
 
20
23
  def environment
@@ -29,12 +32,27 @@ module Frizz
29
32
 
30
33
  private
31
34
 
35
+ def yaml_exists?
36
+ File.exists?(YAML_FILENAME)
37
+ end
38
+
32
39
  def load_yaml!
33
- return unless File.exists?(YAML_FILENAME)
40
+ puts "== Frizz: Loading frizz.yml"
34
41
 
35
42
  YAML.load_file(YAML_FILENAME).each do |key, value|
36
43
  send "#{key}=", value
37
44
  end
38
45
  end
46
+
47
+ def start_yaml_listener
48
+ require "listen"
49
+ listener = Listen.to Dir.pwd
50
+
51
+ listener.change do |modified, added, removed|
52
+ load_yaml! if modified.include? "frizz.yml"
53
+ end
54
+
55
+ listener.start
56
+ end
39
57
  end
40
58
  end
@@ -0,0 +1,15 @@
1
+ require "frizz/middleman/view_helpers"
2
+
3
+ module Frizz
4
+ module Middleman
5
+ class Extension < ::Middleman::Extension
6
+ self.defined_helpers = [Frizz::Middleman::ViewHelpers]
7
+
8
+ def initialize(app, options_hash={}, &block)
9
+ super
10
+ end
11
+ end
12
+ end
13
+ end
14
+
15
+ ::Middleman::Extensions.register(:frizz, Frizz::Middleman::Extension)
data/lib/frizz/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Frizz
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: frizz
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.1
5
+ version: 1.1.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - patbenatar
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-01 00:00:00.000000000 Z
12
+ date: 2013-10-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  prerelease: false
@@ -91,6 +91,22 @@ dependencies:
91
91
  - !ruby/object:Gem::Version
92
92
  version: '1.25'
93
93
  none: false
94
+ - !ruby/object:Gem::Dependency
95
+ prerelease: false
96
+ name: listen
97
+ type: :runtime
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ~>
101
+ - !ruby/object:Gem::Version
102
+ version: 1.2.2
103
+ none: false
104
+ requirement: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ~>
107
+ - !ruby/object:Gem::Version
108
+ version: 1.2.2
109
+ none: false
94
110
  description: Utility for deploying static sites to S3
95
111
  email:
96
112
  - nick@gophilosophie.com
@@ -108,6 +124,7 @@ files:
108
124
  - lib/frizz/configuration.rb
109
125
  - lib/frizz/environment.rb
110
126
  - lib/frizz/local.rb
127
+ - lib/frizz/middleman/extension.rb
111
128
  - lib/frizz/middleman/tasks.rb
112
129
  - lib/frizz/middleman/view_helpers.rb
113
130
  - lib/frizz/remote.rb
@@ -127,7 +144,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
127
144
  - !ruby/object:Gem::Version
128
145
  segments:
129
146
  - 0
130
- hash: -4345520858543621200
147
+ hash: -3193111499133036026
131
148
  version: '0'
132
149
  none: false
133
150
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -136,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
153
  - !ruby/object:Gem::Version
137
154
  segments:
138
155
  - 0
139
- hash: -4345520858543621200
156
+ hash: -3193111499133036026
140
157
  version: '0'
141
158
  none: false
142
159
  requirements: []