zfben_libjs 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +4 -0
- data/lib/zfben_libjs.rb +9 -9
- data/lib/zfben_libjs/collection.rb +1 -1
- data/lib/zfben_libjs/{helper.rb → helpers.rb} +2 -0
- data/zfben_libjs.gemspec +1 -1
- metadata +16 -17
- data/lib/zfben_libjs/sinatra.rb +0 -3
data/README.rdoc
CHANGED
data/lib/zfben_libjs.rb
CHANGED
@@ -17,7 +17,7 @@ module Zfben_libjs
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
['lib.rb', 'source.rb', 'initialize.rb', 'collection.rb', '
|
20
|
+
['lib.rb', 'source.rb', 'initialize.rb', 'collection.rb', 'helpers.rb', 'railtie.rb', 'sinatra.rb'].each { |f| require File.join(File.dirname(__FILE__), 'zfben_libjs', f) }
|
21
21
|
|
22
22
|
def err msg
|
23
23
|
STDERR.print "#{msg}\n".color(:red)
|
@@ -65,13 +65,13 @@ class Zfben_libjs::Libjs
|
|
65
65
|
|
66
66
|
tip '== [2/2] Generate lib.js =='
|
67
67
|
|
68
|
-
libjs = File.read(@libs['lazyload'][0]) <<
|
68
|
+
libjs = File.read(@libs['lazyload'][0]) << ";\n"
|
69
69
|
|
70
70
|
libjs_core = File.read(File.join(@path_gem, 'lib.coffee'))
|
71
71
|
|
72
72
|
libjs_core = CoffeeScript.compile(libjs_core)
|
73
73
|
|
74
|
-
libjs << libjs_core <<
|
74
|
+
libjs << libjs_core << ";\n"
|
75
75
|
|
76
76
|
@urls = {}
|
77
77
|
|
@@ -91,8 +91,8 @@ class Zfben_libjs::Libjs
|
|
91
91
|
@urls[lib] = path
|
92
92
|
end
|
93
93
|
|
94
|
-
libjs << "\n/* libs */\nlib.libs(#{@urls.to_json});lib.loaded('add', 'lazyload')
|
95
|
-
libjs << Time.now.strftime(
|
94
|
+
libjs << "\n/* libs */\nlib.libs(#{@urls.to_json});lib.loaded('add', 'lazyload');\n"
|
95
|
+
libjs << Time.now.strftime("lib.defaults.version = '?%s';\n")
|
96
96
|
|
97
97
|
if @opts.has_key?(:bundle)
|
98
98
|
bundle = {}
|
@@ -109,7 +109,7 @@ class Zfben_libjs::Libjs
|
|
109
109
|
when '.css'
|
110
110
|
css << File.read(file)
|
111
111
|
when '.js'
|
112
|
-
js << File.read(file) <<
|
112
|
+
js << File.read(file) << ";\n"
|
113
113
|
end
|
114
114
|
end
|
115
115
|
end
|
@@ -136,7 +136,7 @@ class Zfben_libjs::Libjs
|
|
136
136
|
end
|
137
137
|
end
|
138
138
|
|
139
|
-
libjs << "\n/* bundle */\nlib.libs(#{bundle.to_json})
|
139
|
+
libjs << "\n/* bundle */\nlib.libs(#{bundle.to_json});\n"
|
140
140
|
end
|
141
141
|
|
142
142
|
if @opts.has_key?(:routes)
|
@@ -145,12 +145,12 @@ class Zfben_libjs::Libjs
|
|
145
145
|
lib_name = lib_name.join ' ' if lib_name.class == Array
|
146
146
|
routes[path] = lib_name
|
147
147
|
end
|
148
|
-
libjs << "\n/* routes */\nlib.routes('add', #{routes.to_json})
|
148
|
+
libjs << "\n/* routes */\nlib.routes('add', #{routes.to_json});\n"
|
149
149
|
end
|
150
150
|
|
151
151
|
if @opts.has_key?(:preload)
|
152
152
|
preload = @opts[:preload].class == Array ? @opts[:preload] : [ @opts[:preload] ]
|
153
|
-
libjs << "\n/* preload */\nlib('#{preload.join(' ')}')
|
153
|
+
libjs << "\n/* preload */\nlib('#{preload.join(' ')}');\n"
|
154
154
|
end
|
155
155
|
|
156
156
|
libjs = minify(libjs, :js) if @opts[:config]['minify']
|
data/zfben_libjs.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zfben_libjs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
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-09-
|
12
|
+
date: 2011-09-13 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rainbow
|
16
|
-
requirement: &
|
16
|
+
requirement: &8862080 !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: *8862080
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: json
|
27
|
-
requirement: &
|
27
|
+
requirement: &8861480 !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: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *8861480
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: compass
|
38
|
-
requirement: &
|
38
|
+
requirement: &8860900 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *8860900
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: coffee-script
|
49
|
-
requirement: &
|
49
|
+
requirement: &8860320 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *8860320
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: uglifier
|
60
|
-
requirement: &
|
60
|
+
requirement: &8859640 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *8859640
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: activesupport
|
71
|
-
requirement: &
|
71
|
+
requirement: &8858700 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *8858700
|
80
80
|
description: ''
|
81
81
|
email:
|
82
82
|
- ben@zfben.com
|
@@ -91,13 +91,12 @@ files:
|
|
91
91
|
- bin/libjs
|
92
92
|
- lib/zfben_libjs.rb
|
93
93
|
- lib/zfben_libjs/collection.rb
|
94
|
-
- lib/zfben_libjs/
|
94
|
+
- lib/zfben_libjs/helpers.rb
|
95
95
|
- lib/zfben_libjs/initialize.rb
|
96
96
|
- lib/zfben_libjs/lib.coffee
|
97
97
|
- lib/zfben_libjs/lib.rb
|
98
98
|
- lib/zfben_libjs/libjs.yml
|
99
99
|
- lib/zfben_libjs/railtie.rb
|
100
|
-
- lib/zfben_libjs/sinatra.rb
|
101
100
|
- lib/zfben_libjs/source.rb
|
102
101
|
- lib/zfben_libjs/support_source/coffee.rb
|
103
102
|
- lib/zfben_libjs/support_source/css.rb
|
@@ -150,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
149
|
version: '0'
|
151
150
|
requirements: []
|
152
151
|
rubyforge_project:
|
153
|
-
rubygems_version: 1.8.
|
152
|
+
rubygems_version: 1.8.10
|
154
153
|
signing_key:
|
155
154
|
specification_version: 3
|
156
155
|
summary: ''
|
data/lib/zfben_libjs/sinatra.rb
DELETED