flutie 1.3.3 → 1.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +9 -0
- data/.travis.yml +9 -0
- data/Appraisals +5 -0
- data/CONTRIBUTING.md +38 -0
- data/Gemfile +1 -7
- data/Gemfile.lock +108 -0
- data/LICENSE +1 -1
- data/README.md +44 -40
- data/Rakefile +10 -23
- data/app/assets/stylesheets/_defaults.scss +6 -4
- data/app/assets/stylesheets/_flashes.scss +7 -5
- data/app/assets/stylesheets/_forms.scss +34 -22
- data/app/assets/stylesheets/_lists.scss +13 -8
- data/app/assets/stylesheets/_tables.scss +8 -4
- data/app/assets/stylesheets/_type.scss +32 -28
- data/app/controllers/flutie/styleguides_controller.rb +1 -1
- data/flutie.gemspec +24 -0
- data/gemfiles/rails_3.0.20.gemfile +7 -0
- data/gemfiles/rails_3.1.11.gemfile +7 -0
- data/gemfiles/rails_3.2.12.gemfile +7 -0
- data/lib/flutie.rb +2 -0
- data/lib/flutie/version.rb +3 -0
- data/lib/tasks/flutie.rake +1 -1
- data/server.rb +21 -0
- data/spec/controllers/styleguides_controller_spec.rb +62 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +45 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +11 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +26 -0
- data/spec/dummy/config/environments/production.rb +49 -0
- data/spec/dummy/config/environments/test.rb +35 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +58 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/javascripts/application.js +2 -0
- data/spec/dummy/public/javascripts/controls.js +965 -0
- data/spec/dummy/public/javascripts/dragdrop.js +974 -0
- data/spec/dummy/public/javascripts/effects.js +1123 -0
- data/spec/dummy/public/javascripts/prototype.js +6001 -0
- data/spec/dummy/public/javascripts/rails.js +191 -0
- data/spec/dummy/public/stylesheets/.gitkeep +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/fixtures/app/views/styleguides/_one.erb +1 -0
- data/spec/fixtures/app/views/styleguides/_two.erb +1 -0
- data/spec/flutie_spec.rb +7 -0
- data/spec/helpers/body_class_helper_spec.rb +43 -0
- data/spec/helpers/page_title_helper_spec.rb +27 -0
- data/spec/initialization_spec.rb +16 -0
- data/spec/integration/navigation_spec.rb +9 -0
- data/spec/spec_helper.rb +35 -0
- metadata +183 -11
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
ul, ol {
|
4
4
|
list-style-position: inside;
|
5
|
-
margin-bottom:
|
5
|
+
margin-bottom: 1em;
|
6
|
+
margin-bottom: 1rem;
|
6
7
|
}
|
7
8
|
|
8
9
|
ul {
|
@@ -14,27 +15,31 @@ ol {
|
|
14
15
|
}
|
15
16
|
|
16
17
|
dl {
|
17
|
-
line-height: 1.
|
18
|
-
margin-bottom:
|
18
|
+
line-height: 1.4em;
|
19
|
+
margin-bottom: 1em;
|
20
|
+
margin-bottom: 1rem;
|
19
21
|
}
|
20
22
|
|
21
23
|
dl dt {
|
22
24
|
font-weight: bold;
|
23
|
-
margin-top:
|
25
|
+
margin-top: .5em;
|
26
|
+
margin-top: .5rem;
|
24
27
|
}
|
25
28
|
|
26
29
|
dl dd {
|
27
|
-
margin-bottom:
|
30
|
+
margin-bottom: 0;
|
28
31
|
}
|
29
32
|
|
30
33
|
dd {
|
31
|
-
margin-left:
|
34
|
+
margin-left: .5em;
|
35
|
+
margin-left: .5rem;
|
32
36
|
}
|
33
37
|
|
34
38
|
li {
|
35
|
-
line-height: 1.
|
39
|
+
line-height: 1.4em;
|
36
40
|
}
|
37
41
|
|
38
42
|
ol ol, ol ul, ul ul, ul ol {
|
39
|
-
margin-left:
|
43
|
+
margin-left: .75em;
|
44
|
+
margin-left: .75rem;
|
40
45
|
}
|
@@ -1,7 +1,8 @@
|
|
1
1
|
/* Tables */
|
2
2
|
|
3
3
|
table {
|
4
|
-
margin-bottom:
|
4
|
+
margin-bottom: 1.5em;
|
5
|
+
margin-bottom: 1.5rem;
|
5
6
|
width: 100%;
|
6
7
|
}
|
7
8
|
|
@@ -16,13 +17,16 @@ td {
|
|
16
17
|
}
|
17
18
|
|
18
19
|
caption, th, td {
|
19
|
-
padding:
|
20
|
+
padding: .25em .75em .25em 0;
|
21
|
+
padding: .25rem .75rem .25rem 0;
|
20
22
|
}
|
21
23
|
|
22
24
|
caption {
|
23
25
|
background: #f1f1f1;
|
24
|
-
margin-bottom:
|
25
|
-
|
26
|
+
margin-bottom: .75em;
|
27
|
+
margin-bottom: .75rem;
|
28
|
+
padding: .75em 0;
|
29
|
+
padding: .75rem 0;
|
26
30
|
}
|
27
31
|
|
28
32
|
tr, td, th {
|
@@ -1,46 +1,42 @@
|
|
1
1
|
/* Headings */
|
2
2
|
h1, h2, h3, h4, h5, h6 {
|
3
3
|
font-weight: bold;
|
4
|
+
line-height: 1.2em;
|
4
5
|
}
|
5
6
|
|
6
7
|
h1 {
|
7
|
-
font-size:
|
8
|
-
|
9
|
-
margin-bottom: 12px;
|
8
|
+
font-size: 1.75em;
|
9
|
+
font-size: 1.75rem;
|
10
10
|
}
|
11
11
|
|
12
12
|
h2 {
|
13
|
-
font-size:
|
14
|
-
|
15
|
-
margin-bottom: 6px;
|
13
|
+
font-size: 1.5em;
|
14
|
+
font-size: 1.5rem;
|
16
15
|
}
|
17
16
|
|
18
17
|
h3 {
|
19
|
-
font-size:
|
20
|
-
|
21
|
-
margin-bottom: 4px;
|
18
|
+
font-size: 1.25em;
|
19
|
+
font-size: 1.25rem;
|
22
20
|
}
|
23
21
|
|
24
22
|
h4 {
|
25
|
-
font-size:
|
26
|
-
|
27
|
-
margin-bottom: 4px;
|
23
|
+
font-size: 1em;
|
24
|
+
font-size: 1rem;
|
28
25
|
}
|
29
26
|
|
30
27
|
h5 {
|
31
|
-
font-size:
|
32
|
-
|
28
|
+
font-size: .75em;
|
29
|
+
font-size: .75rem;
|
33
30
|
}
|
34
31
|
|
35
32
|
h6 {
|
36
|
-
font-size:
|
37
|
-
|
33
|
+
font-size: .5em;
|
34
|
+
font-size: .5rem;
|
38
35
|
}
|
39
36
|
|
40
37
|
/* Text elements */
|
41
38
|
p {
|
42
|
-
line-height: 1.
|
43
|
-
margin-bottom: 12px;
|
39
|
+
line-height: 1.4em;
|
44
40
|
}
|
45
41
|
|
46
42
|
/* Use this if the image is at the top of the <p>. */
|
@@ -49,7 +45,8 @@ p img.top {
|
|
49
45
|
}
|
50
46
|
|
51
47
|
img {
|
52
|
-
margin: 0 0
|
48
|
+
margin: 0 0 .75em;
|
49
|
+
margin: 0 0 .75rem;
|
53
50
|
}
|
54
51
|
|
55
52
|
abbr, acronym {
|
@@ -59,7 +56,8 @@ abbr, acronym {
|
|
59
56
|
|
60
57
|
address {
|
61
58
|
font-style: italic;
|
62
|
-
margin-top:
|
59
|
+
margin-top: 1em;
|
60
|
+
margin-top: 1rem;
|
63
61
|
}
|
64
62
|
|
65
63
|
del {
|
@@ -87,8 +85,10 @@ blockquote {
|
|
87
85
|
border-left: 4px solid #d1d1d1;
|
88
86
|
color: #666;
|
89
87
|
font-style: italic;
|
90
|
-
margin:
|
91
|
-
|
88
|
+
margin: 1em 0;
|
89
|
+
margin: 1rem 0;
|
90
|
+
padding-left: .75em;
|
91
|
+
padding-left: .75rem;
|
92
92
|
}
|
93
93
|
|
94
94
|
strong {
|
@@ -105,25 +105,29 @@ dfn {
|
|
105
105
|
}
|
106
106
|
|
107
107
|
pre, code {
|
108
|
-
margin:
|
108
|
+
margin: .75em 0;
|
109
|
+
margin: .75rem 0;
|
109
110
|
white-space: pre; /* CSS2 */
|
110
111
|
white-space: pre-wrap; /* CSS 2.1 */
|
111
112
|
word-wrap: break-word; /* IE */
|
112
113
|
}
|
113
114
|
|
114
115
|
pre, code, tt {
|
115
|
-
font:
|
116
|
-
|
116
|
+
font: .75rem 'andale mono', 'monotype.com', 'lucida console', monospace;
|
117
|
+
font-size: .75em;
|
118
|
+
font-size: .75rem;
|
119
|
+
line-height: 1.4em;
|
117
120
|
}
|
118
121
|
|
119
122
|
pre.code {
|
120
123
|
background: #000;
|
121
124
|
color: #fff;
|
122
|
-
padding:
|
125
|
+
padding: 1.25em;
|
126
|
+
padding: 1.25rem;
|
123
127
|
}
|
124
128
|
|
125
129
|
tt {
|
126
130
|
display: block;
|
127
|
-
line-height: 1.
|
128
|
-
margin:
|
131
|
+
line-height: 1.4em;
|
132
|
+
margin: 1rem 0;
|
129
133
|
}
|
@@ -15,7 +15,7 @@ module Flutie
|
|
15
15
|
all_styleguide_partials = ActionController::Base.view_paths.map do |view_path|
|
16
16
|
styleguide_path = File.join(view_path.to_s, 'styleguides')
|
17
17
|
if File.exists?(styleguide_path)
|
18
|
-
Dir.glob(styleguide_path + '/_*.*')
|
18
|
+
Dir.glob(styleguide_path + '/_*.*').map { |file| file.chomp(File.extname(file)) }
|
19
19
|
else
|
20
20
|
nil
|
21
21
|
end
|
data/flutie.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "flutie/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = 'flutie'
|
7
|
+
s.version = Flutie::VERSION.dup
|
8
|
+
s.authors = ['Matt Jankowski', 'Chad Pytel', 'Kevin Burg', 'Chad Mazzola', 'Phil LaPier', 'Dan Croak', 'Fred Yates', 'OZAWA Sakuro', 'Mike Burns', 'Greg Sterndale', 'Joe Ferris', 'J. Edward Dewyea', 'Emilien Taque', 'Aaron Suggs', 'Nick Quaranto']
|
9
|
+
s.email = ['support@thoughtbot.com']
|
10
|
+
s.homepage = 'http://github.com/thoughtbot/flutie'
|
11
|
+
s.summary = 'Flutie adds default stylesheets to web apps'
|
12
|
+
s.description = 'Flutie is a starting point for personal discovery'
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
|
19
|
+
s.add_development_dependency('appraisal')
|
20
|
+
s.add_development_dependency('rspec-rails')
|
21
|
+
s.add_development_dependency('capybara', '>= 0.4.0')
|
22
|
+
s.add_development_dependency('sqlite3')
|
23
|
+
s.add_development_dependency('sass')
|
24
|
+
end
|
data/lib/flutie.rb
CHANGED
data/lib/tasks/flutie.rake
CHANGED
@@ -9,7 +9,7 @@ end
|
|
9
9
|
directory = File.dirname(__FILE__)
|
10
10
|
|
11
11
|
namespace :flutie do
|
12
|
-
desc '
|
12
|
+
desc 'Install flutie stylesheets into the public/ directory'
|
13
13
|
task :install => :environment do
|
14
14
|
if Rails.application.config.respond_to?(:assets) && Rails.application.config.assets.enabled
|
15
15
|
# No copy is needed when asset pipelining is enabled
|
data/server.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'sinatra'
|
3
|
+
require 'sass'
|
4
|
+
|
5
|
+
set :views, ['app/views']
|
6
|
+
set :static, true
|
7
|
+
|
8
|
+
helpers do
|
9
|
+
def stylesheet_link_tag(name)
|
10
|
+
"<link href='/stylesheets/#{name}.css' media='all' rel='Stylesheet' type='text/css' />"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
get '/' do
|
15
|
+
erb :"flutie/styleguides/show", :layout => :"layouts/flutie"
|
16
|
+
end
|
17
|
+
|
18
|
+
get '/stylesheets/flutie.css' do
|
19
|
+
content_type 'text/css', :charset => 'utf-8'
|
20
|
+
scss :_flutie, :views => 'app/assets/stylesheets'
|
21
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
ActionController::Base.prepend_view_path File.join(File.dirname(__FILE__), '..', '..', 'app', 'views')
|
4
|
+
ActionController::Base.prepend_view_path File.join(File.dirname(__FILE__), '..', 'fixtures', 'app', 'views')
|
5
|
+
|
6
|
+
shared_examples_for "Renders valid XML" do
|
7
|
+
it "should render valid xml" do
|
8
|
+
lambda { REXML::Document.new(response.body) }.should_not raise_error
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
shared_examples_for "Renders styleguide partials" do
|
13
|
+
it "should render styleguide partials" do
|
14
|
+
response.body.should =~ %r{fixture partial 1}
|
15
|
+
response.body.should =~ %r{fixture partial 2}
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
shared_examples_for "Renders application layout" do
|
20
|
+
it "should use application layout" do
|
21
|
+
response.should render_template('layouts/application')
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
shared_examples_for "Responds with success and renders show template" do
|
26
|
+
it "should respond with success and render show template" do
|
27
|
+
response.should be_success
|
28
|
+
response.should render_template(:show)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe Flutie::StyleguidesController do
|
33
|
+
|
34
|
+
render_views
|
35
|
+
|
36
|
+
describe "GET to /styleguides/show" do
|
37
|
+
before { get :show }
|
38
|
+
it_should_behave_like "Responds with success and renders show template"
|
39
|
+
it_should_behave_like "Renders valid XML"
|
40
|
+
it_should_behave_like "Renders styleguide partials"
|
41
|
+
it_should_behave_like "Renders application layout"
|
42
|
+
end
|
43
|
+
|
44
|
+
describe "GET to /styleguides/show with flutie=false" do
|
45
|
+
before { get :show, :flutie => "false" }
|
46
|
+
it_should_behave_like "Responds with success and renders show template"
|
47
|
+
it_should_behave_like "Renders valid XML"
|
48
|
+
it_should_behave_like "Renders styleguide partials"
|
49
|
+
it_should_behave_like "Renders application layout"
|
50
|
+
end
|
51
|
+
|
52
|
+
describe "GET to /styleguides/show with flutie=true" do
|
53
|
+
before { get :show, :flutie => "true" }
|
54
|
+
it_should_behave_like "Responds with success and renders show template"
|
55
|
+
it_should_behave_like "Renders valid XML"
|
56
|
+
it_should_behave_like "Renders styleguide partials"
|
57
|
+
it "should use flutie layout" do
|
58
|
+
response.should render_template('layouts/flutie')
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
data/spec/dummy/Rakefile
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
|
+
|
4
|
+
require File.expand_path('../config/application', __FILE__)
|
5
|
+
require 'rake'
|
6
|
+
|
7
|
+
Dummy::Application.load_tasks
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require "active_model/railtie"
|
4
|
+
require "active_record/railtie"
|
5
|
+
require "action_controller/railtie"
|
6
|
+
require "action_view/railtie"
|
7
|
+
require "action_mailer/railtie"
|
8
|
+
|
9
|
+
Bundler.require
|
10
|
+
require "flutie"
|
11
|
+
|
12
|
+
module Dummy
|
13
|
+
class Application < Rails::Application
|
14
|
+
# Settings in config/environments/* take precedence over those specified here.
|
15
|
+
# Application configuration should go into files in config/initializers
|
16
|
+
# -- all .rb files in that directory are automatically loaded.
|
17
|
+
|
18
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
19
|
+
# config.autoload_paths += %W(#{config.root}/extras)
|
20
|
+
|
21
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
22
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
23
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
24
|
+
|
25
|
+
# Activate observers that should always be running.
|
26
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
27
|
+
|
28
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
29
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
30
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
31
|
+
|
32
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
33
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
34
|
+
# config.i18n.default_locale = :de
|
35
|
+
|
36
|
+
# JavaScript files you want as :defaults (application.js is always included).
|
37
|
+
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
|
38
|
+
|
39
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
40
|
+
config.encoding = "utf-8"
|
41
|
+
|
42
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
43
|
+
config.filter_parameters += [:password]
|
44
|
+
end
|
45
|
+
end
|