Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

doc updates, minor fixes, test rearrangements

  • Loading branch information...
commit f8d0c3847b226d9499650783f2208b7fbf9053a8 1 parent 6e9ebcb
@technomancy authored
View
29 README.rdoc
@@ -33,12 +33,26 @@ be done in its own Emacs instance.
Repository history is cleared in between conspiracy sessions.
-== Troubleshooting
+For testing purposes, you can run two or more conspiracies on the same
+machine; you just have to specify an alternate port and name for the
+others. Names should always include the string "conspiracy" to
+distinguish them from other gitjour repositories.
-When using Avahi for your ZeroConf implementation, you will not be
-able to do anything unless you have an active network connection. So
-disconnected conspirancy sessions are not possible without bringing up
-an ad-hoc network to trick Avahi into activating.
+ $ conspire repo -p 7457 -n conspiracy2
+
+Set the DEBUG environment variable to get more information on the console.
+
+== Bugs
+
+* Conflict resolution remains entirely unhandled.
+
+* The Emacs frontend currently requires its own Emacs instance.
+
+* When using Avahi for your ZeroConf implementation, you will not be
+ able to do anything unless you have an active network connection. So
+ disconnected conspirancy sessions are not possible without bringing
+ up an ad-hoc network to trick Avahi into activating. You'll also see
+ a big fat warning, which should be ignored.
== Editor Support
@@ -46,11 +60,12 @@ Editors must support:
* Saving on an interval
* Committing files to the repo
-* Refreshing internal copies
+* Refreshing internal buffers
Edits should not be allowed in between these steps.
-Editors may be able to support launching the +conspire+ executable.
+Editors may be able to support launching the +conspire+ executable for
+added convenience.
That's about all there is to it. If your favourite editor is not
supported, please fork and add support for it; it's really not a
View
5 lib/conspire.rb
@@ -21,7 +21,6 @@ module Conspire
def start(path, options)
@options = options
@path = path
- puts "Starting with #{@options.inspect}" if ENV['DEBUG']
Gitjour::Application.init @path
@thread = Thread.new do
Gitjour::Application.serve(@path, @options.name, @options.port)
@@ -58,9 +57,7 @@ def sync_loop
def discover_loop
loop do
Conspire.discover
- p Conspire.conspirators if ENV['DEBUG']
+ puts Conspire.conspirators.map{ |c| c.to_s } if ENV['DEBUG']
end
end
-
- def conspirators; @conspirators end
end
View
19 lib/conspire/conspirator.rb
@@ -7,22 +7,21 @@ def initialize(host, port, name = DEFAULTS[:name])
end
def sync(path)
- if ENV['DEBUG']
- puts "cd #{path} && git pull --rebase #{url}"
- system "cd #{path} && git pull --rebase #{url}" or
- raise "Could not rebase from #{url}"
- else
- system "cd #{path} && git pull --rebase #{url} > /dev/null" or
- raise "Could not rebase from #{url}"
- end
+ # TODO: figure out conflictless rebasing... evan?
+ success = if ENV['DEBUG']
+ puts "cd #{path} && git pull --rebase #{url}"
+ system "cd #{path} && git pull --rebase #{url}"
+ else
+ system "cd #{path} && git pull --rebase #{url} > /dev/null"
+ end
- @last_synced = Time.now
+ raise "could not rebase from #{url}" if ! success
+ # @last_synced = Time.now # is this useful?
end
def url; "git://#{@host}:#{@port}/" end
alias_method :to_s, :url
- alias_method :inspect, :url
# For set equality
def eql?(other); self.url == other.url end
View
8 test/test_conspire.rb
@@ -15,6 +15,8 @@ def self.reset!
@conspirators = []
@thread && @thread.kill
end
+
+ def self.conspirators; @conspirators end
end
class TestConspire < Test::Unit::TestCase
@@ -38,6 +40,10 @@ def teardown
FileUtils.rm_rf(LOCAL_SPACE)
end
+ def test_start
+ assert File.exist?(LOCAL_SPACE + '/.git')
+ end
+
def test_discover
Conspire.discover
assert_equal [7458], Conspire.conspirators.map{ |c| c.port }
@@ -52,8 +58,6 @@ def test_sync
def test_conspirator_set
Conspire.conspirators << Conspire::Conspirator.new('dynabook.', '7458')
Conspire.conspirators << Conspire::Conspirator.new('dynabook.', '7458')
- Conspire.conspirators << Conspire::Conspirator.new('dynabook.', '7458')
- Conspire.conspirators << Conspire::Conspirator.new('dynabook.', '7458')
assert_equal 1, Conspire.conspirators.size
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.