hyla 1.0.7.pre.7 → 1.0.7.pre.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NmE4Zjk2MzExMDJhNDlhOWY4OGRjMGVhMThhMWMwNDBlNjYyMTliZQ==
4
+ MThiYzA4ZmM3OGExMDc3MTZhZTIwYzI2ZWM4YTZhZGJlMWQ0YzFmNQ==
5
5
  data.tar.gz: !binary |-
6
- ZDViYWIwMGRjNWJhMGUzYzUxYWQxNDA3NzdkZmY5OThjMjM1OTdlYQ==
6
+ ZTEwMzA4NTkzMmI5MDVjMWUzNGUwZTU5N2I4ZDM2MTgxODVkM2IxMw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MWYwYTkxOTdhZjIzMzQ4MGExMDQxNmQ2ZDAxMDA3YzA2MDYzZjg0ODhhMzg0
10
- MzRkYjVjYjgyOTliZWUxZDAxOWUyYmM3ZDA3YjkyMTJmZmE4YzczNjZhZDQ0
11
- NzU3YmY3YTU1OWVlZTA4NzMzMWRkOGZlMWIwNzgyNTY3ODA0NzU=
9
+ NzlkOWRhYzBlYjEyNzk0OGEzY2ZiMjYxYTczZjQzMjg5Y2I3MjRlZTFmODkw
10
+ MzM0ZWJjOTc2OWIzOGIyNDZjMDA4YWJjNWIzNDg2ZWIyYzk3YzkyZTgzMWYx
11
+ ZTY3YWE3OTUxNGM4OTc0N2M0M2ZmZmJkY2ZlZjA5YjhmY2Q2YjI=
12
12
  data.tar.gz: !binary |-
13
- N2Q4ZDliZjIxMjAyMDU3NGJkNWU1NjEyNjQyMTU4NTcxNjRkNWQ4NDc0MjNl
14
- N2VmNmFjNzM1ZGYwMGNlZWMyMmU1YjRjNjVmNDhiNzE4M2NmOWNkYzRiNjNk
15
- ZjI5YzliZDZkNzMxNDIwYzNkZDFjODcxOWVjY2MzM2E3OTcxZGM=
13
+ M2Q5MTg0YzM3MmFjMThiMDJiOGIxZWFkMjY1NGNjNDY3YjY5M2NlZTIwOTc2
14
+ MzUyZmJlMmY0ODU3NTFlZWU2NWJhNzNlYmYxZGYyMjA5M2RiODZkYzVlNzlm
15
+ MjlkMDljYmJiOTI1ZTVhZTRiYjYyZWM4M2JhNGJkOWMxMzRmNzI=
data/bin/hyla CHANGED
@@ -17,8 +17,11 @@ program :description, Hyla::DESCRIPTION
17
17
 
18
18
  default_command :default
19
19
 
20
+ $cmd_directory = Dir.getwd
21
+
20
22
  def add_build_options(c)
21
- c.option '-c', '--config CONFIG_FILE', String, 'Custom configuration file'
23
+ c.option '-c', '--config CONFIG_FILE', String, 'Hyla Yaml configuration file'
24
+ c.option '-l', '--log LOG_YML_FILE', String, 'Log4r Yaml configuration file'
22
25
  c.option '-V', '--verbose', 'Print verbose output.'
23
26
  end
24
27
 
@@ -39,12 +42,13 @@ command :new do |c|
39
42
  c.option '-b', '--blank', 'Creates project directory containing the YAML config file and a simple readme.ad file'
40
43
  c.option '--t', '--template_type [TEMPLATE_TYPE]', String, 'Template Type to be used (documentation, book, training, training-exercises, blog, web, ...)'
41
44
 
42
- c.option '-V', '--verbose', 'Print verbose output.'
45
+ add_build_options(c)
43
46
 
44
47
  c.action do |args, options|
45
48
  if args.first.nil?
46
49
  puts "Please specify the PATH where the project should be created."
47
50
  else
51
+ $options = options.__hash__
48
52
  config = Hyla::Configuration.parse(options.__hash__)
49
53
  Hyla::Commands::New.process(args, config)
50
54
  end
@@ -64,6 +68,7 @@ command :add do |c|
64
68
  add_build_options(c)
65
69
 
66
70
  c.action do |args, options|
71
+ $options = options.__hash__
67
72
  config = Hyla::Configuration.parse(options.__hash__)
68
73
  Hyla::Commands::Add.process(args, config)
69
74
  end
@@ -82,17 +87,19 @@ command :generate do |c|
82
87
  c.option '--t', '--toc [PATH]', String, 'File Path of the asciidoc file containing the Table of Content'
83
88
  c.option '-y', '--style [STYLE]', String, 'Stylesheet theme to be applied : asciidoctor, liberation, github, colony, foundation, ...'
84
89
  c.option '-a', '--attributes [KEY=VALUE,KEY=VALUE]', String, 'Asciidoctor attributes'
85
- c.option '-o', '--cover_image [PNG FILE NAME]', String, 'Name of the cover png image file generated'
86
90
  c.option '-s', '--snippet_content [FLAG TRUE or FALSE]', String, 'Flag used to generate HTML content using the // tag::snippet[].'
87
- c.option '-n', '--course_name [COURSE NAME]', String, 'Name of the course'
88
- c.option '-l', '--cover_file [HTML FILE NAME]', String, 'Name of the cover html image file generated'
89
- c.option '-m', '--module_name [MODULE NAME]', String, 'Name of the module'
90
- c.option '-i', '--image_path [BACKGROUND IMAGE]', String, 'Location of the file used as background'
91
+
92
+ c.option '--course_name [COURSE NAME]', String, 'Name of the course'
93
+ c.option '--cover_file [HTML FILE NAME]', String, 'Name of the cover html image file generated'
94
+ c.option '--cover_image [PNG FILE NAME]', String, 'Name of the cover png image file generated'
95
+ c.option '--module_name [MODULE NAME]', String, 'Name of the module'
96
+ c.option '--image_path [BACKGROUND IMAGE]', String, 'Location of the file used as background'
91
97
 
92
98
  add_common_options(c)
93
99
  add_build_options(c)
94
100
 
95
101
  c.action do |args, options|
102
+ $options = options.__hash__
96
103
  config = Hyla::Configuration.parse(options.__hash__)
97
104
  Hyla::Commands::Generate.process(args, config)
98
105
  end
@@ -111,6 +118,7 @@ command :watch do |c|
111
118
  # TODO Find if it is possible to watch files, generate HTML content - asciidoctor, expose content using HTTPServer and expose WebSocket - LiveReload
112
119
  # as they are started in 2 different threads, this is not possible with existing code
113
120
  # Hyla::Commands::Serve.process(args,options.__hash__)
121
+ $options = options.__hash__
114
122
  config = Hyla::Configuration.parse(options.__hash__)
115
123
  Hyla::Commands::Watch.process(args, config)
116
124
  end
@@ -131,6 +139,7 @@ command :serve do |c|
131
139
  add_build_options(c)
132
140
 
133
141
  c.action do |args, options|
142
+ $options = options.__hash__
134
143
  options.default :serving => true
135
144
  config = Hyla::Configuration.parse(options.__hash__)
136
145
  Hyla::Commands::Serve.process(args, config)
@@ -145,7 +154,7 @@ command :sendmail do |c|
145
154
  c.syntax = 'hyla sendmail [options]'
146
155
  c.description = 'Send as HTML Attachment an email to the SMTP Server defined'
147
156
  c.option '-f', '--file [File]', String, 'File to be attached'
148
- c.option '-l', '--location [PATH]', String, 'Directory containing file to be attached'
157
+ c.option '-p', '--path [PATH]', String, 'Directory containing file to be attached'
149
158
  c.option '-a', '--attachment [boolean]', 'Attach to the email the HTML generated'
150
159
  c.option '-e', '--email_attributes [KEY=VALUE,KEY=VALUE]', String, 'Email attributes used to configure smtp server, port number, user password, authentication mode, sender, recipient, subject'
151
160
 
@@ -154,6 +163,7 @@ command :sendmail do |c|
154
163
 
155
164
  c.action do |args, options|
156
165
 
166
+ $options = options.__hash__
157
167
  options.default :attachment => false
158
168
 
159
169
  config = Hyla::Configuration.parse(options.__hash__)
@@ -51,7 +51,7 @@ Gem::Specification.new do |s|
51
51
  s.add_runtime_dependency 'tilt', '~> 1.4'
52
52
  s.add_runtime_dependency 'thor', '~> 0.18'
53
53
  s.add_runtime_dependency 'wkhtmltopdf-binary', '~> 0.9'
54
- # s.add_runtime_dependency 'log4r', '~> 1.1'
54
+ s.add_runtime_dependency 'log4r', '~> 1.1'
55
55
 
56
56
 
57
57
  # Colorize Text Terminal
@@ -5,6 +5,15 @@ source: .
5
5
  destination: generated_content # or . or ~/Hyla or generated_content
6
6
  # end common options
7
7
 
8
+ #
9
+ # Logging
10
+ #
11
+ mode: production # Default value = production. Available : 'production', 'development"
12
+ tracer: 'false' #Default value is false. Can be true or false
13
+ level: 'INFO' # Values available : DEBUG, INFO, WARN, ERROR, FATAL. Default for production : 'WARN' and development 'DEBUG'
14
+ dirname: # Directory where the log files will be saved
15
+ logname: hyla.log # Name of the log file
16
+
8
17
  #
9
18
  # Styles
10
19
  # Supported : liberation, asciidoctor, colony, foundation, foundation-lime, foundation-potion, github, golo, iconic, maker, readthedocs, riak, rocket-panda, rubygems
@@ -0,0 +1,32 @@
1
+ log4r_config:
2
+ # define all loggers ...
3
+ loggers:
4
+ - name : production
5
+ level : "LOGGING_LEVEL"
6
+ trace : "TRACER"
7
+ outputters:
8
+ - logfile
9
+ - name : development
10
+ level : "LOGGING_LEVEL"
11
+ trace : "TRACER"
12
+ outputters:
13
+ - stdout
14
+ - logfile
15
+
16
+ # define all outputters (incl. formatters)
17
+ outputters:
18
+ - type : StdoutOutputter
19
+ name : stdout
20
+ formatter:
21
+ date_pattern: '%Y-%m-%d %H:%M:%S'
22
+ pattern : '%d %l: %m '
23
+ type : PatternFormatter
24
+
25
+ - type : DateFileOutputter
26
+ name : logfile
27
+ dirname : "#{DIRNAME}"
28
+ filename : "#{LOGNAME}" # notice the file extension is needed!
29
+ formatter:
30
+ date_pattern: '%H:%M:%S'
31
+ pattern : '%d %l: %m '
32
+ type : PatternFormatter
@@ -22,7 +22,6 @@ require 'guard'
22
22
  require 'safe_yaml'
23
23
  require 'asciidoctor'
24
24
  require 'asciidoctor/backends/html5'
25
- # require 'asciidoctor/backends/_stylesheets'
26
25
 
27
26
  # Added to fix issue with Ruby 2.0 on Windows machine
28
27
  require 'em/pure_ruby'
@@ -45,12 +44,33 @@ require 'hyla/command'
45
44
  require 'hyla/configuration'
46
45
  require 'hyla/websocket'
47
46
  require 'hyla/logger'
47
+ require 'hyla/logger2'
48
48
 
49
49
  # extensions
50
50
  require_all 'hyla/commands'
51
51
 
52
52
  module Hyla
53
+
53
54
  def self.logger
54
55
  @logger ||= Logger.new
55
56
  end
57
+
58
+ def self.logger2
59
+ log_cfg ||= $options[:log]
60
+
61
+ hyla_cfg = safe_load_file($options[:config]) if $options[:config]
62
+
63
+ mode ||= hyla_cfg['mode']
64
+ dirname ||= hyla_cfg['dirname']
65
+ logname ||= hyla_cfg['logname']
66
+ level ||= hyla_cfg['level']
67
+ tracer ||= hyla_cfg['tracer']
68
+
69
+ $logger2 ||= Logger2.new(mode, log_cfg, dirname, logname, level, tracer)
70
+ end
71
+
72
+ def self.safe_load_file(filename)
73
+ f = File.expand_path(filename, $cmd_directory)
74
+ YAML.safe_load_file(f)
75
+ end
56
76
  end
@@ -0,0 +1,153 @@
1
+ require 'log4r'
2
+ require 'log4r/yamlconfigurator'
3
+ require 'log4r/outputter/datefileoutputter'
4
+ require 'hyla/configuration'
5
+ include Log4r
6
+
7
+ module Hyla
8
+ class Logger2
9
+
10
+ attr_reader :log, :levels
11
+
12
+ def initialize(name, log_yml_file, dirname = nil, logname = nil, level = nil, tracer = nil)
13
+
14
+ #
15
+ # Change logging level within the YAML config file
16
+ # ! Log4r::YamlConfigurator does not allow to change key/val for the level but only for formatter/outputter
17
+ #
18
+ if level.nil?
19
+ new_level = 'INFO'
20
+ else
21
+ new_level = level
22
+ end
23
+
24
+ if tracer.nil?
25
+ new_tracer = 'false'
26
+ else
27
+ new_tracer = tracer
28
+ end
29
+
30
+ log4r_hash = load_file(log_yml_file)
31
+
32
+ #
33
+ # TODO - improve it to avoid to hard code path
34
+ #
35
+ log4r_hash['log4r_config']['loggers'].each_with_index do |x, index|
36
+ log4r_hash['log4r_config']['loggers'][index]['level'] = new_level
37
+ log4r_hash['log4r_config']['loggers'][index]['tracer'] = new_tracer
38
+ end
39
+
40
+ cfg = Log4r::YamlConfigurator
41
+
42
+ if dirname.nil?
43
+ dir = [Dir.home, 'log'] * '/'
44
+ Dir.mkdir(dir) unless Dir.exist?(dir)
45
+ cfg['DIRNAME'] = dir
46
+ else
47
+ cfg['DIRNAME'] = dirname
48
+ end
49
+
50
+ if logname.nil?
51
+ cfg['LOGNAME'] = 'hyla.log'
52
+ else
53
+ cfg['LOGNAME'] = logname
54
+ end
55
+
56
+ cfg.decode_yaml log4r_hash['log4r_config']
57
+
58
+ @log = Log4r::Logger[name]
59
+ end
60
+
61
+ def levels
62
+ # ALL < DEBUG < INFO < WARN < ERROR < FATAL < OFF
63
+ levels = {"ALL" => 0, "DEBUG" => 1, "INFO" => 2, "WARN" => 3, "ERROR" => 4, "FATAL" => 5, "OFF" => 6}
64
+ end
65
+
66
+ def iterate(h, level)
67
+ h.each do |k,v|
68
+ value = v || k
69
+ if value.is_a?(Hash) || value.is_a?(Array)
70
+ puts "evaluating: #{value} recursively..."
71
+ iterate(value, level)
72
+ else
73
+ if k == "level"
74
+ v = level
75
+ end
76
+ end
77
+ end
78
+ end
79
+
80
+ def nested_hash_value(obj,key)
81
+ if obj.respond_to?(:key?) && obj.key?(key)
82
+ obj[key]
83
+ elsif obj.respond_to?(:each)
84
+ r = nil
85
+ obj.find{ |*a| r=nested_hash_value(a.last,key) }
86
+ r
87
+ end
88
+ end
89
+
90
+ def load_file(cfg_file)
91
+ SafeYAML::OPTIONS[:default_mode] = :safe
92
+
93
+ if cfg_file.nil?
94
+ f = [Configuration.configs,'log4r.yaml' ] * '/'
95
+ else
96
+ f = cfg_file
97
+ end
98
+
99
+ #
100
+ # Find/Replace the logging level
101
+ #
102
+ #content = File.read(f)
103
+ #new_contents = content.gsub(/LOGGING_LEVEL/, level)
104
+
105
+ # To merely print the contents of the file, use:
106
+ # puts new_contents
107
+
108
+ # To write changes to the file, use:
109
+ #File.open(f, "w") {|file| file.puts new_contents }
110
+
111
+ YAML.load_file(f)
112
+ end
113
+
114
+ def debug(msg)
115
+ @log.debug msg
116
+ end
117
+
118
+ def info(msg)
119
+ @log.info msg
120
+ end
121
+
122
+ def warn(msg)
123
+ @log.warn msg
124
+ end
125
+
126
+ def error(msg)
127
+ @log.error msg
128
+ end
129
+
130
+ def fatal(msg)
131
+ @log.fatal msg
132
+ end
133
+
134
+ #
135
+ # topic - the topic of the message, e.g. "Configuration file", "Deprecation", etc.
136
+ # message - the message detail
137
+ #
138
+ # Returns the formatted message
139
+ def message(topic, message)
140
+ formatted_topic(topic) + message.to_s.gsub(/\s+/, ' ')
141
+ end
142
+
143
+ #
144
+ # topic - the topic of the message, e.g. "Configuration file", "Deprecation", etc.
145
+ #
146
+ # Returns the formatted topic statement
147
+ def formatted_topic(topic)
148
+ "#{topic} ".rjust(20)
149
+ end
150
+
151
+ end
152
+
153
+ end
@@ -3,7 +3,7 @@ module Hyla
3
3
  program :int_block do
4
4
  # kill threads etc
5
5
  # make sure to exit or abort, otherwise your program keeps running
6
- Hyla::logger.warn "CTRL-C / Shutdown command received"
6
+ Hyla::logger2.warn "CTRL-C / Shutdown command received"
7
7
  exit 1
8
8
  end
9
9
 
@@ -12,7 +12,7 @@ module Hyla
12
12
  #
13
13
  def self.check_mandatory_option?(key, value)
14
14
  if value.nil? or value.empty?
15
- Hyla.logger.warn "Mandatory option missing: #{key}"
15
+ Hyla.logger2.warn "Mandatory option missing: #{key}"
16
16
  exit(1)
17
17
  else
18
18
  true
@@ -23,7 +23,7 @@ module Hyla
23
23
 
24
24
  FileUtils.cp(source, destination)
25
25
 
26
- Hyla::logger.info ">> Artefact #{artefact_file_name} added to project #{destination}"
26
+ Hyla::logger2.info ">> Artefact #{artefact_file_name} added to project #{destination}"
27
27
 
28
28
  case artefact_type
29
29
  when 'image','audio','video','source'
@@ -43,7 +43,7 @@ module Hyla
43
43
  FileUtils.mkdir_p(destination) unless File.exists?(destination)
44
44
  FileUtils.cp_r source, destination
45
45
 
46
- Hyla::logger.info ">> Fonts #{type} added to project #{destination}"
46
+ Hyla::logger2.info ">> Fonts #{type} added to project #{destination}"
47
47
  end
48
48
 
49
49
  end # class Create
@@ -13,9 +13,9 @@ module Hyla
13
13
  def build(training, options)
14
14
  source = options['source']
15
15
  destination = options['destination']
16
- Hyla.logger.info "Source: ", source
17
- Hyla.logger.info "Destination: ", destination
18
- print Hyla.logger.formatted_topic "Generating..."
16
+ Hyla.logger2.info "Source: ", source
17
+ Hyla.logger2.info "Destination: ", destination
18
+ print Hyla.logger2.formatted_topic "Generating..."
19
19
  self.process_training(training)
20
20
  puts "done."
21
21
  end
@@ -29,9 +29,9 @@ module Hyla
29
29
  training.process
30
30
  rescue Hyla::FatalException => e
31
31
  puts
32
- Hyla.logger.error "ERROR:", "YOUR TRAINING COULD NOT BE BUILT:"
33
- Hyla.logger.error "", "------------------------------------"
34
- Hyla.logger.error "", e.message
32
+ Hyla.logger2.error "ERROR:", "YOUR TRAINING COULD NOT BE BUILT:"
33
+ Hyla.logger2.error "", "------------------------------------"
34
+ Hyla.logger2.error "", e.message
35
35
  exit(1)
36
36
  end
37
37
 
@@ -11,7 +11,7 @@ module Hyla
11
11
 
12
12
  when 'toc2adoc'
13
13
 
14
- Hyla.logger.info "Rendering : Table of Content to Asciidoc"
14
+ Hyla.logger2.info "Rendering : Table of Content to Asciidoc"
15
15
  self.check_mandatory_option?('-t / --toc', options[:toc])
16
16
  self.check_mandatory_option?('-d / --destination', options[:destination])
17
17
 
@@ -25,7 +25,7 @@ module Hyla
25
25
 
26
26
  when 'adoc2html'
27
27
 
28
- Hyla.logger.info "Rendering : Asciidoc to HTML"
28
+ Hyla.logger2.info "Rendering : Asciidoc to HTML"
29
29
  self.check_mandatory_option?('-s / --source', options[:source])
30
30
  self.check_mandatory_option?('-d / --destination', options[:destination])
31
31
 
@@ -48,7 +48,7 @@ module Hyla
48
48
  self.asciidoc_to_html(@source, @destination, extensions, excludes, merged_options)
49
49
 
50
50
  when 'index2html'
51
- Hyla.logger.info "Rendering : Asciidoctor Indexed Files to HTML"
51
+ Hyla.logger2.info "Rendering : Asciidoctor Indexed Files to HTML"
52
52
  self.check_mandatory_option?('-s / --source', options[:source])
53
53
  self.check_mandatory_option?('-d / --destination', options[:destination])
54
54
 
@@ -74,7 +74,7 @@ module Hyla
74
74
 
75
75
  when 'html2pdf'
76
76
 
77
- Hyla.logger.info "Rendering : Generate PDF from HTML file"
77
+ Hyla.logger2.info "Rendering : Generate PDF from HTML file"
78
78
 
79
79
  source_dir = options[:source] if self.check_mandatory_option?('-s / --source', options[:source])
80
80
  out_dir = options[:destination] if self.check_mandatory_option?('-d / --destination', options[:destination])
@@ -88,7 +88,7 @@ module Hyla
88
88
 
89
89
  when 'cover2png'
90
90
 
91
- Hyla.logger.info "Rendering : Generate Cover HTML page & picture - format png"
91
+ Hyla.logger2.info "Rendering : Generate Cover HTML page & picture - format png"
92
92
 
93
93
  out_dir = options[:destination] if self.check_mandatory_option?('-d / --destination', options[:destination])
94
94
  file_name = options[:cover_file]
@@ -101,7 +101,7 @@ module Hyla
101
101
  self.cover_img(out_dir, file_name, image_name, course_name, module_name, bg_image_path, tool)
102
102
 
103
103
  else
104
- Hyla.logger.error ">> Unknow rendering"
104
+ Hyla.logger2.error ">> Unknow rendering"
105
105
  exit(1)
106
106
  end
107
107
  end
@@ -129,7 +129,7 @@ module Hyla
129
129
  # Cover Function
130
130
  # Create a png file using the HTML generated with the Slim cover template
131
131
  #
132
- def self.cover_img(out_dir, file_name, image_name, course_name, module_name, bg_image_path, tool)
132
+ def self.cover_img(out_dir, file_name, image_name, course_name, module_name, bg_image_path, tool = imgkit)
133
133
 
134
134
  unless Dir.exist? out_dir
135
135
  FileUtils.mkdir_p out_dir
@@ -147,8 +147,8 @@ module Hyla
147
147
  # Replace underscore with space, next digits & space with nothing & Capitalize
148
148
  module_name = module_name.gsub('_', ' ').gsub(/^\d{1,2}\s/, '').capitalize
149
149
 
150
- Hyla.logger.debug "Module name : " + module_name
151
- Hyla.logger.info "Curent directory : #{Dir.pwd}"
150
+ Hyla.logger2.debug "Module name : " + module_name
151
+ Hyla.logger2.info "Curent directory : #{Dir.pwd}"
152
152
 
153
153
  # Use slim template & render the HTML
154
154
  parameters = {:course_name => course_name,
@@ -185,19 +185,19 @@ module Hyla
185
185
  source = File.expand_path source
186
186
  @destination = File.expand_path destination
187
187
 
188
- Hyla.logger.info ">> Source dir: #{source}"
189
- Hyla.logger.info ">> Destination dir: #{@destination}"
188
+ Hyla.logger2.info ">> Source dir: #{source}"
189
+ Hyla.logger2.info ">> Destination dir: #{@destination}"
190
190
 
191
191
  # Exit if source directory does not exist
192
192
  if !Dir.exist? source
193
- Hyla.logger.error ">> Source directory does not exist"
193
+ Hyla.logger2.error ">> Source directory does not exist"
194
194
  exit(1)
195
195
  end
196
196
 
197
197
  # Move to source directory
198
198
  Dir.chdir(source)
199
199
  current_dir = Dir.pwd
200
- Hyla.logger.info ">> Current dir: #{current_dir}"
200
+ Hyla.logger2.info ">> Current dir: #{current_dir}"
201
201
 
202
202
  #
203
203
  # Backup Asciidoctor attributes
@@ -231,7 +231,7 @@ module Hyla
231
231
  path_to_source = Pathname.new(source)
232
232
  path_to_adoc_file = Pathname.new(f)
233
233
  relative_path = path_to_adoc_file.relative_path_from(path_to_source).to_s
234
- Hyla.logger.debug ">> Relative path: #{relative_path}"
234
+ Hyla.logger2.debug ">> Relative path: #{relative_path}"
235
235
  adoc_file_paths << relative_path
236
236
 
237
237
  # Get asciidoctor file name
@@ -241,7 +241,7 @@ module Hyla
241
241
  # Create destination dir relative to the path calculated
242
242
  #
243
243
  html_dir = [@destination, File.dirname(relative_path)] * '/'
244
- Hyla.logger.debug ">> Dir of html: #{html_dir}"
244
+ Hyla.logger2.debug ">> Dir of html: #{html_dir}"
245
245
  FileUtils.mkdir_p html_dir
246
246
 
247
247
  # Copy Fonts
@@ -263,7 +263,7 @@ module Hyla
263
263
  #
264
264
  # Render asciidoc to HTML
265
265
  #
266
- Hyla.logger.info ">> File to be rendered : #{file_name_processed}"
266
+ Hyla.logger2.info ">> File to be rendered : #{file_name_processed}"
267
267
 
268
268
  #
269
269
  # Convert asciidoc file name to html file name
@@ -289,7 +289,7 @@ module Hyla
289
289
 
290
290
  # No asciidoc files retrieved
291
291
  if adoc_file_paths.empty?
292
- Hyla.logger.info " >> No asciidoc files retrieved."
292
+ Hyla.logger2.info " >> No asciidoc files retrieved."
293
293
  exit(1)
294
294
  end
295
295
 
@@ -314,7 +314,7 @@ module Hyla
314
314
  source = [Configuration::assets, resource] * '/'
315
315
  # destination = [path, resource] * '/'
316
316
  destination = path
317
- Hyla.logger.debug ">> Copy resource from Source dir: #{source} --> destination dir: #{destination}"
317
+ Hyla.logger2.debug ">> Copy resource from Source dir: #{source} --> destination dir: #{destination}"
318
318
  FileUtils.cp_r source, destination, :verbose => false
319
319
  end
320
320
 
@@ -329,7 +329,7 @@ module Hyla
329
329
  #
330
330
  def self.table_of_content_to_asciidoc(toc_file, out_dir, project_name, image_path)
331
331
 
332
- Hyla.logger.info '>> Project Name : ' + project_name + ' <<'
332
+ Hyla.logger2.info '>> Project Name : ' + project_name + ' <<'
333
333
 
334
334
  # Open file & parse it
335
335
  f = f = File.open(toc_file, 'r')
@@ -337,7 +337,7 @@ module Hyla
337
337
 
338
338
  # Expand File Path
339
339
  @out_dir = File.expand_path out_dir
340
- Hyla.logger.info '>> Output directory : ' + out_dir + ' <<'
340
+ Hyla.logger2.info '>> Output directory : ' + out_dir + ' <<'
341
341
 
342
342
  #
343
343
  # Create destination directory if it does not exist
@@ -347,7 +347,7 @@ module Hyla
347
347
  end
348
348
 
349
349
  # Copy YAML Config file
350
- FileUtils.cp_r [Configuration::templates, Configuration::YAML_CONFIG_FILE_NAME] * '/', @out_dir
350
+ FileUtils.cp_r [Configuration::configs, Configuration::YAML_CONFIG_FILE_NAME] * '/', @out_dir
351
351
 
352
352
  # Copy styles
353
353
  # FileUtils.cp_r Configuration::styles, @out_dir
@@ -397,7 +397,7 @@ module Hyla
397
397
  new_dir = [@out_dir, dir_name].join('/')
398
398
  FileUtils.rm_rf new_dir
399
399
  FileUtils.mkdir new_dir
400
- Hyla.logger.info '>> Directory created : ' + new_dir + ' <<'
400
+ Hyla.logger2.info '>> Directory created : ' + new_dir + ' <<'
401
401
 
402
402
  Dir.chdir(new_dir)
403
403
 
@@ -428,7 +428,7 @@ module Hyla
428
428
  #
429
429
  dir_name = File.basename(Dir.getwd)
430
430
  @module_key = dir_name.initial.rjust(2, '0')
431
- Hyla.logger.info ">> Module key : #@module_key <<"
431
+ Hyla.logger2.info ">> Module key : #@module_key <<"
432
432
 
433
433
  #
434
434
  # Reset counter value used to generate file number
@@ -442,9 +442,9 @@ module Hyla
442
442
  @index += 1
443
443
  file_index = sprintf('%02d', @index)
444
444
  f_name = 'm' + @module_key + 'p' + file_index + '_cover' + Configuration::ADOC_EXT
445
- Hyla.logger.debug '>> Directory name : ' + dir_name.to_s.gsub('_', ' ')
445
+ Hyla.logger2.debug '>> Directory name : ' + dir_name.to_s.gsub('_', ' ')
446
446
  rep_txt = Configuration::COVER_TXT.gsub(/xxx\.png/, dir_name + '.png')
447
- Hyla.logger.debug "Replaced by : " + rep_txt
447
+ Hyla.logger2.debug "Replaced by : " + rep_txt
448
448
  cover_f = File.new(f_name, 'w')
449
449
  cover_f.puts rep_txt
450
450
  cover_f.close
@@ -458,13 +458,13 @@ module Hyla
458
458
  course_name = @project_name
459
459
  module_name= dir_name
460
460
  bg_image_path = image_path
461
- Hyla.logger.debug '>> Out Directory : ' + out_dir.to_s
462
- Hyla.logger.debug '>> Image name : ' + image_name.to_s
463
- Hyla.logger.debug '>> Course Name : ' + course_name.to_s
464
- Hyla.logger.debug '>> Module Name : ' + module_name.to_s
465
- Hyla.logger.debug '>> Bg Image : ' + bg_image_path.to_s
461
+ Hyla.logger2.debug '>> Out Directory : ' + out_dir.to_s
462
+ Hyla.logger2.debug '>> Image name : ' + image_name.to_s
463
+ Hyla.logger2.debug '>> Course Name : ' + course_name.to_s
464
+ Hyla.logger2.debug '>> Module Name : ' + module_name.to_s
465
+ Hyla.logger2.debug '>> Bg Image : ' + bg_image_path.to_s
466
466
 
467
- self.cover_img(out_dir, file_name, image_name, course_name, module_name, bg_image_path)
467
+ self.cover_img(out_dir, file_name, image_name, course_name, module_name, bg_image_path, tool = nil)
468
468
 
469
469
  #
470
470
  # Include cover file to index
@@ -559,7 +559,7 @@ module Hyla
559
559
  @new_f.puts Configuration::HEADER_TXT
560
560
  @new_f.puts "\n"
561
561
 
562
- Hyla.logger.info ' # File created : ' + f_asciidoc_name.to_s
562
+ Hyla.logger2.info ' # File created : ' + f_asciidoc_name.to_s
563
563
 
564
564
  @previous_f = @new_f
565
565
 
@@ -620,7 +620,7 @@ module Hyla
620
620
  # Save PDF to a file
621
621
  pdf_file_name = [destination, html_file_name.sub(/html|htm/, 'pdf')] * '/'
622
622
  kit.to_file(pdf_file_name)
623
- Hyla.logger.info ">> PDF file generated and saved : #{pdf_file_name} "
623
+ Hyla.logger2.info ">> PDF file generated and saved : #{pdf_file_name} "
624
624
  end
625
625
  =end
626
626
 
@@ -698,7 +698,7 @@ module Hyla
698
698
  wkhtml_cmd.concat " --margin-bottom '10mm' --footer-center '#{footer_text}'" if footer_text
699
699
  wkhtml_cmd.concat " --cover '#@cover_path'" if @cover_path
700
700
  wkhtml_cmd.concat " --page-size #{size}"
701
- Hyla.logger.debug "c #{wkhtml_cmd}"
701
+ Hyla.logger2.debug "c #{wkhtml_cmd}"
702
702
 
703
703
  Dir.chdir(source) do
704
704
  system "#{wkhtml_cmd}"
@@ -733,7 +733,7 @@ module Hyla
733
733
  #
734
734
  def self.check_slash_end(out_dir)
735
735
  last_char = out_dir.to_s[-1, 1]
736
- Hyla.logger.info '>> Last char : ' + last_char
736
+ Hyla.logger2.info '>> Last char : ' + last_char
737
737
  if !last_char.equal? '/\//'
738
738
  temp_dir = out_dir.to_s
739
739
  out_dir = temp_dir + '/'
@@ -834,7 +834,7 @@ module Hyla
834
834
  #
835
835
  def self.check_mandatory_option?(key, value)
836
836
  if value.nil? or value.empty?
837
- Hyla.logger.warn "Mandatory option missing: #{key}"
837
+ Hyla.logger2.warn "Mandatory option missing: #{key}"
838
838
  exit(1)
839
839
  else
840
840
  true
@@ -28,22 +28,22 @@ EOS
28
28
 
29
29
  if Dir.exist? new_project_path
30
30
 
31
- Hyla.logger.debug("Dir exists: #{new_project_path}")
31
+ Hyla.logger2.debug("Dir exists: #{new_project_path}")
32
32
 
33
33
  # If force is selected, then we delete & recreate it to clean content
34
34
  if options[:force]
35
- Hyla.logger.debug("Force option selected")
35
+ Hyla.logger2.debug("Force option selected")
36
36
  # DOES NOT WORK ON Mac OS X
37
37
  # FileUtils.rmdir(new_project_path)
38
38
  FileUtils.rm_rf new_project_path
39
39
  # Create Directory
40
40
  FileUtils.mkdir_p new_project_path
41
- Hyla.logger.debug("Dir recreated")
41
+ Hyla.logger2.debug("Dir recreated")
42
42
  end
43
43
 
44
44
  # Preserve content if it exists
45
45
  if preserve_content?(new_project_path)
46
- Hyla.logger.error "Conflict: ", "#{new_project_path} exists and is not empty."
46
+ Hyla.logger2.error "Conflict: #{new_project_path} exists and is not empty."
47
47
  exit(1)
48
48
  end
49
49
 
@@ -55,17 +55,17 @@ EOS
55
55
  #
56
56
  # Create blank project
57
57
  # or copy sample project from template directory
58
- #
58
+ #igs
59
59
  if options[:blank]
60
60
  create_blank_project new_project_path
61
61
 
62
62
  # Add yaml config file
63
- FileUtils.cp_r [Configuration::templates, Configuration::YAML_CONFIG_FILE_NAME] * '/', new_project_path
63
+ FileUtils.cp_r [Configuration::configs, Configuration::YAML_CONFIG_FILE_NAME] * '/', new_project_path
64
64
 
65
65
  # Copy styles
66
66
  FileUtils.cp_r Configuration::styles, new_project_path
67
67
 
68
- Hyla.logger.info("Blank project created")
68
+ Hyla.logger2.info("Blank project created")
69
69
 
70
70
  else
71
71
  raise ArgumentError.new('You must specifiy a template type.') if options[:template_type].nil?
@@ -75,7 +75,7 @@ EOS
75
75
  # Copy styles
76
76
  FileUtils.cp_r Configuration::styles, new_project_path
77
77
 
78
- Hyla.logger.info("Sample project created using template : #{options[:template_type]}")
78
+ Hyla.logger2.info("Sample project created using template : #{options[:template_type]}")
79
79
  end
80
80
 
81
81
  end
@@ -100,7 +100,7 @@ EOS
100
100
  FileUtils.cp_r source, path
101
101
 
102
102
  # Add yaml config file
103
- FileUtils.cp_r [Configuration::templates, Configuration::YAML_CONFIG_FILE_NAME] * '/', path
103
+ FileUtils.cp_r [Configuration::configs, Configuration::YAML_CONFIG_FILE_NAME] * '/', path
104
104
  end
105
105
 
106
106
  #
@@ -24,21 +24,21 @@ module Hyla
24
24
  end
25
25
 
26
26
  def reload_browser(paths = [])
27
- Hyla.logger.info "Reloading browser: #{paths.join(' ')}"
27
+ Hyla.logger2.info "Reloading browser: #{paths.join(' ')}"
28
28
  paths.each do |path|
29
- Hyla.logger.info(path)
29
+ Hyla.logger2.info(path)
30
30
  data = _data(path)
31
- Hyla.logger.info(">> Data received : #{data}")
31
+ Hyla.logger2.info(">> Data received : #{data}")
32
32
  @@web_sockets.each { |ws| ws.send(MultiJson.encode(data)) }
33
33
  end
34
34
  end
35
35
 
36
36
  def reload_browser2(paths = [])
37
- Hyla.logger.info "Reloading browser: #{paths.join(' ')}"
37
+ Hyla.logger2.info "Reloading browser: #{paths.join(' ')}"
38
38
  paths.each do |path|
39
- Hyla.logger.info(path)
39
+ Hyla.logger2.info(path)
40
40
  data = 'hyla/development/'
41
- Hyla.logger.info(">> Data received : #{data}")
41
+ Hyla.logger2.info(">> Data received : #{data}")
42
42
  @@web_sockets.each { |ws| ws.send(MultiJson.encode(data)) }
43
43
  end
44
44
  end
@@ -70,7 +70,7 @@ module Hyla
70
70
  end
71
71
 
72
72
  def _start_reactor
73
- Hyla.logger.info "LiveReload is waiting for a browser to connect."
73
+ Hyla.logger2.info "LiveReload is waiting for a browser to connect."
74
74
  EventMachine.epoll
75
75
  EventMachine.run do
76
76
  EventMachine.start_server(@options[:host], @options[:port], @Websocket, {}) do |ws|
@@ -82,7 +82,7 @@ module Hyla
82
82
  end
83
83
 
84
84
  def _connect(ws)
85
- Hyla.logger.info "Browser connected."
85
+ Hyla.logger2.info "Browser connected."
86
86
  ws.send MultiJson.encode(
87
87
  command: 'hello',
88
88
  protocols: ['http://livereload.com/protocols/official-7'],
@@ -90,18 +90,18 @@ module Hyla
90
90
  )
91
91
  @@web_sockets << ws
92
92
  rescue
93
- Hyla.logger.error $!
94
- Hyla.logger.error $!.backtrace
93
+ Hyla.logger2.error $!
94
+ Hyla.logger2.error $!.backtrace
95
95
  end
96
96
 
97
97
  def _disconnect(ws)
98
- Hyla.logger.info "Browser disconnected."
98
+ Hyla.logger2.info "Browser disconnected."
99
99
  @@web_sockets.delete(ws)
100
100
  end
101
101
 
102
102
  def _print_message(message)
103
103
  message = MultiJson.decode(message)
104
- Hyla.logger.info "Browser URL: #{message['url']}" if message['command'] == 'url'
104
+ Hyla.logger2.info "Browser URL: #{message['url']}" if message['command'] == 'url'
105
105
  end
106
106
 
107
107
  end # class
@@ -74,7 +74,7 @@ module Hyla
74
74
 
75
75
  mail.delivery_method :smtp, parameters()
76
76
  mail.deliver!
77
- Hyla.logger.info "Email send to SMTP server from #{sender} with this subject : #{subject}"
77
+ Hyla.logger2.info "Email send to SMTP server from #{sender} with this subject : #{subject}"
78
78
  end
79
79
 
80
80
  #
@@ -29,12 +29,12 @@ module Hyla
29
29
 
30
30
  s.mount(my_opts[:baseurl],HTTPServlet::FileHandler, destination, fh_option)
31
31
 
32
- Hyla.logger.info "Server address:", "http://#{s.config[:BindAddress]}:#{s.config[:Port]}"
32
+ Hyla.logger2.info "Server address:", "http://#{s.config[:BindAddress]}:#{s.config[:Port]}"
33
33
 
34
34
  if options[:detach] # detach the server
35
35
  pid = Process.fork { s.start }
36
36
  Process.detach(pid)
37
- Hyla.logger.info "Server detached with pid '#{pid}'.", "Run `kill -9 #{pid}' to stop the server."
37
+ Hyla.logger2.info "Server detached with pid '#{pid}'.", "Run `kill -9 #{pid}' to stop the server."
38
38
  else # create a new server thread, then join it with current terminal
39
39
  t = Thread.new { s.start }
40
40
  trap("INT") { s.shutdown }
@@ -45,7 +45,7 @@ module Hyla
45
45
 
46
46
  def self.start_callback(detached)
47
47
  unless detached
48
- Proc.new { Hyla.logger.info "Server running...", "press ctrl-c to stop." }
48
+ Proc.new { Hyla.logger2.info "Server running...", "press ctrl-c to stop." }
49
49
  end
50
50
  end
51
51
 
@@ -35,34 +35,34 @@ module Hyla
35
35
  # Detect files modified, deleted or added
36
36
  #
37
37
  callback = Proc.new do |modified, added, removed|
38
- Hyla.logger.info "modified absolute path: #{modified}"
39
- Hyla.logger.info "added absolute path: #{added}"
40
- Hyla.logger.info "removed absolute path: #{removed}"
38
+ Hyla.logger2.info "modified absolute path: #{modified}"
39
+ Hyla.logger2.info "added absolute path: #{added}"
40
+ Hyla.logger2.info "removed absolute path: #{removed}"
41
41
 
42
42
  if !modified.nil? or !added.nil?
43
43
  modified.each do |modify|
44
- Hyla.logger.info "File modified : #{modify}"
44
+ Hyla.logger2.info "File modified : #{modify}"
45
45
  call_asciidoctor(modify)
46
46
  end
47
47
 
48
48
  added.each do |add|
49
- Hyla.logger.info "File added : #{add}"
49
+ Hyla.logger2.info "File added : #{add}"
50
50
  call_asciidoctor(add)
51
51
  end
52
52
 
53
53
  end
54
54
  end # callback
55
55
 
56
- Hyla.logger.info ">> ... Starting\n"
57
- Hyla.logger.info ">> Hyla has started to watch files in this dir : #{@opts[:watch_dir]}"
58
- Hyla.logger.info ">> Results of rendering will be available here : #{@opts[:to_dir]}"
56
+ Hyla.logger2.info ">> ... Starting\n"
57
+ Hyla.logger2.info ">> Hyla has started to watch files in this dir : #{@opts[:watch_dir]}"
58
+ Hyla.logger2.info ">> Results of rendering will be available here : #{@opts[:to_dir]}"
59
59
 
60
60
  # TODO : Investigate issue with Thread pool is not running (Celluloid::Error)
61
61
  # when using a more recent version of guard listen
62
62
  listener = Listen.to!(@opts[:watch_dir], &callback)
63
63
 
64
64
  trap(:INT) {
65
- Hyla.logger.info "Interrupt intercepted"
65
+ Hyla.logger2.info "Interrupt intercepted"
66
66
  Thread.kill(@t)
67
67
  }
68
68
  end
@@ -76,9 +76,9 @@ module Hyla
76
76
 
77
77
  if [".adoc",".ad",".asciidoc",".txt",".index"].include? @ext_name
78
78
 
79
- Hyla.logger.info ">> Directory containing file(s) to be processed : #{dir_file}"
80
- Hyla.logger.info ">> File to be processed : #{file_to_process}"
81
- Hyla.logger.info ">> Extension of the file : #{@ext_name}"
79
+ Hyla.logger2.info ">> Directory containing file(s) to be processed : #{dir_file}"
80
+ Hyla.logger2.info ">> File to be processed : #{file_to_process}"
81
+ Hyla.logger2.info ">> Extension of the file : #{@ext_name}"
82
82
 
83
83
  # Generate File name
84
84
  # Rename xxx.adoc, xxx.asciidoc, xxx.ad, xxx.index to xxx.html
@@ -100,8 +100,8 @@ module Hyla
100
100
 
101
101
  @opts[:to_dir] = calc_dir
102
102
 
103
- Hyla.logger.info ">> Directory of the file to be generated : #{calc_dir}"
104
- Hyla.logger.debug ">> Asciidoctor options : #{@opts}"
103
+ Hyla.logger2.info ">> Directory of the file to be generated : #{calc_dir}"
104
+ Hyla.logger2.debug ">> Asciidoctor options : #{@opts}"
105
105
 
106
106
  # Render Asciidoc document
107
107
  Asciidoctor.render_file(f, @opts)
@@ -115,7 +115,7 @@ module Hyla
115
115
 
116
116
  def self.substract_watch_dir(file_dir, watched_dir)
117
117
  s = file_dir.sub(watched_dir, '')
118
- Hyla.logger.info ">> Relative directory : #{s}"
118
+ Hyla.logger2.info ">> Relative directory : #{s}"
119
119
  s
120
120
  end
121
121
 
@@ -3,7 +3,7 @@ module Hyla
3
3
 
4
4
  attr_reader :HEADER, :INDEX_SUFFIX, :HEADER_INDEX, :INCLUDE_PREFIX, :INCLUDE_SUFFIX, :LEVEL_1, :LEVEL_2, :SKIP_CHARACTERS,
5
5
  :ADOC_EXT, :PREFIX_ARTEFACT, :YAML_CONFIG_FILE_NAME, :DEFAULTS,
6
- :templates, :cover_template, :samples, :resources, :styles, :fonts, :backends, :assets
6
+ :templates, :configs, :cover_template, :samples, :resources, :styles, :fonts, :backends, :assets
7
7
 
8
8
  DEFAULTS = {
9
9
  'source' => Dir.pwd,
@@ -49,18 +49,6 @@ module Hyla
49
49
 
50
50
  SNIPPET_TAG = 'snippet'
51
51
 
52
-
53
- # OLD HEADER_TXT used with hyla < 1.0.7
54
- # HEADER_TXT = ":data-uri:\n" +
55
- # ":icons: font\n" +
56
- # ":last-update-label!:\n" +
57
- # ":source-highlighter: coderay\n"
58
- #
59
- # HEADER_TXT = "ifndef::local[]\n" +
60
- # ":imagesdir: ../image/\n" +
61
- # "endif::[]\n"
62
-
63
-
64
52
  HEADER_TXT = "// Asciidoctor attributes\n"
65
53
 
66
54
  LEVEL_1 = '= '
@@ -91,6 +79,13 @@ module Hyla
91
79
  File.expand_path(COVERS, File.dirname(__FILE__))
92
80
  end
93
81
 
82
+ #
83
+ # Config Location
84
+ #
85
+ def self.configs
86
+ File.expand_path(CONFIGS, File.dirname(__FILE__))
87
+ end
88
+
94
89
  #
95
90
  # Templates Location
96
91
  #
@@ -161,11 +156,11 @@ module Hyla
161
156
 
162
157
  # Stringify keys of the hash that we receive from Hyla
163
158
  override = Configuration[override].stringify_keys
164
- Hyla::logger.debug("OVERRIDE Keys: #{override.inspect}")
159
+ Hyla::logger2.debug("OVERRIDE Keys: #{override.inspect}")
165
160
 
166
161
  # Clone DEFAULTS
167
162
  config = DEFAULTS
168
- Hyla::logger.debug("DEFAULTS Keys: #{config.inspect}")
163
+ Hyla::logger2.debug("DEFAULTS Keys: #{config.inspect}")
169
164
 
170
165
  #
171
166
  # Read the config file passed as parameter if it exists
@@ -177,7 +172,7 @@ module Hyla
177
172
  config = config.deep_merge(alt_config)
178
173
  else
179
174
  new_config = read_config_file(YAML_CONFIG_FILE_NAME)
180
- Hyla::logger.debug("OVERRIDE Keys: #{new_config.inspect}") if !new_config.nil?
175
+ Hyla::logger2.debug("OVERRIDE Keys: #{new_config.inspect}") if !new_config.nil?
181
176
  config = config.deep_merge(new_config) if !new_config.nil?
182
177
  end
183
178
 
@@ -185,7 +180,7 @@ module Hyla
185
180
  config = config.deep_merge(override)
186
181
  # Convert String Keys to Symbols Keys
187
182
  config = Configuration[].transform_keys_to_symbols(config)
188
- Hyla::logger.debug("Merged Keys: #{config.inspect}")
183
+ Hyla::logger2.debug("Merged Keys: #{config.inspect}")
189
184
  return config
190
185
  end
191
186
 
@@ -194,11 +189,10 @@ module Hyla
194
189
  #
195
190
  def self.read_config_file(filename)
196
191
  f = File.expand_path(filename)
197
- Hyla::logger.info("Config file to be parsed : #{f}")
198
- config = safe_load_file(f)
199
- config
192
+ Hyla::logger2.info("Config file to be parsed : #{f}")
193
+ safe_load_file(f)
200
194
  rescue SystemCallError
201
- Hyla::logger.warn "No configuration file retrieved for the name : #{filename}"
195
+ Hyla::logger2.error "No configuration file retrieved for the name : #{filename}"
202
196
  end
203
197
 
204
198
  #
@@ -267,6 +261,8 @@ module Hyla
267
261
 
268
262
  TEMPLATES = '../../lib/templates'
269
263
 
264
+ CONFIGS = '../../lib/configs'
265
+
270
266
  RESOURCES = '../../lib/resources'
271
267
 
272
268
  SAMPLES = '../../lib/templates/sample'
@@ -6,6 +6,7 @@ module Hyla
6
6
  INFO = 1
7
7
  WARN = 2
8
8
  ERROR = 3
9
+ FATAL = 4
9
10
 
10
11
  # Public: Create a new instance of Hyla's logger
11
12
  #
@@ -1,5 +1,5 @@
1
1
  module Hyla
2
- VERSION = '1.0.7.pre.7'
2
+ VERSION = '1.0.7.pre.8'
3
3
  DESCRIPTION = 'Asciidoctor Hyla - Command Line tool to create new project, watch modifications, generate content, publish or consult it live !'
4
4
  SUMMARY = 'Asciidoctor Hyla - builder/generator of HTML5, slideshow. Watch modifications, generate content, publish or consult it live !'
5
5
  end
@@ -23,7 +23,7 @@ module Hyla
23
23
  private
24
24
 
25
25
  def _serve_file(path)
26
- Hyla.logger.info "Serving file #{path}"
26
+ Hyla.logger2.info "Serving file #{path}"
27
27
  send_data "HTTP/1.1 200 OK\r\nContent-Type: #{_content_type(path)}\r\nContent-Length: #{File.size path}\r\n\r\n"
28
28
  stream_file_data(path).callback { close_connection_after_writing }
29
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyla
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7.pre.7
4
+ version: 1.0.7.pre.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Moulliard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-26 00:00:00.000000000 Z
11
+ date: 2015-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -442,6 +442,20 @@ dependencies:
442
442
  - - ~>
443
443
  - !ruby/object:Gem::Version
444
444
  version: '0.9'
445
+ - !ruby/object:Gem::Dependency
446
+ name: log4r
447
+ requirement: !ruby/object:Gem::Requirement
448
+ requirements:
449
+ - - ~>
450
+ - !ruby/object:Gem::Version
451
+ version: '1.1'
452
+ type: :runtime
453
+ prerelease: false
454
+ version_requirements: !ruby/object:Gem::Requirement
455
+ requirements:
456
+ - - ~>
457
+ - !ruby/object:Gem::Version
458
+ version: '1.1'
445
459
  - !ruby/object:Gem::Dependency
446
460
  name: colorator
447
461
  requirement: !ruby/object:Gem::Requirement
@@ -506,7 +520,10 @@ files:
506
520
  - documentation/scripts/remove_temp_directories.sh
507
521
  - documentation/scripts/sendmail.sh
508
522
  - hyla.gemspec
523
+ - lib/configs/_config.yaml
524
+ - lib/configs/log4r.yaml
509
525
  - lib/hyla.rb
526
+ - lib/hyla/Logger2.rb
510
527
  - lib/hyla/command.rb
511
528
  - lib/hyla/commands/add.rb
512
529
  - lib/hyla/commands/build.rb
@@ -1179,7 +1196,6 @@ files:
1179
1196
  - lib/resources/backends/slim/revealjs/inline_menu.html.slim
1180
1197
  - lib/resources/backends/slim/revealjs/inline_quoted.html.slim
1181
1198
  - lib/resources/backends/slim/revealjs/section.html.slim
1182
- - lib/templates/_config.yaml
1183
1199
  - lib/templates/book/development/audio/ocean_waves.mp3
1184
1200
  - lib/templates/book/development/book.adoc
1185
1201
  - lib/templates/book/development/image/hyla_frog.jpg