mabtie 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md ADDED
@@ -0,0 +1,100 @@
1
+ Mabtie
2
+ ======
3
+
4
+ Credits
5
+
6
+ Basic, default styles for rails applications
7
+
8
+ Installation & Upgrading
9
+ ------------------------
10
+
11
+ Flutie is a Rails engine. It works with versions of Rails greater than 3.0.
12
+
13
+ Flutie is recommended to be run as a gem and included in your Gemfile:
14
+
15
+ gem "mabtie", "~> 1.1"
16
+
17
+ After you've bundled, run the installer:
18
+
19
+ rake flutie:install
20
+
21
+ The installer will copy the Flutie stylesheets into public/flutie/stylesheets
22
+
23
+ Once Flutie is installed, with your application running (not in production environment) you can browse to /styleguides. This will present you with many standard markup elements that are present in a Rails application, in your default application layout.
24
+
25
+ Click on the "Default styles" link to view the same markup with a barebones layout that only contains the Flutie stylesheets. Click on "Application styles" to view the markup in your application layout.
26
+
27
+ To upgrade, bump the gem version in your Gemfile, and then run 'rake flutie:install' again to get the latest changes moved into your application.
28
+
29
+ Usage
30
+ -----
31
+
32
+ Flutie registers a :flutie shortcut for stylesheets, so in your layout you can do...
33
+
34
+ bc. <%= stylesheet_link_tag :flutie, 'admin', :cache => true %>
35
+
36
+ ...this will include all the flutie stylesheets, then the 'admin' stylesheet, and it will cache them all into one file.
37
+
38
+ ### Sass
39
+
40
+ If you use Sass in your application, the flutie stylesheets are also available as scss files, installed in public/flutie/sass. This location is automatically added to your Sass template load path. These files can be imported into your own sass files for use with the following:
41
+
42
+ @import "flutie";
43
+
44
+ You'll want to import flutie before any of your own styles so that you can do things like extend your classes with flutie classes.
45
+
46
+ ### Custom Styles
47
+
48
+ To add custom styles to the styleguide add partials to the app/views/styleguides directory. For example:
49
+
50
+ app/views/styleguides/_todo_item.erb:
51
+
52
+ <ol>
53
+ <li class="todo">This is a todo item</li>
54
+ </ol>
55
+
56
+ Plugin authors can also add to the styleguide by ensuring that their view path
57
+ is in ActionController::Base.view_paths and by placing a partial under the
58
+ styleguides directory. For example:
59
+
60
+ ActionController::Base.append_view_path(File.join(File.dirname(__FILE__), 'views'))
61
+
62
+ my_awesome_plugin/views/styleguides/_pagination.erb:
63
+
64
+ <div class="pagination">
65
+ <a href="#prev">Previous</a>
66
+ <a href="#next">Next</a>
67
+ </div>
68
+
69
+ Suggestions, Bugs, Refactoring?
70
+ -------------------------------
71
+
72
+ Fork away and create a "Github Issue":http://github.com/mab879/mabtie/issues. Please don't send pull requests.
73
+
74
+ Development
75
+ -----------
76
+
77
+ The actual stylesheet source files are sass, so edit the files in public/stylesheets/sass.
78
+ To rebuild the normal scss run:
79
+
80
+ sass -C --update public/stylesheets/sass:public/stylesheets
81
+
82
+ Credits
83
+ -------
84
+
85
+ ![thoughtbot](http://thoughtbot.com/images/tm/logo.png)
86
+
87
+ Mabie is forked from [thoughtbot, inc](http://thoughtbot.com/community)
88
+
89
+ Thank you to all [the contributors](https://github.com/mab879/flutie/contributors)!
90
+
91
+ The names and logos for thoughtbot are trademarks of thoughtbot, inc.
92
+
93
+ The form styleing is from [formalize](http://formalize.me/)
94
+
95
+ License
96
+ -------
97
+
98
+ Flutie is Copyright © 2010-2011 thoughtbot. It is free software, and may be redistributed under the terms specified in the LICENSE file.
99
+
100
+ Mabtie is Copyright © 2011 Matthew Burket.
data/Rakefile ADDED
@@ -0,0 +1,23 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rake'
4
+ require 'rake/testtask'
5
+ require 'rake/rdoctask'
6
+
7
+ desc 'Default: run unit tests.'
8
+ task :default => :test
9
+
10
+ Rake::TestTask.new(:test) do |t|
11
+ t.libs << 'lib'
12
+ t.libs << 'test'
13
+ t.pattern = 'test/**/*_test.rb'
14
+ t.verbose = true
15
+ end
16
+
17
+ Rake::RDocTask.new(:rdoc) do |rdoc|
18
+ rdoc.rdoc_dir = 'rdoc'
19
+ rdoc.title = 'Flutie'
20
+ rdoc.options << '--line-numbers' << '--inline-source'
21
+ rdoc.rdoc_files.include('README')
22
+ rdoc.rdoc_files.include('lib/**/*.rb')
23
+ end
@@ -0,0 +1,27 @@
1
+ module Flutie
2
+
3
+ class StyleguidesController < ApplicationController
4
+
5
+ unloadable
6
+
7
+ def show
8
+ @styleguides = styleguides
9
+ render :layout => "flutie" if params[:flutie] == "true"
10
+ end
11
+
12
+ private
13
+
14
+ def styleguides
15
+ all_styleguide_partials = ActionController::Base.view_paths.map do |view_path|
16
+ styleguide_path = File.join(view_path.to_s, 'styleguides')
17
+ if File.exists?(styleguide_path)
18
+ Dir.glob(styleguide_path + '/_*.*')
19
+ else
20
+ nil
21
+ end
22
+ end
23
+ all_styleguide_partials.flatten.compact
24
+ end
25
+ end
26
+
27
+ end