Module: BPM

Defined in:
lib/bpm.rb,
lib/bpm/cli.rb,
lib/bpm/rack.rb,
lib/bpm/local.rb,
lib/bpm/errors.rb,
lib/bpm/remote.rb,
lib/bpm/server.rb,
lib/bpm/package.rb,
lib/bpm/project.rb,
lib/bpm/railtie.rb,
lib/bpm/version.rb,
lib/bpm/cli/base.rb,
lib/bpm/pipeline.rb,
lib/bpm/generator.rb,
lib/bpm/repository.rb,
lib/bpm/credentials.rb,
lib/bpm/init_generator.rb,
lib/bpm/package_project.rb,
lib/bpm/project_generator.rb,
lib/bpm/pipeline/plugin_asset.rb,
lib/bpm/pipeline/plugin_context.rb,
lib/bpm/pipeline/generated_asset.rb,
lib/bpm/pipeline/format_processor.rb,
lib/bpm/pipeline/package_pipeline.rb,
lib/bpm/pipeline/plugin_processor.rb,
lib/bpm/pipeline/directive_processor.rb,
lib/bpm/pipeline/source_url_processor.rb

Defined Under Namespace

Modules: CLI Classes: CircularDependencyError, Console, Credentials, DirectiveProcessor, Error, FormatProcessor, GeneratedAsset, Generator, InitGenerator, InvalidPackageError, InvalidPackagePathError, Local, LocalPackageConflictError, MinifierNotFoundError, Package, PackageConflictError, PackageNotFoundError, PackagePipeline, PackageProject, Pipeline, PluginAsset, PluginContext, PluginProcessor, Project, ProjectGenerator, Rack, Railtie, Remote, Repository, Server, SourceURLProcessor, TooManyTransportsError

Constant Summary collapse

BPM_DIR =
".bpm"
TEMPLATES_DIR =
File.expand_path("../../templates", __FILE__)
ES5_SHIM_PATH =
File.expand_path("../../support/es5-shim.js", __FILE__)
VERSION =
"1.0.0"
COMPAT_VERSION =
'1.0.0'
@@show_deprecations =
false
@@deprecation_count =
0

Class Method Summary collapse

Class Method Details

.compile_js(data) ⇒ Object



30
31
32
33
34
# File 'lib/bpm.rb', line 30

def self.compile_js(data)
  require 'bpm/execjs_ext'
  @es5_shim ||= File.read(ES5_SHIM_PATH)
  ExecJS.compile(@es5_shim+"\n"+data)
end

.deprecation_countObject



47
48
49
# File 'lib/bpm.rb', line 47

def self.deprecation_count
  @@deprecation_count
end

.deprecation_warning(message) ⇒ Object



51
52
53
54
55
56
57
# File 'lib/bpm.rb', line 51

def self.deprecation_warning(message)
  if show_deprecations
    warn "[DEPRECATION] #{message}"
  else
    @@deprecation_count += 1
  end
end

.generator_for(pkg_or_type, type = nil, default = true) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/bpm/generator.rb', line 15

def self.generator_for(pkg_or_type, type=nil, default=true)
  if type
    pkg = pkg_or_type
  else
    pkg = :default
    type = pkg_or_type
  end

  generator = generators[pkg] && generators[pkg][type]
  generator ||= generators[:default] && generators[:default][type] if default
  generator
end

.generatorsObject



6
7
8
# File 'lib/bpm/generator.rb', line 6

def self.generators
  @generators ||= {}
end

.register_generator(pkg, type, generator) ⇒ Object



10
11
12
13
# File 'lib/bpm/generator.rb', line 10

def self.register_generator(pkg, type, generator)
  generators[pkg] ||= {}
  generators[pkg][type] = generator
end

.show_deprecationsObject



39
40
41
# File 'lib/bpm.rb', line 39

def self.show_deprecations
  @@show_deprecations
end

.show_deprecations=(val) ⇒ Object



43
44
45
# File 'lib/bpm.rb', line 43

def self.show_deprecations=(val)
  @@show_deprecations = val
end