ArcherSysOS 0.1.0

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.
Files changed (296) hide show
  1. checksums.yaml +7 -0
  2. data/-interactive +0 -0
  3. data/.302.html.swp +0 -0
  4. data/.AerodiaServer.rb.swp +0 -0
  5. data/.README.md.swp +0 -0
  6. data/.archersys_os_peace.py.swp +0 -0
  7. data/.authorize.php.swp +0 -0
  8. data/.buildinfo +4 -0
  9. data/.git.cmd.swp +0 -0
  10. data/.gitconfig +1 -0
  11. data/.gitignore +9 -0
  12. data/.htaccess +12 -0
  13. data/.index.php.swl +0 -0
  14. data/.index.php.swm +0 -0
  15. data/.index.php.swn +0 -0
  16. data/.index.php.swo +0 -0
  17. data/.index.php.swp +0 -0
  18. data/.irb.cmd.swp +0 -0
  19. data/.irb_history +436 -0
  20. data/.irbrc +24 -0
  21. data/.irbrc~ +24 -0
  22. data/.livesearch.php.swp +0 -0
  23. data/.login.php.swl +0 -0
  24. data/.login.php.swm +0 -0
  25. data/.login.php.swn +0 -0
  26. data/.login.php.swo +0 -0
  27. data/.login.php.swp +0 -0
  28. data/.logout.php.swp +0 -0
  29. data/.npmrc +96 -0
  30. data/.os-desktop.php.swp +0 -0
  31. data/.pythonrc.py +11 -0
  32. data/.railsrc +1 -0
  33. data/.travis.yml +3 -0
  34. data/.vimstarter.bat.swp +0 -0
  35. data/302.html +8 -0
  36. data/401.html +43 -0
  37. data/403.html +9 -0
  38. data/404.html +43 -0
  39. data/7imperialisminjapan2.ppt +0 -0
  40. data/8_imperialism_by_the_united_states2.ppt +0 -0
  41. data/AbstractArrbyKlass.rb +16 -0
  42. data/AbstractImplementation.rb +10 -0
  43. data/Aerodia2.scn +0 -0
  44. data/AerodiaServer.rb +130 -0
  45. data/AerodiaServer.rb~ +129 -0
  46. data/AerodiaServer.txt +53 -0
  47. data/ArcherCGI.txt +8 -0
  48. data/ArcherDBM.rb +30 -0
  49. data/ArcherSysOS.gemspec +33 -0
  50. data/ArcherSysOS.rb +13 -0
  51. data/ArcherSysOS.rb.txt +13 -0
  52. data/ArcherSysOSDate.rb +10 -0
  53. data/ArcherSysOSOptionsParser.rb +108 -0
  54. data/ArcherSysOSOptionsParser.rb~ +108 -0
  55. data/ArcherVMCashewDelegator.rb +17 -0
  56. data/ArcherVMCashewLogger.rb +55 -0
  57. data/ArcherVMCashewLogger.rb~ +55 -0
  58. data/ArcherVMCashewTimeServer.rb +23 -0
  59. data/ArcherVMCashewTimeServer.rb~ +23 -0
  60. data/ArcherVMException.rb +13 -0
  61. data/CHANGELOG.md +4 -0
  62. data/CONTRIBUTING.md +8 -0
  63. data/CodeIgniter_2.2.0.zip +0 -0
  64. data/ConfigTest.php +11 -0
  65. data/F16MUDCockpitServlet.rb +14 -0
  66. data/F16MUDTape.rb +7 -0
  67. data/F16Shell.rb +42 -0
  68. data/Gemfile +4 -0
  69. data/LICENSE +19 -0
  70. data/Listing.rb +31 -0
  71. data/Middleware.rb +12 -0
  72. data/Middleware.txt +12 -0
  73. data/Movie.rb +8 -0
  74. data/MovieLibrary.rb +10 -0
  75. data/MySQLDumper1.24.4.zip +0 -0
  76. data/NotakerPro.aia +0 -0
  77. data/Num.rb +17 -0
  78. data/OSStartScreen.py +31 -0
  79. data/Product.rb +26 -0
  80. data/QAERODIACORP.sav +0 -0
  81. data/Queue.rb +16 -0
  82. data/Queue.rb~ +15 -0
  83. data/README.md +39 -0
  84. data/README.md~ +46 -0
  85. data/Rakefile +1 -0
  86. data/StockTickerServlet.rb +19 -0
  87. data/StockTickerServlet.rb~ +19 -0
  88. data/Symfony_cookbook_2.5.pdf +35637 -39
  89. data/Taxgator.rb +9 -0
  90. data/Tetris +2 -0
  91. data/Ticker.rb +63 -0
  92. data/Ticker.rb~ +63 -0
  93. data/WeakHash.rb +10 -0
  94. data/WikiPage.rb +27 -0
  95. data/WikiPage.rb~ +27 -0
  96. data/ZlibEngine.rb +20 -0
  97. data/_.swm +0 -0
  98. data/_.swn +0 -0
  99. data/_.swo +0 -0
  100. data/_.swp +0 -0
  101. data/acoserver_acoserver (2).sql +15131 -0
  102. data/acoserver_acoserver.sql +34707 -0
  103. data/acoserver_admin.sql +571 -0
  104. data/acoserver_games.sql +6344 -0
  105. data/acoserver_moodle.sql +16013 -0
  106. data/activate_docs_gen.bat +1 -0
  107. data/activate_docs_gen.txt +1 -0
  108. data/ager.py +6 -0
  109. data/alarmpy.py +6 -0
  110. data/american_imperialism2.ppt +0 -0
  111. data/apple-touch-icon.png +0 -0
  112. data/apps.php +35 -0
  113. data/apps.php.txt +7 -0
  114. data/arbylog.rb +16 -0
  115. data/archergit.py +6 -0
  116. data/archergit.py.txt +6 -0
  117. data/archergit.txt +6 -0
  118. data/archerlua.lua +3 -0
  119. data/archersys-logo.png +0 -0
  120. data/archersys.gemspec +32 -0
  121. data/archersys_os_peace.py +7 -0
  122. data/archersys_os_peace.py~ +5 -0
  123. data/autoexec.bat +3 -0
  124. data/bootstrap-tour.css +65 -0
  125. data/bootstrap-tour.js +698 -0
  126. data/bootstrap-tour.min.css +19 -0
  127. data/bootstrap-tour.min.js +19 -0
  128. data/bootstrap.css +7098 -0
  129. data/bootstrap.js +2002 -0
  130. data/bucketwise-master.zip +0 -0
  131. data/cargo.bat +1 -0
  132. data/cargo.cmd +1 -0
  133. data/changelog.txt +769 -0
  134. data/client_secrets.json +4 -0
  135. data/cockpitguess.py +12 -0
  136. data/collaborant-0.1.0.gem +0 -0
  137. data/composer.json +40 -0
  138. data/composer.lock +1484 -0
  139. data/composer.phar +0 -0
  140. data/conchtack_id.dat +0 -0
  141. data/config.json +4 -0
  142. data/config.php +17 -0
  143. data/config.ru +5 -0
  144. data/config.yml +16 -0
  145. data/console.html +8 -0
  146. data/console.php +42 -0
  147. data/contact.db +0 -0
  148. data/contacts.db +0 -0
  149. data/contrib-update.cmd +6 -0
  150. data/contrib-update.cmd~ +6 -0
  151. data/crossdomain.xml +9 -0
  152. data/cse.xml +25 -0
  153. data/depression_dbq.pdf +0 -0
  154. data/desktop-w10.php +6 -0
  155. data/desktop.html +33 -0
  156. data/desktop.php +310 -0
  157. data/dialogue.txt +13 -0
  158. data/dict.rb +15 -0
  159. data/dictionary_of_words.db +0 -0
  160. data/doc-create.html +5 -0
  161. data/doc-create.php +12 -0
  162. data/dokuwiki-d9556fbc2c1c07a0baaf81c07d4165f6.tgz +0 -0
  163. data/drive-appfolder.php +19 -0
  164. data/drive.php +49 -0
  165. data/dropbox-login.php +13 -0
  166. data/drupal-7.34.zip +0 -0
  167. data/dtop.php +131 -0
  168. data/f18mud.rb +2 -0
  169. data/favicon.ico +0 -0
  170. data/favicon.png +0 -0
  171. data/footer.html +5 -0
  172. data/forum.php +5 -0
  173. data/game1.py +171 -0
  174. data/genindex.html +164 -0
  175. data/git.cmd~ +2 -0
  176. data/github-ci.rb +6 -0
  177. data/histogram.py +36 -0
  178. data/htdocs.gemspec~ +31 -0
  179. data/https___summerjobs.dc.gov_(S(ryzytlym5hqgi255zgb4ojjk))_parental_consent_form.pdf +0 -0
  180. data/ieconfig.xml +12 -0
  181. data/imperialism_dbq_questions2.doc +0 -0
  182. data/imperialism_graphic_organizer2.docx +0 -0
  183. data/index-desktop.php +42 -0
  184. data/index-desktop.php.txt +14 -0
  185. data/index.html +175 -0
  186. data/index.php +302 -0
  187. data/index.php~ +315 -0
  188. data/info.php +3 -0
  189. data/iostarter.py +88 -0
  190. data/irb.cmd +3 -0
  191. data/irb.cmd~ +2 -0
  192. data/jquery-mobile-theme-105213-0.zip +0 -0
  193. data/jquery-ui-1.11.1.custom.zip +0 -0
  194. data/laravel-master.zip +0 -0
  195. data/laravel.phar +0 -0
  196. data/latest_specs.4.8 +0 -0
  197. data/latest_specs.4.8.gz +0 -0
  198. data/login.php +266 -0
  199. data/login.php~ +265 -0
  200. data/logout.php +13 -0
  201. data/logout.php~ +13 -0
  202. data/lua.bat +1 -0
  203. data/main.php +22 -0
  204. data/manage.py +10 -0
  205. data/manifest.appcache +22 -0
  206. data/manifest.json +19 -0
  207. data/manifest.webapp +14 -0
  208. data/meter.js +19 -0
  209. data/meter.php +17 -0
  210. data/mime.types +0 -0
  211. data/moodle.sqk +12123 -0
  212. data/moodle.sql +12123 -0
  213. data/movielibrary.rhtml +16 -0
  214. data/mud_login.rb +38 -0
  215. data/news.py +18 -0
  216. data/node.exe +0 -0
  217. data/node_etw_provider.man +153 -0
  218. data/node_perfctr_provider.man +107 -0
  219. data/nodejs-portable.bat +194 -0
  220. data/nodevars.bat +24 -0
  221. data/notifications-gateway.php +5 -0
  222. data/now.bat +3 -0
  223. data/npm +14 -0
  224. data/npm-debug.log +40 -0
  225. data/npm.cmd +6 -0
  226. data/objects.inv +0 -0
  227. data/ocular.phar +0 -0
  228. data/opensearch.xml +12 -0
  229. data/os-desktop.php +211 -0
  230. data/os-mobile.php +127 -0
  231. data/package.json +5 -0
  232. data/parse-js-blank-1.3.0.zip +0 -0
  233. data/partii.appcache +2 -0
  234. data/pear.conf +2 -0
  235. data/phpldapadmin-1.2.3.zip +0 -0
  236. data/phpliteAdmin_v1-9-5.zip +0 -0
  237. data/phpunit.cmd +1 -0
  238. data/phpunit.dist.xml +8 -0
  239. data/phpunit.phar +77428 -2
  240. data/phpunit.xml +8 -0
  241. data/pik.bat +3 -0
  242. data/pik.ps1 +3 -0
  243. data/pik_runner.exe +0 -0
  244. data/pip-selfcheck.json +1 -0
  245. data/prerelease_specs.4.8 +0 -0
  246. data/prerelease_specs.4.8.gz +0 -0
  247. data/producktivshellwin +0 -0
  248. data/profile.php +7 -0
  249. data/prototype.php +7 -0
  250. data/pyconsole.cmd +3 -0
  251. data/pyconsole.py +8 -0
  252. data/pygubu-asos.py +19 -0
  253. data/pythonray.py +62 -0
  254. data/pythonray.py~ +62 -0
  255. data/pyvenv.cfg +3 -0
  256. data/radius.py +12 -0
  257. data/react-0.11.2.zip +0 -0
  258. data/readme.txt +8 -0
  259. data/register.php +130 -0
  260. data/register.php~ +126 -0
  261. data/rockpaperscissors.py +68 -0
  262. data/rockpaperscissors.py~ +28 -0
  263. data/run_f16.rb +2 -0
  264. data/rustc.cmd +1 -0
  265. data/scrollbar.css +6 -0
  266. data/scrollbar.css~ +4 -0
  267. data/scrutinizer.yml +5 -0
  268. data/search.html +177 -0
  269. data/searchindex.js +1 -0
  270. data/setup-owncloud.php +300 -0
  271. data/setup.py +9 -0
  272. data/sinatra-1.4.5.gem +0 -0
  273. data/smartsheet.html +1 -0
  274. data/span.html +5 -0
  275. data/specs.4.8 +0 -0
  276. data/specs.4.8.gz +0 -0
  277. data/starter-kit-1.8.1.zip +0 -0
  278. data/startscreen.php +11 -0
  279. data/startscreen.py +33 -0
  280. data/startup.png +0 -0
  281. data/svg-edit-2.6.zip +0 -0
  282. data/symfony.com_pdf_Symfony_book_2.5.pdf +0 -0
  283. data/telnet-client.py +18 -0
  284. data/tess.py +26 -0
  285. data/time.css +279 -0
  286. data/time.html +2 -0
  287. data/time.php +56 -0
  288. data/tinymce_spellchecker_php_2_0_6_1.zip +0 -0
  289. data/urllib2.py +1371 -0
  290. data/uru.bat +12 -0
  291. data/uru.bat.bak +12 -0
  292. data/uru.ps1 +11 -0
  293. data/uru.ps1.bak +11 -0
  294. data/uru_rt.exe +0 -0
  295. data/vimstarter.bat +3 -0
  296. metadata +338 -0
@@ -0,0 +1,17 @@
1
+ module ArcherSysOS
2
+ class ArcherVMCashewDelegator < Delegator
3
+ def initialize(obj)
4
+ super # pass obj to Delegator constructor, required
5
+ @delegate_sd_obj = obj # store obj for future use
6
+ end
7
+
8
+ def __getobj__
9
+ @delegate_sd_obj # return object we are delegating to, required
10
+ end
11
+
12
+ def __setobj__(obj)
13
+ @delegate_sd_obj = obj # change delegation object,
14
+ # a feature we're providing
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,55 @@
1
+ module ArcherSysOS
2
+ require 'drb/drb'
3
+
4
+ URI="druby://localhost:8787"
5
+
6
+ class Logger
7
+
8
+ # Make dRuby send Logger instances as dRuby references,
9
+ # not copies.
10
+ include DRb::DRbUndumped
11
+
12
+ def initialize(n, fname)
13
+ @name = n
14
+ @filename = fname
15
+ end
16
+
17
+ def log(message)
18
+ File.open(@filename, "a") do |f|
19
+ f.puts("#{Time.now}: #{@name}: #{message}")
20
+ end
21
+ end
22
+
23
+ end
24
+
25
+ # We have a central object for creating and retrieving loggers.
26
+ # This retains a local reference to all loggers created. This
27
+ # is so an existing logger can be looked up by name, but also
28
+ # to prevent loggers from being garbage collected. A dRuby
29
+ # reference to an object is not sufficient to prevent it being
30
+ # garbage collected!
31
+ class LoggerFactory
32
+
33
+ def initialize(bdir)
34
+ @basedir = bdir
35
+ @loggers = {}
36
+ end
37
+
38
+ def get_logger(name)
39
+ if !@loggers.has_key? name
40
+ # make the filename safe, then declare it to be so
41
+ fname = name.gsub(/[.\/\\:]/, "_").untaint
42
+ @loggers[name] = Logger.new(name, @basedir + "/" + fname)
43
+ end
44
+ return @loggers[name]
45
+ end
46
+
47
+ end
48
+
49
+ FRONT_OBJECT=LoggerFactory.new("/tmp/dlog")
50
+
51
+ $SAFE = 1 # disable eval() and friends
52
+
53
+ DRb.start_service(URI, FRONT_OBJECT)
54
+ DRb.thread.join
55
+ end
@@ -0,0 +1,55 @@
1
+ module ArcherSysOS
2
+ require 'drb/drb'
3
+
4
+ URI="druby://localhost:8787"
5
+
6
+ class Logger
7
+
8
+ # Make dRuby send Logger instances as dRuby references,
9
+ # not copies.
10
+ include DRb::DRbUndumped
11
+
12
+ def initialize(n, fname)
13
+ @name = n
14
+ @filename = fname
15
+ end
16
+
17
+ def log(message)
18
+ File.open(@filename, "a") do |f|
19
+ f.puts("#{Time.now}: #{@name}: #{message}")
20
+ end
21
+ end
22
+
23
+ end
24
+
25
+ # We have a central object for creating and retrieving loggers.
26
+ # This retains a local reference to all loggers created. This
27
+ # is so an existing logger can be looked up by name, but also
28
+ # to prevent loggers from being garbage collected. A dRuby
29
+ # reference to an object is not sufficient to prevent it being
30
+ # garbage collected!
31
+ class LoggerFactory
32
+
33
+ def initialize(bdir)
34
+ @basedir = bdir
35
+ @loggers = {}
36
+ end
37
+
38
+ def get_logger(name)
39
+ if !@loggers.has_key? name
40
+ # make the filename safe, then declare it to be so
41
+ fname = name.gsub(/[.\/\\:]/, "_").untaint
42
+ @loggers[name] = Logger.new(name, @basedir + "/" + fname)
43
+ end
44
+ return @loggers[name]
45
+ end
46
+
47
+ end
48
+
49
+ FRONT_OBJECT=LoggerFactory.new("/tmp/dlog")
50
+
51
+ $SAFE = 1 # disable eval() and friends
52
+
53
+ DRb.start_service(URI, FRONT_OBJECT)
54
+ DRb.thread.join
55
+ end
@@ -0,0 +1,23 @@
1
+ module ArcherSysOS
2
+ require 'drb/drb'
3
+
4
+ # The URI for the server to connect to
5
+ URI="druby://localhost:8787"
6
+
7
+ class ArcherVMCashewTimeServer
8
+
9
+ def get_current_time
10
+ return Time.now
11
+ end
12
+
13
+ end
14
+
15
+ # The object that handles requests on the server
16
+ FRONT_OBJECT=ArcherVMCashewTimeServer.new
17
+
18
+ $SAFE = 1 # disable eval() and friends
19
+
20
+ DRb.start_service(URI, FRONT_OBJECT)
21
+ # Wait for the drb server thread to finish before exiting.
22
+ DRb.thread.join
23
+ end
@@ -0,0 +1,23 @@
1
+ module ArcherSysOS
2
+ require 'drb/drb'
3
+
4
+ # The URI for the server to connect to
5
+ URI="druby://localhost:8787"
6
+
7
+ class ArcherVMCashewTimeServer
8
+
9
+ def get_current_time
10
+ return Time.now
11
+ end
12
+
13
+ end
14
+
15
+ # The object that handles requests on the server
16
+ FRONT_OBJECT=ArcherVMCashewTimeServer.new
17
+
18
+ $SAFE = 1 # disable eval() and friends
19
+
20
+ DRb.start_service(URI, FRONT_OBJECT)
21
+ # Wait for the drb server thread to finish before exiting.
22
+ DRb.thread.join
23
+
@@ -0,0 +1,13 @@
1
+ module ArcherSysOS
2
+ module ArcherVMException
3
+ extend Exception2MessageMapper
4
+ def_e2message ArcherVMError, "ASOS-0005: ArrbyException"
5
+ def_exception :ArrbyException, "ASOS-0005: ArrbyException"[ superclass]
6
+
7
+
8
+ end
9
+ class ArcherVMError
10
+ include ArcherVMException
11
+
12
+ end
13
+ end
@@ -0,0 +1,4 @@
1
+ Changelog
2
+ ========
3
+
4
+ 1. New Apps Added
@@ -0,0 +1,8 @@
1
+ Contributing to ArcherSys
2
+ ==========================
3
+ How to Download
4
+
5
+ 1. Unzip
6
+ 2. Start Your Server Or VM
7
+ 3. Create DBs
8
+ 4. Create a account in the OS
Binary file
@@ -0,0 +1,11 @@
1
+ <?php
2
+ require_once "config.php";
3
+ class ConfigTest extends PHPUnit_Framework_TestCase
4
+ {
5
+ public function testConfigArray()
6
+ {
7
+ $this->assertNotEmpty($config);
8
+ $this->assertNotEmpty($config["dbuser"]);
9
+ }
10
+ }
11
+ ?>
@@ -0,0 +1,14 @@
1
+ module ArcherSysOS
2
+ require "mud_login"
3
+ class F16MUDServlet < WEBrick::HTTPServlet::AbstractServlet
4
+ def do_GET request, response
5
+ status, content_type, body = ""
6
+
7
+ response.status = status
8
+ response['Content-Type'] = content_type
9
+ response.body = body
10
+ end
11
+
12
+ end
13
+
14
+ end
@@ -0,0 +1,7 @@
1
+ module ArcherSysOS #ArcherRuby (or ARRBY for short)
2
+ class F16MudTape
3
+ def initialize
4
+ end
5
+ end
6
+
7
+ end
@@ -0,0 +1,42 @@
1
+ module ArcherSysOS
2
+ require 'bombshell'
3
+ require 'mud_login'
4
+
5
+ require "bigdecimal/math"
6
+ include BigMath
7
+ CONNECTION = ArcherSysOS::F16MUDClient.new('localhost',4321,10)
8
+ module F16MUD
9
+ class Shell < Bombshell::Environment
10
+ include Bombshell::Shell
11
+
12
+ before_launch do
13
+ end
14
+
15
+ prompt_with "Think fast!:"
16
+
17
+ def time
18
+ CONNECTION.run_cmd("time")
19
+ end
20
+ def study
21
+ CONNECTION.run_cmd("study")
22
+ end
23
+ def to_radians
24
+ ans = BigDecimal.new(gets.chomp) * ( (BigMath.PI(10) * 100) / 180)
25
+ puts ans
26
+ end
27
+ def open_library
28
+
29
+ CONNECTION.run_cmd("admin")
30
+ end
31
+ def add_entry
32
+ CONNECTION.run_cmd("add_entry")
33
+ end
34
+ def lookup(word)
35
+
36
+ CONNECTION.run_cmd("lookup "+word)
37
+ end
38
+ def calculate(operation,number,number2)
39
+ end
40
+ end
41
+ end
42
+ end
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in htdocs.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 ArcherSys Foundation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files ("ArcherSys"), to deal
7
+ in ArcherSys without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of ArcherSys, and to permit persons to whom ArcherSys is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of ArcheRsy.
14
+ ARCHERSYS IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE ARCHERSYS OR THE USE OR OTHER DEALINGS IN ARCHERSYS.
@@ -0,0 +1,31 @@
1
+ module ArcherSysOS
2
+ require "erb"
3
+
4
+ # build data class
5
+ class Listings
6
+ PRODUCT = { :name => "Chicken Fried Steak",
7
+ :desc => "A well messages pattie, breaded and fried.",
8
+ :cost => 9.95 }
9
+
10
+ attr_reader :product, :price
11
+
12
+ def initialize( product = "", price = "" )
13
+ @product = product
14
+ @price = price
15
+ end
16
+
17
+ def build
18
+ b = binding
19
+ # create and run templates, filling member data variables
20
+ ERB.new(<<-'END_PRODUCT'.gsub(/^\s+/, ""), 0, "", "@product").result b
21
+ <%= PRODUCT[:name] %>
22
+ <%= PRODUCT[:desc] %>
23
+ END_PRODUCT
24
+ ERB.new(<<-'END_PRICE'.gsub(/^\s+/, ""), 0, "", "@price").result b
25
+ <%= PRODUCT[:name] %> -- <%= PRODUCT[:cost] %>
26
+ <%= PRODUCT[:desc] %>
27
+ END_PRICE
28
+ end
29
+ end
30
+
31
+ end
@@ -0,0 +1,12 @@
1
+ module ArcherSysOS
2
+ class Middleware
3
+ def initialize(app)
4
+ @app = app
5
+ end
6
+
7
+ def call(env)
8
+ env["rack.some_header"] = "setting an example"
9
+ @app.call(env)
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module ArcherSysOS
2
+ class Middleware
3
+ def initialize(app)
4
+ @app = app
5
+ end
6
+
7
+ def call(env)
8
+ env["rack.some_header"] = "setting an example"
9
+ @app.call(env)
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,8 @@
1
+ module ArcherSysOS
2
+ class Movie
3
+ def initialize(movie_title,movie_rating)
4
+ @movie_title = movie_title
5
+ @movie_rating = movie_rating
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,10 @@
1
+ module ArcherSysOS
2
+ require 'erb'
3
+ class MovieLibrary
4
+ extend ERB::DefMethod
5
+ def_erb_method('render()', 'movielibrary.rhtml')
6
+ def initialize(items)
7
+ @movies = items
8
+ end
9
+ end
10
+ end
Binary file
Binary file
data/Num.rb ADDED
@@ -0,0 +1,17 @@
1
+ module ArcherSysOS
2
+ require "xmlrpc/server"
3
+
4
+ class Num
5
+ INTERFACE = XMLRPC::interface("num") {
6
+ meth 'int add(int, int)', 'Add two numbers', 'add'
7
+ meth 'int div(int, int)', 'Divide two numbers'
8
+ }
9
+
10
+ def add(a, b) a + b end
11
+ def div(a, b) a / b end
12
+ end
13
+
14
+ s = XMLRPC::CGIServer.new
15
+ s.add_handler(Num::INTERFACE, Num.new)
16
+ s.serve
17
+ end
@@ -0,0 +1,31 @@
1
+ import turtle
2
+ wn = turtle.Screen() # Set up the window and its attributes
3
+ wn.bgcolor("lightgreen")
4
+
5
+
6
+ tess = turtle.Turtle() # create tess and set some attributes
7
+ tess.color("hotpink")
8
+ tess.pensize(5)
9
+
10
+ alex = turtle.Turtle() # create alex
11
+
12
+ tess.forward(80) # Let tess draw an equilateral triangle
13
+ tess.left(120)
14
+ tess.forward(80)
15
+ tess.left(120)
16
+ tess.forward(80)
17
+ tess.left(120) # complete the triangle
18
+
19
+ tess.right(180) # turn tess around
20
+ tess.forward(80) # move her away from the origin
21
+
22
+ alex.forward(50) # make alex draw a square
23
+ alex.left(90)
24
+ alex.forward(50)
25
+ alex.left(90)
26
+ alex.forward(50)
27
+ alex.left(90)
28
+ alex.forward(50)
29
+ alex.left(90)
30
+
31
+ wn.exitonclick()