Module: Nsume::Configure

Defined in:
lib/nsume/configure.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.bootstrap_css_fileObject

Returns the value of attribute bootstrap_css_file.



5
6
7
# File 'lib/nsume/configure.rb', line 5

def bootstrap_css_file
  @bootstrap_css_file
end

.bootstrap_endpointObject

Returns the value of attribute bootstrap_endpoint.



5
6
7
# File 'lib/nsume/configure.rb', line 5

def bootstrap_endpoint
  @bootstrap_endpoint
end

.bootstrap_js_fileObject

Returns the value of attribute bootstrap_js_file.



5
6
7
# File 'lib/nsume/configure.rb', line 5

def bootstrap_js_file
  @bootstrap_js_file
end

.bootswatch_css_fileObject

Returns the value of attribute bootswatch_css_file.



6
7
8
# File 'lib/nsume/configure.rb', line 6

def bootswatch_css_file
  @bootswatch_css_file
end

.bootswatch_endpointObject

Returns the value of attribute bootswatch_endpoint.



6
7
8
# File 'lib/nsume/configure.rb', line 6

def bootswatch_endpoint
  @bootswatch_endpoint
end

.bootswatch_js_fileObject

Returns the value of attribute bootswatch_js_file.



6
7
8
# File 'lib/nsume/configure.rb', line 6

def bootswatch_js_file
  @bootswatch_js_file
end

.bootswatch_themeObject

Returns the value of attribute bootswatch_theme.



7
8
9
# File 'lib/nsume/configure.rb', line 7

def bootswatch_theme
  @bootswatch_theme
end

.dest_pathObject

custom reader



63
64
65
66
67
68
# File 'lib/nsume/configure.rb', line 63

def dest_path
  @dest_path ||= Dir.pwd
  path = @dest_path
  path = File.join(path, 'tmp') if File.exists?(File.join(path, 'nsume.gemspec'))
  path
end

.jquery_endpointObject

Returns the value of attribute jquery_endpoint.



4
5
6
# File 'lib/nsume/configure.rb', line 4

def jquery_endpoint
  @jquery_endpoint
end

.jquery_fileObject

Returns the value of attribute jquery_file.



4
5
6
# File 'lib/nsume/configure.rb', line 4

def jquery_file
  @jquery_file
end

Class Method Details

.assets_cssObject

base reader



28
29
30
# File 'lib/nsume/configure.rb', line 28

def assets_css
  'assets/css'
end

.assets_jsObject



32
33
34
# File 'lib/nsume/configure.rb', line 32

def assets_js
  'assets/js'
end

.config_templateObject



44
45
46
# File 'lib/nsume/configure.rb', line 44

def config_template
  File.read(File.expand_path('_config.yml.erb', self.templates_path))
end

.generators_pathObject



36
37
38
# File 'lib/nsume/configure.rb', line 36

def generators_path
  Nsume.root.join('lib', 'generators').to_s
end

.keysObject



16
17
18
19
20
21
22
23
# File 'lib/nsume/configure.rb', line 16

def keys
  @keys ||= %i[
    jquery_endpoint jquery_file
    bootstrap_endpoint bootstrap_css_file bootstrap_js_file
    bootswatch_endpoint bootswatch_css_file bootswatch_js_file
    bootswatch_theme
  ]
end


48
49
50
# File 'lib/nsume/configure.rb', line 48

def navbar_template
  File.read(File.expand_path('navbar.yml', self.templates_path))
end

.post_templateObject



52
53
54
# File 'lib/nsume/configure.rb', line 52

def post_template
  File.read(File.expand_path('post.md.erb', self.templates_path))
end

.posts_pathObject



70
71
72
73
74
# File 'lib/nsume/configure.rb', line 70

def posts_path
  path = File.expand_path('_posts', self.dest_path)
  FileUtils.mkdir_p(path) unless File.exists?(path)
  path
end

.setupObject



10
11
12
13
14
# File 'lib/nsume/configure.rb', line 10

def setup
  keys.each do |key|
    instance_variable_set(:"@#{key}", Nsume::Default.send(key))
  end
end

.templates_pathObject



40
41
42
# File 'lib/nsume/configure.rb', line 40

def templates_path
  Nsume.root.join('lib', 'templates').to_s
end

.themesObject



56
57
58
# File 'lib/nsume/configure.rb', line 56

def themes
  ['amelia','cerulean','cosmo','cyborg','darkly','flatly','journal','lumen','readable','simplex','slate','spacelab','superhero','united','yeti']
end