Class: BPM::PackageProject

Inherits:
Project show all
Defined in:
lib/bpm/package_project.rb

Constant Summary

Constants inherited from Project

BPM::Project::BPM_DIR, BPM::Project::DEFAULT_CONFIG, BPM::Project::DEFAULT_CONFIG_PATH

Constants inherited from Package

BPM::Package::EXT, BPM::Package::FIELDS, BPM::Package::METADATA_FIELDS, BPM::Package::PLUGIN_TYPES, BPM::Package::REQUIRED_FIELDS, BPM::Package::SPEC_FIELDS

Instance Attribute Summary

Attributes inherited from Project

#name

Attributes inherited from Package

#email, #errors, #json_path, #root_path

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Project

#add_dependencies, #all_dependencies, #assets_path, #assets_root, #bpm, #build, #build_app=, #build_app?, #build_settings, #buildable_asset_filenames, #fetch_dependencies, #find_vendored_package, #find_vendored_project, #has_local_package?, #initialize, #load_json, #local_deps, #map_to_packages, #minifier_name, nearest_project, #package_and_module_from_path, #package_from_name, #package_manifest_path, #path_from_module, #path_from_package, #preview_root, #rebuild_dependency_list, #rebuild_preview, #remove_dependencies, #save!, #sorted_deps, #sorted_development_deps, #sorted_runtime_deps, #unbuild, #validate_name_and_path, #vendor_root, #vendored_packages, #vendored_projects, #verify_and_repair

Methods inherited from Package

#bin_files, #bin_path, #dependencies_build, #directory_files, #expanded_deps, #file_name, #fill_from_gemspec, #find_transport_plugins, from_spec, #full_name, #generator_for, #has_json?, #initialize, is_package_root?, #lib_path, #load_json, #local_deps, #merged_dependencies, #provided_formats, #provided_minifier, #provided_postprocessors, #provided_preprocessors, #provided_transport, #say, #shell, #standalone?, #template_path, #tests_path, #to_json, #to_spec, #used_dependencies, #used_formats, #used_postprocessors, #used_preprocessors, #used_transports, #valid?, #validate, #validate_name_and_path

Constructor Details

This class inherits a constructor from BPM::Project

Class Method Details

.is_project_json?(path) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
# File 'lib/bpm/package_project.rb', line 8

def self.is_project_json?(path)
  json = JSON.load(File.read(path)) rescue nil
  return !!json
end

.is_project_root?(path) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/bpm/package_project.rb', line 13

def self.is_project_root?(path)
  !!project_file_path(path)
end

.project_file_path(path) ⇒ Object



3
4
5
6
# File 'lib/bpm/package_project.rb', line 3

def self.project_file_path(path)
  file = File.join(path, 'package.json')
  File.exist?(file) ? file : nil
end

Instance Method Details

#as_jsonObject



17
18
19
20
21
# File 'lib/bpm/package_project.rb', line 17

def as_json
  json = super
  json.delete("bpm")
  json
end