You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2016/06/09 20:30:23 UTC
[whimsy] branch master updated (8cdb1b1 -> ba98d41)
This is an automated email from the ASF dual-hosted git repository.
rubys pushed a change to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git.
from 8cdb1b1 add a cross-link to memberless PMCs
new 0f4580e tab police
new ba98d41 refactor administrivia into the common helper
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.
Summary of changes:
lib/whimsy/asf/svn.rb | 16 ++++++-------
www/board/agenda/spec/actions_spec.rb | 36 ----------------------------
www/board/agenda/spec/secretary_spec.rb | 2 +-
www/board/agenda/spec/spec_helper.rb | 42 +++++++++++++++++++++++++++++++++
4 files changed, 51 insertions(+), 45 deletions(-)
--
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].
[whimsy] 01/02: tab police
Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rubys pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git
commit 0f4580e3a5c115e2d48ce12e2a2729aef4641b45
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Thu Jun 9 16:23:58 2016 -0400
tab police
---
lib/whimsy/asf/svn.rb | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/lib/whimsy/asf/svn.rb b/lib/whimsy/asf/svn.rb
index fe8160a..28996db 100644
--- a/lib/whimsy/asf/svn.rb
+++ b/lib/whimsy/asf/svn.rb
@@ -117,26 +117,26 @@ module ASF
`svn info #{dir}`[/URL: (.*)/, 1], tmpdir]
# retrieve the file to be updated (may not exist)
- if basename
+ if basename
tmpfile = File.join(tmpdir, basename).untaint
_.system ['svn', 'update',
['--username', env.user, '--password', env.password],
tmpfile]
- else
- tmpfile = nil
- end
+ else
+ tmpfile = nil
+ end
# determine the new contents
- if not tmpfile
- # updating a directory
+ if not tmpfile
+ # updating a directory
previous_contents = contents = nil
yield tmpdir, ''
elsif File.file? tmpfile
- # updating an existing file
+ # updating an existing file
previous_contents = File.read(tmpfile)
contents = yield tmpdir, File.read(tmpfile)
else
- # updating a new file
+ # updating a new file
previous_contents = nil
contents = yield tmpdir, ''
end
--
To stop receiving notification emails like this one, please contact
"commits@whimsical.apache.org" <co...@whimsical.apache.org>.
[whimsy] 02/02: refactor administrivia into the common helper
Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rubys pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git
commit ba98d41bacabeca62fba15b5cc9dd3c6d57fdaf0
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Thu Jun 9 16:29:49 2016 -0400
refactor administrivia into the common helper
---
www/board/agenda/spec/actions_spec.rb | 36 ----------------------------
www/board/agenda/spec/secretary_spec.rb | 2 +-
www/board/agenda/spec/spec_helper.rb | 42 +++++++++++++++++++++++++++++++++
3 files changed, 43 insertions(+), 37 deletions(-)
diff --git a/www/board/agenda/spec/actions_spec.rb b/www/board/agenda/spec/actions_spec.rb
index 4b7feca..4e6fd8f 100644
--- a/www/board/agenda/spec/actions_spec.rb
+++ b/www/board/agenda/spec/actions_spec.rb
@@ -11,7 +11,6 @@ feature 'server actions' do
before :each do
@test_data = IO.read('test/work/data/test.yml')
@test_mins = IO.read('test/work/data/board_minutes_2015_02_18.yml')
- @transcript = ''
@cleanup = []
end
@@ -374,39 +373,4 @@ feature 'server actions' do
Agenda[File.basename(file)].replace :mtime=>0
end
end
-
- #
- # administrivia
- #
-
- # wunderbar environment
- def _
- self
- end
-
- # sinatra environment
- def env
- Struct.new(:user, :password).new('test', nil)
- end
-
- # capture wunderbar 'json' output methods
- def method_missing(method, *args, &block)
- if method =~ /^_(\w+)$/ and args.length == 1
- instance_variable_set "@#$1", args.first
- else
- super
- end
- end
-
- # run system commands, appending output to transcript.
- # intercept commits, adding the files to the cleanup list
- def system(*args)
- args.flatten!
- if args[1] == 'commit'
- @cleanup <<= args[2]
- else
- @transcript += `#{Shellwords.join(args)}`
- end
- 0
- end
end
diff --git a/www/board/agenda/spec/secretary_spec.rb b/www/board/agenda/spec/secretary_spec.rb
index 30437e8..57ca350 100644
--- a/www/board/agenda/spec/secretary_spec.rb
+++ b/www/board/agenda/spec/secretary_spec.rb
@@ -92,7 +92,7 @@ feature 'report' do
file = "#{FOUNDATION_BOARD}/board_minutes_2015_02_18.txt"
begin
- eval(File.read('views/actions/draft.json.rb'))
+ eval(File.read('views/actions/draft.json.rb'), nil, 'draft.json.rb')
expect(File.exist? file).to be true
expect(File.read file).to eq draft
diff --git a/www/board/agenda/spec/spec_helper.rb b/www/board/agenda/spec/spec_helper.rb
index 14f8cfa..78b9a51 100644
--- a/www/board/agenda/spec/spec_helper.rb
+++ b/www/board/agenda/spec/spec_helper.rb
@@ -2,6 +2,10 @@
# common test setup
#
+# prepend whimsy/lib to library search path
+lib = File.expand_path('../' * 5 + 'lib', __FILE__)
+$LOAD_PATH.unshift lib unless $LOAD_PATH.include? lib
+
ENV['RACK_ENV'] = 'test'
ENV['REMOTE_USER'] = 'test'
require 'capybara/rspec'
@@ -21,3 +25,41 @@ then
else
puts STDERR, "phantomjs is not available in PATH, not loading poltergeist"
end
+
+module MockServer
+ # wunderbar environment
+ def _
+ self
+ end
+
+ # sinatra environment
+ def env
+ Struct.new(:user, :password).new('test', nil)
+ end
+
+ # capture wunderbar 'json' output methods
+ def method_missing(method, *args, &block)
+ if method =~ /^_(\w+)$/ and args.length == 1
+ instance_variable_set "@#$1", args.first
+ else
+ super
+ end
+ end
+
+ # run system commands, appending output to transcript.
+ # intercept commits, adding the files to the cleanup list
+ def system(*args)
+ args.flatten!
+ if args[1] == 'commit'
+ @cleanup <<= args[2] if @cleanup
+ else
+ @transcript ||= ''
+ @transcript += `#{Shellwords.join(args)}`
+ end
+ 0
+ end
+end
+
+RSpec.configure do |config|
+ config.include MockServer
+end
--
To stop receiving notification emails like this one, please contact
"commits@whimsical.apache.org" <co...@whimsical.apache.org>.