massimo 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -20,6 +20,8 @@ Massimo is a static website builder that allows you to use dynamic technologies
20
20
  massimo generate my-site
21
21
  cd my-site
22
22
  massimo build
23
+
24
+ For more information, visit http://petebrowne.github.com/massimo/.
23
25
 
24
26
  ## Copyright
25
27
 
data/bin/massimo CHANGED
@@ -17,4 +17,4 @@ when 'w', 'watch'
17
17
  Massimo::Commands::Watch
18
18
  else
19
19
  Massimo::Commands::Help
20
- end.run
20
+ end.run
@@ -84,4 +84,4 @@ module Massimo
84
84
  end
85
85
  end
86
86
  end
87
- end
87
+ end
@@ -16,4 +16,4 @@ Builds the site from the source files.
16
16
  end
17
17
  end
18
18
  end
19
- end
19
+ end
@@ -58,6 +58,5 @@ Within a massimo project, you can generate a new resource file:
58
58
  end
59
59
  end
60
60
  end
61
-
62
61
  end
63
- end
62
+ end
@@ -30,6 +30,5 @@ Commands:
30
30
  end
31
31
  end
32
32
  end
33
-
34
33
  end
35
- end
34
+ end
@@ -21,4 +21,4 @@ Runs a local Rack based web server on the given port.
21
21
  end
22
22
  end
23
23
  end
24
- end
24
+ end
@@ -6,4 +6,4 @@ module Massimo
6
6
  end
7
7
  end
8
8
  end
9
- end
9
+ end
@@ -13,4 +13,4 @@ Watches your files for changes and automatically builds the site.
13
13
  end
14
14
  end
15
15
  end
16
- end
16
+ end
@@ -70,4 +70,4 @@ module Massimo
70
70
  send(lib_name) || {}
71
71
  end
72
72
  end
73
- end
73
+ end
@@ -20,4 +20,4 @@ module Massimo
20
20
  view && view.render(locals)
21
21
  end
22
22
  end
23
- end
23
+ end
@@ -10,35 +10,35 @@ module Massimo
10
10
 
11
11
  protected
12
12
 
13
- def compile
14
- case source_path.extname
15
- when '.coffee'
16
- require 'coffee-script' unless defined?(CoffeeScript)
17
- CoffeeScript.compile(content, Massimo.config.options_for(:coffee_script))
18
- else
19
- require 'sprockets' unless defined?(Sprockets)
20
- options = Massimo.config.options_for(:sprockets).merge(
21
- :assert_root => Massimo.config.output_path,
22
- :source_files => [ source_path.to_s ]
23
- )
24
- secretary = Sprockets::Secretary.new(options)
25
- secretary.install_assets
26
- secretary.concatenation.to_s
27
- end
13
+ def compile
14
+ case source_path.extname
15
+ when '.coffee'
16
+ require 'coffee-script' unless defined?(CoffeeScript)
17
+ CoffeeScript.compile(content, Massimo.config.options_for(:coffee_script))
18
+ else
19
+ require 'sprockets' unless defined?(Sprockets)
20
+ options = Massimo.config.options_for(:sprockets).merge(
21
+ :assert_root => Massimo.config.output_path,
22
+ :source_files => [ source_path.to_s ]
23
+ )
24
+ secretary = Sprockets::Secretary.new(options)
25
+ secretary.install_assets
26
+ secretary.concatenation.to_s
28
27
  end
29
-
30
- def compress(javascript)
31
- case Massimo.config.javascripts_compressor.to_s
32
- when 'min', 'jsmin'
33
- require 'jsmin' unless defined?(JSMin)
34
- JSMin.minify(javascript).strip
35
- when 'pack', 'packr'
36
- require 'packr' unless defined?(Packr)
37
- options = { :shrink_vars => true }.merge Massimo.config.options_for(:packr)
38
- Packr.pack(javascript, options)
39
- else
40
- javascript
41
- end
28
+ end
29
+
30
+ def compress(javascript)
31
+ case Massimo.config.javascripts_compressor.to_s
32
+ when 'min', 'jsmin'
33
+ require 'jsmin' unless defined?(JSMin)
34
+ JSMin.minify(javascript).strip
35
+ when 'pack', 'packr'
36
+ require 'packr' unless defined?(Packr)
37
+ options = { :shrink_vars => true }.merge Massimo.config.options_for(:packr)
38
+ Packr.pack(javascript, options)
39
+ else
40
+ javascript
42
41
  end
42
+ end
43
43
  end
44
- end
44
+ end
data/lib/massimo/page.rb CHANGED
@@ -50,47 +50,47 @@ module Massimo
50
50
 
51
51
  protected
52
52
 
53
- def read_source
54
- case source_path.extname
55
- when '.yml', '.yaml'
56
- @meta_data = (YAML.load(source_path.read) || {}).symbolize_keys
57
- @content = @meta_data[:content] || ''
58
- else
59
- @line = nil
60
- @content = ''
61
- front_matter = false
62
- meta_data = ''
63
-
64
- source_path.open do |file|
65
- file.each do |line|
66
- if line =~ /\A---\s*\Z/
67
- front_matter = !front_matter
53
+ def read_source
54
+ case source_path.extname
55
+ when '.yml', '.yaml'
56
+ @meta_data = (YAML.load(source_path.read) || {}).symbolize_keys
57
+ @content = @meta_data[:content] || ''
58
+ else
59
+ @line = nil
60
+ @content = ''
61
+ front_matter = false
62
+ meta_data = ''
63
+
64
+ source_path.open do |file|
65
+ file.each do |line|
66
+ if line =~ /\A---\s*\Z/
67
+ front_matter = !front_matter
68
+ else
69
+ if front_matter
70
+ meta_data << line
68
71
  else
69
- if front_matter
70
- meta_data << line
71
- else
72
- @line ||= file.lineno
73
- @content << line
74
- end
72
+ @line ||= file.lineno
73
+ @content << line
75
74
  end
76
75
  end
77
76
  end
78
-
79
- @meta_data = (YAML.load(meta_data) || {}).symbolize_keys
80
77
  end
78
+
79
+ @meta_data = (YAML.load(meta_data) || {}).symbolize_keys
81
80
  end
82
-
83
- def method_missing(method, *args, &block)
84
- if args.length == 0
85
- method_name = method.to_s
86
- if method_name.chomp! '?'
87
- !!@meta_data[method_name.to_sym]
88
- else
89
- @meta_data[method_name.to_sym]
90
- end
81
+ end
82
+
83
+ def method_missing(method, *args, &block)
84
+ if args.length == 0
85
+ method_name = method.to_s
86
+ if method_name.chomp! '?'
87
+ !!@meta_data[method_name.to_sym]
91
88
  else
92
- super
89
+ @meta_data[method_name.to_sym]
93
90
  end
91
+ else
92
+ super
94
93
  end
94
+ end
95
95
  end
96
- end
96
+ end
@@ -41,10 +41,10 @@ module Massimo
41
41
 
42
42
  protected
43
43
 
44
- def unprocessable
45
- def self.processable?; false; end
46
- define_method(:process) { false }
47
- end
44
+ def unprocessable
45
+ def self.processable?; false; end
46
+ define_method(:process) { false }
47
+ end
48
48
  end
49
49
 
50
50
  attr_reader :source_path, :content
@@ -98,8 +98,8 @@ module Massimo
98
98
 
99
99
  protected
100
100
 
101
- def read_source
102
- @content = source_path.read
103
- end
101
+ def read_source
102
+ @content = source_path.read
103
+ end
104
104
  end
105
- end
105
+ end
@@ -31,4 +31,4 @@ module Massimo
31
31
  @file_server.call(env)
32
32
  end
33
33
  end
34
- end
34
+ end
data/lib/massimo/site.rb CHANGED
@@ -67,43 +67,43 @@ module Massimo
67
67
 
68
68
  protected
69
69
 
70
- def add_template_scope_blocks(scope)
71
- @template_scope_blocks.each do |block|
72
- scope.instance_eval(&block)
73
- end
70
+ def add_template_scope_blocks(scope)
71
+ @template_scope_blocks.each do |block|
72
+ scope.instance_eval(&block)
74
73
  end
75
-
76
- def add_template_scope_extensions(scope)
77
- @template_scope_extensions.each do |extension|
78
- scope.extend(extension)
79
- end
74
+ end
75
+
76
+ def add_template_scope_extensions(scope)
77
+ @template_scope_extensions.each do |extension|
78
+ scope.extend(extension)
80
79
  end
81
-
82
- def add_template_scope_helpers(scope)
83
- config.files_in(:helpers, :rb).each do |file|
84
- load(file)
85
- if helper = (class_name_of_file(file).constantize rescue nil)
86
- scope.extend(helper)
87
- end
80
+ end
81
+
82
+ def add_template_scope_helpers(scope)
83
+ config.files_in(:helpers, :rb).each do |file|
84
+ load(file)
85
+ if helper = (class_name_of_file(file).constantize rescue nil)
86
+ scope.extend(helper)
88
87
  end
89
88
  end
90
-
91
- def reload_libs
92
- if defined? @previous_libs
93
- @previous_libs.each do |lib|
94
- class_name = class_name_of_file(lib)
95
- Object.class_eval do
96
- remove_const(class_name) if const_defined?(class_name)
97
- end
89
+ end
90
+
91
+ def reload_libs
92
+ if defined? @previous_libs
93
+ @previous_libs.each do |lib|
94
+ class_name = class_name_of_file(lib)
95
+ Object.class_eval do
96
+ remove_const(class_name) if const_defined?(class_name)
98
97
  end
99
98
  end
100
- @previous_libs = config.files_in(:lib, :rb).each do |file|
101
- load(file)
102
- end
103
99
  end
104
-
105
- def class_name_of_file(file)
106
- File.basename(file).sub(/\.[^\.]+$/, '').classify
100
+ @previous_libs = config.files_in(:lib, :rb).each do |file|
101
+ load(file)
107
102
  end
103
+ end
104
+
105
+ def class_name_of_file(file)
106
+ File.basename(file).sub(/\.[^\.]+$/, '').classify
107
+ end
108
108
  end
109
- end
109
+ end
@@ -18,4 +18,4 @@ module Massimo
18
18
  @extension ||= '.css'
19
19
  end
20
20
  end
21
- end
21
+ end
data/lib/massimo/ui.rb CHANGED
@@ -54,17 +54,16 @@ module Massimo
54
54
 
55
55
  protected
56
56
 
57
- def growl(message, title = 'massimo')
58
- Growl.notify(message, :title => title) if defined?(Growl)
59
- end
57
+ def growl(message, title = 'massimo')
58
+ Growl.notify(message, :title => title) if defined?(Growl)
59
+ end
60
+
61
+ def padding
62
+ @padding ||= 0
63
+ end
60
64
 
61
- def padding
62
- @padding ||= 0
63
- end
64
-
65
- def padding=(value)
66
- @padding = [ 0, value.to_i ].max
67
- end
68
-
65
+ def padding=(value)
66
+ @padding = [ 0, value.to_i ].max
67
+ end
69
68
  end
70
- end
69
+ end
@@ -0,0 +1,3 @@
1
+ module Massimo
2
+ VERSION = '0.7.1'
3
+ end
data/lib/massimo/view.rb CHANGED
@@ -10,4 +10,4 @@ module Massimo
10
10
  template.render(Massimo.site.template_scope, locals, &block)
11
11
  end
12
12
  end
13
- end
13
+ end
@@ -42,16 +42,16 @@ module Massimo
42
42
 
43
43
  protected
44
44
 
45
- def files
46
- @files = Dir[*glob].map { |file| File.mtime(file) }
47
- end
48
-
49
- def glob
50
- glob = @site.resources.map(&:path)
51
- glob << @site.config.path_for(:lib)
52
- glob << @site.config.path_for(:helpers)
53
- glob.map! { |path| File.join(path, '**/*.*') }
54
- glob
55
- end
45
+ def files
46
+ @files = Dir[*glob].map { |file| File.mtime(file) }
47
+ end
48
+
49
+ def glob
50
+ glob = @site.resources.map(&:path)
51
+ glob << @site.config.path_for(:lib)
52
+ glob << @site.config.path_for(:helpers)
53
+ glob.map! { |path| File.join(path, '**/*.*') }
54
+ glob
55
+ end
56
56
  end
57
- end
57
+ end
data/lib/massimo.rb CHANGED
@@ -8,6 +8,7 @@ module Massimo
8
8
  autoload :Site, 'massimo/site'
9
9
  autoload :Stylesheet, 'massimo/stylesheet'
10
10
  autoload :UI, 'massimo/ui'
11
+ autoload :Version, 'massimo/version'
11
12
  autoload :View, 'massimo/view'
12
13
  autoload :Watcher, 'massimo/watcher'
13
14
 
@@ -21,8 +22,6 @@ module Massimo
21
22
  autoload :Watch, 'massimo/commands/watch'
22
23
  end
23
24
 
24
- VERSION = '0.7.0'
25
-
26
25
  class << self
27
26
  def site
28
27
  @site ||= Site.new
@@ -36,4 +35,4 @@ module Massimo
36
35
  site.config
37
36
  end
38
37
  end
39
- end
38
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: massimo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 0
10
- version: 0.7.0
9
+ - 1
10
+ version: 0.7.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pete Browne
@@ -15,27 +15,28 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-06 00:00:00 -05:00
18
+ date: 2010-09-14 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
+ name: activesupport
23
+ prerelease: false
22
24
  requirement: &id001 !ruby/object:Gem::Requirement
23
25
  none: false
24
26
  requirements:
25
- - - ">="
27
+ - - ~>
26
28
  - !ruby/object:Gem::Version
27
- hash: 31098225
29
+ hash: 7
28
30
  segments:
29
31
  - 3
30
32
  - 0
31
33
  - 0
32
- - beta
33
- version: 3.0.0.beta
34
+ version: 3.0.0
34
35
  type: :runtime
35
- prerelease: false
36
- name: activesupport
37
36
  version_requirements: *id001
38
37
  - !ruby/object:Gem::Dependency
38
+ name: rack
39
+ prerelease: false
39
40
  requirement: &id002 !ruby/object:Gem::Requirement
40
41
  none: false
41
42
  requirements:
@@ -48,10 +49,10 @@ dependencies:
48
49
  - 0
49
50
  version: 1.2.0
50
51
  type: :runtime
51
- prerelease: false
52
- name: rack
53
52
  version_requirements: *id002
54
53
  - !ruby/object:Gem::Dependency
54
+ name: sinatra_more
55
+ prerelease: false
55
56
  requirement: &id003 !ruby/object:Gem::Requirement
56
57
  none: false
57
58
  requirements:
@@ -64,10 +65,10 @@ dependencies:
64
65
  - 0
65
66
  version: 0.3.0
66
67
  type: :runtime
67
- prerelease: false
68
- name: sinatra_more
69
68
  version_requirements: *id003
70
69
  - !ruby/object:Gem::Dependency
70
+ name: thor
71
+ prerelease: false
71
72
  requirement: &id004 !ruby/object:Gem::Requirement
72
73
  none: false
73
74
  requirements:
@@ -80,10 +81,10 @@ dependencies:
80
81
  - 0
81
82
  version: 0.13.0
82
83
  type: :runtime
83
- prerelease: false
84
- name: thor
85
84
  version_requirements: *id004
86
85
  - !ruby/object:Gem::Dependency
86
+ name: tilt
87
+ prerelease: false
87
88
  requirement: &id005 !ruby/object:Gem::Requirement
88
89
  none: false
89
90
  requirements:
@@ -96,10 +97,10 @@ dependencies:
96
97
  - 0
97
98
  version: 1.0.0
98
99
  type: :runtime
99
- prerelease: false
100
- name: tilt
101
100
  version_requirements: *id005
102
101
  - !ruby/object:Gem::Dependency
102
+ name: tzinfo
103
+ prerelease: false
103
104
  requirement: &id006 !ruby/object:Gem::Requirement
104
105
  none: false
105
106
  requirements:
@@ -112,42 +113,44 @@ dependencies:
112
113
  - 0
113
114
  version: 0.3.0
114
115
  type: :runtime
115
- prerelease: false
116
- name: tzinfo
117
116
  version_requirements: *id006
118
117
  - !ruby/object:Gem::Dependency
118
+ name: rspec
119
+ prerelease: false
119
120
  requirement: &id007 !ruby/object:Gem::Requirement
120
121
  none: false
121
122
  requirements:
122
123
  - - ~>
123
124
  - !ruby/object:Gem::Version
124
- hash: 27
125
+ hash: 62196427
125
126
  segments:
126
- - 1
127
- - 3
127
+ - 2
128
128
  - 0
129
- version: 1.3.0
129
+ - 0
130
+ - beta
131
+ - 20
132
+ version: 2.0.0.beta.20
130
133
  type: :development
131
- prerelease: false
132
- name: rspec
133
134
  version_requirements: *id007
134
135
  - !ruby/object:Gem::Dependency
136
+ name: rr
137
+ prerelease: false
135
138
  requirement: &id008 !ruby/object:Gem::Requirement
136
139
  none: false
137
140
  requirements:
138
141
  - - ~>
139
142
  - !ruby/object:Gem::Version
140
- hash: 55
143
+ hash: 23
141
144
  segments:
145
+ - 1
142
146
  - 0
143
- - 10
144
147
  - 0
145
- version: 0.10.0
148
+ version: 1.0.0
146
149
  type: :development
147
- prerelease: false
148
- name: rr
149
150
  version_requirements: *id008
150
151
  - !ruby/object:Gem::Dependency
152
+ name: test-construct
153
+ prerelease: false
151
154
  requirement: &id009 !ruby/object:Gem::Requirement
152
155
  none: false
153
156
  requirements:
@@ -160,10 +163,10 @@ dependencies:
160
163
  - 0
161
164
  version: 1.2.0
162
165
  type: :development
163
- prerelease: false
164
- name: test-construct
165
166
  version_requirements: *id009
166
167
  - !ruby/object:Gem::Dependency
168
+ name: rack-test
169
+ prerelease: false
167
170
  requirement: &id010 !ruby/object:Gem::Requirement
168
171
  none: false
169
172
  requirements:
@@ -176,10 +179,10 @@ dependencies:
176
179
  - 0
177
180
  version: 0.5.0
178
181
  type: :development
179
- prerelease: false
180
- name: rack-test
181
182
  version_requirements: *id010
182
183
  - !ruby/object:Gem::Dependency
184
+ name: unindent
185
+ prerelease: false
183
186
  requirement: &id011 !ruby/object:Gem::Requirement
184
187
  none: false
185
188
  requirements:
@@ -192,10 +195,10 @@ dependencies:
192
195
  - 0
193
196
  version: 0.9.0
194
197
  type: :development
195
- prerelease: false
196
- name: unindent
197
198
  version_requirements: *id011
198
199
  - !ruby/object:Gem::Dependency
200
+ name: haml
201
+ prerelease: false
199
202
  requirement: &id012 !ruby/object:Gem::Requirement
200
203
  none: false
201
204
  requirements:
@@ -208,10 +211,10 @@ dependencies:
208
211
  - 0
209
212
  version: 3.0.0
210
213
  type: :development
211
- prerelease: false
212
- name: haml
213
214
  version_requirements: *id012
214
215
  - !ruby/object:Gem::Dependency
216
+ name: less
217
+ prerelease: false
215
218
  requirement: &id013 !ruby/object:Gem::Requirement
216
219
  none: false
217
220
  requirements:
@@ -224,10 +227,10 @@ dependencies:
224
227
  - 0
225
228
  version: 1.2.0
226
229
  type: :development
227
- prerelease: false
228
- name: less
229
230
  version_requirements: *id013
230
231
  - !ruby/object:Gem::Dependency
232
+ name: coffee-script
233
+ prerelease: false
231
234
  requirement: &id014 !ruby/object:Gem::Requirement
232
235
  none: false
233
236
  requirements:
@@ -240,10 +243,10 @@ dependencies:
240
243
  - 0
241
244
  version: 0.3.0
242
245
  type: :development
243
- prerelease: false
244
- name: coffee-script
245
246
  version_requirements: *id014
246
247
  - !ruby/object:Gem::Dependency
248
+ name: sprockets
249
+ prerelease: false
247
250
  requirement: &id015 !ruby/object:Gem::Requirement
248
251
  none: false
249
252
  requirements:
@@ -256,10 +259,10 @@ dependencies:
256
259
  - 0
257
260
  version: 1.0.0
258
261
  type: :development
259
- prerelease: false
260
- name: sprockets
261
262
  version_requirements: *id015
262
263
  - !ruby/object:Gem::Dependency
264
+ name: jsmin
265
+ prerelease: false
263
266
  requirement: &id016 !ruby/object:Gem::Requirement
264
267
  none: false
265
268
  requirements:
@@ -272,40 +275,38 @@ dependencies:
272
275
  - 0
273
276
  version: 1.0.0
274
277
  type: :development
275
- prerelease: false
276
- name: growl
277
278
  version_requirements: *id016
278
279
  - !ruby/object:Gem::Dependency
280
+ name: packr
281
+ prerelease: false
279
282
  requirement: &id017 !ruby/object:Gem::Requirement
280
283
  none: false
281
284
  requirements:
282
285
  - - ~>
283
286
  - !ruby/object:Gem::Version
284
- hash: 23
287
+ hash: 3
285
288
  segments:
289
+ - 3
286
290
  - 1
287
291
  - 0
288
- - 0
289
- version: 1.0.0
292
+ version: 3.1.0
290
293
  type: :development
291
- prerelease: false
292
- name: jsmin
293
294
  version_requirements: *id017
294
295
  - !ruby/object:Gem::Dependency
296
+ name: growl
297
+ prerelease: false
295
298
  requirement: &id018 !ruby/object:Gem::Requirement
296
299
  none: false
297
300
  requirements:
298
301
  - - ~>
299
302
  - !ruby/object:Gem::Version
300
- hash: 3
303
+ hash: 23
301
304
  segments:
302
- - 3
303
305
  - 1
304
306
  - 0
305
- version: 3.1.0
307
+ - 0
308
+ version: 1.0.0
306
309
  type: :development
307
- prerelease: false
308
- name: packr
309
310
  version_requirements: *id018
310
311
  description: Massimo builds HTML, Javascript, and CSS Files from your source.
311
312
  email: me@petebrowne.com
@@ -317,24 +318,25 @@ extra_rdoc_files: []
317
318
 
318
319
  files:
319
320
  - bin/massimo
320
- - lib/massimo/stylesheet.rb
321
- - lib/massimo/server.rb
322
- - lib/massimo/view.rb
323
- - lib/massimo/page.rb
321
+ - lib/massimo/commands/base.rb
324
322
  - lib/massimo/commands/build.rb
325
- - lib/massimo/commands/server.rb
326
323
  - lib/massimo/commands/generate.rb
327
324
  - lib/massimo/commands/help.rb
328
- - lib/massimo/commands/watch.rb
325
+ - lib/massimo/commands/server.rb
329
326
  - lib/massimo/commands/version.rb
330
- - lib/massimo/commands/base.rb
331
- - lib/massimo/resource.rb
327
+ - lib/massimo/commands/watch.rb
332
328
  - lib/massimo/config.rb
329
+ - lib/massimo/helpers.rb
330
+ - lib/massimo/javascript.rb
331
+ - lib/massimo/page.rb
332
+ - lib/massimo/resource.rb
333
+ - lib/massimo/server.rb
334
+ - lib/massimo/site.rb
335
+ - lib/massimo/stylesheet.rb
333
336
  - lib/massimo/ui.rb
337
+ - lib/massimo/version.rb
338
+ - lib/massimo/view.rb
334
339
  - lib/massimo/watcher.rb
335
- - lib/massimo/site.rb
336
- - lib/massimo/javascript.rb
337
- - lib/massimo/helpers.rb
338
340
  - lib/massimo.rb
339
341
  - LICENSE
340
342
  - README.md