madness 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/madness/command_line.rb +9 -14
- data/lib/madness/docopt.txt +4 -0
- data/lib/madness/settings.rb +2 -1
- data/lib/madness/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 14bbd2ee1af23197d85f0bcf860e60427a8649d3
|
|
4
|
+
data.tar.gz: 5da1263cd2eeb2bae35eff8fb890f93373029c89
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 97c3567ea71a545b739211c0fc640df165ee7fc0b24feb7cd03757cb8b79e2afc83407f6130e1db1990cf78b1b5911285f3feb34a6aac36a741d6dc3d88c969c
|
|
7
|
+
data.tar.gz: 6f6c10c43eef42c130a6286589ac77fee130998cfdeeffd793bc1a0f4c82df589696785d66ec25ba77fb39842a03d2a7fc8417d33bfdda96f77aff09850f4b60
|
data/README.md
CHANGED
data/lib/madness/command_line.rb
CHANGED
|
@@ -5,14 +5,9 @@ module Madness
|
|
|
5
5
|
include Singleton
|
|
6
6
|
include Colsole
|
|
7
7
|
|
|
8
|
-
#
|
|
9
|
-
# Otherwise, we will set some options before executing.
|
|
8
|
+
# Launch the server
|
|
10
9
|
def execute(argv=[])
|
|
11
|
-
|
|
12
|
-
launch_server
|
|
13
|
-
else
|
|
14
|
-
launch_server_with_options argv
|
|
15
|
-
end
|
|
10
|
+
launch_server_with_options argv
|
|
16
11
|
end
|
|
17
12
|
|
|
18
13
|
private
|
|
@@ -24,11 +19,10 @@ module Madness
|
|
|
24
19
|
begin
|
|
25
20
|
args = Docopt::docopt(doc, argv: argv, version: VERSION)
|
|
26
21
|
set_config args
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
end
|
|
22
|
+
|
|
23
|
+
build_index if config.index
|
|
24
|
+
launch_server unless args['--and-quit']
|
|
25
|
+
|
|
32
26
|
rescue Docopt::Exit => e
|
|
33
27
|
puts e.message
|
|
34
28
|
end
|
|
@@ -42,7 +36,7 @@ module Madness
|
|
|
42
36
|
STDERR.puts "Invalid path (#{config.path})"
|
|
43
37
|
return
|
|
44
38
|
end
|
|
45
|
-
|
|
39
|
+
|
|
46
40
|
show_status
|
|
47
41
|
Server.prepare
|
|
48
42
|
Server.run!
|
|
@@ -57,6 +51,7 @@ module Madness
|
|
|
57
51
|
config.autoh1 = false if args['--no-auto-h1']
|
|
58
52
|
config.highlighter = false if args['--no-syntax']
|
|
59
53
|
config.line_numbers = false if args['--no-line-numbers']
|
|
54
|
+
config.index = true if args['--index']
|
|
60
55
|
end
|
|
61
56
|
|
|
62
57
|
# Say hello to everybody when the server starts, showing the known
|
|
@@ -64,7 +59,7 @@ module Madness
|
|
|
64
59
|
def show_status
|
|
65
60
|
say_status :start, 'the madness'
|
|
66
61
|
say_status :listen, "#{config.bind}:#{config.port}", :txtblu
|
|
67
|
-
say_status :path, config.path, :txtblu
|
|
62
|
+
say_status :path, File.realpath(config.path), :txtblu
|
|
68
63
|
say_status :use, config.filename if config.file_exist?
|
|
69
64
|
say "-" * 40
|
|
70
65
|
end
|
data/lib/madness/docopt.txt
CHANGED
|
@@ -29,8 +29,12 @@ Options:
|
|
|
29
29
|
--index
|
|
30
30
|
Build or rebuild the index for the search page.
|
|
31
31
|
|
|
32
|
+
--and-quit
|
|
33
|
+
Quit after building the index (applicable only with --index).
|
|
34
|
+
|
|
32
35
|
Examples:
|
|
33
36
|
madness
|
|
34
37
|
madness docs
|
|
35
38
|
madness docs --no-auto-h1 -p 4567
|
|
39
|
+
madness --index --and-quit
|
|
36
40
|
|
data/lib/madness/settings.rb
CHANGED
|
@@ -10,7 +10,7 @@ module Madness
|
|
|
10
10
|
include Singleton
|
|
11
11
|
|
|
12
12
|
attr_accessor :port, :bind, :path, :autoh1,
|
|
13
|
-
:highlighter, :line_numbers
|
|
13
|
+
:highlighter, :line_numbers, :index
|
|
14
14
|
|
|
15
15
|
def initialize
|
|
16
16
|
reset
|
|
@@ -41,6 +41,7 @@ module Madness
|
|
|
41
41
|
self.autoh1 = true
|
|
42
42
|
self.highlighter = true
|
|
43
43
|
self.line_numbers = true
|
|
44
|
+
self.index = false
|
|
44
45
|
end
|
|
45
46
|
|
|
46
47
|
def load_from_file
|
data/lib/madness/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: madness
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Danny Ben Shitrit
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-07-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sass
|
|
@@ -328,7 +328,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
328
328
|
version: '0'
|
|
329
329
|
requirements: []
|
|
330
330
|
rubyforge_project:
|
|
331
|
-
rubygems_version: 2.
|
|
331
|
+
rubygems_version: 2.6.6
|
|
332
332
|
signing_key:
|
|
333
333
|
specification_version: 4
|
|
334
334
|
summary: Instant Markdown Server
|