anjlab-bootstrap-rails 1.4.0.12 → 1.4.0.13
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +9 -1
- data/bootstrap-rails.gemspec +1 -0
- data/lib/bootstrap-rails.rb +1 -0
- data/lib/bootstrap-rails/ie_hex_str.rb +2 -7
- data/lib/bootstrap-rails/version.rb +1 -1
- data/test/ie_hex_str_test.rb +26 -0
- data/test/test_helper.rb +2 -0
- metadata +26 -11
data/Rakefile
CHANGED
data/bootstrap-rails.gemspec
CHANGED
data/lib/bootstrap-rails.rb
CHANGED
@@ -8,13 +8,8 @@ module Sass::Script::Functions
|
|
8
8
|
assert_type color, :Color
|
9
9
|
alpha = (color.alpha * 255).round
|
10
10
|
alpha = alpha.to_s(16).rjust(2, '0')
|
11
|
-
color_string = color.to_s.
|
12
|
-
|
13
|
-
|
14
|
-
r, g, b = *color_values
|
15
|
-
if color_values.size == 3
|
16
|
-
color_string = "#{r}#{r}#{g}#{g}#{b}#{b}"
|
17
|
-
end
|
11
|
+
color_string = color.rgb.map {|num| num.to_s(16).rjust(2, '0')} .join
|
12
|
+
|
18
13
|
Sass::Script::String.new("##{alpha}#{color_string}")
|
19
14
|
end
|
20
15
|
declare :ie_hex_str, :args => [:color]
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'sass/script'
|
3
|
+
|
4
|
+
class IeHexStrText < Test::Unit::TestCase
|
5
|
+
def test_named_color
|
6
|
+
assert_equal("#ffffffff", evaluate("ie_hex_str(#ffffff)"))
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_rgba_color
|
10
|
+
assert_equal("#1affffff", evaluate("ie_hex_str(rgba(255, 255, 255, 0.1))"))
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_rgb_color
|
14
|
+
assert_equal("#ffffffff", evaluate("ie_hex_str(rgb(255, 255, 255))"))
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_hsl_color
|
18
|
+
assert_equal("#ffffffff", evaluate("ie_hex_str(hsl(100%, 100%, 100%))"))
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def evaluate(value)
|
24
|
+
Sass::Script::Parser.parse(value, 0, 0).perform(Sass::Environment.new).to_s
|
25
|
+
end
|
26
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anjlab-bootstrap-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.0.
|
4
|
+
version: 1.4.0.13
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-12-
|
12
|
+
date: 2011-12-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
16
|
-
requirement: &
|
16
|
+
requirement: &70291325873160 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70291325873160
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: thor
|
27
|
-
requirement: &
|
27
|
+
requirement: &70291325872240 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,21 @@ dependencies:
|
|
32
32
|
version: '0.14'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70291325872240
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: sass
|
38
|
+
requirement: &70291325871500 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70291325871500
|
36
47
|
- !ruby/object:Gem::Dependency
|
37
48
|
name: bundler
|
38
|
-
requirement: &
|
49
|
+
requirement: &70291325870820 !ruby/object:Gem::Requirement
|
39
50
|
none: false
|
40
51
|
requirements:
|
41
52
|
- - ! '>='
|
@@ -43,10 +54,10 @@ dependencies:
|
|
43
54
|
version: 1.0.0
|
44
55
|
type: :development
|
45
56
|
prerelease: false
|
46
|
-
version_requirements: *
|
57
|
+
version_requirements: *70291325870820
|
47
58
|
- !ruby/object:Gem::Dependency
|
48
59
|
name: rails
|
49
|
-
requirement: &
|
60
|
+
requirement: &70291325870220 !ruby/object:Gem::Requirement
|
50
61
|
none: false
|
51
62
|
requirements:
|
52
63
|
- - ~>
|
@@ -54,7 +65,7 @@ dependencies:
|
|
54
65
|
version: '3.0'
|
55
66
|
type: :development
|
56
67
|
prerelease: false
|
57
|
-
version_requirements: *
|
68
|
+
version_requirements: *70291325870220
|
58
69
|
description: Twitter Bootstrap CSS (with SASS flavour) and JS toolkits for Rails 3
|
59
70
|
projects
|
60
71
|
email:
|
@@ -73,6 +84,8 @@ files:
|
|
73
84
|
- lib/bootstrap-rails/ie_hex_str.rb
|
74
85
|
- lib/bootstrap-rails/railtie.rb
|
75
86
|
- lib/bootstrap-rails/version.rb
|
87
|
+
- test/ie_hex_str_test.rb
|
88
|
+
- test/test_helper.rb
|
76
89
|
- vendor/assets/javascripts/bootstrap-alerts.js
|
77
90
|
- vendor/assets/javascripts/bootstrap-buttons.js
|
78
91
|
- vendor/assets/javascripts/bootstrap-dropdown.js
|
@@ -115,4 +128,6 @@ rubygems_version: 1.8.10
|
|
115
128
|
signing_key:
|
116
129
|
specification_version: 3
|
117
130
|
summary: Bootstrap CSS (with SASS flavour) and JS toolkits for Rails 3 projects
|
118
|
-
test_files:
|
131
|
+
test_files:
|
132
|
+
- test/ie_hex_str_test.rb
|
133
|
+
- test/test_helper.rb
|