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
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/environment.rb
config/environment.rb
# Load the Rails application. require_relative 'application' # Initialize the Rails application. Rails.application.initialize!
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/puma.rb
config/puma.rb
# This configuration file will be evaluated by Puma. The top-level methods that # are invoked here are part of Puma's configuration DSL. For more information # about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html. # # Puma starts a configurable number of processes (workers) and each process # serve...
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/routes.rb
config/routes.rb
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html Rails.application.routes.draw do # Put this at the top for ~performance~ root 'home#index' devise_for :users, controllers: { confirmations: 'users/confirmations', passwords: 'users/passwords', registr...
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/boot.rb
config/boot.rb
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) require "bundler/setup" # Set up gems listed in the Gemfile. require "bootsnap/setup" # Speed up boot time by caching expensive operations.
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/initializers/inline_svg.rb
config/initializers/inline_svg.rb
InlineSvg.configure do |config| config.asset_finder = InlineSvg::PropshaftAssetFinder config.raise_on_file_not_found = true end
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/initializers/default_url_options.rb
config/initializers/default_url_options.rb
# Define the overall Rails default URL options based on action_mailer's # default URL options, which are set in the environment/*.rb files. # # Surprisingly, I wasn't able to figure out a better way to accomplish this. # This is necessary for the URL generation to work in GraphQL. Rails.application.routes.default_url_o...
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/initializers/content_security_policy.rb
config/initializers/content_security_policy.rb
# Be sure to restart your server when you modify this file. # Define an application-wide content security policy # For further information see the following documentation # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy Rails.application.config.content_security_policy do |policy| ...
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/initializers/filter_parameter_logging.rb
config/initializers/filter_parameter_logging.rb
# Be sure to restart your server when you modify this file. # Configure parameters to be filtered from the log file. Use this to limit dissemination of # sensitive information. See the ActiveSupport::ParameterFilter documentation for supported # notations and behaviors. Rails.application.config.filter_parameters += [ ...
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/initializers/application_controller_renderer.rb
config/initializers/application_controller_renderer.rb
# Be sure to restart your server when you modify this file. # ActiveSupport::Reloader.to_prepare do # ApplicationController.renderer.defaults.merge!( # http_host: 'example.org', # https: false # ) # end
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/initializers/friendly_id.rb
config/initializers/friendly_id.rb
# FriendlyId Global Configuration # # Use this to set up shared configuration options for your entire application. # Any of the configuration options shown here can also be applied to single # models by passing arguments to the `friendly_id` class method or defining # methods in your model. # # To learn more, check out...
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/initializers/devise.rb
config/initializers/devise.rb
# frozen_string_literal: true # Use this hook to configure devise mailer, warden hooks and so forth. # Many of these configuration options can be set straight in your model. Devise.setup do |config| # The secret key used by Devise. Devise uses this key to generate # random tokens. Changing this key will render inv...
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/initializers/faker.rb
config/initializers/faker.rb
if defined?(Faker) # Add custom methods to the Game Faker. module Faker class Game < Faker::Base def self.company fetch('game.company') end def self.engine fetch('game.engine') end def self.series fetch('game.series') end def self.store ...
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/initializers/doorkeeper.rb
config/initializers/doorkeeper.rb
# frozen_string_literal: true # rubocop:disable Naming/InclusiveLanguage Doorkeeper.configure do # Change the ORM that doorkeeper will use (requires ORM extensions installed). # Check the list of supported ORMs here: https://github.com/doorkeeper-gem/doorkeeper#orms orm :active_record # This block will be ca...
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/initializers/invisible_captcha.rb
config/initializers/invisible_captcha.rb
# Configuration for https://github.com/markets/invisible_captcha InvisibleCaptcha.setup do |config| # Disable timestamp checking so the test suite doesn't get caught by it. config.timestamp_enabled = !Rails.env.test? # Custom text for the field, no one will ever see this but it's still fun. config.sentence_for_...
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/initializers/graphql_rails_logger.rb
config/initializers/graphql_rails_logger.rb
# If we're in development mode, configure the GraphQL RailsLogger gem. if Rails.env.development? GraphQL::RailsLogger.configure do |config| config.skip_introspection_query = true # Use a theme that actually works on a light terminal background. config.theme = Rouge::Themes::Github.new end end
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/initializers/paper_trail.rb
config/initializers/paper_trail.rb
PaperTrail.config.enabled = true PaperTrail.config.serializer = PaperTrail::Serializers::JSON
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/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 f...
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/initializers/pg_search.rb
config/initializers/pg_search.rb
# Postgres search configuration options for multisearch. PgSearch.multisearch_options = { using: [:tsearch, :trigram] }
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/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. Inflections # are locale specific, and you may define rules for as many different # locales as you wish. All of these examples are active by default: # ActiveSupport::Inflector.inflections(:en) do |inflec...
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/initializers/kaminari_config.rb
config/initializers/kaminari_config.rb
# frozen_string_literal: true Kaminari.configure do |config| config.default_per_page = 30 config.max_per_page = 100 # config.window = 4 # config.outer_window = 0 # config.left = 0 # config.right = 0 # config.page_method_name = :page # config.param_name = :page # config.params_on_first_page = false en...
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/initializers/active_storage.rb
config/initializers/active_storage.rb
# Only attempt to create variants of PNG and JPEG images, don't try to # generate webp variants. This can be changed in the future if we switch to # vips or update ImageMagick to support webp. # # The default for this value includes various other content types as well, but # we don't use any of them. Rails.application....
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/initializers/cookies_serializer.rb
config/initializers/cookies_serializer.rb
# Be sure to restart your server when you modify this file. # Specify a serializer for the signed and encrypted cookie jars. # Valid options are :json, :marshal, and :hybrid. Rails.application.config.action_dispatch.cookies_serializer = :json
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/initializers/permissions_policy.rb
config/initializers/permissions_policy.rb
# Be sure to restart your server when you modify this file. # Define an application-wide HTTP permissions policy. For further # information see: https://developers.google.com/web/updates/2018/06/feature-policy # Rails.application.config.permissions_policy do |policy| # policy.camera :none # policy.gyroscope ...
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/initializers/factory_bot.rb
config/initializers/factory_bot.rb
if defined?(FactoryBot) # Disable automatic creation of enum traits. FactoryBot.automatically_define_enum_traits = false end
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/initializers/sentry.rb
config/initializers/sentry.rb
Sentry.init do |config| config.dsn = ENV['SENTRY_DSN_RAILS'] # Only run in production. config.enabled_environments = ['production'] config.environment = Rails.env config.release = ENV['GIT_COMMIT_SHA'] config.send_default_pii = true # Enable sending logs to Sentry config.enable_logs = true # Patch Ru...
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/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| /my_noisy_library/.match?(line) } # You can also remove all the silencers if you're trying to debug a ...
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/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
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/environments/test.rb
config/environments/test.rb
require 'active_support/core_ext/integer/time' # 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 suite and is wiped # and recreated between test runs. Don't rely on the data the...
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/environments/development.rb
config/environments/development.rb
# frozen_string_literal: true require "active_support/core_ext/integer/time" # Solution for muting the ActiveStorage logger from: # https://stackoverflow.com/a/57108948/7143763 class ActiveStorageStfuLogFormatter def initialize # Suppress is a set of request uuids. Each listed uuid means no messages from this re...
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
connorshea/vglist
https://github.com/connorshea/vglist/blob/7ff3d360e861a3e224565a7ad941228f5fd462e2/config/environments/production.rb
config/environments/production.rb
require "active_support/core_ext/integer/time" Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.enable_reloading = false # Eager load code on boot. This eager loads most of Rails and # your app...
ruby
MIT
7ff3d360e861a3e224565a7ad941228f5fd462e2
2026-01-04T17:32:52.765079Z
false
planet-argonbot/flash-message-conductor
https://github.com/planet-argonbot/flash-message-conductor/blob/68c835bb0a77740fe647f2c9944a4030b332f33b/lib/flash-message-conductor.rb
lib/flash-message-conductor.rb
require "flash-message-conductor/version" require "flash-message-conductor/railtie"
ruby
MIT
68c835bb0a77740fe647f2c9944a4030b332f33b
2026-01-04T17:33:44.365202Z
false
planet-argonbot/flash-message-conductor
https://github.com/planet-argonbot/flash-message-conductor/blob/68c835bb0a77740fe647f2c9944a4030b332f33b/lib/flash-message-conductor/version.rb
lib/flash-message-conductor/version.rb
module FlashMessageConductor VERSION = "2.2.1" end
ruby
MIT
68c835bb0a77740fe647f2c9944a4030b332f33b
2026-01-04T17:33:44.365202Z
false
planet-argonbot/flash-message-conductor
https://github.com/planet-argonbot/flash-message-conductor/blob/68c835bb0a77740fe647f2c9944a4030b332f33b/lib/flash-message-conductor/view_helpers.rb
lib/flash-message-conductor/view_helpers.rb
module FlashMessageConductor module ViewHelpers def render_flash_message(css_class, message = "") return "" if message.blank? content_tag("p", message.html_safe, :class => "#{css_class}") end def render_flash_messages(div_id = "flash_messages", div_class = "") return unless flash_messag...
ruby
MIT
68c835bb0a77740fe647f2c9944a4030b332f33b
2026-01-04T17:33:44.365202Z
false
planet-argonbot/flash-message-conductor
https://github.com/planet-argonbot/flash-message-conductor/blob/68c835bb0a77740fe647f2c9944a4030b332f33b/lib/flash-message-conductor/controller_helpers.rb
lib/flash-message-conductor/controller_helpers.rb
module FlashMessageConductor FLASH_MESSAGE_TYPES = [ :alert, :error, :notice, :message ] module ControllerHelpers module ClassMethods end FLASH_MESSAGE_TYPES.each do |message_type| define_method("add_#{message_type}") do |message, *options| options = options.first || Hash.new fla...
ruby
MIT
68c835bb0a77740fe647f2c9944a4030b332f33b
2026-01-04T17:33:44.365202Z
false
planet-argonbot/flash-message-conductor
https://github.com/planet-argonbot/flash-message-conductor/blob/68c835bb0a77740fe647f2c9944a4030b332f33b/lib/flash-message-conductor/railtie.rb
lib/flash-message-conductor/railtie.rb
require 'flash-message-conductor/view_helpers' require 'flash-message-conductor/controller_helpers' module FlashMessageConductor class Railtie < Rails::Railtie initializer "flash_message_conductor.view_helpers" do ActionView::Base.send :include, FlashMessageConductor::ViewHelpers end initializer "...
ruby
MIT
68c835bb0a77740fe647f2c9944a4030b332f33b
2026-01-04T17:33:44.365202Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/dump_yaml.rb
dump_yaml.rb
require 'rubygems' require 'snmp' require 'yaml' varbinds = [] SNMP::Manager.open do |snmp| snmp.walk("ifTable") do |vb| varbinds << [vb.name.to_s, vb.value.to_s, vb.value.class.to_s] end end puts varbinds.to_yaml
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/import.rb
import.rb
# use local implementation, not the installed gem (if any) $LOAD_PATH.unshift(File.dirname(__FILE__) + "/lib") require 'snmp/mib' if ARGV.size == 1 mib_path = ARGV[0] else smilint_version = `smilint --version` libsmi_version = smilint_version.split[1] mib_path = "/usr/local/Cellar/libsmi/#{libsmi_version}/sha...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/interop/benchmark.rb
interop/benchmark.rb
require 'snmp' require 'benchmark' include SNMP OID_STRING_LIST = ["1.3.6.1.2.1.2.1.0", "1.3.6.1.2.1.1.1.0", "1.3.6.1.2.1.1.2.0", "1.3.6.1.2.1.4.20.1.255.255.255.255", "1.3.6.1.2.1.11.1.0", "1.3.6.1.2.1.1.3.0"] OID_LIST = OID_STRING_LIST.collect { |s| ObjectId.new(s) } Manager.o...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/interop/inform.rb
interop/inform.rb
# sudo snmptrapd -Lf out.txt # tail -f out.txt require 'snmp' SNMP::Manager.open() do |snmp| snmp.inform(12345, "1.3.6.1") snmp.inform(12345, "1.3.6.1", ["1.3.6.1.2"]) snmp.trap_v2(12345, "1.3.6.1") snmp.trap_v2(12345, "1.3.6.1", ["1.3.6.1.2", "1.3.6.1.3"]) end SNMP::Manager.open(:version => :SNMPv1) do |snm...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/interop/trap.rb
interop/trap.rb
require 'test/unit' require 'snmp' require 'timeout' class TestTrapInterop < Test::Unit::TestCase include SNMP def setup @queue = Queue.new @manager = TrapListener.new(:Host => 'localhost', :Port => 1062) do |manager| manager.on_trap_default do |trap| @queue << trap end end end ...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/interop/client.rb
interop/client.rb
require 'snmp' require 'drb' include SNMP def compare_gets(oid) puts oid system("snmpget -v2c -c public localhost:1061 #{oid}") || fail("snmpget failed") message1 = @server.last_pdu request_id = @server.last_request_id Manager.open(:host => 'localhost', :port => 1061) do |manager| manager.next_request_...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/interop/server.rb
interop/server.rb
require 'snmp' require 'drb' require 'logger' class AgentServer include SNMP def initialize(port=1061, max_packet=8000) @log = Logger.new(STDOUT) @lock = Mutex.new @socket = UDPSocket.open @socket.bind(nil, port) @max_packet = max_packet @last_pdu = nil @last_request_id = nil end ...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/test/test_mib.rb
test/test_mib.rb
# frozen_string_literal: true require 'minitest/autorun' require 'snmp/mib' module SNMP class TestMib < Minitest::Test def setup @mib = MIB.new @mib.load_module("SNMPv2-SMI") @mib.load_module("SNMPv2-MIB") @mib.load_module("IF-MIB") end def test_name_to_oid oid = @mib.oi...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/test/test_varbind.rb
test/test_varbind.rb
# encoding: ascii-8bit # frozen_string_literal: true require 'snmp/varbind' require 'minitest/autorun' class TestVarBind < Minitest::Test include SNMP def test_varbind_encode v = VarBind.new([1,3,6,1], OctetString.new("test")) assert_equal("0\v\006\003+\006\001\004\004test", v.encode) refute_nil(v.a...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/test/test_retry.rb
test/test_retry.rb
# frozen_string_literal: true require 'minitest/autorun' require 'snmp' class TimeoutManager < SNMP::Manager attr_accessor :response_count def initialize(config) super(config) @response_count = 0 @raise_on_send = false @raise_on_get = false end def raise_send_error @raise_on_send = true...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/test/test_walk.rb
test/test_walk.rb
# frozen_string_literal: true require 'snmp' require 'minitest/autorun' require 'yaml' include SNMP ## # Accept get and get-next requests, returning the data from the # provided YAML data file. The file contains a list of OID, value, and # value type. # class YamlDataTransport def self.load_data(yaml_file) va...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/test/test_manager.rb
test/test_manager.rb
# frozen_string_literal: true require 'minitest/autorun' require 'snmp/manager' class EchoTransport def initialize end def close end def send(data, host, port) @data = data end def recv(max_bytes) SNMP::Message.decode(@data).response.encode[0,max_bytes] end end class TestConfig < Minitest:...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/test/test_pdu.rb
test/test_pdu.rb
# encoding: ascii-8bit # frozen_string_literal: true require 'snmp/pdu' require 'minitest/autorun' class TestProtocol < Minitest::Test include SNMP def test_message_decode_v1 message = SNMP::Message.decode("0'\002\001\000\004\006public\240\032\002\002\003\350\002\001\000\002\001\0000\0160\f\006\010+\006\001...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/test/test_ber.rb
test/test_ber.rb
# encoding: ascii-8bit # frozen_string_literal: true require 'minitest/autorun' require 'snmp/varbind' require 'snmp/ber' class ASN1_Test < Minitest::Test include SNMP::BER::Encode include SNMP::BER::Decode def test_decode_tlv_empty tag, value, data = decode_tlv("\001\000") assert_equal(1, tag) as...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/test/test_smi.rb
test/test_smi.rb
# frozen_string_literal: true require 'minitest/autorun' begin require 'smi' class TestSmi < MiniTest::Unit::TestCase include SNMP::SMI def test_load name, oid_hash = load_smi_module('test/mibs/IF-MIB') assert_equal("IF-MIB", name) assert_equal("1.3.6.1.2.1.2.2", oid_hash["ifTable"]) ...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/ext/extconf.rb
ext/extconf.rb
require 'mkmf' have_library 'smi', 'smiInit' have_header 'smi.h' create_makefile 'smi'
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/examples/dump.rb
examples/dump.rb
require 'snmp' include SNMP host = ARGV[0] || 'localhost' manager = Manager.new(:Host => host, :Port => 161) start_oid = ObjectId.new("1.3.6.1.2") next_oid = start_oid while next_oid.subtree_of?(start_oid) response = manager.get_next(next_oid) varbind = response.varbind_list.first break if EndOfMibView == varbi...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/examples/iftable.rb
examples/iftable.rb
require 'snmp' include SNMP host = ARGV[0] || 'localhost' manager = Manager.new(:Host => host, :Port => 161) ifTable = ObjectId.new("1.3.6.1.2.1.2.2") next_oid = ifTable while next_oid.subtree_of?(ifTable) response = manager.get_next(next_oid) varbind = response.varbind_list.first next_oid = varbind.name puts...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/examples/set.rb
examples/set.rb
require 'snmp' include SNMP host = ARGV[0] || 'localhost' manager = Manager.new(:Host => host, :Port => 161) varbind = VarBind.new("1.3.6.1.2.1.1.5.0", OctetString.new("System Name")) manager.set(varbind)
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/examples/link_down.rb
examples/link_down.rb
require 'rubygems' require 'snmp' require 'logger' log = Logger.new($stdout) mib = SNMP::MIB.new mib.load_module("IF-MIB") linkDown_OID = mib.oid("linkDown") # 1 is "up" and 2 is "down" in the MIB ADMIN_UP = 1 ADMIN_DOWN = 2 listener = SNMP::TrapListener.new(:Port => 1062, :Community => 'public') do |listener| lo...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/examples/log_traps.rb
examples/log_traps.rb
require 'snmp' require 'logger' def format_v1_trap(trap) "Trap #{trap.generic_trap} from #{trap.source_ip}" end def format_v2c_trap(trap) "Trap #{trap.trap_oid} from #{trap.source_ip}" end log = Logger.new(STDOUT) m = SNMP::TrapManager.new(:Port => 1062) do |manager| manager.on_trap_v1 do |trap| log.info f...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/examples/get.rb
examples/get.rb
require 'snmp' host = ARGV[0] || 'localhost' manager = SNMP::Manager.new(:Host => host, :Port => 161) response = manager.get(["sysDescr.0", "sysName.0"]) response.each_varbind { |vb| puts vb.to_s }
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/examples/datetime.rb
examples/datetime.rb
require 'snmp' module SNMP class OctetString def to_date_time raise ArgumentError, "not DateAndTime format" if size != 8 and size != 11 year = self[0].ord * 256 + self[1].ord month = self[2].ord day = self[3].ord hour = self[4].ord minutes = self[5].ord seconds = self[6]...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/examples/walk.rb
examples/walk.rb
require 'snmp' host = ARGV[0] || 'localhost' SNMP::Manager.open(:Host => "localhost") do |manager| manager.walk("ifTable") { |vb| puts vb } end SNMP::Manager.open(:Host => host) do |manager| manager.walk(["ifIndex", "ifDescr"]) do |ifIndex, ifDescr| puts "#{ifIndex} #{ifDescr}" end end
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/lib/snmp.rb
lib/snmp.rb
# frozen_string_literal: true # # Copyright (c) 2004-2014 David R. Halliday # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/lib/snmp/pdu.rb
lib/snmp/pdu.rb
# frozen_string_literal: true # # Copyright (c) 2004-2014 David R. Halliday # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/lib/snmp/agent.rb
lib/snmp/agent.rb
# frozen_string_literal: true # # Copyright (c) 2004-2014 David R. Halliday # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/lib/snmp/version.rb
lib/snmp/version.rb
# frozen_string_literal: true module SNMP VERSION = "1.3.3" end
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/lib/snmp/options.rb
lib/snmp/options.rb
# frozen_string_literal: true # # Copyright (c) 2004-2014 David R. Halliday # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/lib/snmp/mib.rb
lib/snmp/mib.rb
# frozen_string_literal: true # # Copyright (c) 2004-2014 David R. Halliday # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/lib/snmp/manager.rb
lib/snmp/manager.rb
# frozen_string_literal: true # # Copyright (c) 2004-2014 David R. Halliday # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/lib/snmp/ber.rb
lib/snmp/ber.rb
# encoding: ascii-8bit # frozen_string_literal: true # # Copyright (c) 2004-2014 David R. Halliday # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without lim...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
ruby-snmp/ruby-snmp
https://github.com/ruby-snmp/ruby-snmp/blob/fb2caef72b90a30228ee25594bdabd9c39bf44cb/lib/snmp/varbind.rb
lib/snmp/varbind.rb
# frozen_string_literal: true # # Copyright (c) 2004-2014 David R. Halliday # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to...
ruby
MIT
fb2caef72b90a30228ee25594bdabd9c39bf44cb
2026-01-04T17:33:44.595837Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/features/support/controlrepo_helper.rb
features/support/controlrepo_helper.rb
class ControlRepo_Helper attr_reader :tmp_folder def initialize( name ) @name = name @tmp_folder = '.cucumber/tmp/' end def root_folder @tmp_folder + @name + '/' end def puppetfile root_folder + "Puppetfile" end def onceover_temp_root_folder root_folder + '.onceover/etc/pup...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/features/support/cache_helper.rb
features/support/cache_helper.rb
require 'pathname' class Cache_Helper def cache_exists? File.directory?(dir + '/.onceover') end def self.digest(path, opts = { exceptions: ['.','..','.onceover'] }) if File.directory?(path) # Get the list of files children = Cache_Helper.get_children(path, opts[:exceptions]) else...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/features/support/env.rb
features/support/env.rb
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/features/support/command_helper.rb
features/support/command_helper.rb
require "open3" class Command_Helper attr_reader(:output, :result) attr_writer(:command, :params, :controlrepo) def initialize @executable = ENV["BUNDLE_GEMFILE"] ? "bundle exec onceover" : "onceover" end def run @output, @result = Open3.capture2e generate_command end def success? return ...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/features/step_definitions/common.rb
features/step_definitions/common.rb
Given(/^onceover executable$/) do @cmd = Command_Helper.new end Given(/^control repo "([^"]*)"$/) do |controlrepo_name| @repo = ControlRepo_Helper.new( controlrepo_name ) @cmd.controlrepo = @repo FileUtils.rm_rf @repo.root_folder FileUtils.mkdir_p @repo.tmp_folder FileUtils.rm_rf "#{@repo.tmp_folder}#{con...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/features/step_definitions/formatter.rb
features/step_definitions/formatter.rb
Given(/^the OnceoverFormatter$/) do require 'rspec' require 'onceover/rspec/formatters' RSpec.configure do |c| # Create onceover settings to be accessed by formatters c.add_setting :onceover_tempdir c.add_setting :onceover_root c.add_setting :onceover_environmentpath c.onceover_tempdir ...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/features/step_definitions/run.rb
features/step_definitions/run.rb
Then(/^the temporary Puppetfile should contain \/(.*)\/$/) do |regex| puppetfile = File.read(@repo.onceover_temp_puppetfile) expect(puppetfile).to match(Regexp.new(regex)) end Then(/^the temporary Puppetfile should contain the git branch/) do git_branch = `git rev-parse --abbrev-ref HEAD`.chomp step %Q(the tem...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/features/step_definitions/init.rb
features/step_definitions/init.rb
Given(/^in Puppetfile is misspelled module's name$/) do @repo.add_line_to_puppetfile %Q(mod "acme/not_exists", "7.7.7") end Then(/^I should see generated all necessary files and folders$/) do files = [ 'spec/onceover.yaml', 'Rakefile', 'Gemfile' ].map { |x| @repo.root_folder + x } folders = [ 'spec/factsets', 's...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/features/step_definitions/cache.rb
features/step_definitions/cache.rb
Then(/^the cache should exist$/) do cache_dir = File.join(@repo.root_folder,'.onceover') expect(File.directory?(cache_dir)).to be true end Then(/^the cache should contain all controlrepo files/) do # Get all root files log("Calculating MD5 hashes in repo") repo_digest = Cache_Helper.digest(@repo.root_folder)...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/spec/spec_helper.rb
spec/spec_helper.rb
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib")) $LOAD_PATH.unshift(File.dirname(__FILE__)) require "rspec" RSpec.configure do |config| config.raise_errors_for_deprecations! end
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/spec/fixtures/controlrepos/function_mocking/site/profile/lib/puppet/functions/profile/fail_ruby.rb
spec/fixtures/controlrepos/function_mocking/site/profile/lib/puppet/functions/profile/fail_ruby.rb
Puppet::Functions.create_function(:'profile::fail_ruby') do dispatch :fail do param 'String', :message end def fail(message) call_function('fail', message) end end
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/spec/fixtures/controlrepos/puppet_controlrepo/scripts/get_changed_classes.rb
spec/fixtures/controlrepos/puppet_controlrepo/scripts/get_changed_classes.rb
#! /bin/env ruby files = `git --no-pager diff --name-only HEAD HEAD~1`.split("\n") classes = [] files.each do |file| # if the changed file is a manifest if file =~ /\.pp$/ segments = file.split('/') # Capitalize the segments so that they work as a reference segments = segments.map { |seg| seg.capitali...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/spec/fixtures/controlrepos/puppet_controlrepo/scripts/count_changed_classes.rb
spec/fixtures/controlrepos/puppet_controlrepo/scripts/count_changed_classes.rb
#! /bin/env ruby files = `git --no-pager diff --name-only HEAD HEAD~1`.split("\n") classes = [] files.each do |file| # if the changed file is a manifest if file =~ /\.pp$/ segments = file.split('/') # Capitalize the segments so that they work as a reference segments = segments.map { |seg| seg.capitali...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/spec/fixtures/controlrepos/puppet_controlrepo/scripts/config_version.rb
spec/fixtures/controlrepos/puppet_controlrepo/scripts/config_version.rb
#!/opt/puppetlabs/puppet/bin/ruby begin require 'rugged' require 'socket' rescue LoadError t = Time.new puts t.to_i else environmentpath = ARGV[0] environment = ARGV[1] # Get the hostname of the Puppet master compiling the catalog. # Sometimes the hostname is the fqdn, so we'll take the first segme...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/spec/fixtures/controlrepos/puppet_controlrepo/scripts/code_manager_config_version.rb
spec/fixtures/controlrepos/puppet_controlrepo/scripts/code_manager_config_version.rb
#!/opt/puppetlabs/puppet/bin/ruby require 'json' require 'socket' environmentpath = ARGV[0] environment = ARGV[1] # Get the hostname of the Puppet master compiling the catalog. # Sometimes the hostname is the fqdn, so we'll take the first segment. compiling_master = Socket.gethostname.split('.').first # Get the ...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/deployments/lib/puppet/functions/deployments/generate.rb
spec/fixtures/controlrepos/puppet_controlrepo/site-modules/deployments/lib/puppet/functions/deployments/generate.rb
Puppet::Functions.create_function(:'deployments::generate') do dispatch :generate do param 'Hash', :data param 'String[1]', :secret end def generate(data, secret) require 'jwt' # Remove quotes to work around CDPE-3903 actual_secret = secret.gsub(/"/, '') JWT.encode(data, actual_secret) ...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/spec/fixtures/controlrepos/puppet_controlrepo/spec/shared_examples/helper.rb
spec/fixtures/controlrepos/puppet_controlrepo/spec/shared_examples/helper.rb
require 'spec_helper' shared_examples_for 'test_linux' do |fact_set| describe "SOE Checks" do it do is_expected.to contain_package('tree').with( 'ensure' => 'latest', ) end it do is_expected.to contain_package('vim').with( 'ensure' => 'latest', ) end ...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/spec/fixtures/controlrepos/puppet_controlrepo/spec/matchers/file_matchers.rb
spec/fixtures/controlrepos/puppet_controlrepo/spec/matchers/file_matchers.rb
RSpec::Matchers.define :satisfy_file_resource_requirements do match do |catalog| @missing_param = catalogue.resources.map do |resource| next if !(resource.type == 'File') if resource[:mode] if resource[:mode] =~ /777|\d.*7$/ "Found use of unsafe file mode for file #{resource}, ...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/spec/fixtures/controlrepos/puppet_controlrepo/spec/unit/00_parse_spec.rb
spec/fixtures/controlrepos/puppet_controlrepo/spec/unit/00_parse_spec.rb
# # This set of tests is for syntax validation, It runs through all of the # Puppet, Ruby and ERB code in the repositories and validates it with it's # relevant validator. # # If we want to change the scope of these tests the following variables can be # modified to change which files are in scope: # - puppet_search_...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/spec/fixtures/controlrepos/puppet_controlrepo/spec/unit/01_linting_spec_example.rb
spec/fixtures/controlrepos/puppet_controlrepo/spec/unit/01_linting_spec_example.rb
# # The following set of tests is designed to enforce style in the Puppet code. # This may be coming from the Puppet style guide as in the puppet-lint tests # or may be arbitrarily defined. Anything that relates to how the # code is written should go in this file # require 'puppet-lint' # Create a single linter object...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/spec/fixtures/controlrepos/puppet_controlrepo/spec/unit/03_puppetfile_spec_example.rb
spec/fixtures/controlrepos/puppet_controlrepo/spec/unit/03_puppetfile_spec_example.rb
# # This set of tests ensures that the Puppetfile has been written correctly # Anything relating to the syntax or content of the Puppetfile should be # in this file # require 'r10k/puppetfile' describe "The Puppetfile" do # Load in the Puppetfile using the r10k gem # This handles all of the parsing for us so that ...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/spec/fixtures/controlrepos/puppet_controlrepo/spec/classes/test_spec.rb
spec/fixtures/controlrepos/puppet_controlrepo/spec/classes/test_spec.rb
require 'spec_helper' describe "role::dbserver" do context "With no facts" do let(:facts) { { } } it { should_not compile } end end
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/spec/onceover/controlrepo_spec.rb
spec/onceover/controlrepo_spec.rb
require 'spec_helper' require 'onceover/controlrepo' describe "Onceover::Controlrepo" do context "in a barebones controlrepo" do before do @repo = Onceover::Controlrepo.new( { path: 'spec/fixtures/controlrepos/minimal' } ) end context "without hiera.yaml" do i...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/lib/onceover/test.rb
lib/onceover/test.rb
class Onceover class Test @@all =[] attr_accessor :nodes attr_accessor :classes attr_accessor :test_config attr_reader :default_test_config attr_reader :tags # This can accept a bunch of stuff. It can accept nodes, classes or groups anywhere # it will then detect them and expand ...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/lib/onceover/controlrepo.rb
lib/onceover/controlrepo.rb
require 'r10k/puppetfile' require 'erb' require 'yaml' require 'find' require 'pathname' require 'multi_json' require 'onceover/beaker' require 'onceover/logger' include Onceover::Logger class Onceover class Controlrepo # This exists for caching. Each time a new one of these objects is created # it gets dump...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/lib/onceover/rake_tasks.rb
lib/onceover/rake_tasks.rb
require 'onceover/controlrepo' require 'pathname' require 'voxpupuli/test/rake' @repo = nil @config = nil desc 'Writes a `fixtures.yml` file based on the Puppetfile' task :generate_fixtures do repo = Onceover::Controlrepo.new if File.exist?(File.expand_path('./.fixtures.yml', repo.root)) raise ".fixtures.ym...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/lib/onceover/group.rb
lib/onceover/group.rb
require 'onceover/class' require 'onceover/node' class Onceover class Group @@all = [] # Work out how to do class variables so that I can keep track of all the groups easily attr_accessor :name attr_accessor :members # You need to pass in an array of strings for members, not objects, it will fi...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/lib/onceover/logger.rb
lib/onceover/logger.rb
require 'logging' module Onceover::Logger def logger unless $logger # here we setup a color scheme called 'bright' Logging.color_scheme( 'bright', :levels => { :debug => :cyan, :info => :green, :warn => :yellow, :error => :red, :fatal ...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/lib/onceover/node.rb
lib/onceover/node.rb
require 'onceover/controlrepo' class Onceover class Node @@all = [] attr_accessor :name attr_accessor :beaker_node attr_accessor :fact_set attr_accessor :trusted_set attr_accessor :trusted_external_set def initialize(name) @name = name @beaker_node = nil # If we can't...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/lib/onceover/beaker.rb
lib/onceover/beaker.rb
# rubocop:disable Style/RescueStandardError # ^^ I canlt be bothered fixing this because all of this code is deprecated class Onceover class Beaker # WARNING: All of this functionality is deprecated. It will be left around # until there is something to replace it, but don't rely on it def self.facts_to_v...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/lib/onceover/testconfig.rb
lib/onceover/testconfig.rb
require 'onceover/class' require 'onceover/node' require 'onceover/group' require 'onceover/test' require 'onceover/logger' require 'onceover/controlrepo' require 'git' include Onceover::Logger class Onceover class TestConfig require 'yaml' attr_accessor :classes attr_accessor :nodes attr_accessor :...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false
voxpupuli/onceover
https://github.com/voxpupuli/onceover/blob/2a9776b3caf6cca8bf5b710cfe783cbd01110707/lib/onceover/class.rb
lib/onceover/class.rb
class Onceover class Class @@all = [] attr_accessor :name def initialize(name) # if the class we are trying to create is a regex, create class objects # for everything that matches. if Onceover::Class.name_is_regexp?(name) expression = Onceover::Class.string_to_regexp(name) ...
ruby
Apache-2.0
2a9776b3caf6cca8bf5b710cfe783cbd01110707
2026-01-04T17:33:43.713297Z
false