Skip to content

Commit

Permalink
fixed ruby craddle
Browse files Browse the repository at this point in the history
  • Loading branch information
sroccaserra committed Sep 30, 2010
1 parent 3fc3db6 commit 54827ab
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 24 deletions.
21 changes: 11 additions & 10 deletions coding-dojo.el
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

(defun dojo-find-main-file (project)
(find-if (lambda (x)
(string-match "\\<xxxx\\." x))
(string-match (concat "\\<" (regexp-quote (dojo-project-name project)) "\\.") x))
(dojo-find-project-files project)))

(defun dojo-find-test-file (project)
Expand All @@ -101,7 +101,7 @@
(unwind-protect
(save-current-buffer
(goto-char (point-min))
(while (search-forward-regexp "\\<xxxx" nil t)
(while (search-forward-regexp "xxxx" nil t)
(replace-match project-name nil t))
(basic-save-buffer))
(kill-this-buffer))))))
Expand Down Expand Up @@ -144,14 +144,15 @@
(error "Project %s in language %s already exists." project-name language)))
(dojo-create-project project)
(dojo-substitute-variables project)
(dojo-rename-files project)
(unless (eq "" *dojo-after-new-project-command*)
(save-excursion
(find-file (dojo-project-dir-for project))
(shell-command *dojo-after-new-project-command*)
(kill-buffer)))
(let ((main-file (dojo-find-main-file project)))
(dojo-rename-files project)
(unless (eq "" *dojo-after-new-project-command*)
(save-excursion
(find-file (dojo-project-dir-for project))
(shell-command *dojo-after-new-project-command*)
(kill-buffer)))
(find-file (dojo-project-file main-file project-name))
(find-file (dojo-find-test-file project)))))
(when main-file
(find-file (dojo-project-file main-file project-name))
(find-file (dojo-find-test-file project))))))

(provide 'coding-dojo)
2 changes: 1 addition & 1 deletion coding-dojo.elk
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
(deftest "Find main file"
(test-in-project
(lambda (project)
(assert-equal (concat *dojo-project-dir* "/AutoTest-lua/xxxx.lua")
(assert-equal (concat *dojo-project-dir* "/AutoTest-lua/autoTest.lua")
(dojo-find-main-file project)))))

(deftest "File list contains main"
Expand Down
2 changes: 1 addition & 1 deletion languages/Ruby/Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
task :default do
ruby %{-Ilib -Itest 'test/test_main.rb'}
ruby %{-Ilib -Itest 'test/unit/xxxx_test.rb'}
end
6 changes: 3 additions & 3 deletions languages/Ruby/lib/main.rb → languages/Ruby/lib/xxxx.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#
# $main.rb
# xxxx.rb
#

def $main
def xxxx
end

if __FILE__ == $0
$main
xxxx
end
9 changes: 0 additions & 9 deletions languages/Ruby/test/test_main.rb

This file was deleted.

9 changes: 9 additions & 0 deletions languages/Ruby/test/unit/xxxx_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# test.rb
#

require 'test/unit'
require 'xxxx'

class Testxxxx < Test::Unit::TestCase
end

0 comments on commit 54827ab

Please sign in to comment.