forked from pusher/pusher-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJFile
More file actions
56 lines (45 loc) · 1.24 KB
/
Copy pathJFile
File metadata and controls
56 lines (45 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
require 'yaml'
CONFIG = YAML.load_file('config/config.yml')[(ENV['ENVIRONMENT'] || 'development').to_sym]
# JBundle configuration file
# https://github.com/ismasan/jbundle
target_dir './dist'
src_dir './src'
version '1.12.5'
bundle 'pusher.js' do
license 'pusher-licence.js'
file 'pusher.js'
file 'pusher_event_dispatcher.js'
file 'pusher_machine.js'
file 'net_info.js'
file 'pusher_connection.js'
file 'pusher_channels.js'
file 'pusher_authorizer.js'
file 'dependencies.js'
end
bundle 'flashfallback.js' do
license 'web-socket-js-licence.js'
file 'web-socket-js/swfobject.js'
file 'web-socket-js/web_socket.js'
end
bundle 'sockjs.js' do
license 'sockjs-licence.js'
file 'sockjs/sockjs.js'
end
file 'json2.js'
# Just copy this file across
file 'web-socket-js/WebSocketMainInsecure.swf' => 'WebSocketMain.swf'
# Runs for every bundle and license source.
filter do |src, config|
src.gsub! /<VERSION>/, config.version.to_s
src.gsub! /<CDN_HTTP>/, CONFIG[:js][:cdn][:http]
src.gsub! /<CDN_HTTPS>/, CONFIG[:js][:cdn][:https]
src
end
# some_dependency.js
filter :src do |src, config|
src.gsub /<DEPENDENCY_SUFFIX>/, ''
end
# some_dependency.min.js
filter :min do |src, config|
src.gsub /<DEPENDENCY_SUFFIX>/, '.min'
end