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
mobomo/rack-stream
https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/lib/rack/stream/handlers/http.rb
lib/rack/stream/handlers/http.rb
module Rack class Stream module Handlers # This Handler works under EventMachine aware Rack servers like Thin # and Rainbows! It does chunked transfer encoding. class Http < AbstractHandler TERM = "\r\n".freeze TAIL = "0#{TERM}#{TERM}".freeze def self.accepts?(app) ...
ruby
BSD-2-Clause
b238d0ee773fd94aa72f88887b4de2d7a21e4b6a
2026-01-04T17:39:19.428471Z
false
mobomo/rack-stream
https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/lib/rack/stream/handlers/web_socket.rb
lib/rack/stream/handlers/web_socket.rb
module Rack class Stream module Handlers # This handler uses delegates WebSocket requests to faye-websocket class WebSocket < AbstractHandler def self.accepts?(app) ::Faye::WebSocket.websocket?(app.env) end def close @body.callback { @ws.close(@...
ruby
BSD-2-Clause
b238d0ee773fd94aa72f88887b4de2d7a21e4b6a
2026-01-04T17:39:19.428471Z
false
kobaltz/clamby
https://github.com/kobaltz/clamby/blob/fdd9d92b123006765e944a4d3b99dc305bc29ce9/spec/clamby_spec.rb
spec/clamby_spec.rb
require 'spec_helper' require 'support/shared_context' describe Clamby do include_context 'paths' before { Clamby.configure(Clamby::DEFAULT_CONFIG.dup) } it "should find clamscan" do expect(Clamby.scanner_exists?).to be true end it "should scan file as safe" do expect(Clamby.safe?(good_path)).to b...
ruby
MIT
fdd9d92b123006765e944a4d3b99dc305bc29ce9
2026-01-04T17:39:21.616377Z
false
kobaltz/clamby
https://github.com/kobaltz/clamby/blob/fdd9d92b123006765e944a4d3b99dc305bc29ce9/spec/spec_helper.rb
spec/spec_helper.rb
require 'bundler/setup' Bundler.setup require 'open-uri' require 'tempfile' require 'clamby' # and any other gems you need RSpec.configure do |config| config.mock_with :rspec do |mocks| # so that Command can keep doing what it always does. mocks.verify_partial_doubles = true end def download(url) ...
ruby
MIT
fdd9d92b123006765e944a4d3b99dc305bc29ce9
2026-01-04T17:39:21.616377Z
false
kobaltz/clamby
https://github.com/kobaltz/clamby/blob/fdd9d92b123006765e944a4d3b99dc305bc29ce9/spec/support/shared_context.rb
spec/support/shared_context.rb
RSpec.shared_context 'paths' do let(:special_path) { File.expand_path('../../fixtures/safe (special).txt', __FILE__) } let(:good_path) { File.expand_path('../../fixtures/safe.txt', __FILE__) } let(:bad_path) { File.expand_path("not-here/#{rand 10e6}.txt", __FILE__) } end
ruby
MIT
fdd9d92b123006765e944a4d3b99dc305bc29ce9
2026-01-04T17:39:21.616377Z
false
kobaltz/clamby
https://github.com/kobaltz/clamby/blob/fdd9d92b123006765e944a4d3b99dc305bc29ce9/spec/clamby/command_spec.rb
spec/clamby/command_spec.rb
require 'spec_helper' require 'support/shared_context' describe Clamby::Command do before { Clamby.configure(Clamby::DEFAULT_CONFIG.dup) } describe 'ClamAV version' do it 'returns true' do command = described_class.clamscan_version expect(command).to be true end end describe 'scan' do ...
ruby
MIT
fdd9d92b123006765e944a4d3b99dc305bc29ce9
2026-01-04T17:39:21.616377Z
false
kobaltz/clamby
https://github.com/kobaltz/clamby/blob/fdd9d92b123006765e944a4d3b99dc305bc29ce9/lib/clamby.rb
lib/clamby.rb
require "English" require "clamby/command" require "clamby/error" require "clamby/version" module Clamby DEFAULT_CONFIG = { :check => true, :daemonize => false, :config_file => nil, :error_clamscan_missing => true, :error_clamscan_client_error => false, :error_file_missing => true, :error...
ruby
MIT
fdd9d92b123006765e944a4d3b99dc305bc29ce9
2026-01-04T17:39:21.616377Z
false
kobaltz/clamby
https://github.com/kobaltz/clamby/blob/fdd9d92b123006765e944a4d3b99dc305bc29ce9/lib/clamby/command.rb
lib/clamby/command.rb
module Clamby # Interface with the system. Builds and runs the command. class Command EXECUTABLES = %w(clamscan clamdscan freshclam) # Array containing the complete command line. attr_accessor :command # Returns the appropriate scan executable, based on clamd being used. def self.scan_executab...
ruby
MIT
fdd9d92b123006765e944a4d3b99dc305bc29ce9
2026-01-04T17:39:21.616377Z
false
kobaltz/clamby
https://github.com/kobaltz/clamby/blob/fdd9d92b123006765e944a4d3b99dc305bc29ce9/lib/clamby/version.rb
lib/clamby/version.rb
module Clamby VERSION = "1.6.11" end
ruby
MIT
fdd9d92b123006765e944a4d3b99dc305bc29ce9
2026-01-04T17:39:21.616377Z
false
kobaltz/clamby
https://github.com/kobaltz/clamby/blob/fdd9d92b123006765e944a4d3b99dc305bc29ce9/lib/clamby/error.rb
lib/clamby/error.rb
module Clamby class Error < StandardError; end class VirusDetected < Error; end class ClamscanMissing < Error; end class ClamscanClientError < Error; end class FileNotFound < Error; end end
ruby
MIT
fdd9d92b123006765e944a4d3b99dc305bc29ce9
2026-01-04T17:39:21.616377Z
false
sstephenson/ruby-ejs
https://github.com/sstephenson/ruby-ejs/blob/674a334be4d17e4cee9eecd60fc11733eccfeeb1/test/test_ejs.rb
test/test_ejs.rb
require "ejs" require "test/unit" FUNCTION_PATTERN = /^function\s*\(.*?\)\s*\{(.*?)\}$/ BRACE_SYNTAX = { :evaluation_pattern => /\{\{([\s\S]+?)\}\}/, :interpolation_pattern => /\{\{=([\s\S]+?)\}\}/, :escape_pattern => /\{\{-([\s\S]+?)\}\}/ } QUESTION_MARK_SYNTAX = { :evaluation_pattern => /<\?([...
ruby
MIT
674a334be4d17e4cee9eecd60fc11733eccfeeb1
2026-01-04T17:39:28.548896Z
false
sstephenson/ruby-ejs
https://github.com/sstephenson/ruby-ejs/blob/674a334be4d17e4cee9eecd60fc11733eccfeeb1/lib/ejs.rb
lib/ejs.rb
# EJS (Embedded JavaScript) template compiler for Ruby # This is a port of Underscore.js' `_.template` function: # http://documentcloud.github.com/underscore/ module EJS JS_UNESCAPES = { '\\' => '\\', "'" => "'", 'r' => "\r", 'n' => "\n", 't' => "\t", 'u2028' => "\u2028", 'u2029' => "\u20...
ruby
MIT
674a334be4d17e4cee9eecd60fc11733eccfeeb1
2026-01-04T17:39:28.548896Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/app/workers/build_worker.rb
app/workers/build_worker.rb
class BuildWorker @queue = name class << self def perform(id) Build.find(id).run end def perform_async(id) Resque.enqueue(self, id) end def on_failure(*args) id = args[1] message = args[0].message Build.find(id).update_attributes!(finished_at: Time.now, output: m...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/app/workers/job_enqueue_worker.rb
app/workers/job_enqueue_worker.rb
class JobEnqueueWorker @queue = name class << self def perform(id) Job.find(id).enqueue end def perform_async(id) Resque.enqueue(self, id) end end end
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/app/helpers/application_helper.rb
app/helpers/application_helper.rb
module ApplicationHelper def action_classes %W[#{controller_name}_controller #{action_name}_action] end end
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/app/controllers/jobs_controller.rb
app/controllers/jobs_controller.rb
class JobsController < ApplicationController before_action :require_resources, only: :index before_action :require_resource, only: [:show, :edit, :update, :destroy] validates :create do string :name, required: true end validates :update do string :name end def index respond_with @resources ...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/app/controllers/builds_controller.rb
app/controllers/builds_controller.rb
class BuildsController < ApplicationController before_action :require_job, only: [:index, :create] before_action :require_resources, only: :index before_action :require_resource, only: [:show, :update, :destroy] validates :update do integer :status end def index respond_with @resources end de...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/app/controllers/events_controller.rb
app/controllers/events_controller.rb
class EventsController < ApplicationController include ActionController::Live before_action :require_event_stream def index redis = Redis.new redis.psubscribe("build.*") do |on| on.pmessage do |pattern, event, data| response.stream.write("event: #{event}\n") response.stream.write("...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/app/controllers/application_controller.rb
app/controllers/application_controller.rb
class ApplicationController < ActionController::Base protect_from_forgery respond_to :html, :json self.responder = Altria::Responder rescue_from WeakParameters::ValidationError do head 400 end # Cache to use `view_context.content_for` from controller. # This hack is nice to hook view_context from ...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/app/models/build.rb
app/models/build.rb
class Build < ActiveRecord::Base include Altria::Proprietary serialize :properties, Hash validates :job_id, presence: true belongs_to :job, touch: true, counter_cache: true scope :recent, -> { order("created_at DESC") } scope :finished, -> { where("finished_at IS NOT NULL") } scope :unfinished, -> {...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/app/models/job.rb
app/models/job.rb
class Job < ActiveRecord::Base include Altria::Proprietary serialize :properties, Hash validates :name, presence: true has_many :builds scope :recent, -> { order("updated_at DESC") } delegate :status, :status_name, :status_icon_css_class, to: :last_finished_build, allow_nil: true delegate :scheduled...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/db/seeds.rb
db/seeds.rb
# This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). # # Examples: # # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) # Mayor.create(name: 'Emanuel...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/db/migrate/20130531155155_create_builds.rb
db/migrate/20130531155155_create_builds.rb
class CreateBuilds < ActiveRecord::Migration def change create_table :builds do |t| t.boolean :status t.datetime :started_at t.datetime :finished_at t.references :job t.text :output t.timestamps end add_index :builds, :job_id end end
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/db/migrate/20130531143239_create_jobs.rb
db/migrate/20130531143239_create_jobs.rb
class CreateJobs < ActiveRecord::Migration def change create_table :jobs do |t| t.string :name t.text :config t.timestamps end end end
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/db/migrate/20130707083435_add_incremental_id_to_build.rb
db/migrate/20130707083435_add_incremental_id_to_build.rb
class AddIncrementalIdToBuild < ActiveRecord::Migration def change add_column :builds, :incremental_id, :integer, default: 0 Build.all.each do |build| count = build.job.builds.where("id <= ?", build.id).count build.update_attributes(incremental_id: count) end end end
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/db/migrate/20130608153655_add_column_properties_to_builds.rb
db/migrate/20130608153655_add_column_properties_to_builds.rb
class AddColumnPropertiesToBuilds < ActiveRecord::Migration def change add_column :builds, :properties, :text end end
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/db/migrate/20130608153135_change_job_column_name_from_config_to_properties.rb
db/migrate/20130608153135_change_job_column_name_from_config_to_properties.rb
class ChangeJobColumnNameFromConfigToProperties < ActiveRecord::Migration def up rename_column :jobs, :config, :properties end def down rename_column :jobs, :properties, :config end end
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/db/migrate/20130724151147_add_default_zero_to_builds_count_of_jobs.rb
db/migrate/20130724151147_add_default_zero_to_builds_count_of_jobs.rb
class AddDefaultZeroToBuildsCountOfJobs < ActiveRecord::Migration def up change_column :jobs, :builds_count, :integer, default: 0 Job.all.each do |job| job.update_attributes(builds_count: 0) if job.builds_count.nil? end end def down change_column :jobs, :builds_count, :integer, default: nil...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/db/migrate/20130707082717_add_builds_count_to_job.rb
db/migrate/20130707082717_add_builds_count_to_job.rb
class AddBuildsCountToJob < ActiveRecord::Migration def change add_column :jobs, :builds_count, :integer Job.all.each do |job| job.update_attributes(builds_count: job.builds.count) end end end
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/spec/spec_helper.rb
spec/spec_helper.rb
require "simplecov" require "coveralls" Coveralls.wear! SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter, ] SimpleCov.start ENV["RAILS_ENV"] ||= "test" require File.expand_path("../../config/environment", __FILE__) require "rspec/rails...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/spec/requests/builds_spec.rb
spec/requests/builds_spec.rb
require "spec_helper" describe "Builds" do let(:params) do {} end let(:env) do { "HTTP_ACCEPT" => "application/json" } end let(:job) do FactoryGirl.create(:job, properties: { "script" => "true" }) end let(:build) do FactoryGirl.create(:build, job: job, finished_at: Time.now) end d...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/spec/requests/jobs_spec.rb
spec/requests/jobs_spec.rb
require "spec_helper" describe "Jobs" do let(:params) do {} end let(:env) do { "HTTP_ACCEPT" => "application/json" } end let(:job) do FactoryGirl.create(:job) end describe "GET /jobs" do before do job end it "returns jobs", :autodoc do get "/jobs", params, env ...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/spec/factories/build.rb
spec/factories/build.rb
require "factory_girl" FactoryGirl.define do factory(:build) do job { FactoryGirl.create(:job) } end end
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/spec/factories/job.rb
spec/factories/job.rb
require "factory_girl" FactoryGirl.define do factory(:job) do sequence(:name) {|n| "name #{n}" } end end
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/spec/altria/command_spec.rb
spec/altria/command_spec.rb
require "spec_helper" describe Altria::Command do let(:command) do described_class.new(arguments) end describe ".call" do it "delegates to #call" do described_class.any_instance.should_receive(:call) described_class.call(["setup"]) end end describe "#call" do context "with `setu...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/spec/models/build_spec.rb
spec/models/build_spec.rb
require "spec_helper" describe Build do let(:build) do FactoryGirl.create(:build, job: job) end let(:job) do FactoryGirl.create(:job, properties: { "script" => "true" }) end describe "#run" do context "with success" do it "runs its job and sets status with true" do build.run ...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/spec/models/job_spec.rb
spec/models/job_spec.rb
require "spec_helper" describe Job do let(:job) do FactoryGirl.create(:job, properties: { "script" => "true" }) end describe "#run" do context "without script" do before do job.script = nil end it "raises Job::ScriptNotFound" do expect { job.run }.to raise_error(Job::S...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/script/clock.rb
script/clock.rb
require File.expand_path("../../config/environment.rb", __FILE__) Clockwork.every(1.minute, "JobEnqueueWorker") do Job.scheduled.each(&:enqueue_with_before_enqueues) end
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/lib/altria.rb
lib/altria.rb
$LOAD_PATH.unshift File.expand_path("..", __FILE__) require "altria/command" require "altria/configuration" require "altria/responder" require "altria/version" require "altria/workspace" module Altria class << self def configuration @configuration ||= Altria::Configuration.new end end end
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/lib/altria/command.rb
lib/altria/command.rb
# Provides command line interface for Altria. # # Examples # # # Takes ARGV and invokes a job. # Altria::Command.call(ARGV) # # # Invokes "setup" command to set up your database. # Altria::Command.call(["setup"]) # # # Invokes "start" command to start the processes. # Altria::Command.call(["start"]) # modul...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/lib/altria/version.rb
lib/altria/version.rb
module Altria VERSION = "0.2.2" end
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/lib/altria/responder.rb
lib/altria/responder.rb
require "action_controller" module Altria class Responder < ActionController::Responder def initialize(controller, resources, *args) if resources[0].respond_to?(:page) resources[0] = resources[0].page(controller.params[:page]) end super end end end
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/lib/altria/scheduler.rb
lib/altria/scheduler.rb
module Altria class Scheduler CRON_REGEXP = /\A(\d+|\*) (\d+|\*) (\d+|\*) (\d+|\*) (\d+|\*)\s*\z/ # Takes a schedule as a String. def initialize(schedule) @result, @min, @hour, @day, @month, @wday = *schedule.match(CRON_REGEXP) validate end def scheduled? [:min, :hour, :day, :m...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/lib/altria/configuration.rb
lib/altria/configuration.rb
module Altria class Configuration attr_accessor :workspace_path def initialize @workspace_path = Pathname.new(".") end end end
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/lib/altria/executer.rb
lib/altria/executer.rb
require "open3" module Altria class Executer def self.execute(*args) new(*args).execute end attr_reader :script def initialize(script) @script = script end def execute { output: output, status: status.success? } end private def output result[0] end...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/lib/altria/workspace.rb
lib/altria/workspace.rb
module Altria class Workspace attr_reader :path def initialize(path) @path = Pathname.new(path) end def chdir mkpath_unless_exist Dir.chdir(path) { yield } end def mkpath_unless_exist mkpath unless exist? end def mkpath path.mkpath end def ex...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/lib/altria/proprietary.rb
lib/altria/proprietary.rb
module Altria module Proprietary extend ActiveSupport::Concern def update_properties(properties) properties.each do |key, value| send("#{key}=", value) end save end module ClassMethods def property(name, options = {}) property = Property.new(name, options) ...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/config/application.rb
config/application.rb
require File.expand_path('../boot', __FILE__) require 'rails/all' if defined?(Bundler) Bundler.require(:default, Rails.env) end require File.expand_path("../../lib/altria", __FILE__) module Altria class Application < Rails::Application # Settings in config/environments/* take precedence over those specified...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/config/environment.rb
config/environment.rb
# Load the rails application require File.expand_path('../application', __FILE__) # Initialize the rails application Altria::Application.initialize!
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/config/routes.rb
config/routes.rb
Altria::Application.routes.draw do root to: "jobs#index" resources :jobs, shallow: true do resources :builds, only: [:index, :show, :create, :update, :destroy] end resources :events, only: :index if Rails.configuration.cache_classes end
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/config/boot.rb
config/boot.rb
require 'rubygems' # Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/config/initializers/redis.rb
config/initializers/redis.rb
$redis = Redis.new
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/config/initializers/session_store.rb
config/initializers/session_store.rb
# Be sure to restart your server when you modify this file. Altria::Application.config.session_store :cookie_store, key: '_altria_session' # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information # (create the session table with "rails gen...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/config/initializers/wrap_parameters.rb
config/initializers/wrap_parameters.rb
# Be sure to restart your server when you modify this file. # # This file contains settings for ActionController::ParamsWrapper which # is enabled by default. # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. ActiveSupport.on_load(:action_controller) do wrap_parameters ...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/config/initializers/inflections.rb
config/initializers/inflections.rb
# Be sure to restart your server when you modify this file. # Add new inflection rules using the following format # (all these examples are active by default): # ActiveSupport::Inflector.inflections do |inflect| # inflect.plural /^(ox)$/i, '\1en' # inflect.singular /^(ox)en/i, '\1' # inflect.irregular 'person', ...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/config/initializers/backtrace_silencers.rb
config/initializers/backtrace_silencers.rb
# Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } # You can also remove all the silencers if you're trying to debug a probl...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/config/initializers/mime_types.rb
config/initializers/mime_types.rb
# Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf # Mime::Type.register_alias "text/html", :iphone
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/config/initializers/secret_token.rb
config/initializers/secret_token.rb
# Be sure to restart your server when you modify this file. # Your secret key for verifying the integrity of signed cookies. # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attac...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/config/environments/test.rb
config/environments/test.rb
Altria::Application.configure do # Settings specified here will take precedence over those in config/application.rb # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test sui...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/config/environments/development.rb
config/environments/development.rb
Altria::Application.configure do # Settings specified here will take precedence over those in config/application.rb # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web ser...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
r7kamura/altria
https://github.com/r7kamura/altria/blob/d7743298b1cef2a839be6f6a3ce2a697dda44fda/config/environments/production.rb
config/environments/production.rb
Altria::Application.configure do # Settings specified here will take precedence over those in config/application.rb # Code is not reloaded between requests config.cache_classes = true # Full error reports are disabled and caching is turned on config.consider_all_requests_local = false config.action_...
ruby
MIT
d7743298b1cef2a839be6f6a3ce2a697dda44fda
2026-01-04T17:39:25.520526Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/tasks/this.rb
tasks/this.rb
require 'pathname' # Public: A Class containing all the metadata and utilities needed to manage a # ruby project. class ThisProject # The name of this project attr_accessor :name # The author's name attr_accessor :author # The email address of the author(s) attr_accessor :email # The homepage of this ...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/test/test_spec_lite.rb
test/test_spec_lite.rb
require 'test_stickler' module Stickler class TestSpecLite < Test def setup @specs = { :ruby => Stickler::SpecLite.new( 'foo', '0.4.2' ), :win => Stickler::SpecLite.new( 'bar', '1.0.1', "x86-mswin32" ), :java => Stickler::SpecLite.new( 'jfoo', '0.4.2', 'jruby' ) } end ...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/test/stickler_test_server.rb
test/stickler_test_server.rb
class SticklerTestServer def initialize( test_dir, ru_file ) @test_dir = test_dir @repo_uri = "http://localhost:6789/" @tmp_dir = File.join( @test_dir , "tmp" ) FileUtils.mkdir_p( @tmp_dir ) @pid_file = File.join( @tmp_dir , "rack.pid" ) @ru_file = File.expand_path( File.join( @test_dir , "...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/test/test_paths.rb
test/test_paths.rb
require 'test_stickler' require 'pathname' module Stickler class TestPaths < Test def setup @root_path = Pathname.new( __FILE__ ).dirname.parent.expand_path end def add_trailing_separator( x ) x.to_s + ::File::SEPARATOR end def test_accessing_the_root_dir_of_the_project assert...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/test/test_stickler.rb
test/test_stickler.rb
if RUBY_VERSION >= '1.9.2' then require 'simplecov' SimpleCov.start if ENV['COVERAGE'] end gem 'minitest' require 'minitest/autorun' require 'minitest/pride' require 'stickler' require 'index_test_helpers' module Stickler class Test < ::Minitest::Test def test_dir File.expand_path( File.dirname( __FI...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/test/test_gemfile_lock_parser.rb
test/test_gemfile_lock_parser.rb
require 'test_stickler' require 'stickler/gemfile_lock_parser' module Stickler class TestGemfileLockParser < Test def setup @lockfile = File.join( test_dir, 'data', 'Gemfile.lock.example' ) @parser = ::Stickler::GemfileLockParser.new( @lockfile ) end def test_raises_exception_when_file_doe...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/test/index_test_helpers.rb
test/index_test_helpers.rb
require 'rack/test' require 'rubygems/user_interaction' require 'rubygems/indexer' module Stickler module IndexTestHelpers include Rack::Test::Methods def define_directories # pristine spec data location @idx_test_dir = File.expand_path( File.dirname( __FILE__ ) ) @idx_test_datadir ...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/test/middleware/test_local.rb
test/middleware/test_local.rb
require 'test_stickler' module Stickler class MiddlewareLocalTest < Test include IndexTestHelpers include Rack::Test::Methods def app repo_root = @idx_test_datadir ::Rack::Builder.new do use ::Stickler::Middleware::Compression use ::Stickler::Middleware::Local, :repo_root => ...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/test/middleware/test_not_found.rb
test/middleware/test_not_found.rb
require 'test_stickler' module Stickler class MiddlewareNotFound < Test include Rack::Test::Methods def app ::Stickler::Middleware::NotFound.new end def setup get "/" end def test_responds_with_404_to_everything assert_equal 404, last_response.status end def test_...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/test/repository/test_api.rb
test/repository/test_api.rb
require 'test_stickler' require 'digest/sha1' module Stickler module RepositoryApiTests def test_implements_all_the_api_methods Stickler::Repository::Api.api_methods.each do |method| assert_respond_to repo, method end end end # Stub class for testing module Repository class Stu...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/test/repository/test_local.rb
test/repository/test_local.rb
require 'test_stickler' require 'repository/test_api_behavior' module Stickler class LocalRepositoryTest < Test include RepositoryApiBehaviorTests def repos_dir File.join( test_dir, "repos" ) end def repo_dir File.join( repos_dir, "1" ) end def repo @repo ||= ::Stickler::...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/test/repository/test_null.rb
test/repository/test_null.rb
require 'test_stickler' require 'repository/test_api' module Stickler class NullRepoistoryTest < Test include RepositoryApiTests def repo @repo ||= ::Stickler::Repository::Null.new end def test_null_root_dir_is_class_name assert_equal "Stickler::Repository::Null", repo.root_dir end ...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/test/repository/test_api_behavior.rb
test/repository/test_api_behavior.rb
require 'test_stickler' require 'digest/sha1' require 'repository/test_api' module Stickler module RepositoryApiBehaviorTests include RepositoryApiTests def setup super @foo_gem_local_path = File.join( gems_dir, "foo-1.0.0.gem" ) @baz_gem_local_path = File.join( gems_dir, "baz-3.1.4-java.ge...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/test/repository/test_remote.rb
test/repository/test_remote.rb
require 'test_stickler' require 'stickler_test_server' require 'repository/test_api_behavior' module Stickler class RemoteRepositoryTest < Test include RepositoryApiBehaviorTests attr_reader :repo def setup super @repo_uri = "http://localhost:6789/" @repo = ::Stickler::Repository...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/test/repository/test_index.rb
test/repository/test_index.rb
require 'test_stickler' module Stickler class TestIndexRepository < Test def setup @index_me = File.join( test_dir, "tmp" ) FileUtils.mkdir_p( @index_me ) @specifications = Dir.glob( File.join( specifications_dir, "*.gemspec" ) ) @specifications.each do |s| FileUtils.cp( s, @in...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/test/repository/test_remote_authenticated.rb
test/repository/test_remote_authenticated.rb
require 'test_stickler' require 'stickler_test_server' require 'repository/test_api_behavior' module Stickler class AuthenticatedRemoteRepositoryTest < Test include RepositoryApiBehaviorTests attr_reader :repo def setup super @repo_uri = "http://stickler:secret@localhost:6789/" @repo ...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler.rb
lib/stickler.rb
module Stickler # The Current Version of the library VERSION = "2.4.2" end require 'sinatra/base' require 'stickler/logable' require 'stickler/error' require 'stickler/paths' require 'stickler/spec_lite' require 'stickler/gem_container' require 'stickler/gemfile_lock_parser' require 'stickler/repository' require ...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/repository.rb
lib/stickler/repository.rb
module Stickler module Repository class Error < ::Stickler::Error ; end end end require 'stickler/repository/api' require 'stickler/repository/basic_authenticator' require 'stickler/repository/index' require 'stickler/repository/local' require 'stickler/repository/mirror' require 'stickler/repository/null' req...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/middleware.rb
lib/stickler/middleware.rb
module Stickler module Middleware end end require 'stickler/middleware/helpers' require 'stickler/middleware/compression' require 'stickler/middleware/gemcutter' require 'stickler/middleware/index' require 'stickler/middleware/local' require 'stickler/middleware/mirror' require 'stickler/middleware/not_found' requi...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/gem_container.rb
lib/stickler/gem_container.rb
module Stickler # # Wrap the class that opens the gem file and gives access to all the gem file # internals. The class that implements this in rubygems itself changed, so we # need to be backwards compatible with folks that are using older versions of # rubygems. # class GemContainer attr_reader :path...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/logable.rb
lib/stickler/logable.rb
require 'logging' module Stickler def self.app_name @app_name || "stickler" end def self.app_name=( name ) @app_name = name end class Logging def self.init unless @initialized then layout = ::Logging::Layouts::Pattern.new( :pattern => "%5l %c : %m" ) appender = ::Logging...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/paths.rb
lib/stickler/paths.rb
#-- # Copyright (c) 2010 Jeremy Hinegardner # All rights reserved. See LICENSE and/or COPYING for details. #++ # module Stickler # # Access to various paths inside the project programatically # module Paths # # :call-seq: # Stickler::Paths.root_dir -> String # # Returns The full expanded...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/gemfile_lock_parser.rb
lib/stickler/gemfile_lock_parser.rb
module Stickler class GemfileLockParser attr_reader :gem_dependencies def initialize( path ) p = Pathname.new( path ) raise Stickler::Error, "#{path} does not exist" unless p.exist? raise Stickler::Error, "#{path} is not readable" unless p.readable? parse( p.read ) end def ...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/client.rb
lib/stickler/client.rb
require 'trollop' require 'stickler/client/config_file' module Stickler class Client attr_reader :argv attr_reader :sources def self.config ::Stickler::Client::ConfigFile.new end # Create a new client # # Takes an argv like array as a parameter. def initialize( argv = ARGV ) ...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/server.rb
lib/stickler/server.rb
module Stickler class Server # The directory holding all the repositories attr_reader :stickler_root def initialize( stickler_root ) @stickler_root = File.expand_path( stickler_root ) raise ::Stickler::Error, "Stickler root directory '#{@stickler_root}' must already exist" unless File.direct...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/error.rb
lib/stickler/error.rb
module Stickler class Error < ::StandardError ; end end
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/spec_lite.rb
lib/stickler/spec_lite.rb
require 'rubygems/platform' require 'rubygems/version' module Stickler # # A lightweight version of a gemspec that only responds to name, version, # platform and full_name. Many of the items in the rubygems world # deal with the triplet [ name, verison, platform ] and this class # encapsulates that. # c...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/middleware/local.rb
lib/stickler/middleware/local.rb
require 'stickler/middleware/index' module Stickler::Middleware # # A Sinatra middleware that implements the HTTP portions of a Modern gem server. # It sits on top of a Repository::Local and serves up the gems in it. # # It utilizies a Stickler::Repository::Local, and the :repo_root option # is passed dir...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/middleware/gemcutter.rb
lib/stickler/middleware/gemcutter.rb
require 'stickler/middleware/local' module Stickler::Middleware # # A rack middleware for implementing the gemcutter api # # == Options # # <b>:serve_indexes</b>:: the same as the Index middleware # # <b>:repo_root</b>:: the same as the Local middleware # # The <b>:repo_root</b> option is re...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/middleware/compression.rb
lib/stickler/middleware/compression.rb
module Stickler::Middleware class Compression def initialize( app ) @app = app end def call( env ) status, headers, body = @app.call( env ) return [ status, headers, body ] unless status == 200 headers = ::Rack::Utils::HeaderHash.new( headers ) stream = body if com...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/middleware/index.rb
lib/stickler/middleware/index.rb
module Stickler::Middleware # Index is a Rack middleware that passes all requests through except for the # following urls: # # <b>/specs.#{Gem.marhsal_version}.gz</b>:: The [ name, version, platform ] index # of <b>all<b> the gems in the # ...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/middleware/mirror.rb
lib/stickler/middleware/mirror.rb
module Stickler::Middleware # # A Mirror server keeps gems from one or more upstream gem servers in local # repositories. # # == Options # # <b>:serve_indexes</b>:: the same as the Index middleware # # <b>:repo_root</b>:: The path that is to be the root of the # Rep...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/middleware/not_found.rb
lib/stickler/middleware/not_found.rb
module Stickler::Middleware # # Idea completely taken from rack-contrib, it can function as a middleware # also, and in that case, completely swallows all requests and returns the # 4040 page. # class NotFound def initialize( app = nil ) @body = <<-_ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYP...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/middleware/helpers.rb
lib/stickler/middleware/helpers.rb
module Stickler::Middleware module Helpers # # set what, if any kind of compression to use on the response This is a Gem # server specific type compressions, as it does not set the http headers and # such in the same manner as normal compressed HTTP responses # # compression may be set to one ...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/middleware/server.rb
lib/stickler/middleware/server.rb
require 'pathname' module Stickler::Middleware # Server is the entire stickler stack as a single piece of middleware that # may be used by other libraries that would like to include Stickler in their # application. class Server attr_reader :stickler_root def initialize( app, opts = {} ) @app ...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/repository/local.rb
lib/stickler/repository/local.rb
require 'stickler/repository/index' require 'addressable/uri' require 'tempfile' require 'forwardable' module Stickler::Repository # # A local repository of gems. It implements the Repository::Api # and stores all the gems and specifications local to a root directory. # # It currently has two subdirectories...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/repository/basic_authenticator.rb
lib/stickler/repository/basic_authenticator.rb
require 'addressable/uri' module Stickler::Repository # # Generate the authentication for basic auth request # class BasicAuthenticator def self.handles?( uri ) %w[ http https ].include?( uri.scheme ) and uri.user and uri.password end def initialize( uri ) @user = uri.user @p...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/repository/index.rb
lib/stickler/repository/index.rb
require 'stickler/spec_lite' module Stickler::Repository # # A repository index is a container holding all the SpecLite elements # in the repository. All the gem specs that this index holds are derived # from actual files on the file system. # # It is modelled somewhat like a Gem::SourceIndex. # class...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false
copiousfreetime/stickler
https://github.com/copiousfreetime/stickler/blob/9c9ef5b2287c0be071da0a233e2b262e98c878e5/lib/stickler/repository/mirror.rb
lib/stickler/repository/mirror.rb
require 'stickler/repository/remote' require 'stickler/repository/local' require 'forwardable' module Stickler::Repository # # A Mirror mirrors gems in a Repository::Remote to a Repository::Local # All of the Repository::Api methods are delegated to the Local instance # and a new method #mirror() is added to p...
ruby
MIT
9c9ef5b2287c0be071da0a233e2b262e98c878e5
2026-01-04T17:39:29.193479Z
false