This repository has been archived by the owner on Jun 13, 2022. It is now read-only.
/
bpm.rb
61 lines (50 loc) · 1.82 KB
/
bpm.rb
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
57
58
59
60
Encoding.default_external = 'UTF-8'
module BPM
BPM_DIR = ".bpm"
TEMPLATES_DIR = File.expand_path("../../templates", __FILE__)
ES5_SHIM_PATH = File.expand_path("../../support/es5-shim.js", __FILE__)
autoload :CLI, 'bpm/cli'
autoload :Credentials, 'bpm/credentials'
autoload :Local, 'bpm/local'
autoload :Package, 'bpm/package'
autoload :Remote, 'bpm/remote'
autoload :Repository, 'bpm/repository'
autoload :Project, 'bpm/project'
autoload :Rack, 'bpm/rack'
autoload :Server, 'bpm/server'
autoload :Pipeline, 'bpm/pipeline'
autoload :DirectiveProcessor, 'bpm/pipeline/directive_processor'
autoload :GeneratedAsset, 'bpm/pipeline/generated_asset'
autoload :SourceURLProcessor, 'bpm/pipeline/source_url_processor'
autoload :PluginAsset, 'bpm/pipeline/plugin_asset'
autoload :PluginContext, 'bpm/pipeline/plugin_context'
autoload :PackagePipeline, 'bpm/pipeline/package_pipeline'
autoload :FormatProcessor, 'bpm/pipeline/format_processor'
autoload :PluginProcessor, 'bpm/pipeline/plugin_processor'
def self.compile_js(data)
require 'bpm/execjs_ext'
@es5_shim ||= File.read(ES5_SHIM_PATH)
ExecJS.compile(@es5_shim+"\n"+data)
end
@@show_deprecations = false
@@deprecation_count = 0
def self.show_deprecations
@@show_deprecations
end
def self.show_deprecations=(val)
@@show_deprecations = val
end
def self.deprecation_count
@@deprecation_count
end
def self.deprecation_warning(message)
if show_deprecations
warn "[DEPRECATION] #{message}"
else
@@deprecation_count += 1
end
end
end
# The BPM constants need to be defined first
require 'bpm/libgems_ext'
require 'bpm/errors'