Class: Papers::BowerComponent
Instance Attribute Summary
#license, #license_url, #name, #project_url
Class Method Summary
collapse
Instance Method Summary
collapse
#acceptable_license?, #initialize, #name_without_version
Class Method Details
.asset_type_name ⇒ Object
41
42
43
|
# File 'lib/papers/dependency_specification/bower_component.rb', line 41
def self.asset_type_name
'Bower component'
end
|
.bower_json_entries ⇒ Object
34
35
36
37
38
39
|
# File 'lib/papers/dependency_specification/bower_component.rb', line 34
def self.bower_json_entries
json_files = Dir["#{Papers.config.bower_components_path}/*/.bower.json"]
json_files.map do |path|
JSON.parse File.read(path)
end
end
|
.full_introspected_entries ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/papers/dependency_specification/bower_component.rb', line 18
def self.full_introspected_entries
whitelisted_license = Papers.config.version_whitelisted_license
bower_json_entries.map do |entry|
name =
if whitelisted_license != nil && whitelisted_license == entry['license']
entry['name']
else
"#{entry['name']}-#{entry['_release']}"
end
{
'name' => name,
'homepage' => entry['homepage']
}
end
end
|
.introspected ⇒ Object
14
15
16
|
# File 'lib/papers/dependency_specification/bower_component.rb', line 14
def self.introspected
full_introspected_entries.map { |e| e['name'] }
end
|
.manifest_key ⇒ Object
45
46
47
|
# File 'lib/papers/dependency_specification/bower_component.rb', line 45
def self.manifest_key
"bower_components"
end
|
Instance Method Details
#pretty_hash ⇒ Object
5
6
7
8
9
10
11
12
|
# File 'lib/papers/dependency_specification/bower_component.rb', line 5
def pretty_hash
{
name: name_without_version,
license: license,
license_url: @license_url,
project_url: @project_url
}
end
|