tyrone 0.3.0 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/tyrone +7 -16
- data/deps.rip +1 -1
- data/lib/tyrone/app.rb +87 -0
- data/lib/tyrone.rb +7 -82
- data/templates/application.js.erb +7 -0
- data/templates/dot.gems.erb +3 -0
- data/templates/h_grid.gif +0 -0
- data/templates/layout.haml.erb +14 -0
- data/templates/sinatra.rb.erb +2 -2
- data/templates/v_grid.gif +0 -0
- metadata +9 -3
data/bin/tyrone
CHANGED
@@ -1,22 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'rubygems'
|
3
|
+
require 'tyrone'
|
3
4
|
|
4
|
-
gem 'pixii', '>= 0.1.
|
5
|
+
gem 'pixii', '>= 0.1.6'
|
5
6
|
require 'pixii'
|
6
7
|
|
7
|
-
|
8
|
-
# Shamelessly stolen from sr/mg.
|
9
|
-
def gemspec
|
10
|
-
@spec ||= begin
|
11
|
-
require 'rubygems/specification'
|
12
|
-
data = File.read File.join(File.dirname(__FILE__), '..', 'tyrone.gemspec')
|
13
|
-
spec = nil
|
14
|
-
Thread.new { spec = eval("$SAFE = 3\n#{data}")}.join
|
15
|
-
spec
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
Pixii.called(:tyrone, :version => gemspec.version) do |make, opts|
|
8
|
+
Pixii.called(:tyrone, :version => Tyrone.version, :templates => Tyrone.templates) do |make, opts|
|
20
9
|
make.dir 'features', 'mockups', 'public', 'public/js', 'public/images', 'public/css'
|
21
10
|
|
22
11
|
make.clone 'http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js', 'public/js/jquery.js'
|
@@ -24,13 +13,15 @@ Pixii.called(:tyrone, :version => gemspec.version) do |make, opts|
|
|
24
13
|
make.clone 'http://gist.github.com/160497.txt', 'public/js/grid.js'
|
25
14
|
make.clone 'http://gist.github.com/159037.txt', 'public/css/reset.sass'
|
26
15
|
|
27
|
-
make.clone '
|
28
|
-
make.clone '
|
16
|
+
make.clone 'h_grid.gif', 'public/images/h_grid.gif'
|
17
|
+
make.clone 'v_grid.gif', 'public/images/v_grid.gif'
|
29
18
|
|
30
19
|
make.template 'sinatra.rb.erb', "#{opts.project}.rb"
|
31
20
|
make.template 'config.ru.erb', 'config.ru'
|
32
21
|
make.template 'application.js.erb', 'public/js/application.js'
|
33
22
|
make.template 'layout.haml.erb', 'mockups/layout.haml'
|
34
23
|
|
24
|
+
make.template 'dot.gems.erb', '.gems'
|
25
|
+
|
35
26
|
make.magic!
|
36
27
|
end
|
data/deps.rip
CHANGED
data/lib/tyrone/app.rb
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
gem 'haml', '2.2.2'; require 'haml'; require 'sass'
|
2
|
+
|
3
|
+
set :haml => {:format => :html5}
|
4
|
+
|
5
|
+
helpers do
|
6
|
+
def mockup_path(mockup)
|
7
|
+
"/mockups/#{mockup.to_s.gsub(' ','_')}"
|
8
|
+
end
|
9
|
+
def hidden
|
10
|
+
{:style => 'display:none'}
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
get '/' do
|
15
|
+
use_in_file_templates!
|
16
|
+
@mockups = Dir.glob(File.join(options.views, '*.haml')).map do |mockup|
|
17
|
+
File.basename(mockup,'.*').gsub('_',' ')
|
18
|
+
end.reject {|file| file == 'layout'}
|
19
|
+
haml :index, :layout => false
|
20
|
+
end
|
21
|
+
|
22
|
+
get '/mockups/:mockup' do |mockup|
|
23
|
+
haml mockup.to_sym
|
24
|
+
end
|
25
|
+
|
26
|
+
# Sass doesn't belong in mockups, it belongs in public
|
27
|
+
|
28
|
+
get /^\/css\/(.+)\.css$/ do |style_file|
|
29
|
+
sass_file = File.join('public','css',"#{style_file}.sass")
|
30
|
+
pass unless File.exist?(sass_file)
|
31
|
+
content_type :css
|
32
|
+
sass File.read(sass_file)
|
33
|
+
end
|
34
|
+
|
35
|
+
get /\.sass$/ do
|
36
|
+
pass
|
37
|
+
end
|
38
|
+
|
39
|
+
__END__
|
40
|
+
|
41
|
+
@@index
|
42
|
+
!!!
|
43
|
+
%html
|
44
|
+
%head
|
45
|
+
%title mockups
|
46
|
+
%style{:type => 'text/css', :media => 'screen'}
|
47
|
+
:sass
|
48
|
+
|
49
|
+
*
|
50
|
+
:margin 0
|
51
|
+
:padding 0
|
52
|
+
body
|
53
|
+
:margin 40px
|
54
|
+
:font-family Helvetica, sans-serif
|
55
|
+
h1
|
56
|
+
:font-size 24px
|
57
|
+
:line-height 40px
|
58
|
+
:margin-bottom 20px
|
59
|
+
:text-transform lowercase
|
60
|
+
ul
|
61
|
+
:color #CCC
|
62
|
+
:font-size 12px
|
63
|
+
:line-height 20px
|
64
|
+
:font-size 14px
|
65
|
+
:line-height 20px
|
66
|
+
:color #999
|
67
|
+
a
|
68
|
+
:text-decoration none
|
69
|
+
:color #333
|
70
|
+
&:hover
|
71
|
+
:border-bottom 1px solid #333
|
72
|
+
.footer
|
73
|
+
:font-size 11px
|
74
|
+
:line-height 20px
|
75
|
+
:margin-top 60px
|
76
|
+
:color #CCC
|
77
|
+
:display block
|
78
|
+
:text-decoration none
|
79
|
+
%body
|
80
|
+
%h1 Mockups
|
81
|
+
%ul
|
82
|
+
- if @mockups.empty?
|
83
|
+
there are no mockups yet. add one to <code>#{File.expand_path(options.views)}</code>.
|
84
|
+
- @mockups.each do |mockup|
|
85
|
+
%li
|
86
|
+
%a{:href => mockup_path(mockup)}= mockup
|
87
|
+
%a.footer{:href => 'http://github.com/chrislloyd/tyrone'} tyrone luvs ya.
|
data/lib/tyrone.rb
CHANGED
@@ -1,87 +1,12 @@
|
|
1
|
-
|
1
|
+
module Tyrone
|
2
|
+
extend self
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
helpers do
|
6
|
-
def mockup_path(mockup)
|
7
|
-
"/mockups/#{mockup.to_s.gsub(' ','_')}"
|
8
|
-
end
|
9
|
-
def hidden
|
10
|
-
{:style => 'display:none'}
|
4
|
+
def version
|
5
|
+
'0.3.2'
|
11
6
|
end
|
12
|
-
end
|
13
|
-
|
14
|
-
get '/' do
|
15
|
-
use_in_file_templates!
|
16
|
-
@mockups = Dir.glob(File.join(options.views, '*.haml')).map do |mockup|
|
17
|
-
File.basename(mockup,'.*').gsub('_',' ')
|
18
|
-
end.reject {|file| file == 'layout'}
|
19
|
-
haml :index, :layout => false
|
20
|
-
end
|
21
|
-
|
22
|
-
get '/mockups/:mockup' do |mockup|
|
23
|
-
haml mockup.to_sym
|
24
|
-
end
|
25
7
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
sass_file = File.join('public','css',"#{style_file}.sass")
|
30
|
-
pass unless File.exist?(sass_file)
|
31
|
-
content_type :css
|
32
|
-
sass File.read(sass_file)
|
33
|
-
end
|
8
|
+
def templates
|
9
|
+
File.join(File.dirname(__FILE__),'..','templates')
|
10
|
+
end
|
34
11
|
|
35
|
-
get /\.sass$/ do
|
36
|
-
pass
|
37
12
|
end
|
38
|
-
|
39
|
-
__END__
|
40
|
-
|
41
|
-
@@index
|
42
|
-
!!!
|
43
|
-
%html
|
44
|
-
%head
|
45
|
-
%title mockups
|
46
|
-
%style{:type => 'text/css', :media => 'screen'}
|
47
|
-
:sass
|
48
|
-
|
49
|
-
*
|
50
|
-
:margin 0
|
51
|
-
:padding 0
|
52
|
-
body
|
53
|
-
:margin 40px
|
54
|
-
:font-family Helvetica, sans-serif
|
55
|
-
h1
|
56
|
-
:font-size 24px
|
57
|
-
:line-height 40px
|
58
|
-
:margin-bottom 20px
|
59
|
-
:text-transform lowercase
|
60
|
-
ul
|
61
|
-
:color #CCC
|
62
|
-
:font-size 12px
|
63
|
-
:line-height 20px
|
64
|
-
:font-size 14px
|
65
|
-
:line-height 20px
|
66
|
-
:color #999
|
67
|
-
a
|
68
|
-
:text-decoration none
|
69
|
-
:color #333
|
70
|
-
&:hover
|
71
|
-
:border-bottom 1px solid #333
|
72
|
-
.footer
|
73
|
-
:font-size 11px
|
74
|
-
:line-height 20px
|
75
|
-
:margin-top 60px
|
76
|
-
:color #CCC
|
77
|
-
:display block
|
78
|
-
:text-decoration none
|
79
|
-
%body
|
80
|
-
%h1 Mockups
|
81
|
-
%ul
|
82
|
-
- if @mockups.empty?
|
83
|
-
there are no mockups yet. add one to <code>#{File.expand_path(options.views)}</code>.
|
84
|
-
- @mockups.each do |mockup|
|
85
|
-
%li
|
86
|
-
%a{:href => mockup_path(mockup)}= mockup
|
87
|
-
%a.footer{:href => 'http://github.com/chrislloyd/tyrone'} tyrone luvs ya.
|
Binary file
|
@@ -0,0 +1,14 @@
|
|
1
|
+
!!!
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%meta{:charset => 'utf-8'}
|
5
|
+
%title <%= project %>
|
6
|
+
%link{:rel => 'stylesheet', :type => 'text/css', :href => '/css/reset.css'}
|
7
|
+
|
8
|
+
%script{:src => '/js/jquery.js', :type => 'text/javascript'}
|
9
|
+
%script{:src => '/js/states.js', :type => 'text/javascript'}
|
10
|
+
%script{:src => '/js/grid.js', :type => 'text/javascript'}
|
11
|
+
%script{:src => '/js/application.js', :type => 'text/javascript'}
|
12
|
+
|
13
|
+
%body
|
14
|
+
= yield
|
data/templates/sinatra.rb.erb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
# Tyrone
|
1
|
+
# Tyrone will care the shit out of you
|
2
2
|
gem 'tyrone', '<%= version %>'
|
3
|
-
require 'tyrone'
|
3
|
+
require 'tyrone/app'
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tyrone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Lloyd
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-08-
|
12
|
+
date: 2009-08-10 00:00:00 +10:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.1.
|
43
|
+
version: 0.1.6
|
44
44
|
version:
|
45
45
|
description:
|
46
46
|
email: christopher.lloyd@gmail.com
|
@@ -55,9 +55,15 @@ files:
|
|
55
55
|
- Rakefile
|
56
56
|
- README.md
|
57
57
|
- lib/tyrone.rb
|
58
|
+
- lib/tyrone/app.rb
|
58
59
|
- bin/tyrone
|
60
|
+
- templates/application.js.erb
|
59
61
|
- templates/config.ru.erb
|
62
|
+
- templates/dot.gems.erb
|
63
|
+
- templates/h_grid.gif
|
64
|
+
- templates/layout.haml.erb
|
60
65
|
- templates/sinatra.rb.erb
|
66
|
+
- templates/v_grid.gif
|
61
67
|
has_rdoc: true
|
62
68
|
homepage: http://github.com/chrislloyd/tyrone
|
63
69
|
licenses: []
|