twbs_less_rails 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +12 -0
  3. data/CONTRIBUTING.md +45 -0
  4. data/Gemfile +3 -0
  5. data/Gemfile.lock +144 -0
  6. data/LICENSE +30 -0
  7. data/README.md +147 -0
  8. data/Rakefile +113 -0
  9. data/app/assets/fonts/fontawesome-webfont.eot +0 -0
  10. data/app/assets/fonts/fontawesome-webfont.svg +399 -0
  11. data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
  12. data/app/assets/fonts/fontawesome-webfont.woff +0 -0
  13. data/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  14. data/app/assets/fonts/glyphicons-halflings-regular.svg +229 -0
  15. data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  16. data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  17. data/gemfiles/Gemfile.rails-3.2.x +9 -0
  18. data/gemfiles/Gemfile.rails-4.0.x +9 -0
  19. data/lib/generators/twbs_less_rails/install/install_generator.rb +31 -0
  20. data/lib/generators/twbs_less_rails/install/templates/application.css +15 -0
  21. data/lib/generators/twbs_less_rails/install/templates/application.js +17 -0
  22. data/lib/generators/twbs_less_rails/install/templates/twbs-variables.css.less +5 -0
  23. data/lib/generators/twbs_less_rails/install/templates/twbs.css.less +14 -0
  24. data/lib/generators/twbs_less_rails/install/templates/twbs.js.coffee +7 -0
  25. data/lib/tasks/twbs_less_rails_tasks.rake +4 -0
  26. data/lib/twbs_less_rails/engine.rb +7 -0
  27. data/lib/twbs_less_rails/version.rb +3 -0
  28. data/lib/twbs_less_rails.rb +4 -0
  29. data/test/dummy/README.rdoc +28 -0
  30. data/test/dummy/Rakefile +6 -0
  31. data/test/dummy/app/assets/images/.keep +0 -0
  32. data/test/dummy/app/assets/javascripts/application.js +14 -0
  33. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  34. data/test/dummy/app/assets/stylesheets/default-twbs.css.less +1 -0
  35. data/test/dummy/app/assets/stylesheets/test.css.less +5 -0
  36. data/test/dummy/app/assets/stylesheets/twbs-variables.css.less +6 -0
  37. data/test/dummy/app/assets/stylesheets/twbs.css.less +14 -0
  38. data/test/dummy/app/controllers/application_controller.rb +5 -0
  39. data/test/dummy/app/controllers/concerns/.keep +0 -0
  40. data/test/dummy/app/helpers/application_helper.rb +2 -0
  41. data/test/dummy/app/mailers/.keep +0 -0
  42. data/test/dummy/app/models/.keep +0 -0
  43. data/test/dummy/app/models/concerns/.keep +0 -0
  44. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  45. data/test/dummy/bin/bundle +3 -0
  46. data/test/dummy/bin/rails +4 -0
  47. data/test/dummy/bin/rake +4 -0
  48. data/test/dummy/config/application.rb +27 -0
  49. data/test/dummy/config/boot.rb +5 -0
  50. data/test/dummy/config/database.yml +25 -0
  51. data/test/dummy/config/environment.rb +5 -0
  52. data/test/dummy/config/environments/development.rb +29 -0
  53. data/test/dummy/config/environments/production.rb +80 -0
  54. data/test/dummy/config/environments/test.rb +36 -0
  55. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  56. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  57. data/test/dummy/config/initializers/inflections.rb +16 -0
  58. data/test/dummy/config/initializers/mime_types.rb +5 -0
  59. data/test/dummy/config/initializers/secret_token.rb +18 -0
  60. data/test/dummy/config/initializers/session_store.rb +3 -0
  61. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  62. data/test/dummy/config/locales/en.yml +23 -0
  63. data/test/dummy/config/routes.rb +56 -0
  64. data/test/dummy/config.ru +4 -0
  65. data/test/dummy/db/.keep +0 -0
  66. data/test/dummy/lib/assets/.keep +0 -0
  67. data/test/dummy/log/.keep +0 -0
  68. data/test/dummy/public/404.html +58 -0
  69. data/test/dummy/public/422.html +58 -0
  70. data/test/dummy/public/500.html +57 -0
  71. data/test/dummy/public/favicon.ico +0 -0
  72. data/test/generators/default_rails_assets/application.css +13 -0
  73. data/test/generators/default_rails_assets/application.js +16 -0
  74. data/test/generators/install_generator_test.rb +47 -0
  75. data/test/integration/assets_precompile_integration_test.rb +49 -0
  76. data/test/integration/twbs_less_rails_integration_test.rb +38 -0
  77. data/test/test_helper.rb +38 -0
  78. data/twbs_less_rails.gemspec +34 -0
  79. data/vendor/assets/javascripts/respond.js +342 -0
  80. data/vendor/assets/javascripts/twbs/bootstrap/affix.js +126 -0
  81. data/vendor/assets/javascripts/twbs/bootstrap/alert.js +98 -0
  82. data/vendor/assets/javascripts/twbs/bootstrap/button.js +109 -0
  83. data/vendor/assets/javascripts/twbs/bootstrap/carousel.js +217 -0
  84. data/vendor/assets/javascripts/twbs/bootstrap/collapse.js +179 -0
  85. data/vendor/assets/javascripts/twbs/bootstrap/dropdown.js +154 -0
  86. data/vendor/assets/javascripts/twbs/bootstrap/modal.js +246 -0
  87. data/vendor/assets/javascripts/twbs/bootstrap/popover.js +117 -0
  88. data/vendor/assets/javascripts/twbs/bootstrap/scrollspy.js +158 -0
  89. data/vendor/assets/javascripts/twbs/bootstrap/tab.js +135 -0
  90. data/vendor/assets/javascripts/twbs/bootstrap/tooltip.js +386 -0
  91. data/vendor/assets/javascripts/twbs/bootstrap/transition.js +56 -0
  92. data/vendor/assets/javascripts/twbs/bootstrap.js +12 -0
  93. data/vendor/assets/stylesheets/fontawesome/bootstrap.less +84 -0
  94. data/vendor/assets/stylesheets/fontawesome/core.less +129 -0
  95. data/vendor/assets/stylesheets/fontawesome/extras.less +93 -0
  96. data/vendor/assets/stylesheets/fontawesome/font-awesome.less +33 -0
  97. data/vendor/assets/stylesheets/fontawesome/icons.less +381 -0
  98. data/vendor/assets/stylesheets/fontawesome/mixins.less +48 -0
  99. data/vendor/assets/stylesheets/fontawesome/path.less +14 -0
  100. data/vendor/assets/stylesheets/fontawesome/variables.less +735 -0
  101. data/vendor/assets/stylesheets/twbs/bootstrap/alerts.less +67 -0
  102. data/vendor/assets/stylesheets/twbs/bootstrap/badges.less +51 -0
  103. data/vendor/assets/stylesheets/twbs/bootstrap/bootstrap.less +48 -0
  104. data/vendor/assets/stylesheets/twbs/bootstrap/breadcrumbs.less +23 -0
  105. data/vendor/assets/stylesheets/twbs/bootstrap/button-groups.less +248 -0
  106. data/vendor/assets/stylesheets/twbs/bootstrap/buttons.less +158 -0
  107. data/vendor/assets/stylesheets/twbs/bootstrap/carousel.less +220 -0
  108. data/vendor/assets/stylesheets/twbs/bootstrap/close.less +33 -0
  109. data/vendor/assets/stylesheets/twbs/bootstrap/code.less +53 -0
  110. data/vendor/assets/stylesheets/twbs/bootstrap/component-animations.less +29 -0
  111. data/vendor/assets/stylesheets/twbs/bootstrap/dropdowns.less +192 -0
  112. data/vendor/assets/stylesheets/twbs/bootstrap/forms.less +366 -0
  113. data/vendor/assets/stylesheets/twbs/bootstrap/glyphicons.less +236 -0
  114. data/vendor/assets/stylesheets/twbs/bootstrap/grid.less +93 -0
  115. data/vendor/assets/stylesheets/twbs/bootstrap/input-groups.less +136 -0
  116. data/vendor/assets/stylesheets/twbs/bootstrap/jumbotron.less +40 -0
  117. data/vendor/assets/stylesheets/twbs/bootstrap/labels.less +58 -0
  118. data/vendor/assets/stylesheets/twbs/bootstrap/list-group.less +88 -0
  119. data/vendor/assets/stylesheets/twbs/bootstrap/media.less +56 -0
  120. data/vendor/assets/stylesheets/twbs/bootstrap/mixins.less +846 -0
  121. data/vendor/assets/stylesheets/twbs/bootstrap/modals.less +131 -0
  122. data/vendor/assets/stylesheets/twbs/bootstrap/navbar.less +621 -0
  123. data/vendor/assets/stylesheets/twbs/bootstrap/navs.less +257 -0
  124. data/vendor/assets/stylesheets/twbs/bootstrap/normalize.less +406 -0
  125. data/vendor/assets/stylesheets/twbs/bootstrap/pager.less +55 -0
  126. data/vendor/assets/stylesheets/twbs/bootstrap/pagination.less +85 -0
  127. data/vendor/assets/stylesheets/twbs/bootstrap/panels.less +168 -0
  128. data/vendor/assets/stylesheets/twbs/bootstrap/popovers.less +133 -0
  129. data/vendor/assets/stylesheets/twbs/bootstrap/print.less +100 -0
  130. data/vendor/assets/stylesheets/twbs/bootstrap/progress-bars.less +96 -0
  131. data/vendor/assets/stylesheets/twbs/bootstrap/responsive-utilities.less +209 -0
  132. data/vendor/assets/stylesheets/twbs/bootstrap/scaffolding.less +119 -0
  133. data/vendor/assets/stylesheets/twbs/bootstrap/tables.less +236 -0
  134. data/vendor/assets/stylesheets/twbs/bootstrap/theme.less +246 -0
  135. data/vendor/assets/stylesheets/twbs/bootstrap/thumbnails.less +33 -0
  136. data/vendor/assets/stylesheets/twbs/bootstrap/tooltip.less +95 -0
  137. data/vendor/assets/stylesheets/twbs/bootstrap/type.less +273 -0
  138. data/vendor/assets/stylesheets/twbs/bootstrap/utilities.less +56 -0
  139. data/vendor/assets/stylesheets/twbs/bootstrap/variables.less +637 -0
  140. data/vendor/assets/stylesheets/twbs/bootstrap/wells.less +29 -0
  141. data/vendor/assets/stylesheets/twbs/bootstrap.less +1 -0
  142. metadata +387 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 20d309dd6a723226a51653517d730775b44d03a0
4
+ data.tar.gz: bbf02e76b62787339ad131c6b1be8c1c0eecf335
5
+ SHA512:
6
+ metadata.gz: a6b8b7dc1391ea833c7c6898765bb90e1e443f1b4e7345f2b44069f6c2691ee028fb57a057fa55431a4e9d5e06d32075153189b6dd989e550152d8fe253dbb8d
7
+ data.tar.gz: f36cda1f42f9696da7c3ae9bc7210dc236322756726ff6b5a78d299a99785cfc828d3180087d6d65147ff077fa7110f9893c506e1fee8a605d9cf27a2cb06fb3
data/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ Changelog
2
+ =========
3
+
4
+ 1.0.2
5
+ -----
6
+ * Minor fixes
7
+
8
+ 1.0.0
9
+ -----
10
+ * Bootstrap 3.0 @ [32468b087b](https://github.com/twbs/bootstrap/commit/32468b087b615d1ed710f9118ff4f669cc5ad5e8)
11
+ * Fontawesome 3.2.1 @ [906345058f](https://github.com/FortAwesome/Font-Awesome/commit/906345058f738c2b931f89754a319ed108e17bd8)
12
+ * Respond.js 1.3.0 @ [ad87635f83](https://github.com/scottjehl/Respond/commit/ad87635f83f8b811e1da53c082325a4b35960771)
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,45 @@
1
+ # Contributing to Bootstrap
2
+
3
+ Looking to contribute something to Twbs Less Rails? **Here's how you can help.**
4
+
5
+
6
+
7
+ ## Reporting issues
8
+
9
+ We only accept issues that are bug reports or feature requests. Bugs must be isolated and reproducible problems that we can fix within the Twbs Less Rails core. Please read the following guidelines before opening any issue.
10
+
11
+ 1. **Search for existing issues.**
12
+ 2. **Create an isolated and reproducible test case.**
13
+ 3. **Include a live example if possible.**
14
+ 4. **Share as much information as possible.** Include at least Rails version and gem version. Also include steps to reproduce the bug.
15
+
16
+
17
+
18
+ ## Key branches
19
+
20
+ - `master` is the latest, deployed version. **Never pull against this branch.**
21
+ - `develop` is the official development branch for the next release.
22
+
23
+ Take a look at [git-flow, A successful Git branching model](http://nvie.com/posts/a-successful-git-branching-model/)
24
+
25
+
26
+
27
+ ## Pull requests
28
+
29
+ - Try to submit pull requests against the `develop` branch for easier merging
30
+ - Try not to pollute your pull request with unintended changes--keep them simple and small
31
+ - **Test. Code coverage should never go below 100%.** If you find a bug, write at first a failing test case and then fix it.
32
+
33
+
34
+
35
+ ## Coding standards
36
+
37
+ ### Ruby
38
+
39
+ - [Ruby Styleguide](https://github.com/styleguide/ruby)
40
+
41
+
42
+
43
+ ## License
44
+
45
+ By contributing your code, you agree to license your contribution under the terms of the [BSD 2-Clause License](LICENSE)
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,144 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ twbs_less_rails (1.0.0)
5
+ less-rails
6
+ rails (>= 3.2.15)
7
+ therubyracer
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ actionmailer (4.0.0)
13
+ actionpack (= 4.0.0)
14
+ mail (~> 2.5.3)
15
+ actionpack (4.0.0)
16
+ activesupport (= 4.0.0)
17
+ builder (~> 3.1.0)
18
+ erubis (~> 2.7.0)
19
+ rack (~> 1.5.2)
20
+ rack-test (~> 0.6.2)
21
+ activemodel (4.0.0)
22
+ activesupport (= 4.0.0)
23
+ builder (~> 3.1.0)
24
+ activerecord (4.0.0)
25
+ activemodel (= 4.0.0)
26
+ activerecord-deprecated_finders (~> 1.0.2)
27
+ activesupport (= 4.0.0)
28
+ arel (~> 4.0.0)
29
+ activerecord-deprecated_finders (1.0.3)
30
+ activesupport (4.0.0)
31
+ i18n (~> 0.6, >= 0.6.4)
32
+ minitest (~> 4.2)
33
+ multi_json (~> 1.3)
34
+ thread_safe (~> 0.1)
35
+ tzinfo (~> 0.3.37)
36
+ ansi (1.4.3)
37
+ arel (4.0.0)
38
+ atomic (1.1.14)
39
+ builder (3.1.4)
40
+ capybara (2.1.0)
41
+ mime-types (>= 1.16)
42
+ nokogiri (>= 1.3.3)
43
+ rack (>= 1.0.0)
44
+ rack-test (>= 0.5.4)
45
+ xpath (~> 2.0)
46
+ columnize (0.3.6)
47
+ commonjs (0.2.7)
48
+ coveralls (0.7.0)
49
+ multi_json (~> 1.3)
50
+ rest-client
51
+ simplecov (>= 0.7)
52
+ term-ansicolor
53
+ thor
54
+ debugger (1.6.2)
55
+ columnize (>= 0.3.1)
56
+ debugger-linecache (~> 1.2.0)
57
+ debugger-ruby_core_source (~> 1.2.3)
58
+ debugger-linecache (1.2.0)
59
+ debugger-ruby_core_source (1.2.3)
60
+ erubis (2.7.0)
61
+ hike (1.2.3)
62
+ i18n (0.6.5)
63
+ less (2.4.0)
64
+ commonjs (~> 0.2.7)
65
+ less-rails (2.4.2)
66
+ actionpack (>= 3.1)
67
+ less (~> 2.4.0)
68
+ libv8 (3.16.14.3)
69
+ mail (2.5.4)
70
+ mime-types (~> 1.16)
71
+ treetop (~> 1.4.8)
72
+ mime-types (1.25)
73
+ mini_portile (0.5.1)
74
+ minitest (4.7.5)
75
+ multi_json (1.8.2)
76
+ nokogiri (1.6.0)
77
+ mini_portile (~> 0.5.0)
78
+ polyglot (0.3.3)
79
+ rack (1.5.2)
80
+ rack-test (0.6.2)
81
+ rack (>= 1.0)
82
+ rails (4.0.0)
83
+ actionmailer (= 4.0.0)
84
+ actionpack (= 4.0.0)
85
+ activerecord (= 4.0.0)
86
+ activesupport (= 4.0.0)
87
+ bundler (>= 1.3.0, < 2.0)
88
+ railties (= 4.0.0)
89
+ sprockets-rails (~> 2.0.0)
90
+ railties (4.0.0)
91
+ actionpack (= 4.0.0)
92
+ activesupport (= 4.0.0)
93
+ rake (>= 0.8.7)
94
+ thor (>= 0.18.1, < 2.0)
95
+ rake (10.1.0)
96
+ ref (1.0.5)
97
+ rest-client (1.6.7)
98
+ mime-types (>= 1.16)
99
+ simplecov (0.7.1)
100
+ multi_json (~> 1.0)
101
+ simplecov-html (~> 0.7.1)
102
+ simplecov-html (0.7.1)
103
+ sprockets (2.10.0)
104
+ hike (~> 1.2)
105
+ multi_json (~> 1.0)
106
+ rack (~> 1.0)
107
+ tilt (~> 1.1, != 1.3.0)
108
+ sprockets-rails (2.0.1)
109
+ actionpack (>= 3.0)
110
+ activesupport (>= 3.0)
111
+ sprockets (~> 2.8)
112
+ sqlite3 (1.3.8)
113
+ term-ansicolor (1.2.2)
114
+ tins (~> 0.8)
115
+ therubyracer (0.12.0)
116
+ libv8 (~> 3.16.14.0)
117
+ ref
118
+ thor (0.18.1)
119
+ thread_safe (0.1.3)
120
+ atomic
121
+ tilt (1.4.1)
122
+ tins (0.12.0)
123
+ treetop (1.4.15)
124
+ polyglot
125
+ polyglot (>= 0.3.1)
126
+ turn (0.9.6)
127
+ ansi
128
+ tzinfo (0.3.38)
129
+ xpath (2.0.0)
130
+ nokogiri (~> 1.3)
131
+
132
+ PLATFORMS
133
+ ruby
134
+
135
+ DEPENDENCIES
136
+ capybara
137
+ coveralls
138
+ debugger
139
+ minitest (~> 4)
140
+ rake
141
+ simplecov
142
+ sqlite3
143
+ turn
144
+ twbs_less_rails!
data/LICENSE ADDED
@@ -0,0 +1,30 @@
1
+ Copyright (c) 2013, diowa
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice, this
8
+ list of conditions and the following disclaimer.
9
+ 2. Redistributions in binary form must reproduce the above copyright notice,
10
+ this list of conditions and the following disclaimer in the documentation
11
+ and/or other materials provided with the distribution.
12
+
13
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
17
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+
24
+ Twitter Bootstrap is licensed under the Apache License, Version 2.0
25
+
26
+ Font Awesome is licensed under the MIT License
27
+
28
+ Font Awesome font is licensed under the SIL Open Font License
29
+
30
+ Font Awesome pictograms are licensed under the CC BY 3.0 License
data/README.md ADDED
@@ -0,0 +1,147 @@
1
+ # Twbs Less Rails
2
+ [![Gem Version](https://badge.fury.io/rb/twbs_less_rails.png)](http://badge.fury.io/rb/twbs_less_rails)
3
+ [![Build Status](https://secure.travis-ci.org/diowa/twbs_less_rails.png?branch=master)](https://travis-ci.org/diowa/twbs_less_rails)
4
+ [![Dependency Status](https://gemnasium.com/diowa/twbs_less_rails.png)](https://gemnasium.com/diowa/twbs_less_rails)
5
+ [![Code Climate](https://codeclimate.com/github/diowa/twbs_less_rails.png)](https://codeclimate.com/github/diowa/twbs_less_rails)
6
+ [![Coverage Status](https://coveralls.io/repos/diowa/twbs_less_rails/badge.png?branch=master)](https://coveralls.io/r/diowa/twbs_less_rails)
7
+
8
+ Brings [Bootstrap](http://getbootstrap.com/) and [Font Awesome](http://fontawesome.io) assets into your Rails application.
9
+
10
+
11
+
12
+ ## Quick start
13
+
14
+ Add the gem to your Gemfile
15
+ ```rb
16
+ gem 'twbs_less_rails'
17
+ ```
18
+
19
+ Run the generator
20
+ ```bash
21
+ $ rails g twbs_less_rails:install
22
+ ```
23
+
24
+
25
+
26
+ ## Customization
27
+
28
+ ### Variables
29
+ Use `twbs-variables.css.less` to override Bootstrap defaults:
30
+ ```css
31
+ /* New variables */
32
+ @flat-ui-emerald: #2ecc71;
33
+ @flat-ui-nephritis: #27ae60;
34
+
35
+ @flat-ui-peter-river: #3498db;
36
+ @flat-ui-belize-hole: #2980b9;
37
+
38
+ /* Overrides */
39
+ @brand-primary: @flat-ui-belize-hole;
40
+ @brand-success: @flat-ui-nephritis;
41
+ ```
42
+ **NOTE**: Remember to import `twbs-variables.css.less` instead of `twbs/bootstrap/variables` in any new LESS file.
43
+
44
+ ### Glyphs
45
+ Twbs Less Rails comes with Glyphicons and Fontawesome, both disabled by default. Edit your `twbs.css.less` to enable them.
46
+
47
+ Use Glyphicons:
48
+ ```css
49
+ @import "twbs/bootstrap/glyphicons";
50
+ //@import "fontawesome/font-awesome";
51
+ ```
52
+
53
+ Use FontAwesome:
54
+ ```css
55
+ //@import "twbs/bootstrap/glyphicons";
56
+ @import "fontawesome/font-awesome";
57
+ ```
58
+
59
+ ### Bootstrap theme
60
+ If you want to use the [Bootstrap theme](http://getbootstrap.com/examples/theme/), uncomment `//@import "twbs/bootstrap/theme"` in your `twbs.css.less`.
61
+
62
+ ### Customize LESS components
63
+ If you want to exclude some LESS components, remove `@import "twbs/bootstrap";` from your `twbs.css.less` and add the components you need, e.g.:
64
+ ```css
65
+ // Core variables and mixins
66
+ @import "twbs/bootstrap/variables";
67
+ @import "twbs/bootstrap/mixins";
68
+
69
+ // Reset
70
+ @import "twbs/bootstrap/normalize";
71
+ @import "twbs/bootstrap/print";
72
+ /* ... */
73
+ ```
74
+ Take a look at [the whole list of LESS components](/vendor/assets/stylesheets/twbs/bootstrap/bootstrap.less). **Respect the order of the files and remember to edit paths**.
75
+
76
+ ### Customize Javascript components
77
+ If you want to exclude some Javascript components, remove `//= require twbs/bootstrap` from `twbs.js.coffee` and add the components you need, e.g:
78
+ ```js
79
+ /* ... */
80
+ //= require jquery_ujs
81
+ //= require twbs/bootstrap/transition
82
+ //= require twbs/bootstrap/alert
83
+ //= require twbs/bootstrap/button
84
+ //= require turbolinks
85
+ /* ... */
86
+ ```
87
+ Take a look at [the whole list of Javascript components](/vendor/assets/javascripts/twbs/bootstrap.js). **Respect the order of the files and remember to edit paths**.
88
+
89
+
90
+
91
+ ## Testing
92
+
93
+ To launch the tests against Rails 4, run from the root folder of the repository:
94
+ ```bash
95
+ BUNDLE_GEMFILE=$PWD/gemfiles/Gemfile.rails-4.0.x rake
96
+ ```
97
+
98
+ For Rails 3.2 run instead:
99
+ ```bash
100
+ BUNDLE_GEMFILE=$PWD/gemfiles/Gemfile.rails-3.2.x rake
101
+ ```
102
+
103
+
104
+
105
+ ## Versioning
106
+
107
+ For transparency and insight into our release cycle, and for striving to maintain backward compatibility, Twbs Less Rails will be maintained under the Semantic Versioning guidelines as much as possible. Twbs Less Rails will not follow Bootstrap's version number.
108
+
109
+ Releases will be numbered with the following format:
110
+
111
+ `<major>.<minor>.<patch>`
112
+
113
+ And constructed with the following guidelines:
114
+
115
+ * Breaking backward compatibility bumps the major (and resets the minor and patch)
116
+ * New additions without breaking backward compatibility bumps the minor (and resets the patch)
117
+ * Bug fixes and misc changes bumps the patch
118
+
119
+ For more information on SemVer, please visit [http://semver.org/](http://semver.org/).
120
+
121
+
122
+
123
+ ## Authors
124
+
125
+ **Geremia Taglialatela**
126
+
127
+ + http://github.com/tagliala
128
+ + http://twitter.com/gtagliala
129
+
130
+ **Cesidio Di Landa**
131
+
132
+ + http://github.com/cesidio
133
+ + http://twitter.com/cesid
134
+
135
+
136
+
137
+ ## Copyright and license
138
+
139
+ Copyright 2013 diowa under [the BSD 2-Clause license](LICENSE).
140
+
141
+ Twitter Bootstrap is licensed under the Apache License, Version 2.0
142
+
143
+ Font Awesome is licensed under the MIT License
144
+
145
+ Font Awesome font is licensed under the SIL Open Font License
146
+
147
+ Font Awesome pictograms are licensed under the CC BY 3.0 License
data/Rakefile ADDED
@@ -0,0 +1,113 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'TwbsLessRails'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ Bundler::GemHelper.install_tasks
18
+
19
+ require 'rake/testtask'
20
+
21
+ Rake::TestTask.new(:test) do |t|
22
+ t.libs << 'lib'
23
+ t.libs << 'test'
24
+ t.pattern = 'test/**/*_test.rb'
25
+ t.verbose = false
26
+ end
27
+
28
+ task default: :test
29
+
30
+ SOURCE_FILES = {
31
+ bootstrap_stylesheets: File.expand_path('src/twbs/bootstrap/less/*.less'),
32
+ bootstrap_javascripts: File.expand_path('src/twbs/bootstrap/js/*.js'),
33
+ fontawesome_stylesheets: File.expand_path('src/FortAwesome/Font-Awesome/less/*.less'),
34
+ glyphicons_fonts: File.expand_path('src/twbs/bootstrap/fonts/glyphicons-halflings-regular.*'),
35
+ fontawesome_fonts: File.expand_path('src/FortAwesome/Font-Awesome/font/fontawesome-webfont.*'),
36
+ }
37
+
38
+ DESTINATION_FOLDERS = {
39
+ bootstrap_stylesheets: File.expand_path('vendor/assets/stylesheets/twbs/bootstrap'),
40
+ bootstrap_javascripts: File.expand_path('vendor/assets/javascripts/twbs/bootstrap'),
41
+ fontawesome_stylesheets: File.expand_path('vendor/assets/stylesheets/fontawesome'),
42
+ glyphicons_fonts: File.expand_path('app/assets/fonts'),
43
+ fontawesome_fonts: File.expand_path('app/assets/fonts'),
44
+ }
45
+
46
+ desc "Update assets"
47
+ task :update_assets do
48
+ # git submodule add https://github.com/FortAwesome/Font-Awesome.git src/FortAwesome/Font-Awesome/
49
+ # git submodule add https://github.com/scottjehl/Respond.git src/scottjehl/Respond
50
+ # git submodule add https://github.com/twbs/bootstrap.git src/twbs/bootstrap
51
+
52
+ puts 'Updating submodules...'
53
+ `git submodule update --init`
54
+ `git submodule foreach git pull origin master`
55
+
56
+ puts 'Preparing destination folders...'
57
+ remove_content_from_destination_folders
58
+
59
+ puts 'Copying new assets...'
60
+ copy_source_files_to_destination_folders
61
+
62
+ puts 'Removing unneeded assets...'
63
+ # TODO remove when FA 4.0.0 will be released
64
+ FileUtils.rm_rf "#{DESTINATION_FOLDERS[:fontawesome_stylesheets]}/font-awesome-ie7.less"
65
+
66
+ puts 'Adding respond.js...'
67
+ FileUtils.cp File.expand_path('src/scottjehl/Respond/respond.src.js'), File.expand_path('vendor/assets/javascripts/respond.js')
68
+
69
+ puts 'Updating font paths...'
70
+ update_fontawesome_paths
71
+ update_glyphicons_paths
72
+
73
+ puts 'Disabling glyphicons...'
74
+ disable_glyphicons
75
+
76
+ puts 'Done. RUN TESTS NOW!'
77
+ end
78
+
79
+ def remove_content_from_destination_folders
80
+ DESTINATION_FOLDERS.each do |_, v|
81
+ FileUtils.rm_rf Dir.glob("#{v}/*")
82
+ end
83
+ end
84
+
85
+ def copy_source_files_to_destination_folders
86
+ SOURCE_FILES.each do |k, v|
87
+ FileUtils.cp Dir.glob(v), DESTINATION_FOLDERS[k]
88
+ end
89
+ end
90
+
91
+ def update_fontawesome_paths
92
+ file_name = "#{DESTINATION_FOLDERS[:fontawesome_stylesheets]}/path.less"
93
+ text = File.read(file_name)
94
+ text.gsub! /url\(\'@{FontAwesomePath}\/([\w\-.#]+)[^\)]*\)/, "asset-url('\\1')"
95
+ text.gsub! "fontawesome-webfont.eot') format('embedded-opentype')", "fontawesome-webfont.eot?\#iefix') format('embedded-opentype')"
96
+ text.gsub! "// src: asset-url('FontAwesome.otf') format('opentype'); // used when developing fonts", ''
97
+ File.open(file_name, 'w') { |file| file.puts text }
98
+ end
99
+
100
+ def update_glyphicons_paths
101
+ icon_font_name = File.read("#{DESTINATION_FOLDERS[:bootstrap_stylesheets]}/variables.less").match(/@icon\-font\-name:\s+"([^\"]+)"/)[1]
102
+ file_name = "#{DESTINATION_FOLDERS[:bootstrap_stylesheets]}/glyphicons.less"
103
+ text = File.read(file_name)
104
+ text.gsub! /url\(\'@{icon-font-path}@{icon-font-name}/, "asset-url('#{icon_font_name}"
105
+ File.open(file_name, 'w') { |file| file.puts text }
106
+ end
107
+
108
+ def disable_glyphicons
109
+ file_name = "#{DESTINATION_FOLDERS[:bootstrap_stylesheets]}/bootstrap.less"
110
+ text = File.read(file_name)
111
+ text.gsub! "@import \"glyphicons.less\";\n", ''
112
+ File.open(file_name, 'w') { |file| file.puts text }
113
+ end