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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7bdcb9fc321233729976408b21c9363b7954b895
4
- data.tar.gz: 87528c4ece20a402a56534e709ca4652a8583ba3
3
+ metadata.gz: 2344c6b778c19b92987287199380829193b34412
4
+ data.tar.gz: df17a1133caeaa539daa251bfd62c4e9ddfa8db4
5
5
  SHA512:
6
- metadata.gz: ff6287970ce4b1e95d0694da36f4caed5d4f637bcaca5ef5b278ebeaa8f8d587e7eda508ed8ba050c606c1c8edc8ca096948f9df9f028edb6680f302344d5a92
7
- data.tar.gz: 2052486459eeaa7364ef023a78c7fb488e31ece5a4f3c913b80f83ffdea4eb62850faa7813e1cff4e244c6d71983e68fca4b081a60b8753fed26bb943d87d13a
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
@@ -29,4 +29,5 @@ Gem::Specification.new do |spec|
29
29
 
30
30
  spec.add_development_dependency "bundler", "~> 1.9"
31
31
  spec.add_development_dependency "rake", "~> 10.0"
32
+ spec.add_development_dependency "rails", "~> 4.2"
32
33
  end
data/lib/jextend.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require "jextend/engine"
1
2
  require "jextend/version"
2
3
 
3
4
  module Jextend
@@ -0,0 +1,4 @@
1
+ module Jextend
2
+ class Engine < ::Rails::Engine
3
+ end
4
+ end
@@ -1,3 +1,3 @@
1
1
  module Jextend
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -1,2 +1,4 @@
1
+ //= require jextend/string
2
+ //= require jextend/date
1
3
  //= require jextend/array
2
4
  //= require jextend/math
@@ -0,0 +1,8 @@
1
+ Array.prototype.contains = function (element) {
2
+ for (var i = 0; i < this.length; i++) {
3
+ if (this[i] == element) {
4
+ return true;
5
+ }
6
+ }
7
+ return false;
8
+ };
@@ -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.0
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