twbs_sass_rails 3.7.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/LICENSE +1 -1
  4. data/README.md +1 -1
  5. data/lib/generators/twbs_sass_rails/install/install_generator.rb +5 -3
  6. data/lib/generators/twbs_sass_rails/install/templates/application.css +5 -3
  7. data/lib/generators/twbs_sass_rails/install/templates/application.js +1 -1
  8. data/lib/twbs_sass_rails.rb +2 -2
  9. data/lib/twbs_sass_rails/engine.rb +1 -1
  10. data/lib/twbs_sass_rails/version.rb +1 -1
  11. metadata +37 -128
  12. data/Appraisals +0 -11
  13. data/CONTRIBUTING.md +0 -45
  14. data/Gemfile +0 -3
  15. data/Rakefile +0 -151
  16. data/gemfiles/rails_4.0.gemfile +0 -7
  17. data/gemfiles/rails_4.1.gemfile +0 -7
  18. data/gemfiles/rails_4.2.gemfile +0 -7
  19. data/lib/tasks/twbs_sass_rails_tasks.rake +0 -4
  20. data/test/dummy/README.rdoc +0 -28
  21. data/test/dummy/Rakefile +0 -6
  22. data/test/dummy/app/assets/images/.keep +0 -0
  23. data/test/dummy/app/assets/javascripts/application.js +0 -14
  24. data/test/dummy/app/assets/stylesheets/application.css +0 -15
  25. data/test/dummy/app/assets/stylesheets/default-twbs.scss +0 -1
  26. data/test/dummy/app/assets/stylesheets/subfolder/subfolder.scss +0 -6
  27. data/test/dummy/app/assets/stylesheets/test.scss +0 -13
  28. data/test/dummy/app/assets/stylesheets/twbs-variables.scss +0 -7
  29. data/test/dummy/app/assets/stylesheets/twbs.scss +0 -20
  30. data/test/dummy/app/controllers/application_controller.rb +0 -5
  31. data/test/dummy/app/controllers/concerns/.keep +0 -0
  32. data/test/dummy/app/helpers/application_helper.rb +0 -2
  33. data/test/dummy/app/mailers/.keep +0 -0
  34. data/test/dummy/app/models/.keep +0 -0
  35. data/test/dummy/app/models/concerns/.keep +0 -0
  36. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  37. data/test/dummy/bin/bundle +0 -3
  38. data/test/dummy/bin/rails +0 -4
  39. data/test/dummy/bin/rake +0 -4
  40. data/test/dummy/config.ru +0 -4
  41. data/test/dummy/config/application.rb +0 -25
  42. data/test/dummy/config/boot.rb +0 -5
  43. data/test/dummy/config/environment.rb +0 -5
  44. data/test/dummy/config/environments/development.rb +0 -29
  45. data/test/dummy/config/environments/production.rb +0 -84
  46. data/test/dummy/config/environments/test.rb +0 -43
  47. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  48. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  49. data/test/dummy/config/initializers/inflections.rb +0 -16
  50. data/test/dummy/config/initializers/mime_types.rb +0 -5
  51. data/test/dummy/config/initializers/secret_token.rb +0 -13
  52. data/test/dummy/config/initializers/session_store.rb +0 -3
  53. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  54. data/test/dummy/config/locales/en.yml +0 -23
  55. data/test/dummy/config/routes.rb +0 -56
  56. data/test/dummy/lib/assets/.keep +0 -0
  57. data/test/dummy/log/.keep +0 -0
  58. data/test/dummy/public/404.html +0 -58
  59. data/test/dummy/public/422.html +0 -58
  60. data/test/dummy/public/500.html +0 -57
  61. data/test/dummy/public/favicon.ico +0 -0
  62. data/test/generators/default_rails_assets/application.css +0 -13
  63. data/test/generators/default_rails_assets/application.js +0 -16
  64. data/test/generators/install_generator_test.rb +0 -47
  65. data/test/integration/assets_precompile_integration_test.rb +0 -57
  66. data/test/integration/twbs_sass_rails_integration_test.rb +0 -40
  67. data/test/test_helper.rb +0 -37
  68. data/twbs_sass_rails.gemspec +0 -33
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f40ae4232ea03651d08451a8976941f0742f0503
4
- data.tar.gz: bd2cca2d775366a014e2008d877438a1b7403cc0
3
+ metadata.gz: 7b562cf724719e5f819fa9a139470d9bf1bf8e51
4
+ data.tar.gz: fbac2e8226aae1a87ddc534a39f98fb3c4352c6a
5
5
  SHA512:
6
- metadata.gz: 2379137fa09e9093ffd18daa0d93180dbb684379afca8d65cebc331a0a3827c736fddc21d1e1df3644284bdb4dd10b7d2ed5188615a313553496704d24be74e5
7
- data.tar.gz: d72f82326b5ffe1c4b5abe069c5f7bd69dcee2ea50aea957ddd547a4fd9ee30d734c5577d7c549d1470e34711ec9791f770677660f2ba8213b369b251ae6b8cb
6
+ metadata.gz: 51e681ed6f7be19b59b17f6e5f6f9b930aec1d01e11a4c3c0af07001d0f0f252798664dfd82d40b6c28512bfb0f3c5bea5a7977bfce6bfe16c31ab7ac8099352
7
+ data.tar.gz: 9cec13652cd669936f48ad1b16af86faea66d4b580d48fcaea83add92021e7d8629e36c3a7e65edac4acf13ba9c74e4c12ee83decb24e45f4953acca40eadaa8
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.0
4
+
5
+ * Drop Ruby 1.9 support (Autoprefixer)
6
+ * Add rubocop
7
+ * Improve gemspec
8
+ * Update license
9
+ * Update development gems
10
+
3
11
  ## 3.7.0
4
12
 
5
13
  * bootstrap-sass 3.3.6
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015, diowa
1
+ Copyright (c) 2016, diowa
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
data/README.md CHANGED
@@ -166,7 +166,7 @@ For more information on SemVer, please visit [http://semver.org/](http://semver.
166
166
 
167
167
  ## Copyright and license
168
168
 
169
- Copyright 2015 diowa under [the BSD 2-Clause license](LICENSE).
169
+ Copyright 2016 diowa under [the BSD 2-Clause license](LICENSE).
170
170
 
171
171
  bootstrap-sass is licensed under the MIT License
172
172
 
@@ -1,18 +1,20 @@
1
1
  module TwbsSassRails
2
2
  module Generators
3
3
  class InstallGenerator < ::Rails::Generators::Base
4
-
5
4
  source_root File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
6
- desc "This generator installs Bootstrap to Asset Pipeline"
7
5
 
8
- def copy_assets
6
+ desc 'This generator installs Bootstrap to Asset Pipeline'
7
+
8
+ def copy_js_assets
9
9
  js_manifest = 'app/assets/javascripts/application.js'
10
10
  if File.exist?(File.join(destination_root, js_manifest))
11
11
  insert_into_file js_manifest, "//= require twbs/bootstrap\n", after: "jquery_ujs\n"
12
12
  else
13
13
  copy_file 'application.js', js_manifest
14
14
  end
15
+ end
15
16
 
17
+ def copy_css_assets
16
18
  css_manifest = 'app/assets/stylesheets/application.css'
17
19
  if File.exist?(File.join(destination_root, css_manifest))
18
20
  insert_into_file css_manifest, " *= stub twbs-variables\n *= require twbs\n", before: " *= require_tree .\n"
@@ -5,11 +5,13 @@
5
5
  * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
6
  * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
7
  *
8
- * You're free to add application-wide styles to this file and they'll appear at the top of the
9
- * compiled file, but it's generally better to create a new file per style scope.
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
10
12
  *
11
- *= require_self
12
13
  *= stub twbs-variables
13
14
  *= require twbs
14
15
  *= require_tree .
16
+ *= require_self
15
17
  */
@@ -7,7 +7,7 @@
7
7
  // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
8
  // compiled file.
9
9
  //
10
- // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
11
  // about supported directives.
12
12
  //
13
13
  //= require jquery
@@ -1,3 +1,3 @@
1
- require "sass"
1
+ require 'sass'
2
2
  ::Sass::Script::Number.precision = [10, ::Sass::Script::Number.precision].max
3
- require "twbs_sass_rails/engine"
3
+ require 'twbs_sass_rails/engine'
@@ -2,7 +2,7 @@ require 'sass-rails'
2
2
 
3
3
  module TwbsSassRails
4
4
  class Engine < ::Rails::Engine
5
- initializer "TwbsSassRails precompile hook", group: :all do |app|
5
+ initializer 'TwbsSassRails precompile hook', group: :all do |app|
6
6
  app.config.assets.precompile += %w(respond.js)
7
7
  end
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module TwbsSassRails
2
- VERSION = "3.7.0"
2
+ VERSION = '4.0.0'
3
3
  end
metadata CHANGED
@@ -1,35 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twbs_sass_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - diowa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-26 00:00:00.000000000 Z
11
+ date: 2015-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
14
+ name: autoprefixer-rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: 4.0.13
20
- - - "<"
17
+ - - "~>"
21
18
  - !ruby/object:Gem::Version
22
- version: 5.0.0
19
+ version: '6.2'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: 4.0.13
30
- - - "<"
24
+ - - "~>"
31
25
  - !ruby/object:Gem::Version
32
- version: 5.0.0
26
+ version: '6.2'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: sass-rails
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -51,19 +45,25 @@ dependencies:
51
45
  - !ruby/object:Gem::Version
52
46
  version: 6.0.0
53
47
  - !ruby/object:Gem::Dependency
54
- name: autoprefixer-rails
48
+ name: rails
55
49
  requirement: !ruby/object:Gem::Requirement
56
50
  requirements:
57
- - - "~>"
51
+ - - ">="
58
52
  - !ruby/object:Gem::Version
59
- version: '6.1'
53
+ version: 4.0.13
54
+ - - "<"
55
+ - !ruby/object:Gem::Version
56
+ version: 5.0.0
60
57
  type: :runtime
61
58
  prerelease: false
62
59
  version_requirements: !ruby/object:Gem::Requirement
63
60
  requirements:
64
- - - "~>"
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: 4.0.13
64
+ - - "<"
65
65
  - !ruby/object:Gem::Version
66
- version: '6.1'
66
+ version: 5.0.0
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: appraisal
69
69
  requirement: !ruby/object:Gem::Requirement
@@ -98,14 +98,14 @@ dependencies:
98
98
  requirements:
99
99
  - - "~>"
100
100
  - !ruby/object:Gem::Version
101
- version: 0.8.9
101
+ version: 0.8.10
102
102
  type: :development
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
106
  - - "~>"
107
107
  - !ruby/object:Gem::Version
108
- version: 0.8.9
108
+ version: 0.8.10
109
109
  - !ruby/object:Gem::Dependency
110
110
  name: minitest
111
111
  requirement: !ruby/object:Gem::Requirement
@@ -140,20 +140,34 @@ dependencies:
140
140
  - - "~>"
141
141
  - !ruby/object:Gem::Version
142
142
  version: '10.4'
143
+ - !ruby/object:Gem::Dependency
144
+ name: rubocop
145
+ requirement: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - "~>"
148
+ - !ruby/object:Gem::Version
149
+ version: '0.35'
150
+ type: :development
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ requirements:
154
+ - - "~>"
155
+ - !ruby/object:Gem::Version
156
+ version: '0.35'
143
157
  - !ruby/object:Gem::Dependency
144
158
  name: simplecov
145
159
  requirement: !ruby/object:Gem::Requirement
146
160
  requirements:
147
161
  - - "~>"
148
162
  - !ruby/object:Gem::Version
149
- version: 0.10.0
163
+ version: 0.11.1
150
164
  type: :development
151
165
  prerelease: false
152
166
  version_requirements: !ruby/object:Gem::Requirement
153
167
  requirements:
154
168
  - - "~>"
155
169
  - !ruby/object:Gem::Version
156
- version: 0.10.0
170
+ version: 0.11.1
157
171
  - !ruby/object:Gem::Dependency
158
172
  name: uglifier
159
173
  requirement: !ruby/object:Gem::Requirement
@@ -175,13 +189,9 @@ executables: []
175
189
  extensions: []
176
190
  extra_rdoc_files: []
177
191
  files:
178
- - Appraisals
179
192
  - CHANGELOG.md
180
- - CONTRIBUTING.md
181
- - Gemfile
182
193
  - LICENSE
183
194
  - README.md
184
- - Rakefile
185
195
  - app/assets/fonts/fontawesome-webfont.eot
186
196
  - app/assets/fonts/fontawesome-webfont.svg
187
197
  - app/assets/fonts/fontawesome-webfont.ttf
@@ -192,68 +202,15 @@ files:
192
202
  - app/assets/fonts/glyphicons-halflings-regular.ttf
193
203
  - app/assets/fonts/glyphicons-halflings-regular.woff
194
204
  - app/assets/fonts/glyphicons-halflings-regular.woff2
195
- - gemfiles/rails_4.0.gemfile
196
- - gemfiles/rails_4.1.gemfile
197
- - gemfiles/rails_4.2.gemfile
198
205
  - lib/generators/twbs_sass_rails/install/install_generator.rb
199
206
  - lib/generators/twbs_sass_rails/install/templates/application.css
200
207
  - lib/generators/twbs_sass_rails/install/templates/application.js
201
208
  - lib/generators/twbs_sass_rails/install/templates/twbs-variables.scss
202
209
  - lib/generators/twbs_sass_rails/install/templates/twbs.js.coffee
203
210
  - lib/generators/twbs_sass_rails/install/templates/twbs.scss
204
- - lib/tasks/twbs_sass_rails_tasks.rake
205
211
  - lib/twbs_sass_rails.rb
206
212
  - lib/twbs_sass_rails/engine.rb
207
213
  - lib/twbs_sass_rails/version.rb
208
- - test/dummy/README.rdoc
209
- - test/dummy/Rakefile
210
- - test/dummy/app/assets/images/.keep
211
- - test/dummy/app/assets/javascripts/application.js
212
- - test/dummy/app/assets/stylesheets/application.css
213
- - test/dummy/app/assets/stylesheets/default-twbs.scss
214
- - test/dummy/app/assets/stylesheets/subfolder/subfolder.scss
215
- - test/dummy/app/assets/stylesheets/test.scss
216
- - test/dummy/app/assets/stylesheets/twbs-variables.scss
217
- - test/dummy/app/assets/stylesheets/twbs.scss
218
- - test/dummy/app/controllers/application_controller.rb
219
- - test/dummy/app/controllers/concerns/.keep
220
- - test/dummy/app/helpers/application_helper.rb
221
- - test/dummy/app/mailers/.keep
222
- - test/dummy/app/models/.keep
223
- - test/dummy/app/models/concerns/.keep
224
- - test/dummy/app/views/layouts/application.html.erb
225
- - test/dummy/bin/bundle
226
- - test/dummy/bin/rails
227
- - test/dummy/bin/rake
228
- - test/dummy/config.ru
229
- - test/dummy/config/application.rb
230
- - test/dummy/config/boot.rb
231
- - test/dummy/config/environment.rb
232
- - test/dummy/config/environments/development.rb
233
- - test/dummy/config/environments/production.rb
234
- - test/dummy/config/environments/test.rb
235
- - test/dummy/config/initializers/backtrace_silencers.rb
236
- - test/dummy/config/initializers/filter_parameter_logging.rb
237
- - test/dummy/config/initializers/inflections.rb
238
- - test/dummy/config/initializers/mime_types.rb
239
- - test/dummy/config/initializers/secret_token.rb
240
- - test/dummy/config/initializers/session_store.rb
241
- - test/dummy/config/initializers/wrap_parameters.rb
242
- - test/dummy/config/locales/en.yml
243
- - test/dummy/config/routes.rb
244
- - test/dummy/lib/assets/.keep
245
- - test/dummy/log/.keep
246
- - test/dummy/public/404.html
247
- - test/dummy/public/422.html
248
- - test/dummy/public/500.html
249
- - test/dummy/public/favicon.ico
250
- - test/generators/default_rails_assets/application.css
251
- - test/generators/default_rails_assets/application.js
252
- - test/generators/install_generator_test.rb
253
- - test/integration/assets_precompile_integration_test.rb
254
- - test/integration/twbs_sass_rails_integration_test.rb
255
- - test/test_helper.rb
256
- - twbs_sass_rails.gemspec
257
214
  - vendor/assets/javascripts/respond.js
258
215
  - vendor/assets/javascripts/twbs/bootstrap.js
259
216
  - vendor/assets/javascripts/twbs/bootstrap/affix.js
@@ -376,52 +333,4 @@ rubygems_version: 2.4.5.1
376
333
  signing_key:
377
334
  specification_version: 4
378
335
  summary: Bootstrap and FontAwesome assets in Rails applications
379
- test_files:
380
- - test/dummy/README.rdoc
381
- - test/dummy/Rakefile
382
- - test/dummy/app/assets/images/.keep
383
- - test/dummy/app/assets/javascripts/application.js
384
- - test/dummy/app/assets/stylesheets/application.css
385
- - test/dummy/app/assets/stylesheets/default-twbs.scss
386
- - test/dummy/app/assets/stylesheets/subfolder/subfolder.scss
387
- - test/dummy/app/assets/stylesheets/test.scss
388
- - test/dummy/app/assets/stylesheets/twbs-variables.scss
389
- - test/dummy/app/assets/stylesheets/twbs.scss
390
- - test/dummy/app/controllers/application_controller.rb
391
- - test/dummy/app/controllers/concerns/.keep
392
- - test/dummy/app/helpers/application_helper.rb
393
- - test/dummy/app/mailers/.keep
394
- - test/dummy/app/models/.keep
395
- - test/dummy/app/models/concerns/.keep
396
- - test/dummy/app/views/layouts/application.html.erb
397
- - test/dummy/bin/bundle
398
- - test/dummy/bin/rails
399
- - test/dummy/bin/rake
400
- - test/dummy/config.ru
401
- - test/dummy/config/application.rb
402
- - test/dummy/config/boot.rb
403
- - test/dummy/config/environment.rb
404
- - test/dummy/config/environments/development.rb
405
- - test/dummy/config/environments/production.rb
406
- - test/dummy/config/environments/test.rb
407
- - test/dummy/config/initializers/backtrace_silencers.rb
408
- - test/dummy/config/initializers/filter_parameter_logging.rb
409
- - test/dummy/config/initializers/inflections.rb
410
- - test/dummy/config/initializers/mime_types.rb
411
- - test/dummy/config/initializers/secret_token.rb
412
- - test/dummy/config/initializers/session_store.rb
413
- - test/dummy/config/initializers/wrap_parameters.rb
414
- - test/dummy/config/locales/en.yml
415
- - test/dummy/config/routes.rb
416
- - test/dummy/lib/assets/.keep
417
- - test/dummy/log/.keep
418
- - test/dummy/public/404.html
419
- - test/dummy/public/422.html
420
- - test/dummy/public/500.html
421
- - test/dummy/public/favicon.ico
422
- - test/generators/default_rails_assets/application.css
423
- - test/generators/default_rails_assets/application.js
424
- - test/generators/install_generator_test.rb
425
- - test/integration/assets_precompile_integration_test.rb
426
- - test/integration/twbs_sass_rails_integration_test.rb
427
- - test/test_helper.rb
336
+ test_files: []
data/Appraisals DELETED
@@ -1,11 +0,0 @@
1
- appraise 'rails-4.0' do
2
- gem 'rails', '~> 4.0.13'
3
- end
4
-
5
- appraise 'rails-4.1' do
6
- gem 'rails', '~> 4.1.14'
7
- end
8
-
9
- appraise 'rails-4.2' do
10
- gem 'rails', '~> 4.2.5'
11
- end
@@ -1,45 +0,0 @@
1
- # Contributing to Twbs Sass Rails
2
-
3
- Looking to contribute something to Twbs Sass 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 Sass 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 make pull requests 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 DELETED
@@ -1,3 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec
data/Rakefile DELETED
@@ -1,151 +0,0 @@
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 = 'TwbsSassRails'
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
- SUBMODULES = {
31
- :'bootstrap-sass' => {
32
- name: 'Bootstrap Sass',
33
- sample_version: 'v3.1.0',
34
- folder: File.expand_path('src/twbs/bootstrap-sass')
35
- },
36
- fontawesome: {
37
- name: 'Font Awesome',
38
- sample_version: 'v4.0.3',
39
- folder: File.expand_path('src/FortAwesome/Font-Awesome')
40
- },
41
- respond_js: {
42
- name: 'Respond.js',
43
- sample_version: '1.4.1',
44
- folder: File.expand_path('src/scottjehl/Respond')
45
- }
46
- }
47
-
48
- SOURCE_FILES = {
49
- bootstrap_main_stylesheets: File.expand_path('src/twbs/bootstrap-sass/assets/stylesheets/_bootstrap.scss'),
50
- bootstrap_stylesheets: File.expand_path('src/twbs/bootstrap-sass/assets/stylesheets/bootstrap/*.scss'),
51
- bootstrap_stylesheets_mixins: File.expand_path('src/twbs/bootstrap-sass/assets/stylesheets/bootstrap/mixins/*.scss'),
52
- bootstrap_javascripts: File.expand_path('src/twbs/bootstrap-sass/assets/javascripts/bootstrap/*.js'),
53
- fontawesome_fonts: File.expand_path('src/FortAwesome/Font-Awesome/fonts/fontawesome-webfont.*'),
54
- fontawesome_stylesheets: File.expand_path('src/FortAwesome/Font-Awesome/scss/*.scss'),
55
- glyphicons_fonts: File.expand_path('src/twbs/bootstrap-sass/assets/fonts/bootstrap/glyphicons-halflings-regular.*'),
56
- respondjs_javascripts: File.expand_path('src/scottjehl/Respond/src/respond.js')
57
- }
58
-
59
- DESTINATION_FOLDERS = {
60
- bootstrap_main_stylesheets: File.expand_path('vendor/assets/stylesheets/twbs'),
61
- bootstrap_stylesheets: File.expand_path('vendor/assets/stylesheets/twbs/bootstrap'),
62
- bootstrap_stylesheets_mixins: File.expand_path('vendor/assets/stylesheets/twbs/bootstrap/mixins'),
63
- bootstrap_javascripts: File.expand_path('vendor/assets/javascripts/twbs/bootstrap'),
64
- fontawesome_fonts: File.expand_path('app/assets/fonts'),
65
- fontawesome_stylesheets: File.expand_path('vendor/assets/stylesheets/fontawesome'),
66
- glyphicons_fonts: File.expand_path('app/assets/fonts'),
67
- respondjs_javascripts: File.expand_path('vendor/assets/javascripts')
68
- }
69
-
70
- namespace :update do
71
- SUBMODULES.each do |submodule, v|
72
- desc "Updates #{v[:name]} at specified tag"
73
- task submodule, :tag do |t, args|
74
- if args[:tag]
75
- update_submodule(SUBMODULES[submodule], args[:tag])
76
- else
77
- puts "Please specify a tag, e.g: rake #{t}[#{SUBMODULES[submodule][:sample_version]}]"
78
- end
79
- end
80
- end
81
-
82
- desc "Update assets"
83
- task :assets do
84
- # git submodule add https://github.com/FortAwesome/Font-Awesome.git src/FortAwesome/Font-Awesome/
85
- # git submodule add https://github.com/scottjehl/Respond.git src/scottjehl/Respond
86
- # git submodule add https://github.com/twbs/bootstrap-sass.git src/twbs/bootstrap-sass
87
-
88
- puts 'Preparing destination folders...'
89
- remove_content_from_destination_folders
90
-
91
- puts 'Copying new assets...'
92
- copy_source_files_to_destination_folders
93
-
94
- puts 'Importing bootstrap-sprockets.js'
95
- FileUtils.cp File.expand_path('src/twbs/bootstrap-sass/assets/javascripts/bootstrap-sprockets.js'), File.expand_path('vendor/assets/javascripts/twbs/bootstrap.js')
96
-
97
- puts 'Updating font paths...'
98
- update_fontawesome_paths
99
- update_glyphicons_paths
100
-
101
- puts 'Disabling glyphicons...'
102
- disable_glyphicons
103
-
104
- puts 'Done. RUN TESTS NOW!'
105
- end
106
- end
107
-
108
- private
109
- def update_submodule(submodule, tag)
110
- return unless tag
111
- puts "Updating #{submodule[:name]} at #{tag}..."
112
- `cd #{submodule[:folder]} && git fetch && git fetch --tags && git checkout #{tag}`
113
- end
114
-
115
- def remove_content_from_destination_folders
116
- DESTINATION_FOLDERS.each do |_, v|
117
- FileUtils.rm_rf Dir.glob("#{v}/*")
118
- end
119
- end
120
-
121
- def copy_source_files_to_destination_folders
122
- SOURCE_FILES.each do |k, v|
123
- FileUtils.mkdir_p DESTINATION_FOLDERS[k] unless File.directory?(DESTINATION_FOLDERS[k])
124
- FileUtils.cp Dir.glob(v), DESTINATION_FOLDERS[k]
125
- end
126
- end
127
-
128
- def update_fontawesome_paths
129
- file_name = "#{DESTINATION_FOLDERS[:fontawesome_stylesheets]}/_path.scss"
130
- text = File.read(file_name)
131
- text.gsub! /url\(\'\#{\$fa-font-path}\/([\w\-.#]+)[^\)]*\)/, "font-url('\\1')"
132
- text.gsub! "fontawesome-webfont.eot') format('embedded-opentype')", "fontawesome-webfont.eot?\#iefix') format('embedded-opentype')"
133
- text.gsub! "font-url('fontawesome-webfont.svg') format('svg');", "font-url('fontawesome-webfont.svg#fontawesomeregular') format('svg');"
134
- text.gsub! "// src: font-url('FontAwesome.otf') format('opentype'); // used when developing fonts", ''
135
- File.open(file_name, 'w') { |file| file.puts text }
136
- end
137
-
138
- def update_glyphicons_paths
139
- file_name = "#{DESTINATION_FOLDERS[:bootstrap_stylesheets]}/_glyphicons.scss"
140
- text = File.read(file_name)
141
- text.gsub! /url\(if.*\#\{\$icon-font-name\}\.(.*)\)\)(.*)/, "font-url('\#{$icon-font-name}.\\1)\\2"
142
- text.gsub! /\/\/= depend_on.*\n/, ''
143
- File.open(file_name, 'w') { |file| file.puts text }
144
- end
145
-
146
- def disable_glyphicons
147
- file_name = "#{DESTINATION_FOLDERS[:bootstrap_main_stylesheets]}/_bootstrap.scss"
148
- text = File.read(file_name)
149
- text.gsub! "@import \"bootstrap/glyphicons\";\n", ''
150
- File.open(file_name, 'w') { |file| file.puts text }
151
- end