Module: Nsume::Configure
- Defined in:
- lib/nsume/configure.rb
Class Attribute Summary collapse
-
.bootstrap_css_file ⇒ Object
Returns the value of attribute bootstrap_css_file.
-
.bootstrap_endpoint ⇒ Object
Returns the value of attribute bootstrap_endpoint.
-
.bootstrap_js_file ⇒ Object
Returns the value of attribute bootstrap_js_file.
-
.bootswatch_css_file ⇒ Object
Returns the value of attribute bootswatch_css_file.
-
.bootswatch_endpoint ⇒ Object
Returns the value of attribute bootswatch_endpoint.
-
.bootswatch_js_file ⇒ Object
Returns the value of attribute bootswatch_js_file.
-
.bootswatch_theme ⇒ Object
Returns the value of attribute bootswatch_theme.
-
.dest_path ⇒ Object
custom reader.
-
.jquery_endpoint ⇒ Object
Returns the value of attribute jquery_endpoint.
-
.jquery_file ⇒ Object
Returns the value of attribute jquery_file.
Class Method Summary collapse
-
.assets_css ⇒ Object
base reader.
- .assets_js ⇒ Object
- .config_template ⇒ Object
- .generators_path ⇒ Object
- .keys ⇒ Object
- .navbar_template ⇒ Object
- .post_template ⇒ Object
- .posts_path ⇒ Object
- .setup ⇒ Object
- .templates_path ⇒ Object
- .themes ⇒ Object
Class Attribute Details
.bootstrap_css_file ⇒ Object
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_endpoint ⇒ Object
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_file ⇒ Object
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_file ⇒ Object
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_endpoint ⇒ Object
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_file ⇒ Object
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_theme ⇒ Object
Returns the value of attribute bootswatch_theme.
7 8 9 |
# File 'lib/nsume/configure.rb', line 7 def bootswatch_theme @bootswatch_theme end |
.dest_path ⇒ Object
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_endpoint ⇒ Object
Returns the value of attribute jquery_endpoint.
4 5 6 |
# File 'lib/nsume/configure.rb', line 4 def jquery_endpoint @jquery_endpoint end |
.jquery_file ⇒ Object
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_css ⇒ Object
base reader
28 29 30 |
# File 'lib/nsume/configure.rb', line 28 def assets_css 'assets/css' end |
.assets_js ⇒ Object
32 33 34 |
# File 'lib/nsume/configure.rb', line 32 def assets_js 'assets/js' end |
.config_template ⇒ Object
44 45 46 |
# File 'lib/nsume/configure.rb', line 44 def config_template File.read(File.('_config.yml.erb', self.templates_path)) end |
.generators_path ⇒ Object
36 37 38 |
# File 'lib/nsume/configure.rb', line 36 def generators_path Nsume.root.join('lib', 'generators').to_s end |
.keys ⇒ Object
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 |
.navbar_template ⇒ Object
48 49 50 |
# File 'lib/nsume/configure.rb', line 48 def File.read(File.('navbar.yml', self.templates_path)) end |
.post_template ⇒ Object
52 53 54 |
# File 'lib/nsume/configure.rb', line 52 def post_template File.read(File.('post.md.erb', self.templates_path)) end |
.posts_path ⇒ Object
70 71 72 73 74 |
# File 'lib/nsume/configure.rb', line 70 def posts_path path = File.('_posts', self.dest_path) FileUtils.mkdir_p(path) unless File.exists?(path) path end |
.setup ⇒ Object
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_path ⇒ Object
40 41 42 |
# File 'lib/nsume/configure.rb', line 40 def templates_path Nsume.root.join('lib', 'templates').to_s end |
.themes ⇒ Object
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 |