This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| arturas@zeus:~/work/spacegame/server$ ruby ctest.rb | |
| Starting simulation | |
| 18:03:09 [worker_1|#<Thread:0x917da50>] --- message arrived --- | |
| 18:03:09 [worker_1|#<Thread:0x917da50>] Starting work for 1 seconds. | |
| 18:03:09 [worker_2|#<Thread:0x909136c>] --- message arrived --- | |
| 18:03:09 [worker_2|#<Thread:0x909136c>] Starting work for 3 seconds. | |
| 18:03:10 [worker_1|#<Thread:0x917da50>] Done working. | |
| 18:03:10 [worker_1|#<Thread:0x917da50>] --- message arrived --- | |
| 18:03:10 [worker_1|#<Thread:0x917da50>] Waiting until worker_2 is done. | |
| 18:03:10 [worker_1|#<Thread:0x917da50>] --- message arrived --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe "fail" do | |
| it "should not fail" do | |
| a = some_method_that_returns_activerecord_relation | |
| a.include?(object).should be_true # This does not fail. | |
| a.should include(object) # This fails. | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| arturas@zeus:~/work/spacegame/server$ jruby --1.9 -S rake spec:controllers | |
| /home/arturas/.rvm/rubies/jruby-1.6.5/bin/jruby -S rspec spec/controllers/players_controller_spec.rb spec/controllers/buildings_controller_spec.rb spec/controllers/technologies_controller_spec.rb spec/controllers/announcements_controller_spec.rb spec/controllers/daily_bonus_controller_spec.rb spec/controllers/player_options_controller_spec.rb spec/controllers/chat_controller_spec.rb spec/controllers/objects_controller_spec.rb spec/controllers/quests_controller_spec.rb spec/controllers/routes_controller_spec.rb spec/controllers/market_controller_spec.rb spec/controllers/solar_systems_controller_spec.rb spec/controllers/planets_controller_spec.rb spec/controllers/alliances_controller_spec.rb spec/controllers/notifications_controller_spec.rb spec/controllers/units_controller_spec.rb spec/controllers/game_controller_spec.rb spec/controllers/combat_logs_controller_spec.rb spec/controllers/galaxies_controller_spec.rb spec/controllers/constru |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@ -23,25 +23,27 @@ package models.healing | |
| public var cooldown: int = 0; | |
| public static function calculateRepairPrice(building: Building): HealPrice | |
| { | |
| var priceMod : Number = tech.repairPriceMod; | |
| var cooldownMod: Number = tech.repairCooldownMod; | |
| - price.metal = Math.round(Upgradable.calculateCost(UpgradableType.BUILDINGS, | |
| - building.type, ResourceType.METAL, {'level': building.level}) | |
| - * priceMod * building.damagePercentage); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jruby-1.6.5 :018 > c = ActiveRecord::Base.connection.raw_connection.with_connection_retry_guard { |c| c } | |
| => #<Java::ComMysqlJdbc::JDBC4Connection:0x1200320> | |
| jruby-1.6.5 :019 > c.create_statement | |
| => #<Java::ComMysqlJdbc::StatementImpl:0x16f974f> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RSpec::Matchers.define :be_created_from_static_ss_configuration do | |
| |configuration| | |
| def check_planet(position_str, ss_conditions, data) | |
| exp_to = "Expected planet @ #{position_str} to" | |
| if SsObject::Planet.where(ss_conditions).exists? | |
| planet = SsObject::Planet.where(ss_conditions).first | |
| owned_by_player = ! planet.player_id.nil? | |
| @errors << "#{exp_to} have owned_by_player: #{data["owned_by_player"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Server has encountered an error! | |
| UNEXPECTED EXCEPTION: java.lang.RuntimeException: could not shut down process: java.lang.UNIXProcess@fde438 | |
| Message: | |
| {"params":{"version":"2011-1104-1211","web_player_id":2567,"server_player_id":909},"id":"1320523371429","action":"players|login"} | |
| Backtrace: | |
| org.jruby.RubyIO.obliterateProcess(RubyIO.java:4049) | |
| org.jruby.util.ShellLauncher$POpenProcess.destroy(ShellLauncher.java:886) | |
| org.jruby.RubyIO.obliterateProcess(RubyIO.java:4053) | |
| org.jruby.RubyIO.close2(RubyIO.java:1998) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Invokes SpaceMule pathfinder. | |
| module SpaceMule::Pathfinder | |
| # Scala constants | |
| Coords = SpaceMule::Pmg.classes.geom.Coords | |
| Pf = SpaceMule::SmModules.pathfinder | |
| PfO = Pf.objects | |
| def self.invoke(source, target, avoid_npc) | |
| avoidable_points = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| lambda do | |
| jar_path = File.join(ROOT_DIR, 'vendor', 'SpaceMule', 'dist', 'SpaceMule.jar') | |
| # Win32 requires us to manually require all the jars before requiring | |
| # main jar. | |
| Dir[File.dirname(jar_path) + "/lib/*.jar"].each { |jar| require jar } | |
| require jar_path | |
| # Scala <-> Ruby interoperability. | |
| class Object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object Finder { | |
| def none = None | |
| def test(t: Option[Int]) { println(t.get) } | |
| } | |
| >> f = SpaceMule::PfO.Finder | |
| => Java::SpacemuleModulesPathfinderObjects::Finder | |
| >> | |
| ?> f.test(f.none) | |
| NativeException: java.util.NoSuchElementException: None.get |