frank 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -3,11 +3,10 @@ Frank
3
3
 
4
4
  Inspired by [Sinatra][0]'s simplicity and ease of use, Frank lets you build
5
5
  static sites using your favorite libs, painlessly. It uses [Tilt][1], so it
6
- comes with support for [Haml & Sass][2], [Builder][3], [ERB][4],
6
+ comes with support for [Haml & Sass][2], [LESS][10], [Builder][3], [ERB][4],
7
7
  [Liquid][5], & [Mustache][6].
8
8
 
9
- Frank also supports [CoffeeScript][7] for writing JavaScript in style, and
10
- [LESS][8] is planned for the near future.
9
+ Frank also supports [CoffeeScript][7] for writing JavaScript in style.
11
10
 
12
11
  Overview
13
12
  --------
@@ -124,4 +123,5 @@ Installation
124
123
  [6]: http://github.com/defunkt/mustache
125
124
  [7]: http://jashkenas.github.com/coffee-script/
126
125
  [8]: http://lesscss.org/
127
- [9]: http://rack.rubyforge.org/
126
+ [9]: http://rack.rubyforge.org/
127
+ [10]: http://lesscss.org/
data/Rakefile CHANGED
@@ -7,6 +7,9 @@ begin
7
7
  gemspec.email = "travis.dunn@thisismedium.com"
8
8
  gemspec.homepage = "http://github.com/blahed/frank"
9
9
  gemspec.authors = ["blahed", "nwah"]
10
+ gemspec.add_dependency 'rack'
11
+ gemspec.add_dependency 'mongrel'
12
+ gemspec.add_dependency 'haml'
10
13
  end
11
14
  Jeweler::GemcutterTasks.new
12
15
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/frank.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{frank}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["blahed", "nwah"]
12
- s.date = %q{2010-01-15}
12
+ s.date = %q{2010-01-16}
13
13
  s.description = %q{Create/Dump static builds using whatever templating/helper languages you wish}
14
14
  s.email = %q{travis.dunn@thisismedium.com}
15
15
  s.executables = ["frank", "frankout", "frankup"]
@@ -40,11 +40,11 @@ Gem::Specification.new do |s|
40
40
  "lib/frank/tilt.rb",
41
41
  "lib/template/dynamic/css/frank.sass",
42
42
  "lib/template/dynamic/index.haml",
43
- "lib/template/dynamic/js/frank.coffee",
44
43
  "lib/template/dynamic/layout.haml",
45
44
  "lib/template/helpers.rb",
46
45
  "lib/template/settings.yml",
47
- "lib/template/static/images/frank-med.png"
46
+ "lib/template/static/images/frank-med.png",
47
+ "lib/template/static/js/frank.js"
48
48
  ]
49
49
  s.homepage = %q{http://github.com/blahed/frank}
50
50
  s.rdoc_options = ["--charset=UTF-8"]
@@ -57,9 +57,18 @@ Gem::Specification.new do |s|
57
57
  s.specification_version = 3
58
58
 
59
59
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
60
+ s.add_runtime_dependency(%q<rack>, [">= 0"])
61
+ s.add_runtime_dependency(%q<mongrel>, [">= 0"])
62
+ s.add_runtime_dependency(%q<haml>, [">= 0"])
60
63
  else
64
+ s.add_dependency(%q<rack>, [">= 0"])
65
+ s.add_dependency(%q<mongrel>, [">= 0"])
66
+ s.add_dependency(%q<haml>, [">= 0"])
61
67
  end
62
68
  else
69
+ s.add_dependency(%q<rack>, [">= 0"])
70
+ s.add_dependency(%q<mongrel>, [">= 0"])
71
+ s.add_dependency(%q<haml>, [">= 0"])
63
72
  end
64
73
  end
65
74
 
data/lib/frank/tilt.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Tilt
2
- VERSION = '0.4'
2
+ VERSION = '0.5'
3
3
 
4
4
  @template_mappings = {}
5
5
 
@@ -325,6 +325,25 @@ module Tilt
325
325
  register 'sass', SassTemplate
326
326
 
327
327
 
328
+ # Lessscss template implementation. See:
329
+ # http://lesscss.org/
330
+ #
331
+ # Less templates do not support object scopes, locals, or yield.
332
+ class LessTemplate < Template
333
+ def initialize_engine
334
+ require_template_library 'less' unless defined? ::Less::Engine
335
+ end
336
+
337
+ def compile!
338
+ @engine = ::Less::Engine.new(data)
339
+ end
340
+
341
+ def evaluate(scope, locals, &block)
342
+ @engine.to_css
343
+ end
344
+ end
345
+ register 'less', LessTemplate
346
+
328
347
  # Builder template implementation. See:
329
348
  # http://builder.rubyforge.org/
330
349
  class BuilderTemplate < Template
@@ -523,4 +542,4 @@ module Tilt
523
542
  end
524
543
  end
525
544
  register 'coffee', CoffeeTemplate
526
- end
545
+ end
@@ -59,7 +59,7 @@ em
59
59
  margin-left: -3px
60
60
 
61
61
  #help
62
- top: 180px
62
+ top: 150px
63
63
  border-top: 1px #7a7a7a solid
64
64
 
65
65
  li
@@ -8,8 +8,9 @@
8
8
 
9
9
  %ol#help
10
10
  %li
11
- %p= "Edit <em>settings.yml</em> to set the hostname/port to your liking. Also make sure to set your preferred languages as well. You can also set up multiple layouts for your views."
11
+ %p= "Edit <em>settings.yml</em> to set your server options, folder names for static/dynamic content, and layouts for your views."
12
12
  %li
13
- %p= "Stash your static files (images, flash movies, &c.) in the <em>[project]/public</em> folder."
13
+ %p= "Stash your static files (images, flash movies, etc) in the folder that you set as <em>[static_folder]</em>."
14
14
  %li
15
- %p= "The files in your <em>css</em> & <em>js</em> folders will be auto- matically parsed from the source files. For example if you visit <em>/js/example.js</em>, Frank will parse & return <em>[project]/js/example.coffee</em>"
15
+ %p= "Frank will look for files in the <em>[dynamic_folder]</em> first and try to compile them."
16
+ %p= "Example: a request for <em>/css/blah.css</em> will look for a file in <em>[dynamic_folder]/css/</em> named <em>blah</em>. Frank uses the file extension to determine the correct compiler."
@@ -0,0 +1,48 @@
1
+ (function(){
2
+ var collapse, easeInOutQuad, expand, expanded, expanding, init, slide, toggle;
3
+ // -----------------------------------------------
4
+ //
5
+ // This is pretty gross; Gotta love what those
6
+ // JS libraries do for you
7
+ //
8
+ // -
9
+ // Easing function borrowed from jQuery.easing
10
+ easeInOutQuad = function easeInOutQuad(t, b, c, d) {
11
+ return ((t /= d / 2) < 1) && (c / 2 * t * t + b) || (-c / 2 * ((--t) * (t - 2) - 1) + b);
12
+ };
13
+ // Expand / Collapse help info
14
+ expanded = false;
15
+ expanding = false;
16
+ slide = function slide(el, end, duration, start, now) {
17
+ now = now || 0.001;
18
+ start = start || parseInt(document.defaultView.getComputedStyle(el, null).getPropertyValue('left'));
19
+ el.style.left = Math.round(start + (end - start) * easeInOutQuad(now, 0, 1, duration)) + 'px';
20
+ now += 30;
21
+ return now < duration ? setTimeout(function() {
22
+ return slide(el, end, duration, start, now);
23
+ }, 30) : expanding = false;
24
+ };
25
+ expand = function expand() {
26
+ document.getElementById('tooltip').style.display = 'none';
27
+ slide(document.getElementById('header'), 75, 600);
28
+ return slide(document.getElementById('help'), 525, 600);
29
+ };
30
+ collapse = function collapse() {
31
+ document.getElementById('tooltip').style.display = 'block';
32
+ slide(document.getElementById('header'), 300, 600);
33
+ return slide(document.getElementById('help'), 300, 600);
34
+ };
35
+ toggle = function toggle(e) {
36
+ if (expanding) {
37
+ return false;
38
+ }
39
+ expanded = !expanded;
40
+ expanding = true;
41
+ expanded ? expand() : collapse();
42
+ return false;
43
+ };
44
+ init = function init() {
45
+ return document.addEventListener('click', toggle, false);
46
+ };
47
+ window.onload = init;
48
+ })();
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frank
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - blahed
@@ -10,10 +10,39 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2010-01-15 00:00:00 -05:00
13
+ date: 2010-01-16 00:00:00 -05:00
14
14
  default_executable:
15
- dependencies: []
16
-
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: rack
18
+ type: :runtime
19
+ version_requirement:
20
+ version_requirements: !ruby/object:Gem::Requirement
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: "0"
25
+ version:
26
+ - !ruby/object:Gem::Dependency
27
+ name: mongrel
28
+ type: :runtime
29
+ version_requirement:
30
+ version_requirements: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: "0"
35
+ version:
36
+ - !ruby/object:Gem::Dependency
37
+ name: haml
38
+ type: :runtime
39
+ version_requirement:
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: "0"
45
+ version:
17
46
  description: Create/Dump static builds using whatever templating/helper languages you wish
18
47
  email: travis.dunn@thisismedium.com
19
48
  executables:
@@ -48,11 +77,11 @@ files:
48
77
  - lib/frank/tilt.rb
49
78
  - lib/template/dynamic/css/frank.sass
50
79
  - lib/template/dynamic/index.haml
51
- - lib/template/dynamic/js/frank.coffee
52
80
  - lib/template/dynamic/layout.haml
53
81
  - lib/template/helpers.rb
54
82
  - lib/template/settings.yml
55
83
  - lib/template/static/images/frank-med.png
84
+ - lib/template/static/js/frank.js
56
85
  has_rdoc: true
57
86
  homepage: http://github.com/blahed/frank
58
87
  licenses: []
@@ -1,49 +0,0 @@
1
- # -----------------------------------------------
2
- #
3
- # This is pretty gross; Gotta love what those
4
- # JS libraries do for you
5
- #
6
- # -
7
-
8
-
9
- # Easing function borrowed from jQuery.easing
10
- easeInOutQuad: t, b, c, d =>
11
- ((t/=d/2) < 1) and (c/2*t*t + b) or (-c/2 * ((--t)*(t-2) - 1) + b)
12
-
13
- # Expand / Collapse help info
14
- expanded: false
15
- expanding: false
16
- slide: el, end, duration, start, now =>
17
- now ||= 0.001
18
- start ||= parseInt(document.defaultView.getComputedStyle(el,null).getPropertyValue('left'))
19
- el.style.left = Math.round(start + (end-start) * easeInOutQuad(now, 0, 1, duration)) + 'px'
20
-
21
- now += 30
22
- if now < duration
23
- setTimeout(
24
- => slide(el, end, duration, start, now)
25
- 30 )
26
- else
27
- expanding: false
28
-
29
- expand: =>
30
- document.getElementById('tooltip').style.display = 'none';
31
- slide( document.getElementById('header'), 75, 600)
32
- slide( document.getElementById('help'), 525, 600)
33
-
34
- collapse: =>
35
- document.getElementById('tooltip').style.display = 'block';
36
- slide( document.getElementById('header'), 300, 600)
37
- slide( document.getElementById('help'), 300, 600)
38
-
39
- toggle: e =>
40
- return false if expanding
41
- expanded = !expanded
42
- expanding: true
43
- if expanded then expand() else collapse()
44
- false
45
-
46
- init: =>
47
- document.addEventListener('click', toggle, false)
48
-
49
- window.onload: init