tyrone 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -19,6 +19,10 @@ Then, to get Tyrone started on your job:
19
19
 
20
20
  Bada bing!
21
21
 
22
+ If you want the `states.js` or the `grid.js` you can do so like this:
23
+
24
+ tyrone [NAME OF JOB] --states --grid
25
+
22
26
  ## Features
23
27
 
24
28
  Tyrone believes in tough love. You're going to have to do alot of work yourself. However, he does want to give the pups a headstart. Your job _will_ use HTML 5 and comes with a HTML 5 `reset.css`. It's the way of the future and will save you time (see `input[placeholder]`). If you really object you can turn HTML 5 off, just by placeing this line in your Sinatra file:
@@ -37,7 +41,7 @@ Some mockup helpers are:
37
41
  * `hidden` — Just returns `{:style => 'display:none'}` so you can quickly hide elements. Useful when doing JS hiding and showing.
38
42
  * `mockup_path(mockup)` — Returns a URL to another mockup.
39
43
 
40
- And that's all.
44
+ The `features` directory is where you start placing your user stories. The prototyping phase is a great time to start writing them.
41
45
 
42
46
 
43
47
  ## Associates
data/bin/tyrone CHANGED
@@ -5,16 +5,17 @@ require 'tyrone'
5
5
  gem 'pixii', '>= 0.1.6'
6
6
  require 'pixii'
7
7
 
8
- Pixii.called(:tyrone, :version => Tyrone.version, :templates => Tyrone.templates) do |make, opts|
8
+ Pixii.called( :tyrone,
9
+ :version => Tyrone.version,
10
+ :templates => Tyrone.templates,
11
+ :grid => ARGV.include?('--grid'),
12
+ :states => ARGV.include?('--states')
13
+ )do |make, opts|
9
14
  make.dir 'features', 'mockups', 'public', 'public/js', 'public/images', 'public/css'
10
15
 
11
16
  make.clone 'http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js', 'public/js/jquery.js'
12
- make.clone 'http://github.com/toolmantim/states.js/raw/master/states.js', 'public/js/states.js'
13
- make.clone 'http://gist.github.com/160497.txt', 'public/js/grid.js'
14
- make.clone 'http://gist.github.com/159037.txt', 'public/css/reset.sass'
15
17
 
16
- make.clone 'h_grid.gif', 'public/images/h_grid.gif'
17
- make.clone 'v_grid.gif', 'public/images/v_grid.gif'
18
+ make.clone 'http://gist.github.com/159037.txt', 'public/css/reset.sass'
18
19
 
19
20
  make.template 'sinatra.rb.erb', "#{opts.project}.rb"
20
21
  make.template 'config.ru.erb', 'config.ru'
@@ -23,5 +24,15 @@ Pixii.called(:tyrone, :version => Tyrone.version, :templates => Tyrone.templates
23
24
 
24
25
  make.template 'dot.gems.erb', '.gems'
25
26
 
27
+ if opts.states
28
+ make.clone 'http://gist.github.com/160497.txt', 'public/js/grid.js'
29
+ end
30
+
31
+ if opts.grid
32
+ make.clone 'http://github.com/toolmantim/states.js/raw/master/states.js', 'public/js/states.js'
33
+ make.clone 'h_grid.gif', 'public/images/h_grid.gif'
34
+ make.clone 'v_grid.gif', 'public/images/v_grid.gif'
35
+ end
36
+
26
37
  make.magic!
27
38
  end
data/lib/tyrone/app.rb CHANGED
@@ -1,14 +1,9 @@
1
- gem 'haml', '2.2.2'; require 'haml'; require 'sass'
2
-
3
1
  set :haml => {:format => :html5}
4
2
 
5
3
  helpers do
6
4
  def mockup_path(mockup)
7
5
  "/mockups/#{mockup.to_s.gsub(' ','_')}"
8
6
  end
9
- def hidden
10
- {:style => 'display:none'}
11
- end
12
7
  end
13
8
 
14
9
  get '/' do
@@ -23,19 +18,6 @@ get '/mockups/:mockup' do |mockup|
23
18
  haml mockup.to_sym
24
19
  end
25
20
 
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
21
  __END__
40
22
 
41
23
  @@index
data/lib/tyrone.rb CHANGED
@@ -8,5 +8,4 @@ module Tyrone
8
8
  def templates
9
9
  File.join(File.dirname(__FILE__),'..','templates')
10
10
  end
11
-
12
11
  end
@@ -1,7 +1,7 @@
1
1
  (function($){
2
2
  $(function(){
3
3
 
4
- $(document.body).grid();
4
+ // ...
5
5
 
6
6
  });
7
7
  })(jQuery);
@@ -1,7 +1,15 @@
1
- require 'sinatra'
2
-
3
1
  __DIR__ = File.dirname(__FILE__)
4
2
 
3
+ File.file?(gems_file = File.join(__DIR__,'.gems')) && File.read(gems_file).each do |gem_decl|
4
+ gem_name, version = gem_decl[/^([^\s]+)/,1], gem_decl[/--version ([^\s]+)/,1]
5
+ version ? gem(gem_name, version) : gem(gem_name)
6
+ end
7
+
8
+ require 'sinatra'
9
+ require 'haml'
10
+ require 'sass'
11
+ require 'tyrone/app'
12
+
5
13
  set :run => false,
6
14
  :environment => :development,
7
15
  :root => __DIR__,
@@ -9,6 +17,6 @@ set :run => false,
9
17
  :public => File.join(__DIR__, 'public'),
10
18
  :app_file => '<%= project %>.rb'
11
19
 
12
- require '<%= project %>.rb'
20
+ require '<%= project %>'
13
21
 
14
22
  run Sinatra::Application
@@ -6,9 +6,12 @@
6
6
  %link{:rel => 'stylesheet', :type => 'text/css', :href => '/css/reset.css'}
7
7
 
8
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'}
9
+ <% if states %> %script{:src => '/js/states.js', :type => 'text/javascript'}<% end %>
11
10
  %script{:src => '/js/application.js', :type => 'text/javascript'}
12
-
11
+ <% if grid %> - if options.environment == :development
12
+ %script{:src => '/js/grid.js', :type => 'text/javascript'}
13
+ :javascript
14
+ $(document).ready(function(){ $(document.body).grid(); });
15
+ <% end %>
13
16
  %body
14
17
  = yield
@@ -1,3 +1,14 @@
1
- # Tyrone will care the shit out of you
2
- gem 'tyrone', '<%= version %>'
3
- require 'tyrone/app'
1
+ # Tyrone cares the shit out of you
2
+
3
+ helpers do
4
+ def hidden
5
+ {:style => 'display:none'}
6
+ end
7
+ end
8
+
9
+ get /^\/css\/(.+)\.css$/ do |style_file|
10
+ sass_file = File.join('public','css',"#{style_file}.sass")
11
+ pass unless File.exist?(sass_file)
12
+ content_type :css
13
+ sass File.read(sass_file)
14
+ end
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.2
4
+ version: 0.4.0
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-10 00:00:00 +10:00
12
+ date: 2009-08-22 00:00:00 +10:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency