nekonote-framework 1.0.0.pre.beta4 → 1.0.0.pre.beta5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93b75ef49754ba2acb077f4e48561f052963a1003069aacb5ea5e25c3b63ad8c
4
- data.tar.gz: 991045d68698d89d11998f3799ae5ba0c9a7e8d06f79ea0a5b9b93cfe382e477
3
+ metadata.gz: 83af083867f706bf41adc30483d1b8aebe9bccaa3eae0c90e149cfb885c17492
4
+ data.tar.gz: 7e11322289731393588db00badbc16377f3bd59d0218f7df252479188cb8eab1
5
5
  SHA512:
6
- metadata.gz: c5004e020a5d4c40ccbb99a41025eda8c894a71c597f1f6486d008ecd3390f7815485761f2e25bf4a02ff4d2d1deed37b0711cc23fa84902cea84a54f96db56a
7
- data.tar.gz: fbd87c7eb9ca444e8ac5761a346ea4c7df3fe8290d570fa80d5376f6dc9db3c968216e93168a50b3c705b29fce981d9581a42d930027438edb05a20f10b72a08
6
+ metadata.gz: 88634ed58c3b941da9d21405569d379a72b7e08988bbb504806f49f06b50b54f7da842427c0cd7fb2b1303e2d23c321915b4f162e81f15310252cd838d8ce5c1
7
+ data.tar.gz: c07cbd985ad0f6319f4f21c78cb230cee1563fda2abd5cc2ddbc05c31c6a355962ee5f2d214b6f6626d74201b093dbc8ce1690a208dc143b7f23a44ef6329560
data/README.md CHANGED
@@ -36,7 +36,7 @@ It can display exception's details on your browser.
36
36
  ### Logger
37
37
  It provides you thread-safe logging.
38
38
 
39
- Template Engine
39
+ ### Template Engine
40
40
  The templating engine on Nekonote Framework is Liquid.
41
41
 
42
42
  ## Getting Started
@@ -1,6 +1,6 @@
1
1
  module Nekonote
2
2
  LIBS_NAME = %(nekonote-framework).freeze
3
- VERSION = %(1.0.0-beta4).freeze
3
+ VERSION = %(1.0.0-beta5).freeze
4
4
  HOMEPAGE = %(https://nekonote-framework.github.io).freeze
5
5
  SUMMARY = %(Simple and Lightweight Ruby Framework for Web Development).freeze
6
6
  DESCRIPTION = %(Nekonote Framework is a small web application framework that helps your web development.).freeze
@@ -4,10 +4,8 @@ module Nekonote
4
4
  ::Liquid::Template.register_tag 'setting_get', TagSettingGet
5
5
 
6
6
  class View
7
- NO_USING_NAME = 'none'
8
- DEFAULT_LAYOUT_NAME = 'default'
9
- PATH_TO_TEMPLATE = 'template'
10
- PATH_TO_LAYOUT = 'template/layout'
7
+ PATH_TO_TEMPLATE = 'template'
8
+ PATH_TO_LAYOUT = 'template/layout'
11
9
 
12
10
  # accessor
13
11
  attr_accessor :is_redirect
@@ -279,11 +277,8 @@ module Nekonote
279
277
  private
280
278
  def init_template(handler_name = nil)
281
279
  if @info_template.is_a? String
282
- # check exists later
280
+ # checking whether to exist or not is later
283
281
  @template_path = get_template_path @info_template
284
- elsif @info_template == nil && handler_name.is_a?(String)
285
- # try to set a default template
286
- @template_path = get_default_template_path handler_name
287
282
  else
288
283
  # no use template
289
284
  @template_path = nil
@@ -294,14 +289,8 @@ module Nekonote
294
289
  private
295
290
  def init_layout
296
291
  if @info_layout.is_a? String
297
- # check exists later
292
+ # checking whether to exist or not is later
298
293
  @layout_path = get_layout_path @info_layout
299
- elsif @info_layout == nil
300
- # try to set a default layout
301
- @layout_path = get_layout_path DEFAULT_LAYOUT_NAME
302
- if !Util::Filer.available_file? @layout_path
303
- @layout_path = nil
304
- end
305
294
  else
306
295
  # no use layout
307
296
  @layout_path = nil
@@ -324,35 +313,6 @@ module Nekonote
324
313
  return "#{Nekonote.get_root_path}#{PATH_TO_LAYOUT}/#{layout}.#{ext}"
325
314
  end
326
315
 
327
- # Returns template path for the default when it was found and available
328
- # @param string|nil
329
- private
330
- def get_default_template_path(handler_name)
331
- return nil if !handler_name.is_a? String
332
-
333
- # get default template path when no template specified
334
- begin
335
- template = handler_name.sub(/Handler$/, '').gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').gsub(/([a-z\d])([A-Z])/,'\1_\2').downcase
336
- rescue
337
- template = nil
338
- end
339
-
340
- # return nil if invalid template name
341
- return nil if (template.nil? || template == '')
342
-
343
- # get absolute path
344
- template_path = get_template_path template
345
-
346
- # set if available
347
- if Util::Filer.available_file? template_path
348
- template_path = template_path
349
- else
350
- template_path = nil
351
- end
352
-
353
- return template_path
354
- end
355
-
356
316
  # @param string type
357
317
  # @return string
358
318
  private
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nekonote-framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.beta4
4
+ version: 1.0.0.pre.beta5
5
5
  platform: ruby
6
6
  authors:
7
7
  - khotta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-28 00:00:00.000000000 Z
11
+ date: 2018-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: color_echo