flutie 1.3.3 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. data/.gitignore +9 -0
  2. data/.travis.yml +9 -0
  3. data/Appraisals +5 -0
  4. data/CONTRIBUTING.md +38 -0
  5. data/Gemfile +1 -7
  6. data/Gemfile.lock +108 -0
  7. data/LICENSE +1 -1
  8. data/README.md +44 -40
  9. data/Rakefile +10 -23
  10. data/app/assets/stylesheets/_defaults.scss +6 -4
  11. data/app/assets/stylesheets/_flashes.scss +7 -5
  12. data/app/assets/stylesheets/_forms.scss +34 -22
  13. data/app/assets/stylesheets/_lists.scss +13 -8
  14. data/app/assets/stylesheets/_tables.scss +8 -4
  15. data/app/assets/stylesheets/_type.scss +32 -28
  16. data/app/controllers/flutie/styleguides_controller.rb +1 -1
  17. data/flutie.gemspec +24 -0
  18. data/gemfiles/rails_3.0.20.gemfile +7 -0
  19. data/gemfiles/rails_3.1.11.gemfile +7 -0
  20. data/gemfiles/rails_3.2.12.gemfile +7 -0
  21. data/lib/flutie.rb +2 -0
  22. data/lib/flutie/version.rb +3 -0
  23. data/lib/tasks/flutie.rake +1 -1
  24. data/server.rb +21 -0
  25. data/spec/controllers/styleguides_controller_spec.rb +62 -0
  26. data/spec/dummy/Rakefile +7 -0
  27. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  28. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  29. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  30. data/spec/dummy/config.ru +4 -0
  31. data/spec/dummy/config/application.rb +45 -0
  32. data/spec/dummy/config/boot.rb +10 -0
  33. data/spec/dummy/config/database.yml +11 -0
  34. data/spec/dummy/config/environment.rb +5 -0
  35. data/spec/dummy/config/environments/development.rb +26 -0
  36. data/spec/dummy/config/environments/production.rb +49 -0
  37. data/spec/dummy/config/environments/test.rb +35 -0
  38. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  39. data/spec/dummy/config/initializers/inflections.rb +10 -0
  40. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  41. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  42. data/spec/dummy/config/initializers/session_store.rb +8 -0
  43. data/spec/dummy/config/locales/en.yml +5 -0
  44. data/spec/dummy/config/routes.rb +58 -0
  45. data/spec/dummy/public/404.html +26 -0
  46. data/spec/dummy/public/422.html +26 -0
  47. data/spec/dummy/public/500.html +26 -0
  48. data/spec/dummy/public/favicon.ico +0 -0
  49. data/spec/dummy/public/javascripts/application.js +2 -0
  50. data/spec/dummy/public/javascripts/controls.js +965 -0
  51. data/spec/dummy/public/javascripts/dragdrop.js +974 -0
  52. data/spec/dummy/public/javascripts/effects.js +1123 -0
  53. data/spec/dummy/public/javascripts/prototype.js +6001 -0
  54. data/spec/dummy/public/javascripts/rails.js +191 -0
  55. data/spec/dummy/public/stylesheets/.gitkeep +0 -0
  56. data/spec/dummy/script/rails +6 -0
  57. data/spec/fixtures/app/views/styleguides/_one.erb +1 -0
  58. data/spec/fixtures/app/views/styleguides/_two.erb +1 -0
  59. data/spec/flutie_spec.rb +7 -0
  60. data/spec/helpers/body_class_helper_spec.rb +43 -0
  61. data/spec/helpers/page_title_helper_spec.rb +27 -0
  62. data/spec/initialization_spec.rb +16 -0
  63. data/spec/integration/navigation_spec.rb +9 -0
  64. data/spec/spec_helper.rb +35 -0
  65. metadata +183 -11
@@ -2,7 +2,8 @@
2
2
 
3
3
  ul, ol {
4
4
  list-style-position: inside;
5
- margin-bottom: 16px;
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.4;
18
- margin-bottom: 16px;
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: 6px;
25
+ margin-top: .5em;
26
+ margin-top: .5rem;
24
27
  }
25
28
 
26
29
  dl dd {
27
- margin-bottom: 0em;
30
+ margin-bottom: 0;
28
31
  }
29
32
 
30
33
  dd {
31
- margin-left: 6px;
34
+ margin-left: .5em;
35
+ margin-left: .5rem;
32
36
  }
33
37
 
34
38
  li {
35
- line-height: 1.4;
39
+ line-height: 1.4em;
36
40
  }
37
41
 
38
42
  ol ol, ol ul, ul ul, ul ol {
39
- margin-left: 12px;
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: 24px;
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: 4px 10px 4px 0;
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: 12px;
25
- padding: 10px 0;
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: 28px;
8
- line-height: 1.2;
9
- margin-bottom: 12px;
8
+ font-size: 1.75em;
9
+ font-size: 1.75rem;
10
10
  }
11
11
 
12
12
  h2 {
13
- font-size: 24px;
14
- line-height: 1.2;
15
- margin-bottom: 6px;
13
+ font-size: 1.5em;
14
+ font-size: 1.5rem;
16
15
  }
17
16
 
18
17
  h3 {
19
- font-size: 18px;
20
- line-height: 1.2;
21
- margin-bottom: 4px;
18
+ font-size: 1.25em;
19
+ font-size: 1.25rem;
22
20
  }
23
21
 
24
22
  h4 {
25
- font-size: 16px;
26
- line-height: 1.3;
27
- margin-bottom: 4px;
23
+ font-size: 1em;
24
+ font-size: 1rem;
28
25
  }
29
26
 
30
27
  h5 {
31
- font-size: 14px;
32
- margin-bottom: 4px;
28
+ font-size: .75em;
29
+ font-size: .75rem;
33
30
  }
34
31
 
35
32
  h6 {
36
- font-size: 12px;
37
- margin-bottom: 4px;
33
+ font-size: .5em;
34
+ font-size: .5rem;
38
35
  }
39
36
 
40
37
  /* Text elements */
41
38
  p {
42
- line-height: 1.4;
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 12px;
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: 16px;
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: 16px 0;
91
- padding-left: 12px;
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: 12px 0;
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: 12px 'andale mono', 'monotype.com', 'lucida console', monospace;
116
- line-height: 1.5;
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: 20px;
125
+ padding: 1.25em;
126
+ padding: 1.25rem;
123
127
  }
124
128
 
125
129
  tt {
126
130
  display: block;
127
- line-height: 1.5;
128
- margin: 16px 0;
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
@@ -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
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "rails", "3.0.20"
6
+
7
+ gemspec :path=>"../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "rails", "3.1.11"
6
+
7
+ gemspec :path=>"../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "rails", "3.2.12"
6
+
7
+ gemspec :path=>"../"
@@ -1,3 +1,5 @@
1
+ require 'flutie/version'
2
+
1
3
  module Flutie
2
4
  require 'flutie/engine' if defined?(Rails)
3
5
  end
@@ -0,0 +1,3 @@
1
+ module Flutie
2
+ VERSION = '1.3.4'.freeze
3
+ end
@@ -9,7 +9,7 @@ end
9
9
  directory = File.dirname(__FILE__)
10
10
 
11
11
  namespace :flutie do
12
- desc 'install flutie stylesheets into public/ directory'
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
@@ -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
@@ -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,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag :all %>
6
+ <%= javascript_include_tag :defaults %>
7
+ <%= csrf_meta_tag %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -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