uniform-ui 1.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +5 -5
  2. data/lib/assets/config/manifest.js +1 -0
  3. data/lib/assets/javascripts/uniform/checkbox.js +31 -0
  4. data/lib/assets/javascripts/uniform/component.js +42 -0
  5. data/lib/assets/javascripts/uniform/dom-helpers.js +136 -0
  6. data/lib/assets/javascripts/uniform/dropdown.js +149 -0
  7. data/lib/assets/javascripts/uniform/floating-label.js +54 -0
  8. data/lib/assets/javascripts/uniform/icons.js +16 -0
  9. data/lib/assets/javascripts/uniform/modal.js +103 -0
  10. data/lib/assets/javascripts/uniform/resizer.js +43 -0
  11. data/lib/assets/javascripts/uniform/select.js +235 -0
  12. data/lib/assets/javascripts/uniform/tooltip.js +120 -0
  13. data/lib/assets/javascripts/uniform-es5.js +1 -0
  14. data/lib/assets/javascripts/uniform-jquery.js +124 -0
  15. data/lib/assets/javascripts/uniform.js +17 -0
  16. data/lib/assets/stylesheets/uniform/base.scss +3 -0
  17. data/lib/assets/stylesheets/uniform/components/alert.scss +72 -0
  18. data/lib/assets/stylesheets/uniform/components/buttons.scss +219 -0
  19. data/{vendor → lib}/assets/stylesheets/uniform/components/card.scss +33 -25
  20. data/lib/assets/stylesheets/uniform/components/container.scss +19 -0
  21. data/{vendor → lib}/assets/stylesheets/uniform/components/dropdown.scss +8 -4
  22. data/lib/assets/stylesheets/uniform/components/form/checkbox-collection.scss +103 -0
  23. data/lib/assets/stylesheets/uniform/components/form/checkbox.scss +58 -0
  24. data/lib/assets/stylesheets/uniform/components/form/floating-label.scss +64 -0
  25. data/lib/assets/stylesheets/uniform/components/form/input-group.scss +56 -0
  26. data/lib/assets/stylesheets/uniform/components/form.scss +143 -0
  27. data/lib/assets/stylesheets/uniform/components/grid.scss +158 -0
  28. data/lib/assets/stylesheets/uniform/components/label.scss +26 -0
  29. data/lib/assets/stylesheets/uniform/components/loaders.scss +80 -0
  30. data/{vendor → lib}/assets/stylesheets/uniform/components/modal.scss +26 -4
  31. data/lib/assets/stylesheets/uniform/components/nav.scss +124 -0
  32. data/lib/assets/stylesheets/uniform/components/row.scss +69 -0
  33. data/lib/assets/stylesheets/uniform/components/select.scss +122 -0
  34. data/lib/assets/stylesheets/uniform/components/table.scss +127 -0
  35. data/lib/assets/stylesheets/uniform/components/thumb.scss +41 -0
  36. data/lib/assets/stylesheets/uniform/components/tooltip.scss +63 -0
  37. data/lib/assets/stylesheets/uniform/components.scss +11 -0
  38. data/{vendor → lib}/assets/stylesheets/uniform/defaults.scss +7 -4
  39. data/lib/assets/stylesheets/uniform/functions.scss +31 -0
  40. data/lib/assets/stylesheets/uniform/helpers/border.scss +19 -0
  41. data/lib/assets/stylesheets/uniform/helpers/colors.scss +23 -0
  42. data/lib/assets/stylesheets/uniform/helpers/margin.scss +27 -0
  43. data/lib/assets/stylesheets/uniform/helpers/padding.scss +9 -0
  44. data/lib/assets/stylesheets/uniform/helpers/position.scss +13 -0
  45. data/lib/assets/stylesheets/uniform/helpers/sizes.scss +38 -0
  46. data/{vendor → lib}/assets/stylesheets/uniform/helpers/text.scss +86 -73
  47. data/lib/assets/stylesheets/uniform/helpers.scss +127 -0
  48. data/lib/assets/stylesheets/uniform/mixins.scss +116 -0
  49. data/lib/assets/stylesheets/uniform/print/grid.scss +50 -0
  50. data/lib/assets/stylesheets/uniform/variables.scss +72 -0
  51. data/lib/assets/stylesheets/uniform-print.scss +1 -0
  52. data/lib/assets/stylesheets/uniform.scss +11 -0
  53. data/lib/uniform/version.rb +3 -0
  54. data/lib/uniform.rb +15 -0
  55. metadata +87 -95
  56. data/.gitignore +0 -2
  57. data/CHANGELOG.md +0 -27
  58. data/CNAME +0 -1
  59. data/Gemfile +0 -8
  60. data/Gemfile.lock +0 -40
  61. data/LICENSE +0 -22
  62. data/README.md +0 -35
  63. data/Rakefile +0 -74
  64. data/index.html +0 -251
  65. data/lib/uniform/rails/engine.rb +0 -8
  66. data/lib/uniform/rails.rb +0 -6
  67. data/lib/uniform/ui.rb +0 -1
  68. data/preview/alerts.html.erb +0 -1
  69. data/preview/buttons.html.erb +0 -62
  70. data/preview/cards.html.erb +0 -23
  71. data/preview/colors.html.erb +0 -22
  72. data/preview/dropdown.html.erb +0 -1
  73. data/preview/form.html.erb +0 -233
  74. data/preview/grid.html.erb +0 -304
  75. data/preview/helpers.html.erb +0 -225
  76. data/preview/index.html.erb +0 -77
  77. data/preview/labels.html.erb +0 -1
  78. data/preview/layout.html.erb +0 -63
  79. data/preview/loaders.html.erb +0 -83
  80. data/preview/modal.html.erb +0 -1
  81. data/preview/nav.html.erb +0 -77
  82. data/preview/preview.scss +0 -76
  83. data/preview/rows.html.erb +0 -36
  84. data/preview/select.html.erb +0 -1
  85. data/preview/tables.html.erb +0 -1
  86. data/preview/tabs.html.erb +0 -17
  87. data/preview/tiles.html.erb +0 -1
  88. data/preview/tooltip.erb +0 -1
  89. data/preview.css +0 -0
  90. data/site/alerts.html +0 -157
  91. data/site/alerts.html copy +0 -133
  92. data/site/buttons.html +0 -286
  93. data/site/cards.html +0 -177
  94. data/site/colors.html +0 -275
  95. data/site/dropdown.html +0 -157
  96. data/site/dropdown.html copy +0 -141
  97. data/site/form.html +0 -369
  98. data/site/grid.html +0 -716
  99. data/site/helpers.html +0 -1008
  100. data/site/index.html +0 -251
  101. data/site/labels.html +0 -157
  102. data/site/layout.html +0 -313
  103. data/site/loaders.html +0 -233
  104. data/site/logo.png +0 -0
  105. data/site/modal.html +0 -157
  106. data/site/nav.html +0 -229
  107. data/site/preview.css +0 -1
  108. data/site/preview.js +0 -59
  109. data/site/rows.html +0 -190
  110. data/site/select.html +0 -157
  111. data/site/tables.html +0 -157
  112. data/site/tabs.html +0 -171
  113. data/site/tiles.html +0 -157
  114. data/site/tiles.html copy +0 -109
  115. data/site/tooltip +0 -157
  116. data/site/uniform.css +0 -1
  117. data/uniform.gemspec +0 -22
  118. data/vendor/assets/stylesheets/uniform/base.scss +0 -2
  119. data/vendor/assets/stylesheets/uniform/components/alert.scss +0 -27
  120. data/vendor/assets/stylesheets/uniform/components/buttons.scss +0 -212
  121. data/vendor/assets/stylesheets/uniform/components/form.scss +0 -290
  122. data/vendor/assets/stylesheets/uniform/components/grid.scss +0 -225
  123. data/vendor/assets/stylesheets/uniform/components/label.scss +0 -63
  124. data/vendor/assets/stylesheets/uniform/components/loaders.scss +0 -82
  125. data/vendor/assets/stylesheets/uniform/components/nav.scss +0 -197
  126. data/vendor/assets/stylesheets/uniform/components/row.scss +0 -92
  127. data/vendor/assets/stylesheets/uniform/components/select.scss +0 -98
  128. data/vendor/assets/stylesheets/uniform/components/table.scss +0 -83
  129. data/vendor/assets/stylesheets/uniform/components/tabs.scss +0 -45
  130. data/vendor/assets/stylesheets/uniform/components/tile.scss +0 -20
  131. data/vendor/assets/stylesheets/uniform/components/tooltip.scss +0 -46
  132. data/vendor/assets/stylesheets/uniform/helpers/colors.scss +0 -37
  133. data/vendor/assets/stylesheets/uniform/helpers/margin.scss +0 -44
  134. data/vendor/assets/stylesheets/uniform/helpers/padding.scss +0 -74
  135. data/vendor/assets/stylesheets/uniform/helpers/sizes.scss +0 -31
  136. data/vendor/assets/stylesheets/uniform/helpers.scss +0 -124
  137. data/vendor/assets/stylesheets/uniform/mixins.scss +0 -77
  138. data/vendor/assets/stylesheets/uniform/variables.scss +0 -36
  139. data/vendor/assets/stylesheets/uniform.scss +0 -9
metadata CHANGED
@@ -1,17 +1,45 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uniform-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Ehmke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-11 00:00:00.000000000 Z
11
+ date: 2018-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rake
14
+ name: sass
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubyzip
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: sass-media_query_combiner
15
43
  requirement: !ruby/object:Gem::Requirement
16
44
  requirements:
17
45
  - - ">="
@@ -31,95 +59,59 @@ executables: []
31
59
  extensions: []
32
60
  extra_rdoc_files: []
33
61
  files:
34
- - ".gitignore"
35
- - CHANGELOG.md
36
- - CNAME
37
- - Gemfile
38
- - Gemfile.lock
39
- - LICENSE
40
- - README.md
41
- - Rakefile
42
- - index.html
43
- - lib/uniform/rails.rb
44
- - lib/uniform/rails/engine.rb
45
- - lib/uniform/ui.rb
46
- - preview.css
47
- - preview/alerts.html.erb
48
- - preview/buttons.html.erb
49
- - preview/cards.html.erb
50
- - preview/colors.html.erb
51
- - preview/dropdown.html.erb
52
- - preview/form.html.erb
53
- - preview/grid.html.erb
54
- - preview/helpers.html.erb
55
- - preview/index.html.erb
56
- - preview/labels.html.erb
57
- - preview/layout.html.erb
58
- - preview/loaders.html.erb
59
- - preview/modal.html.erb
60
- - preview/nav.html.erb
61
- - preview/preview.scss
62
- - preview/rows.html.erb
63
- - preview/select.html.erb
64
- - preview/tables.html.erb
65
- - preview/tabs.html.erb
66
- - preview/tiles.html.erb
67
- - preview/tooltip.erb
68
- - site/alerts.html
69
- - site/alerts.html copy
70
- - site/buttons.html
71
- - site/cards.html
72
- - site/colors.html
73
- - site/dropdown.html
74
- - site/dropdown.html copy
75
- - site/form.html
76
- - site/grid.html
77
- - site/helpers.html
78
- - site/index.html
79
- - site/labels.html
80
- - site/layout.html
81
- - site/loaders.html
82
- - site/logo.png
83
- - site/modal.html
84
- - site/nav.html
85
- - site/preview.css
86
- - site/preview.js
87
- - site/rows.html
88
- - site/select.html
89
- - site/tables.html
90
- - site/tabs.html
91
- - site/tiles.html
92
- - site/tiles.html copy
93
- - site/tooltip
94
- - site/uniform.css
95
- - uniform.gemspec
96
- - vendor/assets/stylesheets/uniform.scss
97
- - vendor/assets/stylesheets/uniform/base.scss
98
- - vendor/assets/stylesheets/uniform/components/alert.scss
99
- - vendor/assets/stylesheets/uniform/components/buttons.scss
100
- - vendor/assets/stylesheets/uniform/components/card.scss
101
- - vendor/assets/stylesheets/uniform/components/dropdown.scss
102
- - vendor/assets/stylesheets/uniform/components/form.scss
103
- - vendor/assets/stylesheets/uniform/components/grid.scss
104
- - vendor/assets/stylesheets/uniform/components/label.scss
105
- - vendor/assets/stylesheets/uniform/components/loaders.scss
106
- - vendor/assets/stylesheets/uniform/components/modal.scss
107
- - vendor/assets/stylesheets/uniform/components/nav.scss
108
- - vendor/assets/stylesheets/uniform/components/row.scss
109
- - vendor/assets/stylesheets/uniform/components/select.scss
110
- - vendor/assets/stylesheets/uniform/components/table.scss
111
- - vendor/assets/stylesheets/uniform/components/tabs.scss
112
- - vendor/assets/stylesheets/uniform/components/tile.scss
113
- - vendor/assets/stylesheets/uniform/components/tooltip.scss
114
- - vendor/assets/stylesheets/uniform/defaults.scss
115
- - vendor/assets/stylesheets/uniform/helpers.scss
116
- - vendor/assets/stylesheets/uniform/helpers/colors.scss
117
- - vendor/assets/stylesheets/uniform/helpers/margin.scss
118
- - vendor/assets/stylesheets/uniform/helpers/padding.scss
119
- - vendor/assets/stylesheets/uniform/helpers/sizes.scss
120
- - vendor/assets/stylesheets/uniform/helpers/text.scss
121
- - vendor/assets/stylesheets/uniform/mixins.scss
122
- - vendor/assets/stylesheets/uniform/variables.scss
62
+ - lib/assets/config/manifest.js
63
+ - lib/assets/javascripts/uniform-es5.js
64
+ - lib/assets/javascripts/uniform-jquery.js
65
+ - lib/assets/javascripts/uniform.js
66
+ - lib/assets/javascripts/uniform/checkbox.js
67
+ - lib/assets/javascripts/uniform/component.js
68
+ - lib/assets/javascripts/uniform/dom-helpers.js
69
+ - lib/assets/javascripts/uniform/dropdown.js
70
+ - lib/assets/javascripts/uniform/floating-label.js
71
+ - lib/assets/javascripts/uniform/icons.js
72
+ - lib/assets/javascripts/uniform/modal.js
73
+ - lib/assets/javascripts/uniform/resizer.js
74
+ - lib/assets/javascripts/uniform/select.js
75
+ - lib/assets/javascripts/uniform/tooltip.js
76
+ - lib/assets/stylesheets/uniform-print.scss
77
+ - lib/assets/stylesheets/uniform.scss
78
+ - lib/assets/stylesheets/uniform/base.scss
79
+ - lib/assets/stylesheets/uniform/components.scss
80
+ - lib/assets/stylesheets/uniform/components/alert.scss
81
+ - lib/assets/stylesheets/uniform/components/buttons.scss
82
+ - lib/assets/stylesheets/uniform/components/card.scss
83
+ - lib/assets/stylesheets/uniform/components/container.scss
84
+ - lib/assets/stylesheets/uniform/components/dropdown.scss
85
+ - lib/assets/stylesheets/uniform/components/form.scss
86
+ - lib/assets/stylesheets/uniform/components/form/checkbox-collection.scss
87
+ - lib/assets/stylesheets/uniform/components/form/checkbox.scss
88
+ - lib/assets/stylesheets/uniform/components/form/floating-label.scss
89
+ - lib/assets/stylesheets/uniform/components/form/input-group.scss
90
+ - lib/assets/stylesheets/uniform/components/grid.scss
91
+ - lib/assets/stylesheets/uniform/components/label.scss
92
+ - lib/assets/stylesheets/uniform/components/loaders.scss
93
+ - lib/assets/stylesheets/uniform/components/modal.scss
94
+ - lib/assets/stylesheets/uniform/components/nav.scss
95
+ - lib/assets/stylesheets/uniform/components/row.scss
96
+ - lib/assets/stylesheets/uniform/components/select.scss
97
+ - lib/assets/stylesheets/uniform/components/table.scss
98
+ - lib/assets/stylesheets/uniform/components/thumb.scss
99
+ - lib/assets/stylesheets/uniform/components/tooltip.scss
100
+ - lib/assets/stylesheets/uniform/defaults.scss
101
+ - lib/assets/stylesheets/uniform/functions.scss
102
+ - lib/assets/stylesheets/uniform/helpers.scss
103
+ - lib/assets/stylesheets/uniform/helpers/border.scss
104
+ - lib/assets/stylesheets/uniform/helpers/colors.scss
105
+ - lib/assets/stylesheets/uniform/helpers/margin.scss
106
+ - lib/assets/stylesheets/uniform/helpers/padding.scss
107
+ - lib/assets/stylesheets/uniform/helpers/position.scss
108
+ - lib/assets/stylesheets/uniform/helpers/sizes.scss
109
+ - lib/assets/stylesheets/uniform/helpers/text.scss
110
+ - lib/assets/stylesheets/uniform/mixins.scss
111
+ - lib/assets/stylesheets/uniform/print/grid.scss
112
+ - lib/assets/stylesheets/uniform/variables.scss
113
+ - lib/uniform.rb
114
+ - lib/uniform/version.rb
123
115
  homepage: http://bemky.github.io/uniform/
124
116
  licenses:
125
117
  - MIT
@@ -132,15 +124,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
132
124
  requirements:
133
125
  - - ">="
134
126
  - !ruby/object:Gem::Version
135
- version: 1.9.3
127
+ version: '0'
136
128
  required_rubygems_version: !ruby/object:Gem::Requirement
137
129
  requirements:
138
130
  - - ">="
139
131
  - !ruby/object:Gem::Version
140
- version: 1.3.6
132
+ version: '0'
141
133
  requirements: []
142
134
  rubyforge_project:
143
- rubygems_version: 2.6.11
135
+ rubygems_version: 2.7.6
144
136
  signing_key:
145
137
  specification_version: 4
146
138
  summary: Sass UI
data/.gitignore DELETED
@@ -1,2 +0,0 @@
1
- .sass-cache/*
2
- *.gem
data/CHANGELOG.md DELETED
@@ -1,27 +0,0 @@
1
- # Change Log
2
-
3
- ## 1.0
4
- This is the first really stable and usable release of Uniform. Many of the components were rewritten, removed, and added. In general, this release brings a shift in methodology. Building with Uniform now supplies and relies on more helpers to build things out.
5
-
6
- *This will break everything in previous versions.* Many component names went from `title-case` to `camelCase`, and many modifier classes inside of components were removed in favor of using helper classes in html.
7
-
8
- ### Added
9
- - `uniformAlert`
10
- - `uniformDropdown`
11
- - `uniformSelect`
12
- - `uniformFloatingLabel`
13
- - `uniformModal`
14
- - `uniformTable`
15
- - `uniformTooltip`
16
- - tons of helper classes like `margin`, `pad`, `border-top`...
17
-
18
- ### Removed
19
- - `bourbon` and `neat` dependencies
20
- - custom sass functions
21
- - `uniform-list`, `uniform-checks`, `uniform-step`, `uniform-icons`
22
-
23
- ### Changed
24
- - `title-case` to `camelCase` for all compontents
25
- - `inline-input` to `uniformInputGroup`
26
- - `.container` to `.grid` was completely overhauld to use flexbox
27
- - `table-container` to `table`
data/CNAME DELETED
@@ -1 +0,0 @@
1
- uniform-ui.com
data/Gemfile DELETED
@@ -1,8 +0,0 @@
1
- # Specify your gem's dependencies in uniform.gemspec
2
- source 'https://rubygems.org'
3
-
4
- # Stylesheets
5
- gem 'sass'
6
- gem 'sprockets-sass'
7
- gem 'rake'
8
- gem 'activesupport'
data/Gemfile.lock DELETED
@@ -1,40 +0,0 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
- activesupport (5.0.0.1)
5
- concurrent-ruby (~> 1.0, >= 1.0.2)
6
- i18n (~> 0.7)
7
- minitest (~> 5.1)
8
- tzinfo (~> 1.1)
9
- concurrent-ruby (1.0.2)
10
- hike (1.2.3)
11
- i18n (0.7.0)
12
- minitest (5.9.0)
13
- multi_json (1.12.1)
14
- rack (1.6.4)
15
- rake (11.3.0)
16
- sass (3.4.22)
17
- sprockets (2.12.4)
18
- hike (~> 1.2)
19
- multi_json (~> 1.0)
20
- rack (~> 1.0)
21
- tilt (~> 1.1, != 1.3.0)
22
- sprockets-sass (1.3.1)
23
- sprockets (~> 2.0)
24
- tilt (~> 1.1)
25
- thread_safe (0.3.5)
26
- tilt (1.4.1)
27
- tzinfo (1.2.2)
28
- thread_safe (~> 0.1)
29
-
30
- PLATFORMS
31
- ruby
32
-
33
- DEPENDENCIES
34
- activesupport
35
- rake
36
- sass
37
- sprockets-sass
38
-
39
- BUNDLED WITH
40
- 1.15.4
data/LICENSE DELETED
@@ -1,22 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2014 Ben Ehmke
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 all
13
- 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 THE
21
- SOFTWARE.
22
-
data/README.md DELETED
@@ -1,35 +0,0 @@
1
- ![alt text](https://raw.githubusercontent.com/bemky/uniform/master/site/logo.png)
2
-
3
- A rails gem of sass compenents and defaults for building a UI that's on fleak.
4
-
5
- Demo and Documentation: http://uniform-ui.com
6
-
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
10
-
11
- gem 'uniform-ui'
12
-
13
- And then execute:
14
-
15
- $ bundle
16
-
17
- Or install it yourself as:
18
-
19
- $ gem install uniform-ui
20
-
21
- Include the css library in your asset pipeline.
22
-
23
- ```scss
24
- @import 'uniform';
25
- ```
26
-
27
- ## Usage
28
-
29
- TODO documentation on importing individual compontents
30
-
31
- ## Development
32
-
33
- To compile preview:
34
-
35
- rake compile
data/Rakefile DELETED
@@ -1,74 +0,0 @@
1
- require 'active_support/core_ext/string'
2
- require 'fileutils'
3
- require 'sprockets'
4
- require "sprockets-sass"
5
- require 'bundler/setup'
6
-
7
- Bundler.require(:default)
8
-
9
- # Setup Sprockets
10
- environment = Sprockets::Environment.new
11
- environment.append_path 'vendor/assets/stylesheets'
12
- environment.append_path 'preview'
13
- environment.css_compressor = :scss
14
-
15
- desc "Compile page"
16
- task :compile do
17
-
18
- File.open('./site/uniform.css', "w") do |file|
19
- file << environment['uniform.scss']
20
- end
21
-
22
- File.open('./site/preview.css', "w") do |file|
23
- file << environment['preview.scss']
24
- end
25
-
26
- # Render the test html file
27
- File.open('./index.html', 'w') do |file|
28
- file.write(
29
- render_with_layout("preview/index.html.erb")
30
- )
31
- end
32
-
33
- Dir.foreach(File.join('preview')).select{|file| file =~ /\.erb$/}.each do |file_name|
34
- File.open("./site/#{file_name.gsub('.erb', '')}", 'w') do |file|
35
- file.write(
36
- render_with_layout("preview/#{file_name}")
37
- )
38
- end
39
- end
40
-
41
- end
42
-
43
- def capture
44
- old_output = @output
45
- @output = ""
46
- yield
47
- ensure
48
- @output = old_output
49
- end
50
-
51
- def html_block(**options, &block)
52
- @output << "<pre class='#{options[:class]}'>"
53
- @output << CGI::escapeHTML(capture(&block).strip)
54
- @output << "</pre>"
55
- end
56
-
57
- def render_with_layout(template_path, context = self)
58
- template = File.read(template_path)
59
- layout = File.read('preview/layout.html.erb')
60
- [template, layout].inject(nil) do |prev, temp|
61
- render(temp){prev}
62
- end
63
- end
64
-
65
- def render(template)
66
- ERB.new(template, nil, nil, "@output").result( binding )
67
- end
68
-
69
- class UrlGenerator < Sprockets::DirectiveProcessor
70
- protected
71
- def process_source
72
- @result << @pathname.to_s << "\n" unless @has_written_body
73
- end
74
- end