Class: Papers::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/papers/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



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
# File 'lib/papers/configuration.rb', line 15

def initialize
  @license_whitelist = [
    'MIT',
    'BSD',
    'Apache 2.0',
    'Apache-2.0',
    'LGPLv2.1',
    'LGPLv3',
    'Ruby',
    'Manually Reviewed',
    'Unlicensed'
  ]

  @version_whitelisted_license = nil

  @manifest_file = File.join(Dir.pwd, 'config', 'papers_manifest.yml')

  @validate_gems             = true
  @validate_javascript       = true
  @validate_bower_components = false

  @javascript_paths = [
    File.join(Dir.pwd, 'app',    'assets', 'javascripts'),
    File.join(Dir.pwd, 'lib',    'assets', 'javascripts'),
    File.join(Dir.pwd, 'vendor', 'assets', 'javascripts')
  ]

  @bower_components_path = File.join(Dir.pwd, 'vendor', 'assets', 'components')
end

Instance Attribute Details

#bower_components_pathObject

Returns the value of attribute bower_components_path.



13
14
15
# File 'lib/papers/configuration.rb', line 13

def bower_components_path
  @bower_components_path
end

#javascript_pathsObject

Returns the value of attribute javascript_paths.



12
13
14
# File 'lib/papers/configuration.rb', line 12

def javascript_paths
  @javascript_paths
end

#license_whitelistObject

Returns the value of attribute license_whitelist.



3
4
5
# File 'lib/papers/configuration.rb', line 3

def license_whitelist
  @license_whitelist
end

#manifest_fileObject

Returns the value of attribute manifest_file.



6
7
8
# File 'lib/papers/configuration.rb', line 6

def manifest_file
  @manifest_file
end

#validate_bower_componentsObject

Returns the value of attribute validate_bower_components.



10
11
12
# File 'lib/papers/configuration.rb', line 10

def validate_bower_components
  @validate_bower_components
end

#validate_gemsObject

Returns the value of attribute validate_gems.



8
9
10
# File 'lib/papers/configuration.rb', line 8

def validate_gems
  @validate_gems
end

#validate_javascriptObject

Returns the value of attribute validate_javascript.



9
10
11
# File 'lib/papers/configuration.rb', line 9

def validate_javascript
  @validate_javascript
end

#version_whitelisted_licenseObject

Returns the value of attribute version_whitelisted_license.



4
5
6
# File 'lib/papers/configuration.rb', line 4

def version_whitelisted_license
  @version_whitelisted_license
end

Instance Method Details

#validate_bower_components?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/papers/configuration.rb', line 53

def validate_bower_components?
  !!@validate_bower_components
end

#validate_gems?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/papers/configuration.rb', line 45

def validate_gems?
  !!@validate_gems
end

#validate_javascript?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/papers/configuration.rb', line 49

def validate_javascript?
  !!@validate_javascript
end