cuba-contrib 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cuba/contrib/text_helpers.rb +3 -3
- data/lib/cuba/contrib/version.rb +1 -1
- data/views/field.mote +2 -2
- metadata +8 -8
@@ -7,13 +7,13 @@ class Cuba
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def truncate(str, length, ellipses = "...")
|
10
|
-
return str if str.length <= length
|
10
|
+
return str if !str || str.length <= length
|
11
11
|
|
12
12
|
sprintf("%.#{length}s#{ellipses}", str)
|
13
13
|
end
|
14
14
|
|
15
15
|
def nl2br(str)
|
16
|
-
str.gsub(/\n|\r\n/, "<br>")
|
16
|
+
str.to_s.gsub(/\n|\r\n/, "<br>")
|
17
17
|
end
|
18
18
|
|
19
19
|
def currency(amount, unit = "$")
|
@@ -32,4 +32,4 @@ class Cuba
|
|
32
32
|
str.gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').downcase
|
33
33
|
end
|
34
34
|
end
|
35
|
-
end
|
35
|
+
end
|
data/lib/cuba/contrib/version.rb
CHANGED
data/views/field.mote
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cuba-contrib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
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-11-
|
12
|
+
date: 2011-11-21 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cuba
|
16
|
-
requirement: &
|
16
|
+
requirement: &2160364820 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2160364820
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: cutest
|
27
|
-
requirement: &
|
27
|
+
requirement: &2160363780 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2160363780
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: capybara
|
38
|
-
requirement: &
|
38
|
+
requirement: &2160362800 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2160362800
|
47
47
|
description: Includes various helper tools for Cuba.
|
48
48
|
email:
|
49
49
|
- me@cyrildavid.com
|