zfben_libjs 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +9 -0
- data/Rakefile +1 -0
- data/bin/libjs +25 -0
- data/lib/zfben_libjs/lib.coffee +103 -0
- data/lib/zfben_libjs/lib.rb +75 -0
- data/lib/zfben_libjs/libjs.yml +15 -0
- data/lib/zfben_libjs/version.rb +3 -0
- data/lib/zfben_libjs.rb +311 -0
- data/zfben_libjs.gemspec +39 -0
- metadata +133 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
data/bin/libjs
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require File.join(File.dirname(__FILE__), '..', 'lib', 'zfben_libjs.rb')
|
3
|
+
|
4
|
+
args = ARGF.argv
|
5
|
+
|
6
|
+
if args.length == 0
|
7
|
+
tip 'Please use `libjs [config_filename]` or use `libjs new` to create new libjs project'
|
8
|
+
else
|
9
|
+
if args[0] == 'new'
|
10
|
+
folder = args.length > 1 ? args[1] : 'libjs'
|
11
|
+
if File.exists?(folder)
|
12
|
+
err folder + ' folder is exists!'
|
13
|
+
end
|
14
|
+
system('mkdir ' + folder)
|
15
|
+
cmd = 'cp ' + File.join(File.dirname(__FILE__), '..', 'lib', 'zfben_libjs', 'libjs.yml') + ' ' + folder
|
16
|
+
if system(cmd)
|
17
|
+
tip "Create #{folder}/libjs.yml\nYou can change it then use `libjs #{folder}/libjs` to build it"
|
18
|
+
end
|
19
|
+
else
|
20
|
+
lib = Libjs.new(args[0])
|
21
|
+
if args.length == 1
|
22
|
+
lib.build!
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
# save loaded source to `loaded`
|
2
|
+
loaded = {}
|
3
|
+
|
4
|
+
# save libs to `libs`
|
5
|
+
libs = {}
|
6
|
+
|
7
|
+
# lib start here
|
8
|
+
lib = ->
|
9
|
+
|
10
|
+
# progress arguments to each type
|
11
|
+
css = []
|
12
|
+
js = []
|
13
|
+
funcs = []
|
14
|
+
|
15
|
+
source_types = (args)->
|
16
|
+
for arg in args
|
17
|
+
switch typeof arg
|
18
|
+
when 'string'
|
19
|
+
if typeof loaded[arg] is 'undefined'
|
20
|
+
if arg.indexOf(' ') >= 0
|
21
|
+
source_types(arg.split(' '))
|
22
|
+
else
|
23
|
+
if typeof libs[arg] isnt 'undefined' then source_types(libs[arg])
|
24
|
+
if /\.css[^\.]*$/.test(arg) then css.push(arg)
|
25
|
+
if /\.js[^\.]*$/.test(arg) then js.push(arg)
|
26
|
+
when 'function'
|
27
|
+
funcs.push(arg)
|
28
|
+
else
|
29
|
+
if typeof arg.length isnt 'undefined' then source_types(arg)
|
30
|
+
return true
|
31
|
+
|
32
|
+
source_types(arguments)
|
33
|
+
|
34
|
+
# progress css
|
35
|
+
if css.length > 0
|
36
|
+
if js.length is 0 && funcs.length > 0
|
37
|
+
LazyLoad.css(css, ->
|
38
|
+
for url in css
|
39
|
+
loaded[url] = true
|
40
|
+
for func in funcs
|
41
|
+
func()
|
42
|
+
)
|
43
|
+
else
|
44
|
+
LazyLoad.css(css, ->
|
45
|
+
for url in css
|
46
|
+
loaded[url] = true
|
47
|
+
)
|
48
|
+
|
49
|
+
# progress js
|
50
|
+
if js.length > 0
|
51
|
+
if funcs.length > 0
|
52
|
+
LazyLoad.js(js, ->
|
53
|
+
for url in js
|
54
|
+
loaded[url] = true
|
55
|
+
for func in funcs
|
56
|
+
func()
|
57
|
+
)
|
58
|
+
else
|
59
|
+
LazyLoad.js(js, ->
|
60
|
+
for url in js
|
61
|
+
loaded[url] = true
|
62
|
+
)
|
63
|
+
|
64
|
+
# if everything is loaded, run funcs
|
65
|
+
if css.length is 0 && js.length is 0 && funcs.length > 0
|
66
|
+
for func in funcs
|
67
|
+
func()
|
68
|
+
|
69
|
+
return {
|
70
|
+
css: css
|
71
|
+
js: js
|
72
|
+
funcs: funcs
|
73
|
+
}
|
74
|
+
|
75
|
+
# control loaded api
|
76
|
+
lib.loaded = ->
|
77
|
+
args = Array.prototype.slice.call(arguments)
|
78
|
+
switch args.shift()
|
79
|
+
when 'add'
|
80
|
+
for arg in args
|
81
|
+
if typeof loaded[arg] is 'undefined'
|
82
|
+
loaded[arg] = true
|
83
|
+
when 'del'
|
84
|
+
for arg in args
|
85
|
+
if typeof loaded[arg] isnt 'undefined'
|
86
|
+
delete(loaded[arg])
|
87
|
+
return loaded
|
88
|
+
|
89
|
+
# change libs api
|
90
|
+
lib.libs = (new_libs)->
|
91
|
+
for name, urls of new_libs
|
92
|
+
if urls isnt null
|
93
|
+
libs[name] = urls
|
94
|
+
((name, urls)->
|
95
|
+
lib[name] = ->
|
96
|
+
lib(urls, arguments)
|
97
|
+
)(name, urls)
|
98
|
+
else
|
99
|
+
delete(libs[name])
|
100
|
+
delete(lib[name])
|
101
|
+
return libs
|
102
|
+
|
103
|
+
window.lib = lib
|
@@ -0,0 +1,75 @@
|
|
1
|
+
class String
|
2
|
+
def partition_all(reg)
|
3
|
+
r = self.partition(reg)
|
4
|
+
if reg =~ r[2]
|
5
|
+
r[2] = r[2].partition_all(reg)
|
6
|
+
end
|
7
|
+
return r.flatten
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def get_filetype path
|
12
|
+
return File.extname(path).delete('.')
|
13
|
+
end
|
14
|
+
|
15
|
+
def download url, path
|
16
|
+
if url =~ /:\/\// && (@config['download'] == true || !File.exists?(path))
|
17
|
+
unless system 'wget ' + url + ' -O ' + path + ' -N'
|
18
|
+
p url + ' download fail!'
|
19
|
+
system('rm ' + path)
|
20
|
+
exit!
|
21
|
+
end
|
22
|
+
else
|
23
|
+
system "cp #{url} #{path}" if File.exists?(url) && url != path
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def css_import url, dir
|
28
|
+
path = File.join(dir, File.basename(url))
|
29
|
+
download url, path
|
30
|
+
reg = /@import\s+\(?"([^"]+)"\)?;?/
|
31
|
+
return File.read(path).partition_all(reg).map{ |f|
|
32
|
+
if reg =~ f
|
33
|
+
f = reg.match(f)[1]
|
34
|
+
f = "/* @import #{f} */\n" + css_import(File.join(File.dirname(url), f), dir)
|
35
|
+
end
|
36
|
+
f
|
37
|
+
}.join("\n")
|
38
|
+
end
|
39
|
+
|
40
|
+
def download_images lib, url, path
|
41
|
+
reg = /url\("?'?([^'")]+)'?"?\)/
|
42
|
+
return File.read(path).partition_all(reg).map{ |f|
|
43
|
+
if reg =~ f
|
44
|
+
f = reg.match(f)[1]
|
45
|
+
sub = File.join(File.dirname(path), f)
|
46
|
+
suburl = File.dirname(url) + '/' + f
|
47
|
+
system('mkdir ' + File.dirname(sub)) unless File.exists?(File.dirname(sub))
|
48
|
+
download(suburl, sub)
|
49
|
+
f = sub
|
50
|
+
else
|
51
|
+
f = nil
|
52
|
+
end
|
53
|
+
f
|
54
|
+
}.compact
|
55
|
+
end
|
56
|
+
|
57
|
+
def css2sass css
|
58
|
+
return Sass::CSS.new(css, :cache => false).render(:sass)
|
59
|
+
end
|
60
|
+
|
61
|
+
def minify source, type
|
62
|
+
if source.length > 10
|
63
|
+
min = ''
|
64
|
+
case type
|
65
|
+
when :js
|
66
|
+
min = Uglifier.compile(source, :copyright => false)
|
67
|
+
when :css
|
68
|
+
min = Sass::Engine.new(css2sass(source), { :syntax => :sass, :style => :compressed, :cache => false }).render
|
69
|
+
end
|
70
|
+
if min.length > 10
|
71
|
+
return min
|
72
|
+
end
|
73
|
+
end
|
74
|
+
return source
|
75
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Basic Settings
|
2
|
+
config:
|
3
|
+
src: src # which folder to save files
|
4
|
+
download: false # if file isn't exists, it will be downloaded always
|
5
|
+
minify: true # use uglifier and sass engine to minify files
|
6
|
+
changeImageUrl: true # change image urls in css
|
7
|
+
|
8
|
+
# Files to be download and writen in lib.js
|
9
|
+
libs:
|
10
|
+
jquery: https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js
|
11
|
+
|
12
|
+
jqueryui:
|
13
|
+
- jquery
|
14
|
+
- https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.js
|
15
|
+
- https://raw.github.com/jquery/jquery-ui/master/themes/base/jquery.ui.all.css
|
data/lib/zfben_libjs.rb
ADDED
@@ -0,0 +1,311 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rainbow'
|
3
|
+
require 'json'
|
4
|
+
require 'compass'
|
5
|
+
require 'coffee-script'
|
6
|
+
require 'uglifier'
|
7
|
+
require 'yaml'
|
8
|
+
require 'sass/css'
|
9
|
+
require File.join(File.dirname(__FILE__), 'zfben_libjs', 'lib.rb')
|
10
|
+
|
11
|
+
def err msg
|
12
|
+
STDERR.print "#{msg}\n".color(:red)
|
13
|
+
exit!
|
14
|
+
end
|
15
|
+
|
16
|
+
def tip msg
|
17
|
+
STDOUT.print "#{msg}\n".color(:green)
|
18
|
+
end
|
19
|
+
|
20
|
+
class Libjs
|
21
|
+
def initialize config_file
|
22
|
+
@config_file = File.exists?(config_file) ? [config_file] : Dir[config_file + '*']
|
23
|
+
if @config_file.length == 0 || File.directory?(@config_file[0])
|
24
|
+
err config_file + ' is not exist!'
|
25
|
+
else
|
26
|
+
@config_file = @config_file[0]
|
27
|
+
end
|
28
|
+
|
29
|
+
begin
|
30
|
+
@data = YAML.load(File.read(@config_file))
|
31
|
+
rescue => e
|
32
|
+
err "#{@config_file} load filed!\n#{e}"
|
33
|
+
end
|
34
|
+
|
35
|
+
tip "#{@config_file} load success!"
|
36
|
+
|
37
|
+
p @data
|
38
|
+
end
|
39
|
+
|
40
|
+
def build!
|
41
|
+
print '== Starting Build @' + @config_file
|
42
|
+
|
43
|
+
# Merge default config
|
44
|
+
@config = {
|
45
|
+
'src' => 'src',
|
46
|
+
'download' => false,
|
47
|
+
'minify' => true,
|
48
|
+
'url' => ''
|
49
|
+
}.merge(@data['config'])
|
50
|
+
|
51
|
+
@config['src'] = File.join(File.dirname(@config_file), @config['src'])
|
52
|
+
system('mkdir ' + @config['src']) unless File.exists?(@config['src'])
|
53
|
+
|
54
|
+
['source'].each do |path|
|
55
|
+
@config['src/' + path] = File.join(@config['src'], '.' + path) unless @config.has_key?('src/' + path)
|
56
|
+
system('mkdir ' + @config['src/' + path]) unless File.exists?(@config['src/' + path])
|
57
|
+
end
|
58
|
+
|
59
|
+
['javascripts', 'stylesheets', 'images'].each do |path|
|
60
|
+
@config['url/' + path] = @config['url'] + '/' + path unless @config.has_key?('url/' + path)
|
61
|
+
@config['src/' + path] = File.join(@config['src'], path) unless @config.has_key?('src/' + path)
|
62
|
+
system('mkdir ' + @config['src/' + path]) unless File.exists?(@config['src/' + path])
|
63
|
+
end
|
64
|
+
|
65
|
+
# Merge default libs
|
66
|
+
@libs = {
|
67
|
+
'lazyload' => 'https://raw.github.com/rgrove/lazyload/master/lazyload.js'
|
68
|
+
}.merge(@data['libs'])
|
69
|
+
|
70
|
+
@bundle = @data['bundle']
|
71
|
+
|
72
|
+
@preload = @data['preload']
|
73
|
+
|
74
|
+
if @config.has_key?('before')
|
75
|
+
load @config['before']
|
76
|
+
end
|
77
|
+
|
78
|
+
|
79
|
+
p '== [1/2] Starting Progress Source =='
|
80
|
+
length = @libs.length
|
81
|
+
num = 0
|
82
|
+
@libs.each do |name, urls|
|
83
|
+
num = num + 1
|
84
|
+
p "[#{num}/#{length}] #{name}"
|
85
|
+
urls = [urls] unless urls.class == Array
|
86
|
+
lib = []
|
87
|
+
urls.each do |url|
|
88
|
+
if @libs.has_key?(url)
|
89
|
+
lib.push(url)
|
90
|
+
else
|
91
|
+
path = File.join(@config['src/source'], name, File.basename(url))
|
92
|
+
dir = File.dirname(path)
|
93
|
+
system('mkdir ' + dir) unless File.exists?(dir)
|
94
|
+
download url, path
|
95
|
+
case get_filetype(path)
|
96
|
+
when 'css'
|
97
|
+
css = css_import(url, dir)
|
98
|
+
File.open(path, 'w'){ |f| f.write(css) }
|
99
|
+
images = download_images(name, url, path)
|
100
|
+
if images.length > 0
|
101
|
+
lib.push images
|
102
|
+
end
|
103
|
+
when 'rb'
|
104
|
+
script = eval(File.read(path))
|
105
|
+
rb_path = path
|
106
|
+
css = ''
|
107
|
+
js = ''
|
108
|
+
script.each do | type, content |
|
109
|
+
case type
|
110
|
+
when :css
|
111
|
+
css << content
|
112
|
+
when :js
|
113
|
+
js << content
|
114
|
+
end
|
115
|
+
end
|
116
|
+
if css != ''
|
117
|
+
path = File.join(dir, File.basename(path, '.rb') << '.css')
|
118
|
+
File.open(path, 'w'){ |f| f.write("/* @import #{rb_path} */\n" + css) }
|
119
|
+
elsif js != ''
|
120
|
+
path = File.join(dir, File.basename(path, '.rb') << '.js')
|
121
|
+
File.open(path, 'w'){ |f| f.write("/* @import #{rb_path} */\n" + js) }
|
122
|
+
end
|
123
|
+
when 'sass'
|
124
|
+
options = { :syntax => :sass, :cache => false }.merge(Compass.sass_engine_options)
|
125
|
+
options[:load_paths].push File.dirname(path), File.dirname(url)
|
126
|
+
css = "/* @import #{path} */\n" + Sass::Engine.new(File.read(path), options).render
|
127
|
+
path = File.join(dir, File.basename(path, '.sass') << '.css')
|
128
|
+
File.open(path, 'w'){ |f| f.write(css) }
|
129
|
+
when 'scss'
|
130
|
+
options = { :syntax => :scss, :cache => false }.merge(Compass.sass_engine_options)
|
131
|
+
options[:load_paths].push File.dirname(path), File.dirname(url)
|
132
|
+
css = "/* @import #{path} */\n" + Sass::Engine.new(File.read(path), options).render
|
133
|
+
path = File.join(dir, File.basename(path, '.sass') << '.css')
|
134
|
+
File.open(path, 'w'){ |f| f.write(css) }
|
135
|
+
when 'coffee'
|
136
|
+
js = "/* @import #{path} */\n" + CoffeeScript.compile(File.read(path))
|
137
|
+
path = File.join(dir, File.basename(path, '.coffee') << '.js')
|
138
|
+
File.open(path, 'w'){ |f| f.write(js) }
|
139
|
+
else
|
140
|
+
lib.push url
|
141
|
+
end
|
142
|
+
lib.push(path)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
lib = lib.flatten
|
146
|
+
|
147
|
+
css = ''
|
148
|
+
js = ''
|
149
|
+
lib = lib.map{ |file|
|
150
|
+
if File.exists?(file)
|
151
|
+
content = "/* @import #{file} */\n" + File.read(file)
|
152
|
+
case File.extname(file)
|
153
|
+
when '.css'
|
154
|
+
css << content
|
155
|
+
file = nil
|
156
|
+
when '.js'
|
157
|
+
js << content << ';'
|
158
|
+
file = nil
|
159
|
+
end
|
160
|
+
end
|
161
|
+
file
|
162
|
+
}.compact
|
163
|
+
if css != ''
|
164
|
+
file = File.join(@config['src/source'], name + '.css')
|
165
|
+
File.open(file, 'w'){ |f| f.write(css) }
|
166
|
+
lib.push(file)
|
167
|
+
end
|
168
|
+
if js != ''
|
169
|
+
file = File.join(@config['src/source'], name + '.js')
|
170
|
+
File.open(file, 'w'){ |f| f.write(js) }
|
171
|
+
lib.push(file)
|
172
|
+
end
|
173
|
+
|
174
|
+
@libs[name] = lib.map{ |file|
|
175
|
+
if File.exists?(file)
|
176
|
+
case File.extname(file)
|
177
|
+
when '.js'
|
178
|
+
type = 'javascripts'
|
179
|
+
when '.css'
|
180
|
+
type = 'stylesheets'
|
181
|
+
else
|
182
|
+
type = 'images'
|
183
|
+
end
|
184
|
+
|
185
|
+
path = File.join(@config['src/' + type], File.basename(file))
|
186
|
+
|
187
|
+
p '=> ' + path
|
188
|
+
|
189
|
+
system('cp ' + file + ' ' + path)
|
190
|
+
|
191
|
+
reg = /url\("?'?([^'")]+)'?"?\)/
|
192
|
+
if type == 'stylesheets' && @config['changeImageUrl'] && reg =~ File.read(path)
|
193
|
+
css = File.read(path).partition_all(reg).map{ |f|
|
194
|
+
if reg =~ f
|
195
|
+
if @config['url'] == ''
|
196
|
+
f = 'url("../images/' << File.basename(f.match(reg)[1]) << '")'
|
197
|
+
else
|
198
|
+
f = 'url("' + @config['url/images'] + File.basename(f.match(reg)[1]) << '")'
|
199
|
+
end
|
200
|
+
end
|
201
|
+
f
|
202
|
+
}.join('')
|
203
|
+
File.open(path, 'w'){ |f| f.write(css) }
|
204
|
+
end
|
205
|
+
if type == 'images'
|
206
|
+
path = nil
|
207
|
+
end
|
208
|
+
|
209
|
+
if @config['minify']
|
210
|
+
if type == 'stylesheets'
|
211
|
+
min = minify(File.read(path), :css)
|
212
|
+
File.open(path, 'w'){ |f| f.write(min) }
|
213
|
+
end
|
214
|
+
if type == 'javascripts'
|
215
|
+
min = minify(File.read(path), :js)
|
216
|
+
File.open(path, 'w'){ |f| f.write(min) }
|
217
|
+
end
|
218
|
+
end
|
219
|
+
else
|
220
|
+
path = @libs[file]
|
221
|
+
end
|
222
|
+
path
|
223
|
+
}.compact.flatten.uniq
|
224
|
+
@libs[name] = @libs[name][0] if @libs[name].length == 1
|
225
|
+
end
|
226
|
+
|
227
|
+
p '== [2/2] Generate lib.js =='
|
228
|
+
|
229
|
+
libjs = File.read(@libs['lazyload']) << ';'
|
230
|
+
|
231
|
+
libjs_core = CoffeeScript.compile(File.read(File.join(File.dirname(__FILE__), 'zfben_libjs', 'lib.coffee')))
|
232
|
+
|
233
|
+
libjs << (@config['minify'] ? minify(libjs_core, :js) : @config['minify'])
|
234
|
+
|
235
|
+
@urls = {}
|
236
|
+
@libs.each do |lib, path|
|
237
|
+
path = [path] unless path.class == Array
|
238
|
+
path = path.map{ |url|
|
239
|
+
case File.extname(url)
|
240
|
+
when '.css'
|
241
|
+
url = @config['url/stylesheets'] + '/' + File.basename(url)
|
242
|
+
when '.js'
|
243
|
+
url = @config['url/javascripts'] + '/' + File.basename(url)
|
244
|
+
else
|
245
|
+
url = nil
|
246
|
+
end
|
247
|
+
url
|
248
|
+
}.compact.uniq
|
249
|
+
@urls[lib] = path
|
250
|
+
end
|
251
|
+
|
252
|
+
libjs << "\n/* libs */\nlib.libs(#{@urls.to_json});"
|
253
|
+
|
254
|
+
if @bundle != nil && @bundle.length > 0
|
255
|
+
@bundle.each do |name, libs|
|
256
|
+
css = ''
|
257
|
+
js = ''
|
258
|
+
files = []
|
259
|
+
libs.each do |lib|
|
260
|
+
lib = @libs[lib] if @libs.has_key?(lib)
|
261
|
+
lib = [lib] unless lib.class == Array
|
262
|
+
lib.each do |file|
|
263
|
+
files.push(file)
|
264
|
+
case File.extname(file)
|
265
|
+
when '.css'
|
266
|
+
css << File.read(file)
|
267
|
+
when '.js'
|
268
|
+
js << File.read(file) << ';'
|
269
|
+
end
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
path = []
|
274
|
+
|
275
|
+
if css != ''
|
276
|
+
file = File.join(@config['src/stylesheets'], name + '.css')
|
277
|
+
File.open(file, 'w'){ |f| f.write(css) }
|
278
|
+
path.push(@config['url/stylesheets'] + '/' + File.basename(file))
|
279
|
+
end
|
280
|
+
|
281
|
+
if js != ''
|
282
|
+
files_url = files.map{ |f| @config['url/javascripts'] + '/' + File.basename(f) }.join("','")
|
283
|
+
js << "\nif(typeof lib === 'function'){lib.loaded('add', '#{files_url}');}"
|
284
|
+
file = File.join(@config['src/javascripts'], name + '.js')
|
285
|
+
File.open(file, 'w'){ |f| f.write(js) }
|
286
|
+
path.push(@config['url/javascripts'] + '/' + File.basename(file))
|
287
|
+
end
|
288
|
+
|
289
|
+
if path.length > 0
|
290
|
+
path = path[0] if path.length == 0
|
291
|
+
@bundle[name] = path
|
292
|
+
else
|
293
|
+
@bundle.delete(name)
|
294
|
+
end
|
295
|
+
end
|
296
|
+
|
297
|
+
libjs << "\n/* bundle */\nlib.libs(#{@bundle.to_json});"
|
298
|
+
end
|
299
|
+
|
300
|
+
if @preload.class == Array && @preload.length > 0
|
301
|
+
libjs << "\n/* preload */\nlib('#{@preload.join(' ')}');"
|
302
|
+
end
|
303
|
+
File.open(File.join(@config['src/javascripts'], 'lib.js'), 'w'){ |f| f.write(libjs) }
|
304
|
+
|
305
|
+
if @config.has_key?('after')
|
306
|
+
load @config['after']
|
307
|
+
end
|
308
|
+
|
309
|
+
p '== End Build =='
|
310
|
+
end
|
311
|
+
end
|
data/zfben_libjs.gemspec
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "zfben_libjs/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "zfben_libjs"
|
7
|
+
s.version = ZfbenLibjs::VERSION
|
8
|
+
s.authors = ["Ben"]
|
9
|
+
s.email = ["ben@zfben.com"]
|
10
|
+
s.homepage = ""
|
11
|
+
s.summary = %q{}
|
12
|
+
s.description = %q{}
|
13
|
+
|
14
|
+
s.post_install_message =%q{
|
15
|
+
********************************************************************************
|
16
|
+
Thank you for using zfben_libjs!
|
17
|
+
|
18
|
+
Please follow @zfben on Twitter for announcements, updates, and news.
|
19
|
+
https://twitter.com/zfben
|
20
|
+
********************************************************************************
|
21
|
+
}
|
22
|
+
|
23
|
+
s.rubyforge_project = "zfben_libjs"
|
24
|
+
|
25
|
+
s.files = `git ls-files`.split("\n")
|
26
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
27
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
28
|
+
s.require_paths = ["lib"]
|
29
|
+
|
30
|
+
s.required_ruby_version = '>= 1.9'
|
31
|
+
|
32
|
+
s.add_dependency 'rainbow'
|
33
|
+
s.add_dependency 'json'
|
34
|
+
s.add_dependency 'compass'
|
35
|
+
s.add_dependency 'mustang'
|
36
|
+
s.add_dependency 'coffee-script'
|
37
|
+
s.add_dependency 'uglifier'
|
38
|
+
|
39
|
+
end
|
metadata
ADDED
@@ -0,0 +1,133 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: zfben_libjs
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.1
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Ben
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-07-31 00:00:00 +08:00
|
14
|
+
default_executable:
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: rainbow
|
18
|
+
prerelease: false
|
19
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
|
+
none: false
|
21
|
+
requirements:
|
22
|
+
- - ">="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: "0"
|
25
|
+
type: :runtime
|
26
|
+
version_requirements: *id001
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: json
|
29
|
+
prerelease: false
|
30
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: "0"
|
36
|
+
type: :runtime
|
37
|
+
version_requirements: *id002
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: compass
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: "0"
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id003
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: mustang
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: "0"
|
58
|
+
type: :runtime
|
59
|
+
version_requirements: *id004
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: coffee-script
|
62
|
+
prerelease: false
|
63
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: "0"
|
69
|
+
type: :runtime
|
70
|
+
version_requirements: *id005
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: uglifier
|
73
|
+
prerelease: false
|
74
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: "0"
|
80
|
+
type: :runtime
|
81
|
+
version_requirements: *id006
|
82
|
+
description: ""
|
83
|
+
email:
|
84
|
+
- ben@zfben.com
|
85
|
+
executables:
|
86
|
+
- libjs
|
87
|
+
extensions: []
|
88
|
+
|
89
|
+
extra_rdoc_files: []
|
90
|
+
|
91
|
+
files:
|
92
|
+
- .gitignore
|
93
|
+
- Gemfile
|
94
|
+
- Rakefile
|
95
|
+
- bin/libjs
|
96
|
+
- lib/zfben_libjs.rb
|
97
|
+
- lib/zfben_libjs/lib.coffee
|
98
|
+
- lib/zfben_libjs/lib.rb
|
99
|
+
- lib/zfben_libjs/libjs.yml
|
100
|
+
- lib/zfben_libjs/version.rb
|
101
|
+
- zfben_libjs.gemspec
|
102
|
+
has_rdoc: true
|
103
|
+
homepage: ""
|
104
|
+
licenses: []
|
105
|
+
|
106
|
+
post_install_message: "\n\
|
107
|
+
********************************************************************************\n Thank you for using zfben_libjs!\n \n Please follow @zfben on Twitter for announcements, updates, and news.\n https://twitter.com/zfben\n\
|
108
|
+
********************************************************************************\n"
|
109
|
+
rdoc_options: []
|
110
|
+
|
111
|
+
require_paths:
|
112
|
+
- lib
|
113
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
114
|
+
none: false
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: "1.9"
|
119
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
+
none: false
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: "0"
|
125
|
+
requirements: []
|
126
|
+
|
127
|
+
rubyforge_project: zfben_libjs
|
128
|
+
rubygems_version: 1.6.2
|
129
|
+
signing_key:
|
130
|
+
specification_version: 3
|
131
|
+
summary: ""
|
132
|
+
test_files: []
|
133
|
+
|