From f4d5d2d3d67317a151aa8450ea4b52827b4eb6fe Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Fri, 8 Nov 2013 10:46:47 -0500 Subject: [PATCH 1/5] Add redbot --- .gitmodules | 3 +++ include/redbot | 1 + src/redbot.coffee | 5 +++++ 3 files changed, 9 insertions(+) create mode 100644 .gitmodules create mode 160000 include/redbot create mode 100644 src/redbot.coffee diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..92f6433 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "include/redbot"] + path = include/redbot + url = https://github.com/mrhmouse/redbot.git diff --git a/include/redbot b/include/redbot new file mode 160000 index 0000000..57bd971 --- /dev/null +++ b/include/redbot @@ -0,0 +1 @@ +Subproject commit 57bd97160528436338fa8560daeba62f69b6dd2e diff --git a/src/redbot.coffee b/src/redbot.coffee new file mode 100644 index 0000000..5fdf2bf --- /dev/null +++ b/src/redbot.coffee @@ -0,0 +1,5 @@ +path = require 'path' + +Bot = require path.join __dirname, '..', 'include', 'redbot', 'bot.coffee' + +ruddy = new Bot 'ruddy', '#redspider' From 3e9b9f14217129761eaca36c4dd857d131963252 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Fri, 8 Nov 2013 10:53:56 -0500 Subject: [PATCH 2/5] Update redbot --- include/redbot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/redbot b/include/redbot index 57bd971..4147347 160000 --- a/include/redbot +++ b/include/redbot @@ -1 +1 @@ -Subproject commit 57bd97160528436338fa8560daeba62f69b6dd2e +Subproject commit 41473473a6934e8454d70d3ea7d389ccb44e3819 From bc80f5911aea44c242a82811a52711070dc2f403 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Fri, 8 Nov 2013 10:56:59 -0500 Subject: [PATCH 3/5] Make redbot script executable --- src/redbot.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 src/redbot.coffee diff --git a/src/redbot.coffee b/src/redbot.coffee old mode 100644 new mode 100755 index 5fdf2bf..9519930 --- a/src/redbot.coffee +++ b/src/redbot.coffee @@ -1,5 +1,5 @@ -path = require 'path' +#!/usr/bin/env coffee +path = require 'path' Bot = require path.join __dirname, '..', 'include', 'redbot', 'bot.coffee' - ruddy = new Bot 'ruddy', '#redspider' From d06b7d476cba752cb1198ec3fc253dc6995c5567 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Fri, 8 Nov 2013 12:15:16 -0500 Subject: [PATCH 4/5] Load redbot from environment --- include/redbot | 2 +- setup.py | 2 +- src/redbot.coffee | 2 +- src/rsshell.py | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/redbot b/include/redbot index 4147347..5e3bb44 160000 --- a/include/redbot +++ b/include/redbot @@ -1 +1 @@ -Subproject commit 41473473a6934e8454d70d3ea7d389ccb44e3819 +Subproject commit 5e3bb44012c29fcc6e7529b4b01b934537ac3316 diff --git a/setup.py b/setup.py index f9c8a1c..72be031 100755 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ executable_scripts = [ 'json-parse.py', 'xkcd-fetch.py', 'xkcd-search.py', 'level_up.py', 'summon.py', 'fortune.py', 'godel.py', - 'random-number.py', 'rshelp.py', 'geico.py' ] + 'random-number.py', 'rshelp.py', 'geico.py', 'redbot.coffee' ] python_modules = 'src/xkcd-fetch.py src/level_up.py'.split() diff --git a/src/redbot.coffee b/src/redbot.coffee index 9519930..e47c587 100755 --- a/src/redbot.coffee +++ b/src/redbot.coffee @@ -1,5 +1,5 @@ #!/usr/bin/env coffee path = require 'path' -Bot = require path.join __dirname, '..', 'include', 'redbot', 'bot.coffee' +Bot = require 'redbot' ruddy = new Bot 'ruddy', '#redspider' diff --git a/src/rsshell.py b/src/rsshell.py index 69306f5..b9eb66c 100755 --- a/src/rsshell.py +++ b/src/rsshell.py @@ -34,8 +34,10 @@ def get_red_spider_root(): def set_environment (rs_root): bin_dir = join(rs_root, 'bin') lib_dir = join(rs_root, 'lib') + include_dir = join(rs_root, 'include') env_prepend('PATH', bin_dir) env_prepend('PYTHONPATH', lib_dir) + env_prepend('NODE_PATH', include_dir) if os.name == 'nt': # Windows env_append('PATHEXT', '.py') os.putenv('RED_SPIDER_ROOT', rs_root) From 712d18fb564a18fdd3bb671c0ca12f22edca0454 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Fri, 8 Nov 2013 12:33:45 -0500 Subject: [PATCH 5/5] Be sure that submodules are up to date --- setup.py | 5 +++++ src/rsshell.py | 1 + 2 files changed, 6 insertions(+) diff --git a/setup.py b/setup.py index 72be031..40f44d7 100755 --- a/setup.py +++ b/setup.py @@ -21,6 +21,7 @@ import py_compile import sys import stat +from subprocess import call bin_dir = 'bin' extbin_dir = 'extbin' # stands for 'external binaries' @@ -158,8 +159,12 @@ def install ( ): map(lambda x: splitext(x)[0], executable_scripts) ) install_python_modules(python_modules) + install_submodules() # add more of such steps if that's feasible and no build system is available +def install_submodules ( ): + call(["git", "submodule", "update"]) + def install_rsshell ( ): if not exists(src_dir): print(no_src_panic_msg) diff --git a/src/rsshell.py b/src/rsshell.py index b9eb66c..9a7c91a 100755 --- a/src/rsshell.py +++ b/src/rsshell.py @@ -40,6 +40,7 @@ def set_environment (rs_root): env_prepend('NODE_PATH', include_dir) if os.name == 'nt': # Windows env_append('PATHEXT', '.py') + env_append('PATHEXT', '.coffee') os.putenv('RED_SPIDER_ROOT', rs_root) def env_prepend (varname, addition):