npm2gem 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +241 -0
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +4 -0
  7. data/CODE_OF_CONDUCT.md +111 -0
  8. data/Gemfile +4 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +102 -0
  11. data/Rakefile +6 -0
  12. data/bin/console +14 -0
  13. data/bin/setup +7 -0
  14. data/exe/npm2gem +8 -0
  15. data/lib/npm2gem/cli.rb +56 -0
  16. data/lib/npm2gem/config.rb +21 -0
  17. data/lib/npm2gem/exception.rb +4 -0
  18. data/lib/npm2gem/file_copier.rb +65 -0
  19. data/lib/npm2gem/gem_version_updater.rb +42 -0
  20. data/lib/npm2gem/npm_install.rb +36 -0
  21. data/lib/npm2gem/version.rb +3 -0
  22. data/lib/npm2gem/version_updaters/base_file_updater.rb +29 -0
  23. data/lib/npm2gem/version_updaters/gemspec_updater.rb +12 -0
  24. data/lib/npm2gem/version_updaters/version_file_updater.rb +18 -0
  25. data/lib/npm2gem.rb +5 -0
  26. data/npm2gem.gemspec +31 -0
  27. data/spec/cli_spec.rb +22 -0
  28. data/spec/config_spec.rb +40 -0
  29. data/spec/dummy/Gemfile +4 -0
  30. data/spec/dummy/README.md +7 -0
  31. data/spec/dummy/Rakefile +6 -0
  32. data/spec/dummy/dummy.gemspec +31 -0
  33. data/spec/dummy/lib/dummy/version.rb +3 -0
  34. data/spec/dummy/lib/dummy.rb +8 -0
  35. data/spec/dummy/node_modules/bootstrap/CHANGELOG.md +5 -0
  36. data/spec/dummy/node_modules/bootstrap/Gruntfile.js +533 -0
  37. data/spec/dummy/node_modules/bootstrap/LICENSE +21 -0
  38. data/spec/dummy/node_modules/bootstrap/README.md +139 -0
  39. data/spec/dummy/node_modules/bootstrap/dist/css/bootstrap-theme.css +587 -0
  40. data/spec/dummy/node_modules/bootstrap/dist/css/bootstrap-theme.css.map +1 -0
  41. data/spec/dummy/node_modules/bootstrap/dist/css/bootstrap-theme.min.css +6 -0
  42. data/spec/dummy/node_modules/bootstrap/dist/css/bootstrap-theme.min.css.map +1 -0
  43. data/spec/dummy/node_modules/bootstrap/dist/css/bootstrap.css +6760 -0
  44. data/spec/dummy/node_modules/bootstrap/dist/css/bootstrap.css.map +1 -0
  45. data/spec/dummy/node_modules/bootstrap/dist/css/bootstrap.min.css +6 -0
  46. data/spec/dummy/node_modules/bootstrap/dist/css/bootstrap.min.css.map +1 -0
  47. data/spec/dummy/node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.eot +0 -0
  48. data/spec/dummy/node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.svg +288 -0
  49. data/spec/dummy/node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
  50. data/spec/dummy/node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.woff +0 -0
  51. data/spec/dummy/node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 +0 -0
  52. data/spec/dummy/node_modules/bootstrap/dist/js/bootstrap.js +2363 -0
  53. data/spec/dummy/node_modules/bootstrap/dist/js/bootstrap.min.js +7 -0
  54. data/spec/dummy/node_modules/bootstrap/dist/js/npm.js +13 -0
  55. data/spec/dummy/node_modules/bootstrap/fonts/glyphicons-halflings-regular.eot +0 -0
  56. data/spec/dummy/node_modules/bootstrap/fonts/glyphicons-halflings-regular.svg +288 -0
  57. data/spec/dummy/node_modules/bootstrap/fonts/glyphicons-halflings-regular.ttf +0 -0
  58. data/spec/dummy/node_modules/bootstrap/fonts/glyphicons-halflings-regular.woff +0 -0
  59. data/spec/dummy/node_modules/bootstrap/fonts/glyphicons-halflings-regular.woff2 +0 -0
  60. data/spec/dummy/node_modules/bootstrap/grunt/bs-commonjs-generator.js +30 -0
  61. data/spec/dummy/node_modules/bootstrap/grunt/bs-glyphicons-data-generator.js +42 -0
  62. data/spec/dummy/node_modules/bootstrap/grunt/bs-lessdoc-parser.js +237 -0
  63. data/spec/dummy/node_modules/bootstrap/grunt/bs-raw-files-generator.js +44 -0
  64. data/spec/dummy/node_modules/bootstrap/grunt/configBridge.json +46 -0
  65. data/spec/dummy/node_modules/bootstrap/grunt/sauce_browsers.yml +82 -0
  66. data/spec/dummy/node_modules/bootstrap/js/affix.js +162 -0
  67. data/spec/dummy/node_modules/bootstrap/js/alert.js +94 -0
  68. data/spec/dummy/node_modules/bootstrap/js/button.js +120 -0
  69. data/spec/dummy/node_modules/bootstrap/js/carousel.js +237 -0
  70. data/spec/dummy/node_modules/bootstrap/js/collapse.js +211 -0
  71. data/spec/dummy/node_modules/bootstrap/js/dropdown.js +165 -0
  72. data/spec/dummy/node_modules/bootstrap/js/modal.js +337 -0
  73. data/spec/dummy/node_modules/bootstrap/js/popover.js +108 -0
  74. data/spec/dummy/node_modules/bootstrap/js/scrollspy.js +172 -0
  75. data/spec/dummy/node_modules/bootstrap/js/tab.js +155 -0
  76. data/spec/dummy/node_modules/bootstrap/js/tooltip.js +514 -0
  77. data/spec/dummy/node_modules/bootstrap/js/transition.js +59 -0
  78. data/spec/dummy/node_modules/bootstrap/less/alerts.less +73 -0
  79. data/spec/dummy/node_modules/bootstrap/less/badges.less +66 -0
  80. data/spec/dummy/node_modules/bootstrap/less/bootstrap.less +56 -0
  81. data/spec/dummy/node_modules/bootstrap/less/breadcrumbs.less +26 -0
  82. data/spec/dummy/node_modules/bootstrap/less/button-groups.less +244 -0
  83. data/spec/dummy/node_modules/bootstrap/less/buttons.less +166 -0
  84. data/spec/dummy/node_modules/bootstrap/less/carousel.less +270 -0
  85. data/spec/dummy/node_modules/bootstrap/less/close.less +34 -0
  86. data/spec/dummy/node_modules/bootstrap/less/code.less +69 -0
  87. data/spec/dummy/node_modules/bootstrap/less/component-animations.less +33 -0
  88. data/spec/dummy/node_modules/bootstrap/less/dropdowns.less +216 -0
  89. data/spec/dummy/node_modules/bootstrap/less/forms.less +613 -0
  90. data/spec/dummy/node_modules/bootstrap/less/glyphicons.less +305 -0
  91. data/spec/dummy/node_modules/bootstrap/less/grid.less +84 -0
  92. data/spec/dummy/node_modules/bootstrap/less/input-groups.less +171 -0
  93. data/spec/dummy/node_modules/bootstrap/less/jumbotron.less +54 -0
  94. data/spec/dummy/node_modules/bootstrap/less/labels.less +64 -0
  95. data/spec/dummy/node_modules/bootstrap/less/list-group.less +130 -0
  96. data/spec/dummy/node_modules/bootstrap/less/media.less +66 -0
  97. data/spec/dummy/node_modules/bootstrap/less/mixins/alerts.less +14 -0
  98. data/spec/dummy/node_modules/bootstrap/less/mixins/background-variant.less +9 -0
  99. data/spec/dummy/node_modules/bootstrap/less/mixins/border-radius.less +18 -0
  100. data/spec/dummy/node_modules/bootstrap/less/mixins/buttons.less +65 -0
  101. data/spec/dummy/node_modules/bootstrap/less/mixins/center-block.less +7 -0
  102. data/spec/dummy/node_modules/bootstrap/less/mixins/clearfix.less +22 -0
  103. data/spec/dummy/node_modules/bootstrap/less/mixins/forms.less +85 -0
  104. data/spec/dummy/node_modules/bootstrap/less/mixins/gradients.less +59 -0
  105. data/spec/dummy/node_modules/bootstrap/less/mixins/grid-framework.less +91 -0
  106. data/spec/dummy/node_modules/bootstrap/less/mixins/grid.less +122 -0
  107. data/spec/dummy/node_modules/bootstrap/less/mixins/hide-text.less +21 -0
  108. data/spec/dummy/node_modules/bootstrap/less/mixins/image.less +33 -0
  109. data/spec/dummy/node_modules/bootstrap/less/mixins/labels.less +12 -0
  110. data/spec/dummy/node_modules/bootstrap/less/mixins/list-group.less +30 -0
  111. data/spec/dummy/node_modules/bootstrap/less/mixins/nav-divider.less +10 -0
  112. data/spec/dummy/node_modules/bootstrap/less/mixins/nav-vertical-align.less +9 -0
  113. data/spec/dummy/node_modules/bootstrap/less/mixins/opacity.less +8 -0
  114. data/spec/dummy/node_modules/bootstrap/less/mixins/pagination.less +24 -0
  115. data/spec/dummy/node_modules/bootstrap/less/mixins/panels.less +24 -0
  116. data/spec/dummy/node_modules/bootstrap/less/mixins/progress-bar.less +10 -0
  117. data/spec/dummy/node_modules/bootstrap/less/mixins/reset-filter.less +8 -0
  118. data/spec/dummy/node_modules/bootstrap/less/mixins/reset-text.less +18 -0
  119. data/spec/dummy/node_modules/bootstrap/less/mixins/resize.less +6 -0
  120. data/spec/dummy/node_modules/bootstrap/less/mixins/responsive-visibility.less +15 -0
  121. data/spec/dummy/node_modules/bootstrap/less/mixins/size.less +10 -0
  122. data/spec/dummy/node_modules/bootstrap/less/mixins/tab-focus.less +9 -0
  123. data/spec/dummy/node_modules/bootstrap/less/mixins/table-row.less +28 -0
  124. data/spec/dummy/node_modules/bootstrap/less/mixins/text-emphasis.less +9 -0
  125. data/spec/dummy/node_modules/bootstrap/less/mixins/text-overflow.less +8 -0
  126. data/spec/dummy/node_modules/bootstrap/less/mixins/vendor-prefixes.less +227 -0
  127. data/spec/dummy/node_modules/bootstrap/less/mixins.less +40 -0
  128. data/spec/dummy/node_modules/bootstrap/less/modals.less +150 -0
  129. data/spec/dummy/node_modules/bootstrap/less/navbar.less +660 -0
  130. data/spec/dummy/node_modules/bootstrap/less/navs.less +242 -0
  131. data/spec/dummy/node_modules/bootstrap/less/normalize.less +424 -0
  132. data/spec/dummy/node_modules/bootstrap/less/pager.less +54 -0
  133. data/spec/dummy/node_modules/bootstrap/less/pagination.less +89 -0
  134. data/spec/dummy/node_modules/bootstrap/less/panels.less +271 -0
  135. data/spec/dummy/node_modules/bootstrap/less/popovers.less +131 -0
  136. data/spec/dummy/node_modules/bootstrap/less/print.less +101 -0
  137. data/spec/dummy/node_modules/bootstrap/less/progress-bars.less +87 -0
  138. data/spec/dummy/node_modules/bootstrap/less/responsive-embed.less +35 -0
  139. data/spec/dummy/node_modules/bootstrap/less/responsive-utilities.less +194 -0
  140. data/spec/dummy/node_modules/bootstrap/less/scaffolding.less +161 -0
  141. data/spec/dummy/node_modules/bootstrap/less/tables.less +234 -0
  142. data/spec/dummy/node_modules/bootstrap/less/theme.less +291 -0
  143. data/spec/dummy/node_modules/bootstrap/less/thumbnails.less +36 -0
  144. data/spec/dummy/node_modules/bootstrap/less/tooltip.less +101 -0
  145. data/spec/dummy/node_modules/bootstrap/less/type.less +302 -0
  146. data/spec/dummy/node_modules/bootstrap/less/utilities.less +55 -0
  147. data/spec/dummy/node_modules/bootstrap/less/variables.less +869 -0
  148. data/spec/dummy/node_modules/bootstrap/less/wells.less +29 -0
  149. data/spec/dummy/node_modules/bootstrap/package.json +138 -0
  150. data/spec/dummy/vendor/assets/javascripts/bootstrap.js +2363 -0
  151. data/spec/dummy/vendor/assets/stylesheets/bootstrap-theme.css +587 -0
  152. data/spec/dummy/vendor/assets/stylesheets/bootstrap.css +6760 -0
  153. data/spec/file_copier_spec.rb +45 -0
  154. data/spec/gem_version_updater_spec.rb +45 -0
  155. data/spec/npm2gem_spec.rb +7 -0
  156. data/spec/npm_install_spec.rb +22 -0
  157. data/spec/spec_helper.rb +26 -0
  158. metadata +403 -0
@@ -0,0 +1,533 @@
1
+ /*!
2
+ * Bootstrap's Gruntfile
3
+ * http://getbootstrap.com
4
+ * Copyright 2013-2015 Twitter, Inc.
5
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
6
+ */
7
+
8
+ module.exports = function (grunt) {
9
+ 'use strict';
10
+
11
+ // Force use of Unix newlines
12
+ grunt.util.linefeed = '\n';
13
+
14
+ RegExp.quote = function (string) {
15
+ return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
16
+ };
17
+
18
+ var fs = require('fs');
19
+ var path = require('path');
20
+ var npmShrinkwrap = require('npm-shrinkwrap');
21
+ var generateGlyphiconsData = require('./grunt/bs-glyphicons-data-generator.js');
22
+ var BsLessdocParser = require('./grunt/bs-lessdoc-parser.js');
23
+ var getLessVarsData = function () {
24
+ var filePath = path.join(__dirname, 'less/variables.less');
25
+ var fileContent = fs.readFileSync(filePath, { encoding: 'utf8' });
26
+ var parser = new BsLessdocParser(fileContent);
27
+ return { sections: parser.parseFile() };
28
+ };
29
+ var generateRawFiles = require('./grunt/bs-raw-files-generator.js');
30
+ var generateCommonJSModule = require('./grunt/bs-commonjs-generator.js');
31
+ var configBridge = grunt.file.readJSON('./grunt/configBridge.json', { encoding: 'utf8' });
32
+
33
+ Object.keys(configBridge.paths).forEach(function (key) {
34
+ configBridge.paths[key].forEach(function (val, i, arr) {
35
+ arr[i] = path.join('./docs/assets', val);
36
+ });
37
+ });
38
+
39
+ // Project configuration.
40
+ grunt.initConfig({
41
+
42
+ // Metadata.
43
+ pkg: grunt.file.readJSON('package.json'),
44
+ banner: '/*!\n' +
45
+ ' * Bootstrap v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
46
+ ' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
47
+ ' * Licensed under the <%= pkg.license %> license\n' +
48
+ ' */\n',
49
+ jqueryCheck: configBridge.config.jqueryCheck.join('\n'),
50
+ jqueryVersionCheck: configBridge.config.jqueryVersionCheck.join('\n'),
51
+
52
+ // Task configuration.
53
+ clean: {
54
+ dist: 'dist',
55
+ docs: 'docs/dist'
56
+ },
57
+
58
+ jshint: {
59
+ options: {
60
+ jshintrc: 'js/.jshintrc'
61
+ },
62
+ grunt: {
63
+ options: {
64
+ jshintrc: 'grunt/.jshintrc'
65
+ },
66
+ src: ['Gruntfile.js', 'package.js', 'grunt/*.js']
67
+ },
68
+ core: {
69
+ src: 'js/*.js'
70
+ },
71
+ test: {
72
+ options: {
73
+ jshintrc: 'js/tests/unit/.jshintrc'
74
+ },
75
+ src: 'js/tests/unit/*.js'
76
+ },
77
+ assets: {
78
+ src: ['docs/assets/js/src/*.js', 'docs/assets/js/*.js', '!docs/assets/js/*.min.js']
79
+ }
80
+ },
81
+
82
+ jscs: {
83
+ options: {
84
+ config: 'js/.jscsrc'
85
+ },
86
+ grunt: {
87
+ src: '<%= jshint.grunt.src %>'
88
+ },
89
+ core: {
90
+ src: '<%= jshint.core.src %>'
91
+ },
92
+ test: {
93
+ src: '<%= jshint.test.src %>'
94
+ },
95
+ assets: {
96
+ options: {
97
+ requireCamelCaseOrUpperCaseIdentifiers: null
98
+ },
99
+ src: '<%= jshint.assets.src %>'
100
+ }
101
+ },
102
+
103
+ concat: {
104
+ options: {
105
+ banner: '<%= banner %>\n<%= jqueryCheck %>\n<%= jqueryVersionCheck %>',
106
+ stripBanners: false
107
+ },
108
+ bootstrap: {
109
+ src: [
110
+ 'js/transition.js',
111
+ 'js/alert.js',
112
+ 'js/button.js',
113
+ 'js/carousel.js',
114
+ 'js/collapse.js',
115
+ 'js/dropdown.js',
116
+ 'js/modal.js',
117
+ 'js/tooltip.js',
118
+ 'js/popover.js',
119
+ 'js/scrollspy.js',
120
+ 'js/tab.js',
121
+ 'js/affix.js'
122
+ ],
123
+ dest: 'dist/js/<%= pkg.name %>.js'
124
+ }
125
+ },
126
+
127
+ uglify: {
128
+ options: {
129
+ compress: {
130
+ warnings: false
131
+ },
132
+ mangle: true,
133
+ preserveComments: 'some'
134
+ },
135
+ core: {
136
+ src: '<%= concat.bootstrap.dest %>',
137
+ dest: 'dist/js/<%= pkg.name %>.min.js'
138
+ },
139
+ customize: {
140
+ src: configBridge.paths.customizerJs,
141
+ dest: 'docs/assets/js/customize.min.js'
142
+ },
143
+ docsJs: {
144
+ src: configBridge.paths.docsJs,
145
+ dest: 'docs/assets/js/docs.min.js'
146
+ }
147
+ },
148
+
149
+ qunit: {
150
+ options: {
151
+ inject: 'js/tests/unit/phantom.js'
152
+ },
153
+ files: 'js/tests/index.html'
154
+ },
155
+
156
+ less: {
157
+ compileCore: {
158
+ options: {
159
+ strictMath: true,
160
+ sourceMap: true,
161
+ outputSourceFiles: true,
162
+ sourceMapURL: '<%= pkg.name %>.css.map',
163
+ sourceMapFilename: 'dist/css/<%= pkg.name %>.css.map'
164
+ },
165
+ src: 'less/bootstrap.less',
166
+ dest: 'dist/css/<%= pkg.name %>.css'
167
+ },
168
+ compileTheme: {
169
+ options: {
170
+ strictMath: true,
171
+ sourceMap: true,
172
+ outputSourceFiles: true,
173
+ sourceMapURL: '<%= pkg.name %>-theme.css.map',
174
+ sourceMapFilename: 'dist/css/<%= pkg.name %>-theme.css.map'
175
+ },
176
+ src: 'less/theme.less',
177
+ dest: 'dist/css/<%= pkg.name %>-theme.css'
178
+ }
179
+ },
180
+
181
+ autoprefixer: {
182
+ options: {
183
+ browsers: configBridge.config.autoprefixerBrowsers
184
+ },
185
+ core: {
186
+ options: {
187
+ map: true
188
+ },
189
+ src: 'dist/css/<%= pkg.name %>.css'
190
+ },
191
+ theme: {
192
+ options: {
193
+ map: true
194
+ },
195
+ src: 'dist/css/<%= pkg.name %>-theme.css'
196
+ },
197
+ docs: {
198
+ src: ['docs/assets/css/src/docs.css']
199
+ },
200
+ examples: {
201
+ expand: true,
202
+ cwd: 'docs/examples/',
203
+ src: ['**/*.css'],
204
+ dest: 'docs/examples/'
205
+ }
206
+ },
207
+
208
+ csslint: {
209
+ options: {
210
+ csslintrc: 'less/.csslintrc'
211
+ },
212
+ dist: [
213
+ 'dist/css/bootstrap.css',
214
+ 'dist/css/bootstrap-theme.css'
215
+ ],
216
+ examples: [
217
+ 'docs/examples/**/*.css'
218
+ ],
219
+ docs: {
220
+ options: {
221
+ ids: false,
222
+ 'overqualified-elements': false
223
+ },
224
+ src: 'docs/assets/css/src/docs.css'
225
+ }
226
+ },
227
+
228
+ cssmin: {
229
+ options: {
230
+ // TODO: disable `zeroUnits` optimization once clean-css 3.2 is released
231
+ // and then simplify the fix for https://github.com/twbs/bootstrap/issues/14837 accordingly
232
+ compatibility: 'ie8',
233
+ keepSpecialComments: '*',
234
+ sourceMap: true,
235
+ advanced: false
236
+ },
237
+ minifyCore: {
238
+ src: 'dist/css/<%= pkg.name %>.css',
239
+ dest: 'dist/css/<%= pkg.name %>.min.css'
240
+ },
241
+ minifyTheme: {
242
+ src: 'dist/css/<%= pkg.name %>-theme.css',
243
+ dest: 'dist/css/<%= pkg.name %>-theme.min.css'
244
+ },
245
+ docs: {
246
+ src: [
247
+ 'docs/assets/css/ie10-viewport-bug-workaround.css',
248
+ 'docs/assets/css/src/pygments-manni.css',
249
+ 'docs/assets/css/src/docs.css'
250
+ ],
251
+ dest: 'docs/assets/css/docs.min.css'
252
+ }
253
+ },
254
+
255
+ csscomb: {
256
+ options: {
257
+ config: 'less/.csscomb.json'
258
+ },
259
+ dist: {
260
+ expand: true,
261
+ cwd: 'dist/css/',
262
+ src: ['*.css', '!*.min.css'],
263
+ dest: 'dist/css/'
264
+ },
265
+ examples: {
266
+ expand: true,
267
+ cwd: 'docs/examples/',
268
+ src: '**/*.css',
269
+ dest: 'docs/examples/'
270
+ },
271
+ docs: {
272
+ src: 'docs/assets/css/src/docs.css',
273
+ dest: 'docs/assets/css/src/docs.css'
274
+ }
275
+ },
276
+
277
+ copy: {
278
+ fonts: {
279
+ expand: true,
280
+ src: 'fonts/*',
281
+ dest: 'dist/'
282
+ },
283
+ docs: {
284
+ expand: true,
285
+ cwd: 'dist/',
286
+ src: [
287
+ '**/*'
288
+ ],
289
+ dest: 'docs/dist/'
290
+ }
291
+ },
292
+
293
+ connect: {
294
+ server: {
295
+ options: {
296
+ port: 3000,
297
+ base: '.'
298
+ }
299
+ }
300
+ },
301
+
302
+ jekyll: {
303
+ options: {
304
+ config: '_config.yml'
305
+ },
306
+ docs: {},
307
+ github: {
308
+ options: {
309
+ raw: 'github: true'
310
+ }
311
+ }
312
+ },
313
+
314
+ htmlmin: {
315
+ dist: {
316
+ options: {
317
+ collapseWhitespace: true,
318
+ conservativeCollapse: true,
319
+ minifyCSS: true,
320
+ minifyJS: true,
321
+ removeAttributeQuotes: true,
322
+ removeComments: true
323
+ },
324
+ expand: true,
325
+ cwd: '_gh_pages',
326
+ dest: '_gh_pages',
327
+ src: [
328
+ '**/*.html',
329
+ '!examples/**/*.html'
330
+ ]
331
+ }
332
+ },
333
+
334
+ jade: {
335
+ options: {
336
+ pretty: true,
337
+ data: getLessVarsData
338
+ },
339
+ customizerVars: {
340
+ src: 'docs/_jade/customizer-variables.jade',
341
+ dest: 'docs/_includes/customizer-variables.html'
342
+ },
343
+ customizerNav: {
344
+ src: 'docs/_jade/customizer-nav.jade',
345
+ dest: 'docs/_includes/nav/customize.html'
346
+ }
347
+ },
348
+
349
+ htmllint: {
350
+ options: {
351
+ ignore: [
352
+ 'Attribute "autocomplete" not allowed on element "button" at this point.',
353
+ 'Attribute "autocomplete" is only allowed when the input type is "color", "date", "datetime", "datetime-local", "email", "month", "number", "password", "range", "search", "tel", "text", "time", "url", or "week".',
354
+ 'Element "img" is missing required attribute "src".'
355
+ ]
356
+ },
357
+ src: '_gh_pages/**/*.html'
358
+ },
359
+
360
+ watch: {
361
+ src: {
362
+ files: '<%= jshint.core.src %>',
363
+ tasks: ['jshint:core', 'qunit', 'concat']
364
+ },
365
+ test: {
366
+ files: '<%= jshint.test.src %>',
367
+ tasks: ['jshint:test', 'qunit']
368
+ },
369
+ less: {
370
+ files: 'less/**/*.less',
371
+ tasks: 'less'
372
+ }
373
+ },
374
+
375
+ sed: {
376
+ versionNumber: {
377
+ pattern: (function () {
378
+ var old = grunt.option('oldver');
379
+ return old ? RegExp.quote(old) : old;
380
+ })(),
381
+ replacement: grunt.option('newver'),
382
+ exclude: [
383
+ 'dist/fonts',
384
+ 'docs/assets',
385
+ 'fonts',
386
+ 'js/tests/vendor',
387
+ 'node_modules',
388
+ 'test-infra'
389
+ ],
390
+ recursive: true
391
+ }
392
+ },
393
+
394
+ 'saucelabs-qunit': {
395
+ all: {
396
+ options: {
397
+ build: process.env.TRAVIS_JOB_ID,
398
+ throttled: 10,
399
+ maxRetries: 3,
400
+ maxPollRetries: 4,
401
+ urls: ['http://127.0.0.1:3000/js/tests/index.html?hidepassed'],
402
+ browsers: grunt.file.readYAML('grunt/sauce_browsers.yml')
403
+ }
404
+ }
405
+ },
406
+
407
+ exec: {
408
+ npmUpdate: {
409
+ command: 'npm update'
410
+ }
411
+ },
412
+
413
+ compress: {
414
+ main: {
415
+ options: {
416
+ archive: 'bootstrap-<%= pkg.version %>-dist.zip',
417
+ mode: 'zip',
418
+ level: 9,
419
+ pretty: true
420
+ },
421
+ files: [
422
+ {
423
+ expand: true,
424
+ cwd: 'dist/',
425
+ src: ['**'],
426
+ dest: 'bootstrap-<%= pkg.version %>-dist'
427
+ }
428
+ ]
429
+ }
430
+ }
431
+
432
+ });
433
+
434
+
435
+ // These plugins provide necessary tasks.
436
+ require('load-grunt-tasks')(grunt, { scope: 'devDependencies' });
437
+ require('time-grunt')(grunt);
438
+
439
+ // Docs HTML validation task
440
+ grunt.registerTask('validate-html', ['jekyll:docs', 'htmllint']);
441
+
442
+ var runSubset = function (subset) {
443
+ return !process.env.TWBS_TEST || process.env.TWBS_TEST === subset;
444
+ };
445
+ var isUndefOrNonZero = function (val) {
446
+ return val === undefined || val !== '0';
447
+ };
448
+
449
+ // Test task.
450
+ var testSubtasks = [];
451
+ // Skip core tests if running a different subset of the test suite
452
+ if (runSubset('core') &&
453
+ // Skip core tests if this is a Savage build
454
+ process.env.TRAVIS_REPO_SLUG !== 'twbs-savage/bootstrap') {
455
+ testSubtasks = testSubtasks.concat(['dist-css', 'dist-js', 'csslint:dist', 'test-js', 'docs']);
456
+ }
457
+ // Skip HTML validation if running a different subset of the test suite
458
+ if (runSubset('validate-html') &&
459
+ // Skip HTML5 validator on Travis when [skip validator] is in the commit message
460
+ isUndefOrNonZero(process.env.TWBS_DO_VALIDATOR)) {
461
+ testSubtasks.push('validate-html');
462
+ }
463
+ // Only run Sauce Labs tests if there's a Sauce access key
464
+ if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined' &&
465
+ // Skip Sauce if running a different subset of the test suite
466
+ runSubset('sauce-js-unit') &&
467
+ // Skip Sauce on Travis when [skip sauce] is in the commit message
468
+ isUndefOrNonZero(process.env.TWBS_DO_SAUCE)) {
469
+ testSubtasks.push('connect');
470
+ testSubtasks.push('saucelabs-qunit');
471
+ }
472
+ grunt.registerTask('test', testSubtasks);
473
+ grunt.registerTask('test-js', ['jshint:core', 'jshint:test', 'jshint:grunt', 'jscs:core', 'jscs:test', 'jscs:grunt', 'qunit']);
474
+
475
+ // JS distribution task.
476
+ grunt.registerTask('dist-js', ['concat', 'uglify:core', 'commonjs']);
477
+
478
+ // CSS distribution task.
479
+ grunt.registerTask('less-compile', ['less:compileCore', 'less:compileTheme']);
480
+ grunt.registerTask('dist-css', ['less-compile', 'autoprefixer:core', 'autoprefixer:theme', 'csscomb:dist', 'cssmin:minifyCore', 'cssmin:minifyTheme']);
481
+
482
+ // Full distribution task.
483
+ grunt.registerTask('dist', ['clean:dist', 'dist-css', 'copy:fonts', 'dist-js']);
484
+
485
+ // Default task.
486
+ grunt.registerTask('default', ['clean:dist', 'copy:fonts', 'test']);
487
+
488
+ // Version numbering task.
489
+ // grunt change-version-number --oldver=A.B.C --newver=X.Y.Z
490
+ // This can be overzealous, so its changes should always be manually reviewed!
491
+ grunt.registerTask('change-version-number', 'sed');
492
+
493
+ grunt.registerTask('build-glyphicons-data', function () { generateGlyphiconsData.call(this, grunt); });
494
+
495
+ // task for building customizer
496
+ grunt.registerTask('build-customizer', ['build-customizer-html', 'build-raw-files']);
497
+ grunt.registerTask('build-customizer-html', 'jade');
498
+ grunt.registerTask('build-raw-files', 'Add scripts/less files to customizer.', function () {
499
+ var banner = grunt.template.process('<%= banner %>');
500
+ generateRawFiles(grunt, banner);
501
+ });
502
+
503
+ grunt.registerTask('commonjs', 'Generate CommonJS entrypoint module in dist dir.', function () {
504
+ var srcFiles = grunt.config.get('concat.bootstrap.src');
505
+ var destFilepath = 'dist/js/npm.js';
506
+ generateCommonJSModule(grunt, srcFiles, destFilepath);
507
+ });
508
+
509
+ // Docs task.
510
+ grunt.registerTask('docs-css', ['autoprefixer:docs', 'autoprefixer:examples', 'csscomb:docs', 'csscomb:examples', 'cssmin:docs']);
511
+ grunt.registerTask('lint-docs-css', ['csslint:docs', 'csslint:examples']);
512
+ grunt.registerTask('docs-js', ['uglify:docsJs', 'uglify:customize']);
513
+ grunt.registerTask('lint-docs-js', ['jshint:assets', 'jscs:assets']);
514
+ grunt.registerTask('docs', ['docs-css', 'lint-docs-css', 'docs-js', 'lint-docs-js', 'clean:docs', 'copy:docs', 'build-glyphicons-data', 'build-customizer']);
515
+
516
+ grunt.registerTask('prep-release', ['dist', 'docs', 'jekyll:github', 'htmlmin', 'compress']);
517
+
518
+ // Task for updating the cached npm packages used by the Travis build (which are controlled by test-infra/npm-shrinkwrap.json).
519
+ // This task should be run and the updated file should be committed whenever Bootstrap's dependencies change.
520
+ grunt.registerTask('update-shrinkwrap', ['exec:npmUpdate', '_update-shrinkwrap']);
521
+ grunt.registerTask('_update-shrinkwrap', function () {
522
+ var done = this.async();
523
+ npmShrinkwrap({ dev: true, dirname: __dirname }, function (err) {
524
+ if (err) {
525
+ grunt.fail.warn(err);
526
+ }
527
+ var dest = 'test-infra/npm-shrinkwrap.json';
528
+ fs.renameSync('npm-shrinkwrap.json', dest);
529
+ grunt.log.writeln('File ' + dest.cyan + ' updated.');
530
+ done();
531
+ });
532
+ });
533
+ };
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2011-2015 Twitter, Inc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,139 @@
1
+ # [Bootstrap](http://getbootstrap.com)
2
+
3
+ [![Slack](https://bootstrap-slack.herokuapp.com/badge.svg)](https://bootstrap-slack.herokuapp.com)
4
+ ![Bower version](https://img.shields.io/bower/v/bootstrap.svg)
5
+ [![npm version](https://img.shields.io/npm/v/bootstrap.svg)](https://www.npmjs.com/package/bootstrap)
6
+ [![Build Status](https://img.shields.io/travis/twbs/bootstrap/master.svg)](https://travis-ci.org/twbs/bootstrap)
7
+ [![devDependency Status](https://img.shields.io/david/dev/twbs/bootstrap.svg)](https://david-dm.org/twbs/bootstrap#info=devDependencies)
8
+ [![NuGet](https://img.shields.io/nuget/v/bootstrap.svg)](https://www.nuget.org/packages/Bootstrap)
9
+ [![Selenium Test Status](https://saucelabs.com/browser-matrix/bootstrap.svg)](https://saucelabs.com/u/bootstrap)
10
+
11
+ Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development, created by [Mark Otto](https://twitter.com/mdo) and [Jacob Thornton](https://twitter.com/fat), and maintained by the [core team](https://github.com/orgs/twbs/people) with the massive support and involvement of the community.
12
+
13
+ To get started, check out <http://getbootstrap.com>!
14
+
15
+
16
+ ## Table of contents
17
+
18
+ * [Quick start](#quick-start)
19
+ * [Bugs and feature requests](#bugs-and-feature-requests)
20
+ * [Documentation](#documentation)
21
+ * [Contributing](#contributing)
22
+ * [Community](#community)
23
+ * [Versioning](#versioning)
24
+ * [Creators](#creators)
25
+ * [Copyright and license](#copyright-and-license)
26
+
27
+
28
+ ## Quick start
29
+
30
+ Several quick start options are available:
31
+
32
+ * [Download the latest release](https://github.com/twbs/bootstrap/archive/v3.3.6.zip).
33
+ * Clone the repo: `git clone https://github.com/twbs/bootstrap.git`.
34
+ * Install with [Bower](http://bower.io): `bower install bootstrap`.
35
+ * Install with [npm](https://www.npmjs.com): `npm install bootstrap`.
36
+ * Install with [Meteor](https://www.meteor.com): `meteor add twbs:bootstrap`.
37
+ * Install with [Composer](https://getcomposer.org): `composer require twbs/bootstrap`.
38
+
39
+ Read the [Getting started page](http://getbootstrap.com/getting-started/) for information on the framework contents, templates and examples, and more.
40
+
41
+ ### What's included
42
+
43
+ Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. You'll see something like this:
44
+
45
+ ```
46
+ bootstrap/
47
+ ├── css/
48
+ │ ├── bootstrap.css
49
+ │ ├── bootstrap.css.map
50
+ │ ├── bootstrap.min.css
51
+ │ ├── bootstrap.min.css.map
52
+ │ ├── bootstrap-theme.css
53
+ │ ├── bootstrap-theme.css.map
54
+ │ ├── bootstrap-theme.min.css
55
+ │ └── bootstrap-theme.min.css.map
56
+ ├── js/
57
+ │ ├── bootstrap.js
58
+ │ └── bootstrap.min.js
59
+ └── fonts/
60
+ ├── glyphicons-halflings-regular.eot
61
+ ├── glyphicons-halflings-regular.svg
62
+ ├── glyphicons-halflings-regular.ttf
63
+ ├── glyphicons-halflings-regular.woff
64
+ └── glyphicons-halflings-regular.woff2
65
+ ```
66
+
67
+ We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified CSS and JS (`bootstrap.min.*`). CSS [source maps](https://developer.chrome.com/devtools/docs/css-preprocessors) (`bootstrap.*.map`) are available for use with certain browsers' developer tools. Fonts from Glyphicons are included, as is the optional Bootstrap theme.
68
+
69
+
70
+ ## Bugs and feature requests
71
+
72
+ Have a bug or a feature request? Please first read the [issue guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#using-the-issue-tracker) and search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/twbs/bootstrap/issues/new).
73
+
74
+
75
+ ## Documentation
76
+
77
+ Bootstrap's documentation, included in this repo in the root directory, is built with [Jekyll](http://jekyllrb.com) and publicly hosted on GitHub Pages at <http://getbootstrap.com>. The docs may also be run locally.
78
+
79
+ ### Running documentation locally
80
+
81
+ 1. If necessary, [install Jekyll](http://jekyllrb.com/docs/installation) (requires v3.0.x).
82
+ **Note for Windows users:** Read [this unofficial guide](http://jekyll-windows.juthilo.com/) to get Jekyll up and running without problems.
83
+ 2. Install the Ruby-based syntax highlighter, [Rouge](https://github.com/jneen/rouge), with `gem install rouge`.
84
+ 3. From the root `/bootstrap` directory, run `jekyll serve` in the command line.
85
+ 4. Open `http://localhost:9001` in your browser, and voilà.
86
+
87
+ Learn more about using Jekyll by reading its [documentation](http://jekyllrb.com/docs/home/).
88
+
89
+ ### Documentation for previous releases
90
+
91
+ Documentation for v2.3.2 has been made available for the time being at <http://getbootstrap.com/2.3.2/> while folks transition to Bootstrap 3.
92
+
93
+ [Previous releases](https://github.com/twbs/bootstrap/releases) and their documentation are also available for download.
94
+
95
+
96
+ ## Contributing
97
+
98
+ Please read through our [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development.
99
+
100
+ Moreover, if your pull request contains JavaScript patches or features, you must include [relevant unit tests](https://github.com/twbs/bootstrap/tree/master/js/tests). All HTML and CSS should conform to the [Code Guide](https://github.com/mdo/code-guide), maintained by [Mark Otto](https://github.com/mdo).
101
+
102
+ Editor preferences are available in the [editor config](https://github.com/twbs/bootstrap/blob/master/.editorconfig) for easy use in common text editors. Read more and download plugins at <http://editorconfig.org>.
103
+
104
+
105
+ ## Community
106
+
107
+ Get updates on Bootstrap's development and chat with the project maintainers and community members.
108
+
109
+ * Follow [@getbootstrap on Twitter](https://twitter.com/getbootstrap).
110
+ * Read and subscribe to [The Official Bootstrap Blog](http://blog.getbootstrap.com).
111
+ * Join [the official Slack room](https://bootstrap-slack.herokuapp.com).
112
+ * Chat with fellow Bootstrappers in IRC. On the `irc.freenode.net` server, in the `##bootstrap` channel.
113
+ * Implementation help may be found at Stack Overflow (tagged [`twitter-bootstrap-3`](https://stackoverflow.com/questions/tagged/twitter-bootstrap-3)).
114
+ * Developers should use the keyword `bootstrap` on packages which modify or add to the functionality of Bootstrap when distributing through [npm](https://www.npmjs.com/browse/keyword/bootstrap) or similar delivery mechanisms for maximum discoverability.
115
+
116
+
117
+ ## Versioning
118
+
119
+ For transparency into our release cycle and in striving to maintain backward compatibility, Bootstrap is maintained under [the Semantic Versioning guidelines](http://semver.org/). Sometimes we screw up, but we'll adhere to those rules whenever possible.
120
+
121
+ See [the Releases section of our GitHub project](https://github.com/twbs/bootstrap/releases) for changelogs for each release version of Bootstrap. Release announcement posts on [the official Bootstrap blog](http://blog.getbootstrap.com) contain summaries of the most noteworthy changes made in each release.
122
+
123
+
124
+ ## Creators
125
+
126
+ **Mark Otto**
127
+
128
+ * <https://twitter.com/mdo>
129
+ * <https://github.com/mdo>
130
+
131
+ **Jacob Thornton**
132
+
133
+ * <https://twitter.com/fat>
134
+ * <https://github.com/fat>
135
+
136
+
137
+ ## Copyright and license
138
+
139
+ Code and documentation copyright 2011-2015 Twitter, Inc. Code released under [the MIT license](https://github.com/twbs/bootstrap/blob/master/LICENSE). Docs released under [Creative Commons](https://github.com/twbs/bootstrap/blob/master/docs/LICENSE).