bootswatch-rails 0.3.1 → 0.3.2

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.
data/HISTORY.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.3.2 (2013-01-23)
2
+
3
+ * Escape complex arguments to box-shadow in Simplex (reported @murtra)
4
+ * Make glyphicon links rails-friendly by default (reported @nysalor)
5
+
1
6
  ## 0.3.1 (2013-01-14)
2
7
 
3
8
  * Add !default to all bootswatch variables, making them overridable
data/converter CHANGED
@@ -48,6 +48,21 @@ convert_include_syntax = lambda do |line, _|
48
48
  end
49
49
  end
50
50
 
51
+ escape_box_shadow_arguments = lambda do |line, _|
52
+ box_shadow = /@include\s+box-shadow/
53
+ without_comma = /@include\s+box-shadow\([^,]+$/
54
+ without_dollar = /@include\s+box-shadow\([^\$]+$/
55
+
56
+ with_dollar_and_comma =
57
+ (line !~ without_comma) && (line !~ without_dollar)
58
+
59
+ if line =~ box_shadow && with_dollar_and_comma
60
+ line.sub(/\((.+)\);/) { "(\#{#{$1}});" }
61
+ else
62
+ line
63
+ end
64
+ end
65
+
51
66
  swap_spin_adjust_hue = lambda do |line, _|
52
67
  line.gsub(/(\W)spin\(/) do
53
68
  "#{$1}adjust-hue("
@@ -83,6 +98,16 @@ clear_out_escapes = lambda do |line, _|
83
98
  line.gsub(/~"([^"]+)"/) { $1 }
84
99
  end
85
100
 
101
+ rewrite_image_paths = lambda do |line, _|
102
+ if line =~ /^\s*\$/ && line.include?(':') && line.include?('.png"')
103
+ line.sub(/"([^"]+)"/) do
104
+ "image-path(\"#{File.basename($1)}\")"
105
+ end
106
+ else
107
+ line
108
+ end
109
+ end
110
+
86
111
  mark_variables_default = lambda do |line, _|
87
112
  if line =~ /^\s*\$/ && line.include?(':')
88
113
  line.sub(';', ' !default;')
@@ -93,17 +118,21 @@ end
93
118
 
94
119
  line_processors = [
95
120
  swap_variable_prefix,
96
- # turn_percentages_into_percentiles,
121
+ turn_percentages_into_percentiles,
97
122
  convert_mixin_declarations,
98
123
  convert_namespace_include_syntax,
99
124
  convert_include_syntax,
125
+ escape_box_shadow_arguments,
100
126
  swap_spin_adjust_hue,
101
127
  resolve_ampersand_dash,
102
128
  clear_out_escapes
103
129
  ]
104
130
 
105
131
  if File.basename(src_file_path) =~ /variables/
106
- line_processors << mark_variables_default
132
+ line_processors += [
133
+ rewrite_image_paths,
134
+ mark_variables_default
135
+ ]
107
136
  end
108
137
 
109
138
  comment_line = /^\s*\/\//
@@ -1,5 +1,5 @@
1
1
  module Bootswatch
2
2
  module Rails
3
- VERSION = "0.3.1"
3
+ VERSION = "0.3.2"
4
4
  end
5
5
  end
@@ -191,8 +191,8 @@ $zindexModal: 1050 !default;
191
191
 
192
192
  // Sprite icons path
193
193
  // -------------------------
194
- $iconSpritePath: "../img/glyphicons-halflings.png" !default;
195
- $iconWhiteSpritePath: "../img/glyphicons-halflings-white.png" !default;
194
+ $iconSpritePath: image-path("glyphicons-halflings.png") !default;
195
+ $iconWhiteSpritePath: image-path("glyphicons-halflings-white.png") !default;
196
196
 
197
197
 
198
198
  // Input placeholder text color
@@ -151,8 +151,8 @@ $zindexModal: 1050 !default;
151
151
 
152
152
  // Sprite icons path
153
153
  // -------------------------
154
- $iconSpritePath: "../img/glyphicons-halflings.png" !default;
155
- $iconWhiteSpritePath: "../img/glyphicons-halflings-white.png" !default;
154
+ $iconSpritePath: image-path("glyphicons-halflings.png") !default;
155
+ $iconWhiteSpritePath: image-path("glyphicons-halflings-white.png") !default;
156
156
 
157
157
 
158
158
  // Input placeholder text color
@@ -151,8 +151,8 @@ $zindexModal: 1050 !default;
151
151
 
152
152
  // Sprite icons path
153
153
  // -------------------------
154
- $iconSpritePath: "../img/glyphicons-halflings.png" !default;
155
- $iconWhiteSpritePath: "../img/glyphicons-halflings-white.png" !default;
154
+ $iconSpritePath: image-path("glyphicons-halflings.png") !default;
155
+ $iconWhiteSpritePath: image-path("glyphicons-halflings-white.png") !default;
156
156
 
157
157
 
158
158
  // Input placeholder text color
@@ -151,8 +151,8 @@ $zindexModal: 1050 !default;
151
151
 
152
152
  // Sprite icons path
153
153
  // -------------------------
154
- $iconSpritePath: "../img/glyphicons-halflings.png" !default;
155
- $iconWhiteSpritePath: "../img/glyphicons-halflings-white.png" !default;
154
+ $iconSpritePath: image-path("glyphicons-halflings.png") !default;
155
+ $iconWhiteSpritePath: image-path("glyphicons-halflings-white.png") !default;
156
156
 
157
157
 
158
158
  // Input placeholder text color
@@ -151,8 +151,8 @@ $zindexModal: 1050 !default;
151
151
 
152
152
  // Sprite icons path
153
153
  // -------------------------
154
- $iconSpritePath: "../img/glyphicons-halflings.png" !default;
155
- $iconWhiteSpritePath: "../img/glyphicons-halflings-white.png" !default;
154
+ $iconSpritePath: image-path("glyphicons-halflings.png") !default;
155
+ $iconWhiteSpritePath: image-path("glyphicons-halflings-white.png") !default;
156
156
 
157
157
 
158
158
  // Input placeholder text color
@@ -151,8 +151,8 @@ $zindexModal: 1050 !default;
151
151
 
152
152
  // Sprite icons path
153
153
  // -------------------------
154
- $iconSpritePath: "../img/glyphicons-halflings.png" !default;
155
- $iconWhiteSpritePath: "../img/glyphicons-halflings-white.png" !default;
154
+ $iconSpritePath: image-path("glyphicons-halflings.png") !default;
155
+ $iconWhiteSpritePath: image-path("glyphicons-halflings-white.png") !default;
156
156
 
157
157
 
158
158
  // Input placeholder text color
@@ -137,7 +137,7 @@ div.subnav {
137
137
  font-family: $headingsFontFamily;
138
138
 
139
139
  &.subnav-fixed {
140
- @include box-shadow(inset 0 5px #fff, $boxShadow);
140
+ @include box-shadow(#{inset 0 5px #fff, $boxShadow});
141
141
  }
142
142
 
143
143
  .nav > li > a {
@@ -308,7 +308,7 @@ div.subnav {
308
308
  .breadcrumb {
309
309
  background-color: $white;
310
310
  border: 0px solid transparent;
311
- @include box-shadow($boxShadow, -1px -1px 0 rgba(0, 0, 0, 0.1));
311
+ @include box-shadow(#{$boxShadow, -1px -1px 0 rgba(0, 0, 0, 0.1)});
312
312
 
313
313
  li {
314
314
  padding-top: 2px;
@@ -416,13 +416,13 @@ i[class^="icon-"]{
416
416
  }
417
417
 
418
418
  .well {
419
- @include box-shadow($boxShadow, -1px -1px 0 rgba(0, 0, 0, 0.1));
419
+ @include box-shadow(#{$boxShadow, -1px -1px 0 rgba(0, 0, 0, 0.1)});
420
420
  border: none;
421
421
  }
422
422
 
423
423
  .hero-unit {
424
424
  background-color: $navbarBackground;
425
- @include box-shadow($boxShadow, -1px -1px 0 rgba(0, 0, 0, 0.1));
425
+ @include box-shadow(#{$boxShadow, -1px -1px 0 rgba(0, 0, 0, 0.1)});
426
426
  }
427
427
 
428
428
  .thumbnail {
@@ -151,8 +151,8 @@ $zindexModal: 1050 !default;
151
151
 
152
152
  // Sprite icons path
153
153
  // -------------------------
154
- $iconSpritePath: "../img/glyphicons-halflings.png" !default;
155
- $iconWhiteSpritePath: "../img/glyphicons-halflings-white.png" !default;
154
+ $iconSpritePath: image-path("glyphicons-halflings.png") !default;
155
+ $iconWhiteSpritePath: image-path("glyphicons-halflings-white.png") !default;
156
156
 
157
157
 
158
158
  // Input placeholder text color
@@ -151,8 +151,8 @@ $zindexModal: 1050 !default;
151
151
 
152
152
  // Sprite icons path
153
153
  // -------------------------
154
- $iconSpritePath: "../img/glyphicons-halflings.png" !default;
155
- $iconWhiteSpritePath: "../img/glyphicons-halflings-white.png" !default;
154
+ $iconSpritePath: image-path("glyphicons-halflings.png") !default;
155
+ $iconWhiteSpritePath: image-path("glyphicons-halflings-white.png") !default;
156
156
 
157
157
 
158
158
  // Input placeholder text color
@@ -191,8 +191,8 @@ $zindexModal: 1050 !default;
191
191
 
192
192
  // Sprite icons path
193
193
  // -------------------------
194
- $iconSpritePath: "../img/glyphicons-halflings.png" !default;
195
- $iconWhiteSpritePath: "../img/glyphicons-halflings-white.png" !default;
194
+ $iconSpritePath: image-path("glyphicons-halflings.png") !default;
195
+ $iconWhiteSpritePath: image-path("glyphicons-halflings-white.png") !default;
196
196
 
197
197
 
198
198
  // Input placeholder text color
@@ -151,8 +151,8 @@ $zindexModal: 1050 !default;
151
151
 
152
152
  // Sprite icons path
153
153
  // -------------------------
154
- $iconSpritePath: "../img/glyphicons-halflings.png" !default;
155
- $iconWhiteSpritePath: "../img/glyphicons-halflings-white.png" !default;
154
+ $iconSpritePath: image-path("glyphicons-halflings.png") !default;
155
+ $iconWhiteSpritePath: image-path("glyphicons-halflings-white.png") !default;
156
156
 
157
157
 
158
158
  // Input placeholder text color
@@ -151,8 +151,8 @@ $zindexModal: 1050 !default;
151
151
 
152
152
  // Sprite icons path
153
153
  // -------------------------
154
- $iconSpritePath: "../img/glyphicons-halflings.png" !default;
155
- $iconWhiteSpritePath: "../img/glyphicons-halflings-white.png" !default;
154
+ $iconSpritePath: image-path("glyphicons-halflings.png") !default;
155
+ $iconWhiteSpritePath: image-path("glyphicons-halflings-white.png") !default;
156
156
 
157
157
 
158
158
  // Input placeholder text color
@@ -151,8 +151,8 @@ $zindexModal: 1050 !default;
151
151
 
152
152
  // Sprite icons path
153
153
  // -------------------------
154
- $iconSpritePath: "../img/glyphicons-halflings.png" !default;
155
- $iconWhiteSpritePath: "../img/glyphicons-halflings-white.png" !default;
154
+ $iconSpritePath: image-path("glyphicons-halflings.png") !default;
155
+ $iconWhiteSpritePath: image-path("glyphicons-halflings-white.png") !default;
156
156
 
157
157
 
158
158
  // Input placeholder text color
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootswatch-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-14 00:00:00.000000000 Z
12
+ date: 2013-01-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties