repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/lib/rukawa/errors.rb
lib/rukawa/errors.rb
module Rukawa class DependencyUnsatisfied < StandardError; end end
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/lib/rukawa/overview.rb
lib/rukawa/overview.rb
module Rukawa module Overview class << self def list_job_net(with_jobs: false) header = ["Job", "Desc"] header << "Dependencies" if with_jobs table = Terminal::Table.new headings: header do |t| JobNet.descendants.each do |job_net| list_table_row(t, job_net, with...
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/lib/rukawa/state.rb
lib/rukawa/state.rb
module Rukawa::State def self.get(name) const_get(name.to_s.split("_").map(&:capitalize).join) end module BaseExt def state_name @state_name ||= to_s.gsub(/Rukawa::State::/, "").downcase end def colored Paint[state_name.to_s, color] end def merge(other) other end ...
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/lib/rukawa/abstract_job.rb
lib/rukawa/abstract_job.rb
require 'set' require 'rukawa/state' require 'active_support/core_ext/class' module Rukawa class AbstractJob attr_reader :parent_job_net extend ActiveSupport::DescendantsTracker class_attribute :skip_rules, instance_writer: false self.skip_rules = [] class << self def add_skip_rule(callabl...
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/lib/rukawa/configuration.rb
lib/rukawa/configuration.rb
require 'singleton' require 'ostruct' require 'delegate' require 'concurrent' module Rukawa class Configuration < Delegator include Singleton def initialize @config = OpenStruct.new( concurrency: Concurrent.processor_count, dot_command: "dot", job_dirs: [File.join(Dir.pwd, "job...
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/lib/rukawa/runner.rb
lib/rukawa/runner.rb
require 'terminal-table' require 'paint' require 'rukawa/overview' module Rukawa class Runner DEFAULT_REFRESH_INTERVAL = 3 def self.run(job_net, batch_mode = false, refresh_interval = DEFAULT_REFRESH_INTERVAL) new(job_net).run(batch_mode, refresh_interval) end def initialize(root_job_net) ...
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/lib/rukawa/cli.rb
lib/rukawa/cli.rb
require 'thor' require 'rukawa/runner' require 'rukawa/overview' module Rukawa class Cli < Thor def self.base_options method_option :config, type: :string, default: nil, desc: "If this options is not set, try to load ./rukawa.rb" method_option :job_dirs, type: :array, default: [], desc: "Load job di...
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/lib/rukawa/wrapper.rb
lib/rukawa/wrapper.rb
module Rukawa module Wrapper class WrappedJobError < StandardError; end end end
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/lib/rukawa/context.rb
lib/rukawa/context.rb
module Rukawa class Context attr_reader :store, :executor, :semaphore, :concurrency def initialize(concurrency = nil) @concurrency = concurrency || Rukawa.config.concurrency @store = Concurrent::Hash.new @executor = Concurrent::CachedThreadPool.new @semaphore = Concurrent::Semaphore.n...
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/lib/rukawa/job.rb
lib/rukawa/job.rb
require 'concurrent' require 'rukawa/abstract_job' require 'rukawa/dependency' require 'rukawa/state' require 'active_support/core_ext/class' require 'active_support/callbacks' module Rukawa class Job < AbstractJob include ActiveSupport::Callbacks define_callbacks :run, terminator: ->(_,result) { resul...
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/lib/rukawa/remote.rb
lib/rukawa/remote.rb
module Rukawa module Remote class << self def store Rukawa.config.status_store end end end end
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/lib/rukawa/dependency.rb
lib/rukawa/dependency.rb
module Rukawa module Dependency def self.get(name) const_get(name.to_s.split("_").map(&:capitalize).join) end class Base def initialize(*results) @results = results end def resolve raise NotImplementedError end end class AllSuccess < Base def ...
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/lib/rukawa/dag.rb
lib/rukawa/dag.rb
require 'set' require 'tsort' module Rukawa class Dag include Enumerable include TSort attr_reader :nodes, :jobs, :edges def initialize @nodes = Set.new @jobs = Set.new @edges = Set.new end def build(job_net, variables, context, dependencies) deps = tsortable_hash(d...
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/lib/rukawa/builtins/waiter.rb
lib/rukawa/builtins/waiter.rb
require 'rukawa/builtins/base' require 'timeout' module Rukawa module Builtins class Waiter < Base class_attribute :timeout, :poll_interval self.timeout = 1800 self.poll_interval = 1 class << self def handle_parameters(timeout: nil, poll_interval: nil, **rest) self.tim...
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/lib/rukawa/builtins/embulk.rb
lib/rukawa/builtins/embulk.rb
require 'rukawa/builtins/shell' module Rukawa module Builtins class Embulk < Shell class_attribute :config, :embulk_bin, :embulk_bundle, :embulk_vm_options, :jvm_options, :preview self.embulk_bin = "embulk" self.embulk_bundle = nil self.embulk_vm_options = [] self.jvm_options = [] ...
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/lib/rukawa/builtins/base.rb
lib/rukawa/builtins/base.rb
require 'rukawa/job' module Rukawa module Builtins class Base < ::Rukawa::Job class << self def [](**params) Class.new(self) do handle_parameters(params) def self.name super || "#{superclass.name}_#{object_id}" end end e...
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/lib/rukawa/builtins/shell.rb
lib/rukawa/builtins/shell.rb
require 'rukawa/builtins/base' require 'active_support/core_ext/class' require 'open3' module Rukawa module Builtins class Shell < Base class_attribute :command, :args, :env, :chdir, :stdout, :stderr self.args = [] self.stdout = $stdout self.stderr = $stderr class << self ...
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/lib/rukawa/remote/status_store.rb
lib/rukawa/remote/status_store.rb
module Rukawa module Remote class StatusStore ENQUEUED = "enqueued".freeze PERFORMING = "performing".freeze COMPLETED = "completed".freeze FAILED = "failed".freeze # default expire duration is 24 hours. def initialize(job_id:, expire_duration: Rukawa.config.status_expire_durat...
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/lib/rukawa/wrapper/active_job.rb
lib/rukawa/wrapper/active_job.rb
require 'rukawa/job' require 'rukawa/wrapper' require 'rukawa/remote/status_store' module Rukawa module Wrapper module ActiveJob def self.[](job_class) raise "Please set Rukawa.config.status_store subclass of ActiveSupport::Cache::Store" unless Rukawa.config.status_store @wrapper_classes ||...
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/sample/rukawa.rb
sample/rukawa.rb
Rukawa.configure do |c| c.graph.concentrate = true c.graph.nodesep = 0.8 end redis_host = ENV["REDIS_HOST"] || "localhost:6379" Rukawa.configure do |c| c.status_store = ActiveSupport::Cache::RedisStore.new(redis_host) end require 'active_job' ActiveJob::Base.queue_adapter = :sucker_punch
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/sample/jobs/active_job.rb
sample/jobs/active_job.rb
require 'active_job' class ActiveJobSample1 < ActiveJob::Base queue_as :default def perform sleep 10 p "active_job1" end end class ActiveJobSample2 < ActiveJob::Base queue_as :default def perform sleep 10 raise "active_job2 is failed" end end
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/sample/jobs/sample_job.rb
sample/jobs/sample_job.rb
module ExecuteLog def self.store @store ||= {} end end class Notifier def after_run(job) puts "#{job.name}:#{job.state.name}:#{job.elapsed_time_from}" end end class SampleJob < Rukawa::Job def run sleep rand(5) ExecuteLog.store[self.class] = Time.now end end class Job1 < SampleJob set_d...
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
joker1007/rukawa
https://github.com/joker1007/rukawa/blob/23b32adbbb61a42c549b582f03df92b8cc548746/sample/job_nets/sample_job_net.rb
sample/job_nets/sample_job_net.rb
class InnerJobNet < Rukawa::JobNet class << self def dependencies { InnerJob2 => [InnerJob1, InnerJob3], } end end end class InnerJobNet2 < Rukawa::JobNet class << self def dependencies { InnerJob5 => [InnerJob4], InnerJob6 => [InnerJob4, InnerJob5], } ...
ruby
MIT
23b32adbbb61a42c549b582f03df92b8cc548746
2026-01-04T17:51:46.689670Z
false
seratch/rspec-kickstarter
https://github.com/seratch/rspec-kickstarter/blob/969d85fb9d702908ab0c6f2acc014b72a91c17e9/spec/rspec_kickstarter_spec.rb
spec/rspec_kickstarter_spec.rb
# -*- encoding: utf-8 -*- require 'spec_helper' describe RSpecKickstarter do describe '#write_spec' do it 'works' do file_path = 'lib/rspec_kickstarter.rb' spec_dir = './spec' force_write = false dry_run = false RSpecKickstarter.write_spec(file_path, spec_dir, force_write, dry_run)...
ruby
MIT
969d85fb9d702908ab0c6f2acc014b72a91c17e9
2026-01-04T17:51:47.903820Z
false
seratch/rspec-kickstarter
https://github.com/seratch/rspec-kickstarter/blob/969d85fb9d702908ab0c6f2acc014b72a91c17e9/spec/spec_helper.rb
spec/spec_helper.rb
require 'simplecov' if ENV['TRAVIS'] require 'coveralls' Coveralls.wear! else require 'simplecov' SimpleCov.start end # RSpec.configure do |config| # end
ruby
MIT
969d85fb9d702908ab0c6f2acc014b72a91c17e9
2026-01-04T17:51:47.903820Z
false
seratch/rspec-kickstarter
https://github.com/seratch/rspec-kickstarter/blob/969d85fb9d702908ab0c6f2acc014b72a91c17e9/spec/rspec_kickstarter/version_spec.rb
spec/rspec_kickstarter/version_spec.rb
# -*- encoding: utf-8 -*- require 'spec_helper' require 'rspec_kickstarter/version' describe RSpecKickstarter do describe RSpecKickstarter::VERSION do it 'exists' do expect(RSpecKickstarter::VERSION).not_to be_nil end end end
ruby
MIT
969d85fb9d702908ab0c6f2acc014b72a91c17e9
2026-01-04T17:51:47.903820Z
false
seratch/rspec-kickstarter
https://github.com/seratch/rspec-kickstarter/blob/969d85fb9d702908ab0c6f2acc014b72a91c17e9/spec/rspec_kickstarter/generator_spec.rb
spec/rspec_kickstarter/generator_spec.rb
# -*- encoding: utf-8 -*- require 'spec_helper' require 'rspec_kickstarter/generator' describe RSpecKickstarter::Generator do let(:generator) { RSpecKickstarter::Generator.new('tmp/spec') } describe '#new' do it 'works without params' do result = RSpecKickstarter::Generator.new expect(result).not...
ruby
MIT
969d85fb9d702908ab0c6f2acc014b72a91c17e9
2026-01-04T17:51:47.903820Z
false
seratch/rspec-kickstarter
https://github.com/seratch/rspec-kickstarter/blob/969d85fb9d702908ab0c6f2acc014b72a91c17e9/spec/rspec_kickstarter/rdoc_factory_spec.rb
spec/rspec_kickstarter/rdoc_factory_spec.rb
# -*- encoding: utf-8 -*- require 'spec_helper' require 'rspec_kickstarter/rdoc_factory' describe RSpecKickstarter::RDocFactory do describe '#get_rdoc_class_or_module' do it 'works' do file_path = 'lib/rspec_kickstarter.rb' result = RSpecKickstarter::RDocFactory.get_rdoc_class_or_module(file_path) ...
ruby
MIT
969d85fb9d702908ab0c6f2acc014b72a91c17e9
2026-01-04T17:51:47.903820Z
false
seratch/rspec-kickstarter
https://github.com/seratch/rspec-kickstarter/blob/969d85fb9d702908ab0c6f2acc014b72a91c17e9/lib/rspec_kickstarter.rb
lib/rspec_kickstarter.rb
# -*- encoding: utf-8 -*- require 'rspec_kickstarter/generator' require 'rspec_kickstarter/version' # # RSpecKickstarter Facade # module RSpecKickstarter def self.write_spec(file_path, spec_dir = './spec', force_write = false, dry_run = false) generator = RSpecKickstarter::Generator.new(spec_dir) generator...
ruby
MIT
969d85fb9d702908ab0c6f2acc014b72a91c17e9
2026-01-04T17:51:47.903820Z
false
seratch/rspec-kickstarter
https://github.com/seratch/rspec-kickstarter/blob/969d85fb9d702908ab0c6f2acc014b72a91c17e9/lib/rspec_kickstarter/erb_factory.rb
lib/rspec_kickstarter/erb_factory.rb
# -*- encoding: utf-8 -*- require 'erb' require 'rspec_kickstarter' require 'rspec_kickstarter/erb_templates' # # ERB instance provider # module RSpecKickstarter class ERBFactory def initialize(custom_template) @custom_template = custom_template end # # Returns ERB instance for creating new ...
ruby
MIT
969d85fb9d702908ab0c6f2acc014b72a91c17e9
2026-01-04T17:51:47.903820Z
false
seratch/rspec-kickstarter
https://github.com/seratch/rspec-kickstarter/blob/969d85fb9d702908ab0c6f2acc014b72a91c17e9/lib/rspec_kickstarter/version.rb
lib/rspec_kickstarter/version.rb
# -*- encoding: utf-8 -*- # # Gem version # module RSpecKickstarter VERSION = '1.0.2' end
ruby
MIT
969d85fb9d702908ab0c6f2acc014b72a91c17e9
2026-01-04T17:51:47.903820Z
false
seratch/rspec-kickstarter
https://github.com/seratch/rspec-kickstarter/blob/969d85fb9d702908ab0c6f2acc014b72a91c17e9/lib/rspec_kickstarter/rdoc_factory.rb
lib/rspec_kickstarter/rdoc_factory.rb
# -*- encoding: utf-8 -*- require 'rdoc' require 'rdoc/generator' require 'rdoc/options' require 'rdoc/parser/ruby' require 'rdoc/stats' require 'rspec_kickstarter' # # RDoc instance factory # module RSpecKickstarter class RDocFactory # # Returns RDoc::NormalClass/RDoc::NormalModule instance. # def...
ruby
MIT
969d85fb9d702908ab0c6f2acc014b72a91c17e9
2026-01-04T17:51:47.903820Z
false
seratch/rspec-kickstarter
https://github.com/seratch/rspec-kickstarter/blob/969d85fb9d702908ab0c6f2acc014b72a91c17e9/lib/rspec_kickstarter/generator.rb
lib/rspec_kickstarter/generator.rb
# -*- encoding: utf-8 -*- require 'rdoc' require 'rspec_kickstarter' require 'rspec_kickstarter/erb_factory' require 'rspec_kickstarter/erb_templates' require 'rspec_kickstarter/rdoc_factory' # # RSpec Code Generator # module RSpecKickstarter class Generator include RSpecKickstarter::ERBTemplates attr_acce...
ruby
MIT
969d85fb9d702908ab0c6f2acc014b72a91c17e9
2026-01-04T17:51:47.903820Z
false
seratch/rspec-kickstarter
https://github.com/seratch/rspec-kickstarter/blob/969d85fb9d702908ab0c6f2acc014b72a91c17e9/lib/rspec_kickstarter/erb_templates.rb
lib/rspec_kickstarter/erb_templates.rb
# -*- encoding: utf-8 -*- require 'erb' require 'rspec_kickstarter' # # ERB templates # module RSpecKickstarter module ERBTemplates BASIC_METHODS_PART_TEMPLATE = <<SPEC <%- methods_to_generate.map { |method| %> # TODO: auto-generated describe '#<%= method.name %>' do it 'works' do <%- unless get_instan...
ruby
MIT
969d85fb9d702908ab0c6f2acc014b72a91c17e9
2026-01-04T17:51:47.903820Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/test/cie94_test.rb
test/cie94_test.rb
require 'test_helper' describe ScorchedEarth::Services::CIE94 do Color = Java::JavaAwt::Color # HACK it 'can tell colors are the same' do assert_equal 0, ScorchedEarth::Services::CIE94.new.call(Color.black, Color.black) end it 'can tell colors are different' do assert_equal 9341.57053391457, Scorched...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/test/test_helper.rb
test/test_helper.rb
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'bundler/setup' require 'support/simplecov' require 'support/null_object' require 'scorched_earth' require 'minitest/autorun'
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/test/game_test.rb
test/game_test.rb
require 'test_helper' describe ScorchedEarth::Game do before do @game = ScorchedEarth::Game.new(800, 600) @game.setup end it 'renders' do @game.publish ScorchedEarth::Events::MouseMoved.new(0, 0) @game.render graphics = NullObject.new end it 'fires when clicked' do @game.publish Scorc...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/test/helpers_test.rb
test/helpers_test.rb
require 'test_helper' describe ScorchedEarth::Helpers do before do @subject = ScorchedEarth::Helpers end it('#angle') { @subject.angle(1, 1).must_equal 45 } it('#radians_to_degrees') { @subject.radians_to_degrees(Math::PI).must_equal 180 } it('#degrees_to_radians') { @subject.degrees_to_rad...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/test/deform_test.rb
test/deform_test.rb
require 'test_helper' describe ScorchedEarth::Services::Deform do it 'reduces' do assert_equal [10.0, 9.0, 10.0], ScorchedEarth::Services::Deform.new([10, 10, 10]).call(1, 1) end end
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/test/support/simplecov.rb
test/support/simplecov.rb
require 'simplecov' SimpleCov.add_group 'Events', 'lib/scorched_earth/events/' SimpleCov.add_group 'Objects', 'lib/scorched_earth/objects/' SimpleCov.add_group 'Services', 'lib/scorched_earth/services/' SimpleCov.add_group 'Subscribers', 'lib/scorched_earth/subscribers/' SimpleCov.add_group 'Renders', ...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/test/support/null_object.rb
test/support/null_object.rb
class NullObject def method_missing(*_args) self end end
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth.rb
lib/scorched_earth.rb
$LOAD_PATH.unshift File.dirname(__FILE__) require 'scorched_earth/version' require 'scorched_earth/game' require 'scorched_earth/game_window' module ScorchedEarth; end
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/version.rb
lib/scorched_earth/version.rb
module ScorchedEarth VERSION = '1.0.0'.freeze end
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/renders.rb
lib/scorched_earth/renders.rb
require 'scorched_earth/renders/explosion' require 'scorched_earth/renders/mouse' require 'scorched_earth/renders/player' require 'scorched_earth/renders/shot' require 'scorched_earth/renders/map' module ScorchedEarth module Renders def self.find(object) class_name = object.class.name.split('::').last ...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/event_runner.rb
lib/scorched_earth/event_runner.rb
module ScorchedEarth class EventRunner attr_reader :queue, :subscribers def initialize @queue = Queue.new @subscribers = [] end def publish(event) queue << event end def subscribe(klass, &block) subscribers << [klass, block] end def run(event) su...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/game.rb
lib/scorched_earth/game.rb
include Java import java.awt.Color require 'scorched_earth/objects/player' require 'scorched_earth/objects/shot' require 'scorched_earth/objects/explosion' require 'scorched_earth/objects/mouse' require 'scorched_earth/event_runner' require 'scorched_earth/events/game_update' require 'scorched_earth/events/game_rende...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/game_window.rb
lib/scorched_earth/game_window.rb
include Java import java.awt.event.WindowEvent import java.awt.image.BufferStrategy import javax.swing.JFrame import java.awt.Canvas import java.awt.Dimension import javax.swing.JPanel import java.awt.Color require 'scorched_earth/events/mouse_pressed' require 'scorched_earth/events/mouse_released' require 'scorched_...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/helpers.rb
lib/scorched_earth/helpers.rb
module ScorchedEarth module Helpers def normalize_degrees(degrees) (degrees + 360 * 2e10) % 360 end def angle(x, y) normalize_degrees radians_to_degrees Math.atan2(y, x) end def radians_to_degrees(radians) radians * (180 / Math::PI) end def degrees_to_radians(degrees) ...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/services/wave.rb
lib/scorched_earth/services/wave.rb
module ScorchedEarth module Services class Wave attr_reader :width, :height, :phases def initialize(width, height, phases) @width = width @height = height @phases = phases end def each return enum_for(:each) unless block_given? width.times do |in...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/services/color_palette.rb
lib/scorched_earth/services/color_palette.rb
include Java import java.awt.Color require 'scorched_earth/services/cie94' module ScorchedEarth module Services class ColorPalette include Enumerable attr_reader :cache, :colors, :strategy def initialize(*colors) @cache = {} @colors = colors @strategy = Strategi...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/services/deform.rb
lib/scorched_earth/services/deform.rb
require 'scorched_earth/helpers' module ScorchedEarth module Services class Deform include Helpers attr_reader :array def initialize(array) @array = array end def call(center_x, radius, center_y = array[center_x]) new_array = array.dup circle(radius) do |of...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/services/cie94.rb
lib/scorched_earth/services/cie94.rb
include Java import java.awt.Color module ScorchedEarth module Services # https://github.com/halostatue/color/blob/master/lib/color/rgb.rb class CIE94 def call(color_1, color_2, weighting_type = :graphic_arts) color_1 = to_lab(color_1) color_2 = to_lab(color_2) case weighting_...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/renders/shot.rb
lib/scorched_earth/renders/shot.rb
include Java import java.awt.Color import java.awt.BasicStroke import java.awt.geom.GeneralPath require 'scorched_earth/renders/trajectory' module ScorchedEarth module Renders class Shot attr_reader :shot def initialize(shot) @shot = shot end def call(graphics, *_args) ...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/renders/mouse.rb
lib/scorched_earth/renders/mouse.rb
include Java import java.awt.BasicStroke module ScorchedEarth module Renders class Mouse attr_reader :mouse, :player def initialize(mouse, player) @mouse = mouse @player = player end def call(graphics, color_palette) return unless mouse.x && mouse.y co...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/renders/player.rb
lib/scorched_earth/renders/player.rb
module ScorchedEarth module Renders class Player attr_reader :player def initialize(player) @player = player end def call(graphics, color_palette) color = color_palette.get(player.x) height = graphics.destination.height y = height - player.y - radius...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/renders/trajectory.rb
lib/scorched_earth/renders/trajectory.rb
include Java import java.awt.Color import java.awt.BasicStroke import java.awt.geom.GeneralPath module ScorchedEarth module Renders class Trajectory attr_reader :trajectory def initialize(trajectory) @trajectory = trajectory end def call(graphics, *_args) height ...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/renders/explosion.rb
lib/scorched_earth/renders/explosion.rb
module ScorchedEarth module Renders class Explosion attr_reader :explosion def initialize(explosion) @explosion = explosion end def call(graphics, *_args) height = graphics.destination.height y = height - explosion.y - radius / 2 graphics.set_color c...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/renders/map.rb
lib/scorched_earth/renders/map.rb
include Java import java.awt.Transparency import java.awt.Image module ScorchedEarth module Renders class Map module Cache def to_image(graphics, color_palette) cache(key) do super end end private def key array.join end ...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/events/game_update.rb
lib/scorched_earth/events/game_update.rb
module ScorchedEarth module Events GameUpdate = Struct.new(:delta) end end
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/events/mouse_moved.rb
lib/scorched_earth/events/mouse_moved.rb
module ScorchedEarth module Events MouseMoved = Struct.new(:x, :y) end end
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/events/game_render.rb
lib/scorched_earth/events/game_render.rb
module ScorchedEarth module Events GameRender = Struct.new(:graphics) end end
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/events/mouse_pressed.rb
lib/scorched_earth/events/mouse_pressed.rb
module ScorchedEarth module Events MousePressed = Struct.new(:x, :y) end end
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/events/hit.rb
lib/scorched_earth/events/hit.rb
module ScorchedEarth module Events Hit = Struct.new(:object, :radius) end end
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/events/mouse_released.rb
lib/scorched_earth/events/mouse_released.rb
module ScorchedEarth module Events MouseReleased = Struct.new(:x, :y) end end
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/events/game_over.rb
lib/scorched_earth/events/game_over.rb
module ScorchedEarth module Events GameOver = Struct.new(:time) end end
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/subscribers/mouse_moved.rb
lib/scorched_earth/subscribers/mouse_moved.rb
module ScorchedEarth module Subscribers module MouseMoved def setup super event_runner.subscribe(Events::MouseMoved) do |event| @mouse = Mouse.new event.x, event.y, mouse.pressed_at end end end end end
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/subscribers/game_render.rb
lib/scorched_earth/subscribers/game_render.rb
module ScorchedEarth module Subscribers module GameRender def setup super event_runner.subscribe(Events::GameRender) do |event| graphics = event.graphics graphics.set_color color_palette.get('sky') graphics.fill_rect 0, 0, width, height Renders::Mou...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/subscribers/mouse_pressed.rb
lib/scorched_earth/subscribers/mouse_pressed.rb
module ScorchedEarth module Subscribers module MousePressed def setup super event_runner.subscribe(Events::MousePressed) do |_event| @mouse = Mouse.new mouse.x, mouse.y, Time.now end end end end end
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/subscribers/mouse_released/next_player.rb
lib/scorched_earth/subscribers/mouse_released/next_player.rb
module ScorchedEarth module Subscribers module NextPlayer def setup super event_runner.subscribe(Events::MouseReleased) do |_event| @players = players.rotate! end end end end end
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/subscribers/mouse_released/fire.rb
lib/scorched_earth/subscribers/mouse_released/fire.rb
module ScorchedEarth module Subscribers module Fire def setup super event_runner.subscribe(Events::MouseReleased) do |_event| if mouse.pressed_at && mouse.x && mouse.y shot = Shot.new current_player.x, array[current_player.x], velocity_x, velocity_y object...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/subscribers/game_update/delta.rb
lib/scorched_earth/subscribers/game_update/delta.rb
module ScorchedEarth module Subscribers module Delta def setup super event_runner.subscribe(Events::GameUpdate) do |event| @objects = objects.map { |object| object.update event.delta }.compact end end end end end
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/subscribers/game_update/collisions.rb
lib/scorched_earth/subscribers/game_update/collisions.rb
module ScorchedEarth module Subscribers module Collisions def setup super event_runner.subscribe(Events::GameUpdate) do objects .select { |object| object.is_a? Shot } .select { |object| array.fetch(object.x, 0) > object.y } .each { |obje...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/subscribers/hit/effect.rb
lib/scorched_earth/subscribers/hit/effect.rb
require 'scorched_earth/events/hit' module ScorchedEarth module Subscribers module Effect def setup super event_runner.subscribe(Events::Hit) do |event| objects << Explosion.new(event.object.x, event.object.y) end end end end end
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/subscribers/hit/deform.rb
lib/scorched_earth/subscribers/hit/deform.rb
require 'scorched_earth/events/hit' module ScorchedEarth module Subscribers module Deform def setup super event_runner.subscribe(Events::Hit) do |event| if event.object.x < array.size && event.object.x > 0 @array = Services::Deform.new(array).call(event.object.x, even...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/subscribers/hit/radius.rb
lib/scorched_earth/subscribers/hit/radius.rb
require 'scorched_earth/events/hit' module ScorchedEarth module Subscribers module Radius def setup super event_runner.subscribe(Events::Hit) do |event| if players.any? { |player| inside_radius? event.object.x - player.x, 0, event.radius } event_runner.publish Events:...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/subscribers/game_over/timeout.rb
lib/scorched_earth/subscribers/game_over/timeout.rb
require 'scorched_earth/events/game_over' module ScorchedEarth module Subscribers module Timeout def setup super event_runner.subscribe(Events::GameOver) do |event| event.time < Time.now ? setup : event_runner.publish(event) end end end end end
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/objects/shot.rb
lib/scorched_earth/objects/shot.rb
module ScorchedEarth class Shot class Trajectory < Array def initialize(*args) super freeze end def update(*_args) self end end attr_reader :x, :y, :velocity_x, :velocity_y, :trajectory def initialize(x, y, velocity_x, velocity_y, trajectory = Trajec...
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/objects/mouse.rb
lib/scorched_earth/objects/mouse.rb
module ScorchedEarth class Mouse attr_reader :x, :y, :pressed_at def initialize(x = nil, y = nil, pressed_at = nil) @x = x @y = y @pressed_at = pressed_at freeze end end end
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/objects/player.rb
lib/scorched_earth/objects/player.rb
module ScorchedEarth class Player attr_reader :x, :y def initialize(x, y) @x = x @y = y freeze end end end
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
jamesmoriarty/scorched_earth
https://github.com/jamesmoriarty/scorched_earth/blob/3be74974891f26f00c96b9a9fb5696270e4fcb6a/lib/scorched_earth/objects/explosion.rb
lib/scorched_earth/objects/explosion.rb
module ScorchedEarth class Explosion attr_reader :x, :y, :radius def initialize(x, y, radius = 25) @x = x @y = y @radius = radius freeze end def update(_delta) self.class.new(x, y, radius + 25) if radius < 125 end end end
ruby
MIT
3be74974891f26f00c96b9a9fb5696270e4fcb6a
2026-01-04T17:51:41.140983Z
false
pelargir/auto-session-timeout
https://github.com/pelargir/auto-session-timeout/blob/0125651d4b310d270aab21e02c71ee7583e46023/test/test_helper.rb
test/test_helper.rb
require 'rubygems' require 'minitest/autorun' require 'logger' require 'action_controller' require File.expand_path(File.dirname(__FILE__) + '/../lib/auto-session-timeout')
ruby
MIT
0125651d4b310d270aab21e02c71ee7583e46023
2026-01-04T17:51:45.260070Z
false
pelargir/auto-session-timeout
https://github.com/pelargir/auto-session-timeout/blob/0125651d4b310d270aab21e02c71ee7583e46023/test/auto_session_timeout_test.rb
test/auto_session_timeout_test.rb
require File.dirname(__FILE__) + '/test_helper' describe AutoSessionTimeout do it "tests something" do assert true end end
ruby
MIT
0125651d4b310d270aab21e02c71ee7583e46023
2026-01-04T17:51:45.260070Z
false
pelargir/auto-session-timeout
https://github.com/pelargir/auto-session-timeout/blob/0125651d4b310d270aab21e02c71ee7583e46023/test/auto_session_timeout_helper_test.rb
test/auto_session_timeout_helper_test.rb
require File.dirname(__FILE__) + '/test_helper' describe AutoSessionTimeoutHelper do class StubView include AutoSessionTimeoutHelper include ActionView::Helpers::JavaScriptHelper include ActionView::Helpers::TagHelper def timeout_path "/timeout" end def active_path "/active" ...
ruby
MIT
0125651d4b310d270aab21e02c71ee7583e46023
2026-01-04T17:51:45.260070Z
false
pelargir/auto-session-timeout
https://github.com/pelargir/auto-session-timeout/blob/0125651d4b310d270aab21e02c71ee7583e46023/lib/auto_session_timeout_helper.rb
lib/auto_session_timeout_helper.rb
module AutoSessionTimeoutHelper def auto_session_timeout_js(options={}) frequency = options[:frequency] || 60 attributes = options[:attributes] || {} code = <<JS function PeriodicalQuery() { var request = new XMLHttpRequest(); request.onload = function (event) { var status = event.target.status; ...
ruby
MIT
0125651d4b310d270aab21e02c71ee7583e46023
2026-01-04T17:51:45.260070Z
false
pelargir/auto-session-timeout
https://github.com/pelargir/auto-session-timeout/blob/0125651d4b310d270aab21e02c71ee7583e46023/lib/auto-session-timeout.rb
lib/auto-session-timeout.rb
require 'auto_session_timeout' require 'auto_session_timeout_helper'
ruby
MIT
0125651d4b310d270aab21e02c71ee7583e46023
2026-01-04T17:51:45.260070Z
false
pelargir/auto-session-timeout
https://github.com/pelargir/auto-session-timeout/blob/0125651d4b310d270aab21e02c71ee7583e46023/lib/auto_session_timeout.rb
lib/auto_session_timeout.rb
module AutoSessionTimeout def self.included(controller) controller.extend ClassMethods end module ClassMethods def auto_session_timeout(seconds=nil) prepend_before_action do |c| if session_expired?(c) && !signing_in?(c) handle_session_reset(c) else unless c.requ...
ruby
MIT
0125651d4b310d270aab21e02c71ee7583e46023
2026-01-04T17:51:45.260070Z
false
pelargir/auto-session-timeout
https://github.com/pelargir/auto-session-timeout/blob/0125651d4b310d270aab21e02c71ee7583e46023/lib/auto/session/timeout.rb
lib/auto/session/timeout.rb
require "auto/session/timeout/version" module Auto module Session module Timeout # Your code goes here... end end end
ruby
MIT
0125651d4b310d270aab21e02c71ee7583e46023
2026-01-04T17:51:45.260070Z
false
pelargir/auto-session-timeout
https://github.com/pelargir/auto-session-timeout/blob/0125651d4b310d270aab21e02c71ee7583e46023/lib/auto/session/timeout/version.rb
lib/auto/session/timeout/version.rb
module Auto module Session module Timeout VERSION = "1.3" end end end
ruby
MIT
0125651d4b310d270aab21e02c71ee7583e46023
2026-01-04T17:51:45.260070Z
false
picatz/shodanz
https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/spec/rest_api_spec.rb
spec/rest_api_spec.rb
require "spec_helper" RSpec.describe Shodanz::API::REST do include_context Async::RSpec::Reactor before do @client = Shodanz.api.rest.new end before(:each) do # try to avoid rate limit sleep 3 end describe '#scan' do it 'should be able to scan a host on the internet' do resp = @cli...
ruby
MIT
134eac5265d700efe1b6eec004dc3c25270cbc6c
2026-01-04T17:51:46.633447Z
false
picatz/shodanz
https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/spec/exploits_api_spec.rb
spec/exploits_api_spec.rb
require "spec_helper" RSpec.describe Shodanz::API::Exploits do include_context Async::RSpec::Reactor before do @client = Shodanz.api.exploits.new end before(:each) do # try to avoid rate limit sleep 3 end describe '#search' do it 'should search across a variety of data sources for exploi...
ruby
MIT
134eac5265d700efe1b6eec004dc3c25270cbc6c
2026-01-04T17:51:46.633447Z
false
picatz/shodanz
https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/spec/shodanz_spec.rb
spec/shodanz_spec.rb
require "spec_helper" RSpec.describe Shodanz do it "has a version number" do expect(Shodanz::VERSION).not_to be nil end end
ruby
MIT
134eac5265d700efe1b6eec004dc3c25270cbc6c
2026-01-04T17:51:46.633447Z
false
picatz/shodanz
https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/spec/streaming_api_spec.rb
spec/streaming_api_spec.rb
require "spec_helper" RSpec.describe Shodanz::API::Streaming do include_context Async::RSpec::Reactor before do @client = Shodanz.api.streaming.new end before(:each) do # try to avoid rate limit sleep 1 end describe '#banners' do it "should stream any banner data Shodan collects" do ...
ruby
MIT
134eac5265d700efe1b6eec004dc3c25270cbc6c
2026-01-04T17:51:46.633447Z
false
picatz/shodanz
https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/spec/spec_helper.rb
spec/spec_helper.rb
require "bundler/setup" require "async/rspec" require "shodanz" require "pry" require "readline" RSpec.configure do |config| # Enable flags like --only-failures and --next-failure config.example_status_persistence_file_path = ".rspec_status" # Disable RSpec exposing methods globally on `Module` and `main` con...
ruby
MIT
134eac5265d700efe1b6eec004dc3c25270cbc6c
2026-01-04T17:51:46.633447Z
false
picatz/shodanz
https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/examples/async_host_search_example.rb
examples/async_host_search_example.rb
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'async' require 'shodanz' client = Shodanz.client.new webservers = ['apache', 'nginx', 'caddy', 'lighttpd', 'cherokee'] # we can use methods sequentially started = Time.now.sec webservers.each do |webserver| # make HTTP request client.rest_api.ho...
ruby
MIT
134eac5265d700efe1b6eec004dc3c25270cbc6c
2026-01-04T17:51:46.633447Z
false
picatz/shodanz
https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/examples/async_honeypot_detector.rb
examples/async_honeypot_detector.rb
# frozen_string_literal: true $LOAD_PATH.unshift File.expand_path('../lib', __dir__) require 'async' require 'shodanz' client = Shodanz.client.new client.streaming_api.banners do |banner| if ip = banner['ip_str'] Async do score = client.rest_api.honeypot_score(ip).wait puts "#{ip} has a #{score * 1...
ruby
MIT
134eac5265d700efe1b6eec004dc3c25270cbc6c
2026-01-04T17:51:46.633447Z
false
picatz/shodanz
https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/examples/debug.rb
examples/debug.rb
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'shodanz' require 'pry' # rest_api = Shodanz.api.rest.new # streaming_api = Shodanz.api.streaming.new # exploits_api = Shodanz.api.exploits.new client = Shodanz.client.new binding.pry
ruby
MIT
134eac5265d700efe1b6eec004dc3c25270cbc6c
2026-01-04T17:51:46.633447Z
false
picatz/shodanz
https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/examples/top_10_countries_running.rb
examples/top_10_countries_running.rb
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'shodanz' require 'command_lion' require 'yaml' require 'pry' module Top10 @rest_api = Shodanz.api.rest.new def self.check(product) begin @rest_api.host_count(product: product, facets: { country: 10 })["facets"]["country"].collect {...
ruby
MIT
134eac5265d700efe1b6eec004dc3c25270cbc6c
2026-01-04T17:51:46.633447Z
false
picatz/shodanz
https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/examples/streaming_banner_product_stats.rb
examples/streaming_banner_product_stats.rb
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'shodanz' # clean CTRL+C exit trap "SIGINT" do exit 0 end # streaming API client streaming_api = Shodanz.api.streaming.new # every key's value starts at zero stats = Hash.new(0) # collect banners streaming_api.banners do |banner| product = bann...
ruby
MIT
134eac5265d700efe1b6eec004dc3c25270cbc6c
2026-01-04T17:51:46.633447Z
false
picatz/shodanz
https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/examples/async_stream_example.rb
examples/async_stream_example.rb
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'pry' require 'async' require 'shodanz' client = Shodanz.client.new stats = Hash.new(0) ports = [21, 22, 80, 443] services = ['ftp', 'ssh', 'http', 'https'] ports_with_service_names = ports.zip(services) Async do # collect banners for ports ...
ruby
MIT
134eac5265d700efe1b6eec004dc3c25270cbc6c
2026-01-04T17:51:46.633447Z
false
picatz/shodanz
https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/examples/top_10_countries_running_apache_chart.rb
examples/top_10_countries_running_apache_chart.rb
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require "shodanz" require "chart_js" module Top10 @rest_api = Shodanz.api.rest.new def self.check(product) begin @rest_api.host_count(product: product, facets: { country: 10 })["facets"]["country"].collect { |x| x.values }.to_h.invert rescue ...
ruby
MIT
134eac5265d700efe1b6eec004dc3c25270cbc6c
2026-01-04T17:51:46.633447Z
false