roots-rails 0.0.1.alpha → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. data/.gitignore +0 -1
  2. data/lib/generators/roots/install_generator.rb +28 -12
  3. data/lib/generators/templates/layouts/_settings.styl +40 -0
  4. data/lib/generators/templates/layouts/application.css.styl +13 -0
  5. data/lib/generators/templates/layouts/layout.html.slim +26 -0
  6. data/lib/generators/templates/{scripts/pie.htc → pie.htc} +0 -0
  7. data/lib/roots/version.rb +1 -1
  8. data/readme.md +5 -13
  9. data/roots-rails.gemspec +2 -10
  10. metadata +13 -87
  11. data/Gemfile +0 -4
  12. data/lib/generators/roots/framework_generator.rb +0 -28
  13. data/lib/generators/templates/images/apple-touch-icon-114x114.png +0 -0
  14. data/lib/generators/templates/images/apple-touch-icon-72x72.png +0 -0
  15. data/lib/generators/templates/images/apple-touch-icon.png +0 -0
  16. data/lib/generators/templates/images/preview.png +0 -0
  17. data/lib/generators/templates/layouts/application.sass +0 -23
  18. data/lib/generators/templates/layouts/config.html.haml +0 -57
  19. data/lib/generators/templates/layouts/layout.html.haml +0 -26
  20. data/lib/generators/templates/sass/modules/_animation.sass +0 -454
  21. data/lib/generators/templates/sass/modules/_buttons.sass +0 -233
  22. data/lib/generators/templates/sass/modules/_code.sass +0 -41
  23. data/lib/generators/templates/sass/modules/_forms.sass +0 -209
  24. data/lib/generators/templates/sass/modules/_interaction.sass +0 -89
  25. data/lib/generators/templates/sass/modules/_reset.sass +0 -238
  26. data/lib/generators/templates/sass/modules/_tables.sass +0 -76
  27. data/lib/generators/templates/sass/modules/_typography.sass +0 -367
  28. data/lib/generators/templates/sass/modules/_ui.sass +0 -205
  29. data/lib/generators/templates/sass/modules/_utilities.sass +0 -372
  30. data/lib/generators/templates/sass/roots.sass +0 -54
  31. data/lib/generators/templates/scripts/selectivizr.js +0 -5
  32. data/vendor/assets/stylesheets/modules/_animation.sass +0 -454
  33. data/vendor/assets/stylesheets/modules/_buttons.sass +0 -233
  34. data/vendor/assets/stylesheets/modules/_code.sass +0 -41
  35. data/vendor/assets/stylesheets/modules/_fluid.sass +0 -160
  36. data/vendor/assets/stylesheets/modules/_forms.sass +0 -209
  37. data/vendor/assets/stylesheets/modules/_interaction.sass +0 -89
  38. data/vendor/assets/stylesheets/modules/_reset.sass +0 -238
  39. data/vendor/assets/stylesheets/modules/_tables.sass +0 -76
  40. data/vendor/assets/stylesheets/modules/_typography.sass +0 -367
  41. data/vendor/assets/stylesheets/modules/_ui.sass +0 -205
  42. data/vendor/assets/stylesheets/modules/_utilities.sass +0 -372
  43. data/vendor/assets/stylesheets/roots.sass +0 -57
data/.gitignore CHANGED
@@ -1,5 +1,4 @@
1
1
  *.gem
2
2
  .bundle
3
- Gemfile.lock
4
3
  pkg/*
5
4
  .DS_Store
@@ -1,34 +1,50 @@
1
-
2
1
  module Roots
3
2
  module Generators
4
3
  class InstallGenerator < Rails::Generators::Base
5
- desc "Loads sass framework, replaces layout, removes public/index.html"
4
+ desc "Installs the roots-rails system"
6
5
  source_root File.expand_path('../../templates', __FILE__)
7
6
 
8
7
  def replace_layout
9
8
  remove_file "app/views/layouts/application.html.erb"
10
- copy_file "layouts/layout.html.haml", "app/views/layouts/application.html.haml"
11
- copy_file "layouts/config.html.haml", "app/views/layouts/_config.html.haml"
9
+ copy_file "layouts/layout.html.slim", "app/views/layouts/application.html.slim"
12
10
  end
13
11
 
14
12
  def replace_application_css
15
13
  remove_file "app/assets/stylesheets/application.css"
16
- copy_file "layouts/application.sass", "app/assets/stylesheets/application.sass"
14
+ copy_file "layouts/application.css.styl", "app/assets/stylesheets/application.css.styl"
15
+ copy_file "layouts/_settings.styl", "app/assets/stylesheets/_settings.styl"
17
16
  end
18
17
 
19
18
  def install_dependencies
20
- copy_file "scripts/selectivizr.js", "vendor/assets/javascripts/selectivizr.js"
21
- copy_file "scripts/pie.htc", "vendor/assets/javascripts/pie.htc"
19
+ empty_directory 'public/js'
20
+ empty_directory 'public/img'
21
+ copy_file "pie.htc", "public/js/pie.htc"
22
22
  remove_file "public/favicon.ico"
23
23
  copy_file "favicon.ico", "public/favicon.ico"
24
- directory "images", "public/roots"
25
- copy_file "noise.png", "app/assets/images/noise.png"
24
+ copy_file "noise.png", "public/img/noise.png"
25
+ end
26
+
27
+ def add_gems
28
+ append_to_file "Gemfile", "\ngem 'slim'"
29
+ append_to_file "Gemfile", "\ngem 'stylus', group: :assets"
30
+ run 'bundle'
31
+ end
32
+
33
+ # note: it's possible to stream from the npm registry with ruby and eliminate
34
+ # this dependency on node (https://github.com/railsjedi/ruby-stylus-source/blob/master/Rakefile#L23)
35
+ def install_roots_css_library
36
+ empty_directory 'node_modules'
37
+ run 'npm install roots-css'
38
+ end
39
+
40
+ def add_stylus_initializer
41
+ create_file 'config/initializers/roots.rb'
42
+ append_file 'config/initializers/roots.rb', "Stylus.use 'roots-css'"
26
43
  end
27
44
 
28
- def remove_defaults
45
+ def remove_defaults_and_complete
29
46
  remove_file "app/assets/rails.png"
30
- remove_file "public/index.html"
31
- say "\nComplete! Make sure to visit these two files to configure things: \n - app/views/layouts/config.html.haml\n - app/assets/stylesheets/application.sass\n\n", "\e[32m"
47
+ say "\nComplete! Make sure to visit these two files to configure things: \n - app/views/layouts/config.html.slim\n - app/assets/stylesheets/application.css.styl\n\n", "\e[32m"
32
48
  end
33
49
 
34
50
  end
@@ -0,0 +1,40 @@
1
+ // -------------------------------------------------------
2
+ // Roots global settings variables
3
+ // -------------------------------------------------------
4
+
5
+ // font options (add your own!)
6
+ helvetica-neue = "Helvetica Neue", HelveticaNeue, Helvetica, Arial, sans-serif
7
+ helvetica = "Helvetica Neue", Helvetica, Arial, sans-serif
8
+ georgia = Georgia, Cambria, "Times New Roman", Times, serif
9
+ lucidia-grande = "Lucida Grande", Tahoma, Verdana, Arial, sans-serif
10
+ monospace = unquote("'Bitstream Vera Sans Mono', Consolas, Courier, monospace")
11
+ verdana = Verdana, Geneva, sans-serif
12
+
13
+ // default font stack
14
+ font-stack = helvetica-neue
15
+ font-size = 15
16
+ font-color = #555
17
+
18
+ // colors
19
+ red = #B44326
20
+ orange = #F2A34F
21
+ yellow = #F8CA5C
22
+ green = #7FC028
23
+ light-blue = #52D7FE
24
+ blue = #00a6fc
25
+ purple = #8E48C2
26
+ white = #fff
27
+ black = #272727
28
+
29
+ // default color
30
+ default = blue
31
+
32
+ // text hilight color
33
+ hilight-color = blue
34
+
35
+ // vendor prefixes
36
+ vendors = webkit moz o ms official
37
+
38
+ // progressive internet explorer
39
+ pie-enabled = false
40
+ ie-support = false
@@ -0,0 +1,13 @@
1
+ // This is roots' version of the application file. You will have to
2
+ // manually load each stylsheet that you want to use here (this is a
3
+ // best practice anyway, gives you control over what's included and in
4
+ // what order). Just use an @import directive like is done below.
5
+
6
+ @import "_settings"
7
+
8
+ // normalize.css - strongly recommended
9
+ normalize()
10
+
11
+ // ---------------------------------------------------
12
+ // @import your stylsheets here (.styl extension only)
13
+ // ---------------------------------------------------
@@ -0,0 +1,26 @@
1
+ doctype html
2
+ html
3
+ head
4
+ title your page title
5
+ meta name='description' content='description of the site'
6
+ meta name='author' content='author of the site'
7
+
8
+ meta property='og:title' content='title'
9
+ meta property='og:description' content='description'
10
+ meta property='og:image' content='preview.jpg'
11
+ meta property='og:url' content='http://example.com'
12
+ meta property='og:type' content='website'
13
+
14
+ = stylesheet_link_tag 'application'
15
+ = csrf_meta_tags
16
+
17
+ / uncomment if this is a mobile site
18
+ / meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0'
19
+
20
+ body
21
+ = yield
22
+
23
+ /[if (gte IE6)&(lte IE8)]
24
+ = javascript_include_tag 'selectivizr.js'
25
+
26
+ = javascript_include_tag 'application'
data/lib/roots/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Roots
3
- VERSION = '0.0.1.alpha'
3
+ VERSION = '1.0.0'
4
4
  end
data/readme.md CHANGED
@@ -1,23 +1,15 @@
1
- Roots-Rails
2
- ===========
1
+ Roots Rails
2
+ -----------
3
3
 
4
4
  This gem can be used to bootstrap your rails app with the roots sass framework, layout, and assets.
5
5
 
6
6
  ### Setup
7
7
 
8
- To add roots to your application, just add `gem 'roots-rails'` under the assets group in your Gemfile. Make sure that you also add `gem 'haml'` if you have not already, as the roots layout files are haml (could be ported to erb as well if there's demand). Then run `bundle` and the framework will be available to you using `@import roots`.
8
+ To add roots to your application, run `rails g roots:install` and I'll set up your app to work great with the roots css framework and templating languages. This command is destructive particularly to your main layout file and application.css file, so it's recommended that you run it at the beginning of your project or back up those two files beforehand.
9
9
 
10
- It is **strongly recommended** that you use the roots install generator as well, which sets up the layout, images, icons, and older browser fixes.
10
+ The roots css library will be automatically included in any stylus file you use. If you would like to jump in and edit the source directly, you can easily override any of the files in your asset pipeline. Check out the [roots-css repo](http://github.com/jenius/roots-css) to dive into the structure. Documentation for the css library will be available very soon.
11
11
 
12
- ### Generators
13
-
14
- Situation: you just made a new rails application and you want to bootstrap it with roots. We've got a generator for that. Just hit the command below, which will replace the default layout, remove the default rails assets, and add in roots' sass framework, layouts, icons, and legacy browser fixes.
15
-
16
- rails g roots:install
17
-
18
- If you would like to jump in and edit the source directly, you can generate the framework so that it shows up in your asset pipeline. Just run
19
-
20
- rails g roots:framework
12
+ Currently, this gem also **depends on node.js** and npm, but this will be phased out in the future. Just makes life easier for the first release.
21
13
 
22
14
  ### Feedback
23
15
 
data/roots-rails.gemspec CHANGED
@@ -9,20 +9,12 @@ Gem::Specification.new do |s|
9
9
  s.authors = ["Jeff Escalante"]
10
10
  s.email = ["jeff.escalante@carrotcreative.com"]
11
11
  s.homepage = "http://roots.carrotbeta.com"
12
- s.summary = %q{Injects roots sass framework, layouts, and assets into your rails app}
13
- s.description = %q{Injects roots sass framework, layouts, and assets into your rails app}
12
+ s.summary = %q{Injects roots css framework, layouts, and assets into your rails app}
13
+ s.description = %q{Injects roots css framework, layouts, and assets into your rails app}
14
14
 
15
15
  s.files = `git ls-files`.split("\n")
16
16
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
17
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
18
  s.require_paths = ["lib"]
19
19
 
20
- # testing
21
- s.add_development_dependency "rspec"
22
-
23
- # dependencies
24
- s.add_dependency('haml')
25
- s.add_dependency('coffee-script')
26
- s.add_dependency('rdiscount')
27
-
28
20
  end
metadata CHANGED
@@ -1,61 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roots-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha
5
- prerelease: 6
4
+ version: 1.0.0
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jeff Escalante
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-28 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: rspec
16
- requirement: &70305630226660 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :development
23
- prerelease: false
24
- version_requirements: *70305630226660
25
- - !ruby/object:Gem::Dependency
26
- name: haml
27
- requirement: &70305630252740 !ruby/object:Gem::Requirement
28
- none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: '0'
33
- type: :runtime
34
- prerelease: false
35
- version_requirements: *70305630252740
36
- - !ruby/object:Gem::Dependency
37
- name: coffee-script
38
- requirement: &70305630252180 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ! '>='
42
- - !ruby/object:Gem::Version
43
- version: '0'
44
- type: :runtime
45
- prerelease: false
46
- version_requirements: *70305630252180
47
- - !ruby/object:Gem::Dependency
48
- name: rdiscount
49
- requirement: &70305630251180 !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- type: :runtime
56
- prerelease: false
57
- version_requirements: *70305630251180
58
- description: Injects roots sass framework, layouts, and assets into your rails app
12
+ date: 2012-12-03 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Injects roots css framework, layouts, and assets into your rails app
59
15
  email:
60
16
  - jeff.escalante@carrotcreative.com
61
17
  executables: []
@@ -63,48 +19,18 @@ extensions: []
63
19
  extra_rdoc_files: []
64
20
  files:
65
21
  - .gitignore
66
- - Gemfile
67
- - lib/generators/roots/framework_generator.rb
68
22
  - lib/generators/roots/install_generator.rb
69
23
  - lib/generators/templates/favicon.ico
70
- - lib/generators/templates/images/apple-touch-icon-114x114.png
71
- - lib/generators/templates/images/apple-touch-icon-72x72.png
72
- - lib/generators/templates/images/apple-touch-icon.png
73
- - lib/generators/templates/images/preview.png
74
- - lib/generators/templates/layouts/application.sass
75
- - lib/generators/templates/layouts/config.html.haml
76
- - lib/generators/templates/layouts/layout.html.haml
24
+ - lib/generators/templates/layouts/_settings.styl
25
+ - lib/generators/templates/layouts/application.css.styl
26
+ - lib/generators/templates/layouts/layout.html.slim
77
27
  - lib/generators/templates/noise.png
78
- - lib/generators/templates/sass/modules/_animation.sass
79
- - lib/generators/templates/sass/modules/_buttons.sass
80
- - lib/generators/templates/sass/modules/_code.sass
81
- - lib/generators/templates/sass/modules/_forms.sass
82
- - lib/generators/templates/sass/modules/_interaction.sass
83
- - lib/generators/templates/sass/modules/_reset.sass
84
- - lib/generators/templates/sass/modules/_tables.sass
85
- - lib/generators/templates/sass/modules/_typography.sass
86
- - lib/generators/templates/sass/modules/_ui.sass
87
- - lib/generators/templates/sass/modules/_utilities.sass
88
- - lib/generators/templates/sass/roots.sass
89
- - lib/generators/templates/scripts/pie.htc
90
- - lib/generators/templates/scripts/selectivizr.js
28
+ - lib/generators/templates/pie.htc
91
29
  - lib/roots.rb
92
30
  - lib/roots/engine.rb
93
31
  - lib/roots/version.rb
94
32
  - readme.md
95
33
  - roots-rails.gemspec
96
- - vendor/assets/stylesheets/modules/_animation.sass
97
- - vendor/assets/stylesheets/modules/_buttons.sass
98
- - vendor/assets/stylesheets/modules/_code.sass
99
- - vendor/assets/stylesheets/modules/_fluid.sass
100
- - vendor/assets/stylesheets/modules/_forms.sass
101
- - vendor/assets/stylesheets/modules/_interaction.sass
102
- - vendor/assets/stylesheets/modules/_reset.sass
103
- - vendor/assets/stylesheets/modules/_tables.sass
104
- - vendor/assets/stylesheets/modules/_typography.sass
105
- - vendor/assets/stylesheets/modules/_ui.sass
106
- - vendor/assets/stylesheets/modules/_utilities.sass
107
- - vendor/assets/stylesheets/roots.sass
108
34
  homepage: http://roots.carrotbeta.com
109
35
  licenses: []
110
36
  post_install_message:
@@ -120,13 +46,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
120
46
  required_rubygems_version: !ruby/object:Gem::Requirement
121
47
  none: false
122
48
  requirements:
123
- - - ! '>'
49
+ - - ! '>='
124
50
  - !ruby/object:Gem::Version
125
- version: 1.3.1
51
+ version: '0'
126
52
  requirements: []
127
53
  rubyforge_project:
128
- rubygems_version: 1.8.11
54
+ rubygems_version: 1.8.24
129
55
  signing_key:
130
56
  specification_version: 3
131
- summary: Injects roots sass framework, layouts, and assets into your rails app
57
+ summary: Injects roots css framework, layouts, and assets into your rails app
132
58
  test_files: []
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'http://rubygems.org'
2
-
3
- # Specify your gem's dependencies in roots.gemspec
4
- gemspec
@@ -1,28 +0,0 @@
1
-
2
- module Roots
3
- module Generators
4
- class FrameworkGenerator < Rails::Generators::Base
5
- desc "Places roots in your asset pipeline so you can edit it"
6
- source_root File.expand_path('../../templates', __FILE__)
7
-
8
- def generate
9
- say_notice = false
10
-
11
- if yes? "This will replace your application.css file - is this ok / have you backed it up? [y/n]", "\e[31m"
12
-
13
- if File.exist? "app/assets/stylesheets/application.css"
14
- remove_file "app/assets/stylesheets/application.css"
15
- copy_file "layouts/application.sass", "app/assets/stylesheets/application.sass"
16
- say_notice = true
17
- end
18
-
19
- directory "sass", "app/assets/stylesheets"
20
- end
21
-
22
- say "\nComplete! Make sure to visit application.sass to configure.\n\n", "\e[32m" if say_notice
23
-
24
- end
25
-
26
- end
27
- end
28
- end
@@ -1,23 +0,0 @@
1
- // This is roots' version of the application file. You will have to
2
- // manually load each stylsheet that you want to use here (this is a
3
- // best practice anyway, gives you control over what's included and in
4
- // what order). Just use an @import directive like is done below.
5
-
6
- @import "roots"
7
-
8
- // Uncomment only one of these - first one removes all default browser styles
9
- // and the second is a port of normalize.css (http://necolas.github.com/normalize.css/)
10
-
11
- // +global-reset
12
- // +normalize
13
-
14
- // If you uncomment this line, it will load roots styles on to default elements, much
15
- // like a traditional css framework. If you don't want to replace everything, it can
16
- // be broken down into many sub-mixins, which can be found in the file _roots.sass.
17
- // It is *strongly recommended* to at very least use +base.
18
-
19
- // +framework
20
-
21
- // ------------------------------
22
- // @import your stylsheets here
23
- // ------------------------------
@@ -1,57 +0,0 @@
1
- %meta{ :charset => 'utf8' }
2
- %meta{ 'http-equiv' => 'X-UA-Compatible', :content => 'IE=edge, chrome=1' }
3
-
4
- -# -----------------------------------------------------
5
- -# CONFIGURATION: This is important stuff, do it first!
6
- -# -----------------------------------------------------
7
-
8
- - title = "Your page title here"
9
- - author = "Your name or company name"
10
- - description = "Short description of your site"
11
- - url = "http://example.com"
12
- - preview_image = "/roots/preview.png" # 75x75 square. if you really can't, pass false
13
-
14
- - favicons = true # see section below for size details
15
- - facebook_tags = true
16
- - mobile_site = false
17
- - ie_app = true
18
-
19
- -# -----------------------------------------------------
20
-
21
- %title= title
22
- %meta{ :name => 'description', :content => "#{description}" }
23
- %meta{ :name => 'author', :content => "#{author}" }
24
-
25
- - if favicons
26
- -# 16x16, .ico
27
- %link{ :rel => "shortcut icon", :href => "/favicon.ico" }
28
- -# 57x57, .png
29
- %link{ :rel => "apple-touch-icon", :href => "/roots/apple-touch-icon.png" }
30
- -# 72x72, .png
31
- %link{ :rel => "apple-touch-icon", :sizes => "72x72", :href => "/roots/apple-touch-icon-72x72.png" }
32
- -# 114x114, .png
33
- %link{ :rel => "apple-touch-icon", :sizes => "114x114", :href => "/roots/apple-touch-icon-114x114.png" }
34
-
35
- - if facebook_tags
36
- %meta{ property: 'og:title', content: "#{title}"}
37
- %meta{ property: 'og:description', content: "#{description}"}
38
- %meta{ property: 'og:image', content: "#{preview_image}"}
39
- %meta{ property: 'og:url', content: "#{url}" }
40
- -# more than just a website? Docs @ http://developers.facebook.com/docs/opengraph/objects/builtin/
41
- %meta{ property: 'og:type', content: 'website' }
42
-
43
- - if mobile_site
44
- %meta{ :name => 'viewport', :content => 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' }
45
-
46
- - if ie_app
47
- -# You can get more detailed with this if you want. Docs @ http://msdn.microsoft.com/en-us/library/gg131029.aspx
48
- %meta{ name: "application-name", content: "#{title}" }
49
- %meta{ name: "msapplication-starturl", content: "#{url}" }
50
- -# by all means, change this color
51
- %meta{ name: "msapplication-navbutton-color", content: "#E88F4E" }
52
-
53
- -# ---------------------------------------------------------------------------
54
- -# Any other stuff you need in the head goes here! (fonts, stylesheets, etc.)
55
- -# ---------------------------------------------------------------------------
56
- -# NOTE: Script loads are blocking. It's recommended to load javascript at the bottom
57
- -# of the page unless it's something like a webfont.