jextend 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +106 -0
- data/jextend.gemspec +1 -0
- data/lib/jextend.rb +1 -0
- data/lib/jextend/engine.rb +4 -0
- data/lib/jextend/version.rb +1 -1
- data/vendor/assets/javascripts/jextend.js +2 -0
- data/vendor/assets/javascripts/jextend/array.js +8 -0
- data/vendor/assets/javascripts/jextend/date.js +15 -0
- data/vendor/assets/javascripts/jextend/string.js +22 -0
- metadata +19 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2344c6b778c19b92987287199380829193b34412
|
4
|
+
data.tar.gz: df17a1133caeaa539daa251bfd62c4e9ddfa8db4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: faa62ee530f9372c0cba914b875a7e683ac7d7448e76d060d48adae4bdb40c9865416fbee971217f455c5513d421542a1b1af25c16486c229163b5607e329922
|
7
|
+
data.tar.gz: 69e66cb499291365e56e31ea0e9d39410683ba1c7c1c4fc400bb4198fe450fcf28d24a88b40d4e261647ddbf310987948e0b6ebafecb2eb2e91b4e77796efef7
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
jextend (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://ruby.taobao.org/
|
8
|
+
specs:
|
9
|
+
actionmailer (4.2.4)
|
10
|
+
actionpack (= 4.2.4)
|
11
|
+
actionview (= 4.2.4)
|
12
|
+
activejob (= 4.2.4)
|
13
|
+
mail (~> 2.5, >= 2.5.4)
|
14
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
15
|
+
actionpack (4.2.4)
|
16
|
+
actionview (= 4.2.4)
|
17
|
+
activesupport (= 4.2.4)
|
18
|
+
rack (~> 1.6)
|
19
|
+
rack-test (~> 0.6.2)
|
20
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
21
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
22
|
+
actionview (4.2.4)
|
23
|
+
activesupport (= 4.2.4)
|
24
|
+
builder (~> 3.1)
|
25
|
+
erubis (~> 2.7.0)
|
26
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
27
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
28
|
+
activejob (4.2.4)
|
29
|
+
activesupport (= 4.2.4)
|
30
|
+
globalid (>= 0.3.0)
|
31
|
+
activemodel (4.2.4)
|
32
|
+
activesupport (= 4.2.4)
|
33
|
+
builder (~> 3.1)
|
34
|
+
activerecord (4.2.4)
|
35
|
+
activemodel (= 4.2.4)
|
36
|
+
activesupport (= 4.2.4)
|
37
|
+
arel (~> 6.0)
|
38
|
+
activesupport (4.2.4)
|
39
|
+
i18n (~> 0.7)
|
40
|
+
json (~> 1.7, >= 1.7.7)
|
41
|
+
minitest (~> 5.1)
|
42
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
43
|
+
tzinfo (~> 1.1)
|
44
|
+
arel (6.0.3)
|
45
|
+
builder (3.2.2)
|
46
|
+
erubis (2.7.0)
|
47
|
+
globalid (0.3.6)
|
48
|
+
activesupport (>= 4.1.0)
|
49
|
+
i18n (0.7.0)
|
50
|
+
json (1.8.3)
|
51
|
+
loofah (2.0.3)
|
52
|
+
nokogiri (>= 1.5.9)
|
53
|
+
mail (2.6.3)
|
54
|
+
mime-types (>= 1.16, < 3)
|
55
|
+
mime-types (2.6.2)
|
56
|
+
mini_portile (0.6.2)
|
57
|
+
minitest (5.8.0)
|
58
|
+
nokogiri (1.6.6.2)
|
59
|
+
mini_portile (~> 0.6.0)
|
60
|
+
rack (1.6.4)
|
61
|
+
rack-test (0.6.3)
|
62
|
+
rack (>= 1.0)
|
63
|
+
rails (4.2.4)
|
64
|
+
actionmailer (= 4.2.4)
|
65
|
+
actionpack (= 4.2.4)
|
66
|
+
actionview (= 4.2.4)
|
67
|
+
activejob (= 4.2.4)
|
68
|
+
activemodel (= 4.2.4)
|
69
|
+
activerecord (= 4.2.4)
|
70
|
+
activesupport (= 4.2.4)
|
71
|
+
bundler (>= 1.3.0, < 2.0)
|
72
|
+
railties (= 4.2.4)
|
73
|
+
sprockets-rails
|
74
|
+
rails-deprecated_sanitizer (1.0.3)
|
75
|
+
activesupport (>= 4.2.0.alpha)
|
76
|
+
rails-dom-testing (1.0.7)
|
77
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
78
|
+
nokogiri (~> 1.6.0)
|
79
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
80
|
+
rails-html-sanitizer (1.0.2)
|
81
|
+
loofah (~> 2.0)
|
82
|
+
railties (4.2.4)
|
83
|
+
actionpack (= 4.2.4)
|
84
|
+
activesupport (= 4.2.4)
|
85
|
+
rake (>= 0.8.7)
|
86
|
+
thor (>= 0.18.1, < 2.0)
|
87
|
+
rake (10.4.2)
|
88
|
+
sprockets (3.3.4)
|
89
|
+
rack (~> 1.0)
|
90
|
+
sprockets-rails (2.3.3)
|
91
|
+
actionpack (>= 3.0)
|
92
|
+
activesupport (>= 3.0)
|
93
|
+
sprockets (>= 2.8, < 4.0)
|
94
|
+
thor (0.19.1)
|
95
|
+
thread_safe (0.3.5)
|
96
|
+
tzinfo (1.2.2)
|
97
|
+
thread_safe (~> 0.1)
|
98
|
+
|
99
|
+
PLATFORMS
|
100
|
+
ruby
|
101
|
+
|
102
|
+
DEPENDENCIES
|
103
|
+
bundler (~> 1.9)
|
104
|
+
jextend!
|
105
|
+
rails (~> 4.2)
|
106
|
+
rake (~> 10.0)
|
data/jextend.gemspec
CHANGED
data/lib/jextend.rb
CHANGED
data/lib/jextend/version.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
Date.prototype.format = function (fmt) {
|
2
|
+
var o = {
|
3
|
+
"M+": this.getMonth() + 1, //月份
|
4
|
+
"d+": this.getDate(), //日
|
5
|
+
"h+": this.getHours(), //小时
|
6
|
+
"m+": this.getMinutes(), //分
|
7
|
+
"s+": this.getSeconds(), //秒
|
8
|
+
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
9
|
+
"S": this.getMilliseconds() //毫秒
|
10
|
+
};
|
11
|
+
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
12
|
+
for (var k in o)
|
13
|
+
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
14
|
+
return fmt;
|
15
|
+
};
|
@@ -0,0 +1,22 @@
|
|
1
|
+
String.prototype.format = function (args) {
|
2
|
+
var result = this;
|
3
|
+
if (arguments.length > 0) {
|
4
|
+
if (arguments.length == 1 && typeof (args) == "object") {
|
5
|
+
for (var key in args) {
|
6
|
+
if (args[key] != undefined) {
|
7
|
+
var reg = new RegExp("({" + key + "})", "g");
|
8
|
+
result = result.replace(reg, args[key]);
|
9
|
+
}
|
10
|
+
}
|
11
|
+
}
|
12
|
+
else {
|
13
|
+
for (var i = 0; i < arguments.length; i++) {
|
14
|
+
if (arguments[i] != undefined) {
|
15
|
+
var reg = new RegExp("({[" + i + "]})", "g");
|
16
|
+
result = result.replace(reg, arguments[i]);
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
return result;
|
22
|
+
};
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jextend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- saxer
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rails
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '4.2'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '4.2'
|
41
55
|
description: javascript extend for rails
|
42
56
|
email:
|
43
57
|
- 15201280641@qq.com
|
@@ -48,6 +62,7 @@ files:
|
|
48
62
|
- ".gitignore"
|
49
63
|
- ".travis.yml"
|
50
64
|
- Gemfile
|
65
|
+
- Gemfile.lock
|
51
66
|
- LICENSE
|
52
67
|
- README.md
|
53
68
|
- Rakefile
|
@@ -55,10 +70,13 @@ files:
|
|
55
70
|
- bin/setup
|
56
71
|
- jextend.gemspec
|
57
72
|
- lib/jextend.rb
|
73
|
+
- lib/jextend/engine.rb
|
58
74
|
- lib/jextend/version.rb
|
59
75
|
- vendor/assets/javascripts/jextend.js
|
60
76
|
- vendor/assets/javascripts/jextend/array.js
|
77
|
+
- vendor/assets/javascripts/jextend/date.js
|
61
78
|
- vendor/assets/javascripts/jextend/math.js
|
79
|
+
- vendor/assets/javascripts/jextend/string.js
|
62
80
|
homepage: https://github.com/mumaoxi/jextend-rails
|
63
81
|
licenses:
|
64
82
|
- MIT
|