gitdocs 0.1.1 → 0.1.2
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.
- data/README.md +6 -3
- data/lib/gitdocs.rb +5 -1
- data/lib/gitdocs/cli.rb +6 -2
- data/lib/gitdocs/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -66,7 +66,10 @@ gitdocs serve
|
|
66
66
|
|
67
67
|
and then visit `http://localhost:8888` for access to all your docs in the browser.
|
68
68
|
|
69
|
-
##
|
69
|
+
## Planned Features
|
70
70
|
|
71
|
-
-
|
72
|
-
-
|
71
|
+
- A web UI for uploading, and editing text files (in addition to viewing)
|
72
|
+
- Local-area peer-to-peer sync.
|
73
|
+
- Click-to-share instant access granting.
|
74
|
+
- Better conflict-resolution behavior (maintains both versions of a file)
|
75
|
+
- Support for linux and windows (coming soon)
|
data/lib/gitdocs.rb
CHANGED
@@ -10,14 +10,18 @@ require 'yajl'
|
|
10
10
|
require 'dante'
|
11
11
|
|
12
12
|
module Gitdocs
|
13
|
-
def self.run(config_root = nil)
|
13
|
+
def self.run(config_root = nil, debug=false)
|
14
14
|
loop do
|
15
15
|
@config = Configuration.new(config_root)
|
16
|
+
puts "Using configuration root: '#{@config.config_root}'" if debug
|
17
|
+
puts "Watch paths: #{@config.paths.join(", ")}" if debug
|
16
18
|
@threads = @config.paths.map do |path|
|
17
19
|
t = Thread.new { Runner.new(path).run }
|
18
20
|
t.abort_on_exception = true
|
19
21
|
t
|
20
22
|
end
|
23
|
+
puts "Watch threads: #{@threads.map { |t| "Thread status: '#{t.status}', running: #{t.alive?}" }}" if debug
|
24
|
+
puts "Joined #{@threads.size} watch threads...running" if debug
|
21
25
|
@threads.each(&:join)
|
22
26
|
sleep(60)
|
23
27
|
end
|
data/lib/gitdocs/cli.rb
CHANGED
@@ -7,11 +7,15 @@ module Gitdocs
|
|
7
7
|
def self.source_root; File.expand_path('../../', __FILE__); end
|
8
8
|
|
9
9
|
desc "start", "Starts a daemonized gitdocs process"
|
10
|
+
method_option :debug, :type => :boolean, :aliases => "-D"
|
10
11
|
def start
|
11
|
-
if !self.running?
|
12
|
+
if !self.running? && !options[:debug]
|
12
13
|
self.runner(:daemonize => true, :pid_path => self.pid_path).execute { Gitdocs.run }
|
13
14
|
say "Started gitdocs", :green
|
14
|
-
|
15
|
+
elsif !self.running? && options[:debug]
|
16
|
+
say "Running in debug mode", :yellow
|
17
|
+
Gitdocs.run(nil, true)
|
18
|
+
else # already running
|
15
19
|
say "Gitdocs is already running, please use restart", :red
|
16
20
|
end
|
17
21
|
end
|
data/lib/gitdocs/version.rb
CHANGED