speedo 0.0.8 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2 @@
1
+ // @import files below speedo (in order) so you can use the bourbon's jazzy mixins. Don't *=require
2
+ @import "speedo";
@@ -1,14 +1,11 @@
1
- /*
2
- *= require normalize
3
- *= require autoSuggest
4
- *= require chosen
5
- *= require gh-buttons
6
- *= require jquery.dataTables
7
- *= require jquery.fancybox-1.3.4
8
- *= require jquery-ui-1.8.18.custom
9
- *= require uniform.default
10
- */
11
-
1
+ @import "normalize";
2
+ @import "autoSuggest";
3
+ @import "chosen";
4
+ @import "gh-buttons";
5
+ @import "jquery.dataTables";
6
+ @import "jquery.fancybox-1.3.4";
7
+ @import "jquery-ui-1.8.18.custom";
8
+ @import "uniform.default";
12
9
  @import "bourbon";
13
10
 
14
11
 
@@ -310,9 +307,11 @@ ul.as-selections {
310
307
  */
311
308
 
312
309
  #wrapper {
313
- max-width: 964px; /* Set the width of the page here, +4px for colmask box-shadow */
314
- padding:0 2px 4px; /* (for colmask box-shadow) */
315
- margin: 0 auto;
310
+ max-width: 960px; /* Set the width of the page here */
311
+ padding:0;
312
+ margin: 0 auto 20px;
313
+ @include border-bottom-radius(3px);
314
+ @include box-shadow(0 2px 2px rgba(0,0,0,0.5));
316
315
  }
317
316
 
318
317
  /* Layout for mobile < 480px width screens (see below for media queries) */
@@ -322,7 +321,6 @@ ul.as-selections {
322
321
  float:left;
323
322
  width:100%; /* width of whole page */
324
323
  @include border-radius(0 0 3px 3px);
325
- @include box-shadow(0 2px 2px rgba(0,0,0,0.5));
326
324
  background:#fff;
327
325
  overflow:hidden; /* This chops off any overhanging divs, including the leftcol bg */
328
326
  }
@@ -21,7 +21,7 @@
21
21
 
22
22
  %body
23
23
  %noscript#noscript_warning This site works best with JavaScript enabled. Some features may not be available
24
- #wrapper
24
+ #wrapper.clearfix
25
25
  %header.branding.clearfix
26
26
  = link_to image_tag('speedo/logo.png'), root_url, class: 'logo'
27
27
 
@@ -7,33 +7,52 @@ module Speedo
7
7
 
8
8
  # app/views/layouts/application.html.haml
9
9
  def layout
10
- if yes? 'Do you want to replace the application layout? [yN]'
10
+ if File.exist? 'app/views/layouts/application.html.haml'
11
+ if yes? 'application.html.haml already exists. Do you want the template as speedo.html.haml (for manual integration)? [yN]'
12
+ template 'app/views/layouts/speedo/application.html.haml',
13
+ 'app/views/layouts/speedo.html.haml'
14
+ end
15
+ else
11
16
  template 'app/views/layouts/speedo/application.html.haml',
12
17
  'app/views/layouts/application.html.haml'
13
- remove_file 'app/views/layouts/application.html.erb'
18
+ end
19
+
20
+ if File.exist? 'app/views/layouts/application.html.erb'
21
+ if yes? 'Do you want to remove the application.html.erb layout (otherwise delete it manually)? [yN]'
22
+ remove_file 'app/views/layouts/application.html.erb'
23
+ end
14
24
  end
15
25
  end
16
26
 
17
27
  # app/assets/stylesheets/speedo.css.scss
18
28
  def copy_stylesheet
19
- template 'app/assets/stylesheets/speedo.css.scss',
20
- 'app/assets/stylesheets/speedo.css.scss'
29
+ copy_file 'app/assets/stylesheets/speedo.css.scss',
30
+ 'app/assets/stylesheets/speedo.css.scss'
21
31
  end
22
32
 
23
- def alter_application_css
24
- if_file 'app/assets/stylesheets/application.css' do |path|
25
- unless File.read(path).match /require speedo/
26
- inject_into_file path, after: '*= require_self' do
27
- "\n *= require speedo"
28
- end
33
+
34
+ # app/assets/stylesheets/application.css.scss
35
+ def copy_application_css
36
+ if File.exist? 'app/assets/stylesheets/application.css.scss'
37
+ if yes? 'application.css.scss already exists. Do you want to replace it? [yN]'
38
+ copy_file 'app/assets/stylesheets/application.css.scss',
39
+ 'app/assets/stylesheets/application.css.scss'
40
+ else
41
+ say 'Make sure to @import "speedo"; in your application.css.scss, and @import other files - do NOT use *=require.'
42
+ end
43
+ end
44
+
45
+ if File.exist? 'app/assets/stylesheets/application.css'
46
+ if yes? 'Do you want to remove application.css (otherwise delete it manually)? [yN]'
47
+ remove_file 'app/assets/stylesheets/application.css'
29
48
  end
30
49
  end
31
50
  end
32
51
 
33
52
  # app/assets/javascripts/swim.js.coffee
34
53
  def javascript
35
- template 'app/assets/javascripts/swim.js.coffee',
36
- 'app/assets/javascripts/swim.js.coffee'
54
+ copy_file 'app/assets/javascripts/swim.js.coffee',
55
+ 'app/assets/javascripts/swim.js.coffee'
37
56
  end
38
57
 
39
58
  def alter_application_js
@@ -48,8 +67,16 @@ module Speedo
48
67
 
49
68
  # config/locales/speedo.en.yml
50
69
  def locales
51
- template 'config/locales/speedo.en.yml',
52
- 'config/locales/speedo.en.yml'
70
+ if File.exist? 'config/locales/en.yml'
71
+ unless File.read('config/locales/en.yml').match /app_name/
72
+ inject_into_file 'config/locales/en.yml', after: 'en:' do
73
+ "\n app_name: 'See config/locales to name this app'"
74
+ end
75
+ end
76
+ else
77
+ copy_file 'config/locales/speedo.en.yml',
78
+ 'config/locales/speedo.en.yml'
79
+ end
53
80
  end
54
81
 
55
82
  def routes
@@ -62,7 +89,7 @@ module Speedo
62
89
  if File.exist? path
63
90
  yield path
64
91
  else
65
- say "#{path} not found. Please manually require speedo."
92
+ say "#{path} not found. Add '//= require_tree .' to application.js."
66
93
  end
67
94
  end
68
95
 
data/lib/speedo/sass.rb CHANGED
@@ -1,5 +1,13 @@
1
1
  require 'bourbon'
2
-
3
- Sass::Engine::DEFAULT_OPTIONS[:load_paths].tap do |load_paths|
4
- load_paths << "#{Gem.loaded_specs['bourbon'].full_gem_path}/app/assets/stylesheets/"
5
- end
2
+ #
3
+ module Speedo
4
+ class Railtie < ::Rails::Railtie
5
+ initializer "speedo.initialize_rails", :group => :all do
6
+ Sass::Engine::DEFAULT_OPTIONS[:load_paths].tap do |load_paths|
7
+ load_paths << "#{Gem.loaded_specs['bourbon'].full_gem_path}/app/assets/stylesheets/"
8
+ load_paths << "#{Rails.root}/app/assets/stylesheets"
9
+ load_paths << "#{Rails.root}/vendor/assets/stylesheets"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module Speedo
2
- VERSION = "0.0.8"
2
+ VERSION = "0.1.0"
3
3
  end
data/lib/speedo.rb CHANGED
@@ -1,4 +1,4 @@
1
- require "speedo/engine"
1
+ require 'speedo/engine'
2
2
  require 'speedo/sass'
3
3
  require 'speedo/layout_helper'
4
4
  require 'haml'