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 |
|---|---|---|---|---|---|---|---|---|
prognostikos/cb2 | https://github.com/prognostikos/cb2/blob/338cb29d8154a07128501044175eb90e087a7a00/spec/acceptance_spec.rb | spec/acceptance_spec.rb | require "spec_helper"
describe "Acceptance" do
let(:breaker) do
CB2::Breaker.new(
strategy: :percentage,
duration: 10,
threshold: 9,
reenable_after: 5)
end
def fail!
breaker.run { raise SocketError }
rescue SocketError
end
def pass!
breaker.run { true }
end
it "toggles states" do
t = Time.now
# starting with a fresh closed circuit
Timecop.freeze(t) do
9.times { pass! }
fail!
assert breaker.open?
assert_raises(CB2::BreakerOpen) { fail! }
end
# circuit should now be half-open, make sure it closes on a single success
Timecop.freeze(t += 6) do
pass!
refute breaker.open?
end
# close it again
Timecop.freeze(t) do
9.times { pass! }
fail!
assert breaker.open?
end
# half open again, make sure it opens on a single failure
Timecop.freeze(t += 6) do
fail!
assert breaker.open?
end
end
end
| ruby | MIT | 338cb29d8154a07128501044175eb90e087a7a00 | 2026-01-04T17:47:11.173474Z | false |
prognostikos/cb2 | https://github.com/prognostikos/cb2/blob/338cb29d8154a07128501044175eb90e087a7a00/spec/spec_helper.rb | spec/spec_helper.rb | require "bundler/setup"
Bundler.setup
require "timecop"
require "rr"
require "cb2"
# establish a Redis connection to the default server (localhost:6379)
Redis.new
RSpec.configure do |config|
config.expect_with :minitest
config.include RR::DSL
config.before(:each) do
redis.flushdb
end
def redis
@redis ||= Redis.new
end
end
| ruby | MIT | 338cb29d8154a07128501044175eb90e087a7a00 | 2026-01-04T17:47:11.173474Z | false |
prognostikos/cb2 | https://github.com/prognostikos/cb2/blob/338cb29d8154a07128501044175eb90e087a7a00/spec/strategies/rolling_window_spec.rb | spec/strategies/rolling_window_spec.rb | require "spec_helper"
describe CB2::RollingWindow do
let(:breaker) do
CB2::Breaker.new(
strategy: :rolling_window,
duration: 60,
threshold: 5,
reenable_after: 600)
end
let(:strategy) { breaker.strategy }
describe "#open?" do
it "starts closed" do
refute strategy.open?
end
it "checks in redis" do
redis.set(strategy.key, Time.now.to_i)
assert strategy.open?
end
it "closes again after the specified window" do
redis.set(strategy.key, Time.now.to_i - 601)
refute strategy.open?
end
end
describe "#half_open?" do
it "indicates the circuit was opened, but is ready to enable calls again" do
redis.set(strategy.key, Time.now.to_i - 601)
assert strategy.half_open?
end
it "is not half_open when the circuit is just open (before time reenable_after time)" do
redis.set(strategy.key, Time.now.to_i - 599)
refute strategy.half_open?
end
end
describe "#trip!" do
it "sets a key in redis with the time the circuit was opened" do
t = Time.now
Timecop.freeze(t) { strategy.trip! }
assert_equal t.to_i, redis.get(strategy.key).to_i
end
end
describe "#success" do
it "resets the counter so half open breakers go back to closed" do
redis.set(strategy.key, Time.now.to_i - 601)
strategy.success
assert_nil redis.get(strategy.key)
end
end
describe "#error" do
before { @t = Time.now }
it "opens the circuit when we hit the threshold" do
5.times { strategy.error }
assert strategy.open?
end
it "opens the circuit right away when half open" do
redis.set(strategy.key, Time.now.to_i - 601) # set as half open
strategy.error
assert strategy.open?
end
it "trims the window" do
Timecop.freeze(@t-60) do
4.times { strategy.error }
end
Timecop.freeze do
strategy.error
refute strategy.open?
end
end
end
end
| ruby | MIT | 338cb29d8154a07128501044175eb90e087a7a00 | 2026-01-04T17:47:11.173474Z | false |
prognostikos/cb2 | https://github.com/prognostikos/cb2/blob/338cb29d8154a07128501044175eb90e087a7a00/spec/strategies/stub_spec.rb | spec/strategies/stub_spec.rb | require "spec_helper"
describe CB2::Stub do
describe "default behavior (allow all)" do
before { @breaker = CB2::Breaker.new(strategy: :stub, allow: true) }
it "always leave the breaker closed, allowing all calls" do
refute @breaker.open?
end
end
describe "when disabled" do
before { @breaker = CB2::Breaker.new(strategy: :stub, allow: false) }
it "always leaves the breaker open, denying all calls" do
assert @breaker.open?
end
end
end
| ruby | MIT | 338cb29d8154a07128501044175eb90e087a7a00 | 2026-01-04T17:47:11.173474Z | false |
prognostikos/cb2 | https://github.com/prognostikos/cb2/blob/338cb29d8154a07128501044175eb90e087a7a00/spec/strategies/percentage_spec.rb | spec/strategies/percentage_spec.rb | require "spec_helper"
describe CB2::Percentage do
let(:breaker) do
CB2::Breaker.new(
strategy: :percentage,
duration: 60,
threshold: 10,
reenable_after: 600)
end
let(:strategy) { breaker.strategy }
describe "#error" do
before { @t = Time.now }
it "opens the circuit when we hit the threshold percentage" do
5.times { strategy.count }
strategy.error
assert breaker.open?
end
end
end
| ruby | MIT | 338cb29d8154a07128501044175eb90e087a7a00 | 2026-01-04T17:47:11.173474Z | false |
prognostikos/cb2 | https://github.com/prognostikos/cb2/blob/338cb29d8154a07128501044175eb90e087a7a00/lib/cb2.rb | lib/cb2.rb | require "redis"
require "securerandom"
module CB2
end
require "cb2/breaker"
require "cb2/error"
require "cb2/strategies/rolling_window"
require "cb2/strategies/percentage"
require "cb2/strategies/stub"
| ruby | MIT | 338cb29d8154a07128501044175eb90e087a7a00 | 2026-01-04T17:47:11.173474Z | false |
prognostikos/cb2 | https://github.com/prognostikos/cb2/blob/338cb29d8154a07128501044175eb90e087a7a00/lib/cb2/breaker.rb | lib/cb2/breaker.rb | class CB2::Breaker
attr_accessor :service, :strategy
def initialize(options)
@service = options[:service] || "default"
@strategy = initialize_strategy(options)
end
def run
if open?
raise CB2::BreakerOpen.new("#{service} breaker open")
end
begin
process_count
ret = yield
process_success
rescue => e
process_error
raise e
end
return ret
end
def open?
strategy.open?
rescue Redis::BaseError
false
end
def process_count
strategy.count if strategy.respond_to?(:count)
rescue Redis::BaseError
end
def process_success
strategy.success if strategy.respond_to?(:success)
rescue Redis::BaseError
end
def process_error
strategy.error if strategy.respond_to?(:error)
rescue Redis::BaseError
end
def initialize_strategy(options)
strategy_options = options.dup.merge(service: self.service)
if options[:strategy].respond_to?(:open?)
return options[:strategy].new(strategy_options)
end
case options[:strategy].to_s
when "", "percentage"
CB2::Percentage.new(strategy_options)
when "rolling_window"
CB2::RollingWindow.new(strategy_options)
when "stub"
CB2::Stub.new(strategy_options)
end
end
end
| ruby | MIT | 338cb29d8154a07128501044175eb90e087a7a00 | 2026-01-04T17:47:11.173474Z | false |
prognostikos/cb2 | https://github.com/prognostikos/cb2/blob/338cb29d8154a07128501044175eb90e087a7a00/lib/cb2/error.rb | lib/cb2/error.rb | module CB2
class BreakerOpen < StandardError
end
end
| ruby | MIT | 338cb29d8154a07128501044175eb90e087a7a00 | 2026-01-04T17:47:11.173474Z | false |
prognostikos/cb2 | https://github.com/prognostikos/cb2/blob/338cb29d8154a07128501044175eb90e087a7a00/lib/cb2/strategies/rolling_window.rb | lib/cb2/strategies/rolling_window.rb | class CB2::RollingWindow
attr_accessor :service, :duration, :threshold, :reenable_after, :redis
def initialize(options)
@service = options.fetch(:service)
@duration = options.fetch(:duration)
@threshold = options.fetch(:threshold)
@reenable_after = options.fetch(:reenable_after)
@redis = options[:redis] || Redis.new
end
def open?
@last_open = nil # always fetch the latest value from redis here
last_open && last_open.to_i > (Time.now.to_i - reenable_after)
end
def half_open?
last_open && last_open.to_i < (Time.now.to_i - reenable_after)
end
def last_open
@last_open ||= redis.get(key)
end
def success
if half_open?
reset!
end
end
def error
count = increment_rolling_window(key("error"))
if half_open? || should_open?(count)
trip!
end
end
def reset!
@last_open = nil
redis.del(key)
end
def trip!
@last_open = Time.now.to_i
redis.set(key, @last_open)
end
# generate a key to use in redis
def key(id=nil)
postfix = id ? "-#{id}" : ""
"cb2-#{service}#{postfix}"
end
protected
def increment_rolling_window(key)
t = Time.now.to_i
result = redis.pipelined do |pipeline|
# keep the sorted set clean
pipeline.zremrangebyscore(key, "-inf", t - duration)
# add as a random uuid because sorted sets won't take duplicate items:
pipeline.zadd(key, t, SecureRandom.uuid)
# just count how many errors are left in the set
pipeline.zcard(key)
end
result.last # return the count
end
def should_open?(error_count)
error_count >= threshold
end
end
| ruby | MIT | 338cb29d8154a07128501044175eb90e087a7a00 | 2026-01-04T17:47:11.173474Z | false |
prognostikos/cb2 | https://github.com/prognostikos/cb2/blob/338cb29d8154a07128501044175eb90e087a7a00/lib/cb2/strategies/stub.rb | lib/cb2/strategies/stub.rb | class CB2::Stub
attr_accessor :allow
def initialize(options)
@allow = options.fetch(:allow)
end
def open?
!allow
end
end
| ruby | MIT | 338cb29d8154a07128501044175eb90e087a7a00 | 2026-01-04T17:47:11.173474Z | false |
prognostikos/cb2 | https://github.com/prognostikos/cb2/blob/338cb29d8154a07128501044175eb90e087a7a00/lib/cb2/strategies/percentage.rb | lib/cb2/strategies/percentage.rb | class CB2::Percentage < CB2::RollingWindow
# keep a rolling window of all calls too
def count
@current_count = increment_rolling_window(key("count"))
end
private
def should_open?(error_count)
# do not open until we have a reasonable number of requests
return false if @current_count < 5
error_perc = error_count * 100 / @current_count.to_f
return error_perc >= threshold
end
end
| ruby | MIT | 338cb29d8154a07128501044175eb90e087a7a00 | 2026-01-04T17:47:11.173474Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/test/spreadsheet_on_rails_test.rb | test/spreadsheet_on_rails_test.rb | require 'test_helper'
class SpreadsheetOnRailsTest < ActiveSupport::TestCase
test "xls mime type" do
assert_equal "application/xls", Mime[:xls].to_s
end
test "xls sym should be xls" do
assert_equal :xls, Mime[:xls].to_sym
end
end
| ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/test/test_helper.rb | test/test_helper.rb | # Configure Rails Environment
ENV["RAILS_ENV"] = "test"
require File.expand_path("../dummy/config/environment.rb", __FILE__)
require "rails/test_help"
require 'capybara/rails'
require "shoulda"
Rails.backtrace_cleaner.remove_silencers!
# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
class ActionDispatch::IntegrationTest
# Make the Capybara DSL available in all integration tests
include Capybara::DSL
# # Stop ActiveRecord from wrapping tests in transactions
# self.use_transactional_fixtures = false
teardown do
Capybara.reset_sessions! # Forget the (simulated) browser state
Capybara.use_default_driver # Revert Capybara.current_driver to Capybara.default_driver
end
end
| ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/test/integration/navigation_test.rb | test/integration/navigation_test.rb | require 'test_helper'
class NavigationTest < ActionDispatch::IntegrationTest
context "sending an xls file" do
setup do
visit koala_path
click_link 'XLS'
end
should "set binary header" do
assert_equal 'binary', headers['Content-Transfer-Encoding']
end
should "set correct filename" do
assert_equal 'attachment; filename=koalatastic.xls', headers['Content-Disposition']
end
should "set correct content type" do
assert_equal 'application/xls', headers['Content-Type']
end
end
context 'xls renderer uses the specified template' do
setup do
visit '/another.pdf'
end
should "set binary header" do
assert_equal 'binary', headers['Content-Transfer-Encoding']
end
should "set correct filename" do
assert_equal 'attachment; filename=contents.xls', headers['Content-Disposition']
end
should "set correct content type" do
assert_equal 'application/xls', headers['Content-Type']
end
end
protected
def headers
page.response_headers
end
end
| ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/test/dummy/app/helpers/application_helper.rb | test/dummy/app/helpers/application_helper.rb | module ApplicationHelper
end
| ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/test/dummy/app/controllers/koala_controller.rb | test/dummy/app/controllers/koala_controller.rb | class KoalaController < ApplicationController
def index
respond_to do |format|
format.html
format.xls { render :xls => "koalatastic"}
end
end
def another
render :xls => "contents", :template => "koala/index"
end
end
| ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/test/dummy/app/controllers/application_controller.rb | test/dummy/app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
protect_from_forgery
end
| ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/test/dummy/config/application.rb | test/dummy/config/application.rb | require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require
require "spreadsheet_on_rails"
module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Activate observers that should always be running.
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
# Use SQL instead of Active Record's schema dumper when creating the database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql
# Enforce whitelist mode for mass assignment.
# This will create an empty whitelist of attributes available for mass-assignment for all models
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
# parameters by using an attr_accessible or attr_protected declaration.
# config.active_record.whitelist_attributes = true
# Enable the asset pipeline
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
end
end
| ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/test/dummy/config/environment.rb | test/dummy/config/environment.rb | # Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Dummy::Application.initialize!
| ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/test/dummy/config/routes.rb | test/dummy/config/routes.rb | Dummy::Application.routes.draw do
get "/koala(.:format)", :to => "koala#index", :as => :koala
get "/another(.:format)", :to => "koala#another", :as => :another
end
| ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/test/dummy/config/boot.rb | test/dummy/config/boot.rb | require 'rubygems'
gemfile = File.expand_path('../../../../Gemfile', __FILE__)
if File.exist?(gemfile)
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
end
$:.unshift File.expand_path('../../../../lib', __FILE__) | ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/test/dummy/config/initializers/session_store.rb | test/dummy/config/initializers/session_store.rb | # Be sure to restart your server when you modify this file.
Dummy::Application.config.session_store :cookie_store, key: '_dummy_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 generate session_migration")
# Dummy::Application.config.session_store :active_record_store
| ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/test/dummy/config/initializers/wrap_parameters.rb | test/dummy/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 format: [:json]
end
# Disable root element in JSON by default.
ActiveSupport.on_load(:active_record) do
self.include_root_in_json = false
end
| ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/test/dummy/config/initializers/inflections.rb | test/dummy/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', 'people'
# inflect.uncountable %w( fish sheep )
# end
#
# These inflection rules are supported but not enabled by default:
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.acronym 'RESTful'
# end
| ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/test/dummy/config/initializers/backtrace_silencers.rb | test/dummy/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 problem that might stem from framework code.
# Rails.backtrace_cleaner.remove_silencers!
| ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/test/dummy/config/initializers/mime_types.rb | test/dummy/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
Mime::Type.register "application/xls", :xls
| ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/test/dummy/config/initializers/secret_token.rb | test/dummy/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 attacks.
Dummy::Application.config.secret_token = '22e97e271d9b6709bca4547572ee1bbb7b75ec514616a065f1ee64fabf10dc74063c7e6bd9c786685f217e61011e26adb63d53569c5f57afcc7f484950ac5cfe'
| ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/test/dummy/config/environments/test.rb | test/dummy/config/environments/test.rb | Dummy::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 suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
# Configure static asset server for tests with Cache-Control for performance
config.serve_static_assets = true
config.static_cache_control = "public, max-age=3600"
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Raise exceptions instead of rendering exception templates
config.action_dispatch.show_exceptions = false
# Disable request forgery protection in test environment
config.action_controller.allow_forgery_protection = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
end
| ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/test/dummy/config/environments/development.rb | test/dummy/config/environments/development.rb | Dummy::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 server when you make code changes.
config.cache_classes = false
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
config.active_record.auto_explain_threshold_in_seconds = 0.5
# Do not compress assets
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = true
end
| ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/test/dummy/config/environments/production.rb | test/dummy/config/environments/production.rb | Dummy::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_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
# Compress JavaScripts and CSS
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false
# Generate digests for assets URLs
config.assets.digest = true
# Defaults to Rails.root.join("public/assets")
# config.assets.manifest = YOUR_PATH
# Specifies the header that your server uses for sending files
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
# See everything in the log (default is :info)
# config.log_level = :debug
# Prepend all log lines with the following tags
# config.log_tags = [ :subdomain, :uuid ]
# Use a different logger for distributed setups
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production
# config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
# config.assets.precompile += %w( search.js )
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
# Enable threaded mode
# config.threadsafe!
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
end
| ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/lib/spreadsheet_on_rails.rb | lib/spreadsheet_on_rails.rb | module SpreadsheetOnRails
def self.render_xls_string(spreadsheet)
<<RENDER
workbook = Spreadsheet::Workbook.new
#{spreadsheet}
blob = StringIO.new("")
workbook.write(blob)
blob.string
RENDER
end
end
# Setups the template handling
require "action_view/template"
require 'spreadsheet'
ActionView::Template.register_template_handler :rxls, ->(obj, template) {
SpreadsheetOnRails.render_xls_string(obj.source)
}
# # Why doesn't the aboce template handler catch this one as well?
# # Added for backwards compatibility.
ActionView::Template.register_template_handler :"xls.rxls", ->(obj, template) {
SpreadsheetOnRails.render_xls_string(obj.source)
}
# Adds support for `format.xls`
require "action_controller"
Mime::Type.register "application/xls", :xls
ActionController::Renderers.add :xls do |filename, options|
send_data render_to_string(options),
type: "application/xls",
disposition: "attachment; filename=#{filename}.xls"
end
| ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
atog/spreadsheet_on_rails | https://github.com/atog/spreadsheet_on_rails/blob/74187c02fa23bd2cefa9da27c685ff0965db49b5/lib/spreadsheet_on_rails/version.rb | lib/spreadsheet_on_rails/version.rb | module SpreadsheetOnRails
VERSION = "1.0.1"
end
| ruby | MIT | 74187c02fa23bd2cefa9da27c685ff0965db49b5 | 2026-01-04T17:47:13.296637Z | false |
jdliss/shoulda-callback-matchers | https://github.com/jdliss/shoulda-callback-matchers/blob/b8a3680bc1d19ac713e43054a2b33238ce845698/ext/mkrf_conf.rb | ext/mkrf_conf.rb | rbx = defined?(RUBY_ENGINE) && 'rbx' == RUBY_ENGINE
def already_installed(dep)
!Gem::DependencyInstaller.new(domain: :local).find_gems_with_sources(dep).empty? ||
!Gem::DependencyInstaller.new(domain: :local, prerelease: true).find_gems_with_sources(dep).empty?
end
if rbx
require 'rubygems'
require 'rubygems/command.rb'
require 'rubygems/dependency.rb'
require 'rubygems/dependency_installer.rb'
begin
Gem::Command.build_args = ARGV
rescue NoMethodError
end
dep = [
Gem::Dependency.new("rubysl", '~> 2.0'),
Gem::Dependency.new("rubysl-test-unit", '~> 2.0'),
Gem::Dependency.new("racc", '~> 1.4')
].reject{|d| already_installed(d) }
begin
puts "Installing base gem"
inst = Gem::DependencyInstaller.new
dep.each {|d| inst.install d }
rescue
inst = Gem::DependencyInstaller.new(prerelease: true)
begin
dep.each {|d| inst.install d }
rescue Exception => e
puts e
puts e.backtrace.join "\n "
exit(1)
end
end unless dep.size == 0
end
# create dummy rakefile to indicate success
f = File.open(File.join(File.dirname(__FILE__), "Rakefile"), "w")
f.write("task :default\n")
f.close | ruby | MIT | b8a3680bc1d19ac713e43054a2b33238ce845698 | 2026-01-04T17:47:17.480742Z | false |
jdliss/shoulda-callback-matchers | https://github.com/jdliss/shoulda-callback-matchers/blob/b8a3680bc1d19ac713e43054a2b33238ce845698/spec/spec_helper.rb | spec/spec_helper.rb | require 'logger'
LOGGER = Logger.new STDOUT
TESTAPP_ROOT = Pathname.new File.expand_path('../tmp/aruba/testapp', __FILE__)
FileUtils.rm_rf TESTAPP_ROOT if File.exists? TESTAPP_ROOT
ENV['RAILS_ENV'] = 'test'
ENV['BUNDLE_GEMFILE'] ||= TESTAPP_ROOT.join('Gemfile')
LOGGER.info "Generating Rails app in #{TESTAPP_ROOT}..."
`rails new #{TESTAPP_ROOT}`
LOGGER.info "Done"
require TESTAPP_ROOT.join('config', 'environment')
require 'shoulda-callback-matchers'
require 'rspec/rails'
PROJECT_ROOT = Pathname.new File.expand_path('../..', __FILE__)
$LOAD_PATH << PROJECT_ROOT.join('lib')
Dir[PROJECT_ROOT.join('spec', 'support', '**', '*.rb')].each do |file|
require file
end
# Run the migrations
LOGGER.info "Running the migrations for the testapp..."
ActiveRecord::Migration.verbose = false
ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate")
LOGGER.info "Done"
RSpec.configure do |config|
config.include ClassBuilder
config.include ModelBuilder
if rails_version < '3.2'
config.filter_run_excluding :"rails_3.2" => true
end
# rspec-rails 3 will no longer automatically infer an example group's spec type
# from the file location. You can explicitly opt-in to the feature using this
# config option.
# To explicitly tag specs without using automatic inference, set the `:type`
# metadata manually:
#
# describe ThingsController, :type => :controller do
# # Equivalent to being in spec/controllers
# end
config.infer_spec_type_from_file_location!
end | ruby | MIT | b8a3680bc1d19ac713e43054a2b33238ce845698 | 2026-01-04T17:47:17.480742Z | false |
jdliss/shoulda-callback-matchers | https://github.com/jdliss/shoulda-callback-matchers/blob/b8a3680bc1d19ac713e43054a2b33238ce845698/spec/support/model_builder.rb | spec/support/model_builder.rb | module ModelBuilder
def self.included(example_group)
example_group.class_eval do
before do
@created_tables ||= []
end
after do
drop_created_tables
end
end
end
def create_table(table_name, options = {}, &block)
connection.create_table(table_name, options, &block)
@created_tables << table_name
connection
rescue Exception => e
drop_table(table_name)
raise e
end
def define_model_class(class_name, &block)
define_class(class_name, ActiveRecord::Base, &block)
end
def define_active_model_class(class_name, options = {}, &block)
define_class(class_name) do
include ActiveModel::Validations
extend ActiveModel::Callbacks
define_model_callbacks :initialize, :find, :touch, :only => :after
define_model_callbacks :save, :create, :update, :destroy
options[:accessors].each do |column|
attr_accessor column.to_sym
end
if block_given?
class_eval(&block)
end
end
end
def define_model(name, columns = {}, &block)
class_name = name.to_s.pluralize.classify
table_name = class_name.tableize
create_table(table_name) do |table|
columns.each do |name, type|
table.column name, type
end
end
define_model_class(class_name, &block)
end
def drop_created_tables
@created_tables.each do |table_name|
drop_table(table_name)
end
end
def drop_table table_name
connection.execute("DROP TABLE IF EXISTS #{table_name}")
end
def connection
@connection ||= ActiveRecord::Base.connection
end
end | ruby | MIT | b8a3680bc1d19ac713e43054a2b33238ce845698 | 2026-01-04T17:47:17.480742Z | false |
jdliss/shoulda-callback-matchers | https://github.com/jdliss/shoulda-callback-matchers/blob/b8a3680bc1d19ac713e43054a2b33238ce845698/spec/support/class_builder.rb | spec/support/class_builder.rb | module ClassBuilder
def self.included example_group
example_group.class_eval do
after do
teardown_defined_constants
end
end
end
def define_class class_name, base = Object, &block
Object.const_set class_name, Class.new(base)
Object.const_get(class_name).tap do |constant_class|
constant_class.unloadable
if block_given?
constant_class.class_eval(&block)
end
if constant_class.respond_to?(:reset_column_information)
constant_class.reset_column_information
end
end
end
def teardown_defined_constants
ActiveSupport::Dependencies.clear
end
end | ruby | MIT | b8a3680bc1d19ac713e43054a2b33238ce845698 | 2026-01-04T17:47:17.480742Z | false |
jdliss/shoulda-callback-matchers | https://github.com/jdliss/shoulda-callback-matchers/blob/b8a3680bc1d19ac713e43054a2b33238ce845698/spec/shoulda/active_model/callback_matcher_spec.rb | spec/shoulda/active_model/callback_matcher_spec.rb | require 'spec_helper'
describe Shoulda::Callback::Matchers::ActiveModel do
context "invalid use" do
before do
@callback_object_class = define_model :callback do
define_method("before_create"){}
define_method("after_save"){}
end
callback_object = @callback_object_class.new
@model = define_model(:example, :attr => :string,
:other => :integer) do
before_create :dance!, :if => :evaluates_to_false!
after_save :shake!, :unless => :evaluates_to_true!
after_create :wiggle!
before_create callback_object, :if => :evaluates_to_false!
after_save callback_object, :unless => :evaluates_to_true!
after_create callback_object
define_method(:shake!){}
define_method(:dance!){}
end.new
end
it "should return a meaningful error when used without a defined lifecycle" do
expect { callback(:dance!).matches? :foo }.to raise_error Shoulda::Callback::Matchers::ActiveModel::UsageError,
"callback dance! can not be tested against an undefined lifecycle, use .before, .after or .around"
end
it "should return a meaningful error when used with an optional lifecycle without the original lifecycle being validation" do
expect { callback(:dance!).after(:create).on(:save) }.to raise_error Shoulda::Callback::Matchers::ActiveModel::UsageError,
"The .on option is only valid for validation, commit, and rollback and cannot be used with create, use with .before(:validation) or .after(:validation)"
end
it "should return a meaningful error when used without a defined lifecycle" do
expect { callback(@callback_object_class).matches? :foo }.to raise_error Shoulda::Callback::Matchers::ActiveModel::UsageError,
"callback Callback can not be tested against an undefined lifecycle, use .before, .after or .around"
end
it "should return a meaningful error when used with an optional lifecycle without the original lifecycle being validation" do
expect { callback(@callback_object_class).after(:create).on(:save) }.to raise_error Shoulda::Callback::Matchers::ActiveModel::UsageError,
"The .on option is only valid for validation, commit, and rollback and cannot be used with create, use with .before(:validation) or .after(:validation)"
end
it "should return a meaningful error when used with rollback or commit and before" do
expect { callback(@callback_object_class).before(:commit).on(:destroy) }.to raise_error Shoulda::Callback::Matchers::ActiveModel::UsageError,
"Can not callback before or around commit, use after."
end
end
[:save, :create, :update, :destroy].each do |lifecycle|
context "on #{lifecycle}" do
before do
@callback_object_class = define_model(:callback) do
define_method("before_#{lifecycle}"){}
define_method("after_#{lifecycle}"){}
define_method("around_#{lifecycle}"){}
end
callback_object = @callback_object_class.new
@other_callback_object_class = define_model(:other_callback) do
define_method("after_#{lifecycle}"){}
define_method("around_#{lifecycle}"){}
end
other_callback_object = @other_callback_object_class.new
@callback_object_not_found_class = define_model(:callback_not_found) do
define_method("before_#{lifecycle}"){}
define_method("after_#{lifecycle}"){}
define_method("around_#{lifecycle}"){}
end
@model = define_model(:example, :attr => :string,
:other => :integer) do
send(:"before_#{lifecycle}", :dance!, :if => :evaluates_to_false!)
send(:"after_#{lifecycle}", :shake!, :unless => :evaluates_to_true!)
send(:"around_#{lifecycle}", :giggle!)
send(:"before_#{lifecycle}", :wiggle!)
send(:"before_#{lifecycle}", callback_object, :if => :evaluates_to_false!)
send(:"after_#{lifecycle}", callback_object, :unless => :evaluates_to_true!)
send(:"around_#{lifecycle}", callback_object)
send(:"before_#{lifecycle}", other_callback_object)
define_method(:shake!){}
define_method(:dance!){}
define_method(:giggle!){}
end.new
end
context "as a simple callback test" do
it "should find the callback before the fact" do
expect(@model).to callback(:dance!).before(lifecycle)
end
it "should find the callback after the fact" do
expect(@model).to callback(:shake!).after(lifecycle)
end
it "should find the callback around the fact" do
expect(@model).to callback(:giggle!).around(lifecycle)
end
it "should not find callbacks that are not there" do
expect(@model).not_to callback(:scream!).around(lifecycle)
end
it "should not find callback_objects around the fact" do
expect(@model).not_to callback(:shake!).around(lifecycle)
end
it "should have a meaningful description" do
matcher = callback(:dance!).before(lifecycle)
expect(matcher.description).to eq("callback dance! before #{lifecycle}")
end
it "should find the callback_object before the fact" do
expect(@model).to callback(@callback_object_class).before(lifecycle)
end
it "should find the callback_object after the fact" do
expect(@model).to callback(@callback_object_class).after(lifecycle)
end
it "should find the callback_object around the fact" do
expect(@model).to callback(@callback_object_class).around(lifecycle)
end
it "should not find callbacks that are not there" do
expect(@model).not_to callback(@callback_object_not_found_class).around(lifecycle)
end
it "should not find callback_objects around the fact" do
expect(@model).not_to callback(@callback_object_not_found_class).around(lifecycle)
end
it "should have a meaningful description" do
matcher = callback(@callback_object_class).before(lifecycle)
expect(matcher.description).to eq("callback Callback before #{lifecycle}")
end
it "should have a meaningful error if it fails with an inexistent method on a model" do
matcher = callback(:wiggle!).before(lifecycle)
expect(matcher.matches?(@model)).to eq(false)
expect(matcher.failure_message).to eq("callback wiggle! is listed as a callback before #{lifecycle}, but the model does not respond to wiggle! (using respond_to?(:wiggle!, true)")
end
it "should have a meaningful error if it fails with an inexistent method on a callback class" do
matcher = callback(@other_callback_object_class).before(lifecycle)
expect(matcher.matches?(@model)).to eq(false)
expect(matcher.failure_message).to eq("callback OtherCallback is listed as a callback before #{lifecycle}, but the given object does not respond to before_#{lifecycle} (using respond_to?(:before_#{lifecycle}, true)")
end
end
context "with conditions" do
it "should match the if condition" do
expect(@model).to callback(:dance!).before(lifecycle).if(:evaluates_to_false!)
end
it "should match the unless condition" do
expect(@model).to callback(:shake!).after(lifecycle).unless(:evaluates_to_true!)
end
it "should not find callbacks not matching the conditions" do
expect(@model).not_to callback(:giggle!).around(lifecycle).unless(:evaluates_to_false!)
end
it "should not find callbacks that are not there entirely" do
expect(@model).not_to callback(:scream!).before(lifecycle).unless(:evaluates_to_false!)
end
it "should have a meaningful description" do
matcher = callback(:dance!).after(lifecycle).unless(:evaluates_to_false!)
expect(matcher.description).to eq("callback dance! after #{lifecycle} unless evaluates_to_false! evaluates to false")
end
it "should match the if condition" do
expect(@model).to callback(@callback_object_class).before(lifecycle).if(:evaluates_to_false!)
end
it "should match the unless condition" do
expect(@model).to callback(@callback_object_class).after(lifecycle).unless(:evaluates_to_true!)
end
it "should not find callbacks not matching the conditions" do
expect(@model).not_to callback(@callback_object_class).around(lifecycle).unless(:evaluates_to_false!)
end
it "should not find callbacks that are not there entirely" do
expect(@model).not_to callback(@callback_object_not_found_class).before(lifecycle).unless(:evaluates_to_false!)
end
it "should have a meaningful description" do
matcher = callback(@callback_object_class).after(lifecycle).unless(:evaluates_to_false!)
expect(matcher.description).to eq("callback Callback after #{lifecycle} unless evaluates_to_false! evaluates to false")
end
end
end
end
context "on validation" do
before do
@callback_object_class = define_model(:callback) do
define_method("before_validation"){}
define_method("after_validation"){}
end
@callback_object_class2 = define_model(:callback2) do
define_method("before_validation"){}
define_method("after_validation"){}
end
callback_object = @callback_object_class.new
callback_object2 = @callback_object_class2.new
@callback_object_not_found_class = define_model(:callback_not_found) do
define_method("before_validation"){}
define_method("after_validation"){}
end
@model = define_model(:example, :attr => :string,
:other => :integer) do
before_validation :dance!, :if => :evaluates_to_false!
after_validation :shake!, :unless => :evaluates_to_true!
before_validation :dress!, :on => :create
after_validation :shriek!, :on => :update, :unless => :evaluates_to_true!
after_validation :pucker!, :on => :save, :if => :evaluates_to_false!
before_validation callback_object, :if => :evaluates_to_false!
after_validation callback_object, :unless => :evaluates_to_true!
before_validation callback_object, :on => :create
after_validation callback_object, :on => :update, :unless => :evaluates_to_true!
after_validation callback_object2, :on => :save, :if => :evaluates_to_false!
define_method(:dance!){}
define_method(:shake!){}
define_method(:dress!){}
define_method(:shriek!){}
define_method(:pucker!){}
end.new
end
context "as a simple callback test" do
it "should find the callback before the fact" do
expect(@model).to callback(:dance!).before(:validation)
end
it "should find the callback after the fact" do
expect(@model).to callback(:shake!).after(:validation)
end
it "should not find a callback around the fact" do
expect(@model).not_to callback(:giggle!).around(:validation)
end
it "should not find callbacks that are not there" do
expect(@model).not_to callback(:scream!).around(:validation)
end
it "should have a meaningful description" do
matcher = callback(:dance!).before(:validation)
expect(matcher.description).to eq("callback dance! before validation")
end
it "should find the callback before the fact" do
expect(@model).to callback(@callback_object_class).before(:validation)
end
it "should find the callback after the fact" do
expect(@model).to callback(@callback_object_class).after(:validation)
end
it "should not find a callback around the fact" do
expect(@model).not_to callback(@callback_object_class).around(:validation)
end
it "should not find callbacks that are not there" do
expect(@model).not_to callback(@callback_object_not_found_class).around(:validation)
end
it "should have a meaningful description" do
matcher = callback(@callback_object_class).before(:validation)
expect(matcher.description).to eq("callback Callback before validation")
end
end
context "with additinal lifecycles defined" do
it "should find the callback before the fact on create" do
expect(@model).to callback(:dress!).before(:validation).on(:create)
end
it "should find the callback after the fact on update" do
expect(@model).to callback(:shriek!).after(:validation).on(:update)
end
it "should find the callback after the fact on save" do
expect(@model).to callback(:pucker!).after(:validation).on(:save)
end
it "should not find a callback for pucker! after the fact on update" do
expect(@model).not_to callback(:pucker!).after(:validation).on(:update)
end
it "should have a meaningful description" do
matcher = callback(:dance!).after(:validation).on(:update)
expect(matcher.description).to eq("callback dance! after validation on update")
end
it "should find the callback before the fact on create" do
expect(@model).to callback(@callback_object_class).before(:validation).on(:create)
end
it "should find the callback after the fact on update" do
expect(@model).to callback(@callback_object_class).after(:validation).on(:update)
end
it "should find the callback after the fact on save" do
expect(@model).to callback(@callback_object_class2).after(:validation).on(:save)
end
it "should not find a callback for Callback after the fact on update" do
expect(@model).not_to callback(@callback_object_class2).after(:validation).on(:update)
end
it "should have a meaningful description" do
matcher = callback(@callback_object_class).after(:validation).on(:update)
expect(matcher.description).to eq("callback Callback after validation on update")
end
end
context "with conditions" do
it "should match the if condition" do
expect(@model).to callback(:dance!).before(:validation).if(:evaluates_to_false!)
end
it "should match the unless condition" do
expect(@model).to callback(:shake!).after(:validation).unless(:evaluates_to_true!)
end
it "should not find callbacks not matching the conditions" do
expect(@model).not_to callback(:giggle!).around(:validation).unless(:evaluates_to_false!)
end
it "should not find callbacks that are not there entirely" do
expect(@model).not_to callback(:scream!).before(:validation).unless(:evaluates_to_false!)
end
it "should have a meaningful description" do
matcher = callback(:dance!).after(:validation).unless(:evaluates_to_false!)
expect(matcher.description).to eq("callback dance! after validation unless evaluates_to_false! evaluates to false")
end
it "should match the if condition" do
expect(@model).to callback(@callback_object_class).before(:validation).if(:evaluates_to_false!)
end
it "should match the unless condition" do
expect(@model).to callback(@callback_object_class).after(:validation).unless(:evaluates_to_true!)
end
it "should not find callbacks not matching the conditions" do
expect(@model).not_to callback(@callback_object_class).around(:validation).unless(:evaluates_to_false!)
end
it "should not find callbacks that are not there entirely" do
expect(@model).not_to callback(@callback_object_not_found_class).before(:validation).unless(:evaluates_to_false!)
end
it "should have a meaningful description" do
matcher = callback(@callback_object_class).after(:validation).unless(:evaluates_to_false!)
expect(matcher.description).to eq("callback Callback after validation unless evaluates_to_false! evaluates to false")
end
end
context "with conditions and additional lifecycles" do
it "should find the callback before the fact on create" do
expect(@model).to callback(:dress!).before(:validation).on(:create)
end
it "should find the callback after the fact on update with the unless condition" do
expect(@model).to callback(:shriek!).after(:validation).on(:update).unless(:evaluates_to_true!)
end
it "should find the callback after the fact on save with the if condition" do
expect(@model).to callback(:pucker!).after(:validation).on(:save).if(:evaluates_to_false!)
end
it "should not find a callback for pucker! after the fact on save with the wrong condition" do
expect(@model).not_to callback(:pucker!).after(:validation).on(:save).unless(:evaluates_to_false!)
end
it "should have a meaningful description" do
matcher = callback(:dance!).after(:validation).on(:save).unless(:evaluates_to_false!)
expect(matcher.description).to eq("callback dance! after validation on save unless evaluates_to_false! evaluates to false")
end
it "should find the callback before the fact on create" do
expect(@model).to callback(@callback_object_class).before(:validation).on(:create)
end
it "should find the callback after the fact on update with the unless condition" do
expect(@model).to callback(@callback_object_class).after(:validation).on(:update).unless(:evaluates_to_true!)
end
it "should find the callback after the fact on save with the if condition" do
expect(@model).to callback(@callback_object_class2).after(:validation).on(:save).if(:evaluates_to_false!)
end
it "should not find a callback for Callback after the fact on save with the wrong condition" do
expect(@model).not_to callback(@callback_object_class).after(:validation).on(:save).unless(:evaluates_to_false!)
end
it "should have a meaningful description" do
matcher = callback(@callback_object_class).after(:validation).on(:save).unless(:evaluates_to_false!)
expect(matcher.description).to eq("callback Callback after validation on save unless evaluates_to_false! evaluates to false")
end
end
end
[:rollback, :commit].each do |lifecycle|
context "on #{lifecycle}" do
before do
@callback_object_class = define_model(:callback) do
define_method("after_#{lifecycle}"){}
end
@callback_object_class2 = define_model(:callback2) do
define_method("after_#{lifecycle}"){}
end
callback_object = @callback_object_class.new
callback_object2 = @callback_object_class2.new
@callback_object_not_found_class = define_model(:callback_not_found) do
define_method("after_#{lifecycle}"){}
end
@model = define_model(:example, :attr => :string,
:other => :integer) do
send :"after_#{lifecycle}", :dance!, :if => :evaluates_to_false!
send :"after_#{lifecycle}", :shake!, :unless => :evaluates_to_true!
send :"after_#{lifecycle}", :dress!, :on => :create
send :"after_#{lifecycle}", :shriek!, :on => :update, :unless => :evaluates_to_true!
send :"after_#{lifecycle}", :pucker!, :on => :destroy, :if => :evaluates_to_false!
if rails_version >= '3.2'
send :"after_#{lifecycle}", :jump!, :on => [:create, :update]
send :"after_#{lifecycle}", :holler!, :on => [:update, :destroy]
end
send :"after_#{lifecycle}", callback_object, :if => :evaluates_to_false!
send :"after_#{lifecycle}", callback_object, :unless => :evaluates_to_true!
send :"after_#{lifecycle}", callback_object, :on => :create
send :"after_#{lifecycle}", callback_object, :on => :update, :unless => :evaluates_to_true!
send :"after_#{lifecycle}", callback_object2, :on => :destroy, :if => :evaluates_to_false!
if rails_version >= '3.2'
send :"after_#{lifecycle}", callback_object, :on => [:create, :update]
send :"after_#{lifecycle}", callback_object, :on => [:update, :destroy]
end
define_method(:dance!){}
define_method(:shake!){}
define_method(:dress!){}
define_method(:shriek!){}
define_method(:pucker!){}
define_method(:jump!){}
define_method(:holler!){}
end.new
end
context "as a simple callback test" do
it "should find the callback after the fact" do
expect(@model).to callback(:shake!).after(lifecycle)
end
it "should not find callbacks that are not there" do
expect(@model).not_to callback(:scream!).after(lifecycle)
end
it "should have a meaningful description" do
matcher = callback(:dance!).after(lifecycle)
expect(matcher.description).to eq("callback dance! after #{lifecycle}")
end
it "should find the callback after the fact" do
expect(@model).to callback(@callback_object_class).after(lifecycle)
end
it "should not find callbacks that are not there" do
expect(@model).not_to callback(@callback_object_not_found_class).after(lifecycle)
end
it "should have a meaningful description" do
matcher = callback(@callback_object_class).after(lifecycle)
expect(matcher.description).to eq("callback Callback after #{lifecycle}")
end
end
context "with additinal lifecycles defined" do
it "should find the callback after the fact on create" do
expect(@model).to callback(:dress!).after(lifecycle).on(:create)
end
it "should find the callback after the fact on update" do
expect(@model).to callback(:shriek!).after(lifecycle).on(:update)
end
it "should find the callback after the fact on save" do
expect(@model).to callback(:pucker!).after(lifecycle).on(:destroy)
end
it "should not find a callback for pucker! after the fact on update" do
expect(@model).not_to callback(:pucker!).after(lifecycle).on(:update)
end
it "should have a meaningful description" do
matcher = callback(:dance!).after(lifecycle).on(:update)
expect(matcher.description).to eq("callback dance! after #{lifecycle} on update")
end
it "should find the callback before the fact on create" do
expect(@model).to callback(@callback_object_class).after(lifecycle).on(:create)
end
it "should find the callback after the fact on update" do
expect(@model).to callback(@callback_object_class).after(lifecycle).on(:update)
end
it "should find the callback after the fact on save" do
expect(@model).to callback(@callback_object_class2).after(lifecycle).on(:destroy)
end
it "should not find a callback for Callback after the fact on update" do
expect(@model).not_to callback(@callback_object_class2).after(lifecycle).on(:update)
end
it "should have a meaningful description" do
matcher = callback(@callback_object_class).after(lifecycle).on(:update)
expect(matcher.description).to eq("callback Callback after #{lifecycle} on update")
end
end
context "with multiple lifecycles defined", :"rails_3.2" => true do
it "should find the callback after the fact on create and update" do
expect(@model).to callback(:jump!).after(lifecycle).on([:create, :update])
end
it "should find the callback after the fact on update and destroy" do
expect(@model).to callback(:holler!).after(lifecycle).on([:update, :destroy])
end
it "should find the callback after the fact on create and update" do
expect(@model).to callback(@callback_object_class).after(lifecycle).on([:create, :update])
end
it "should find the callback after the fact on update and destroy" do
expect(@model).to callback(@callback_object_class).after(lifecycle).on([:update, :destroy])
end
end
context "with conditions" do
it "should match the if condition" do
expect(@model).to callback(:dance!).after(lifecycle).if(:evaluates_to_false!)
end
it "should match the unless condition" do
expect(@model).to callback(:shake!).after(lifecycle).unless(:evaluates_to_true!)
end
it "should not find callbacks not matching the conditions" do
expect(@model).not_to callback(:giggle!).after(lifecycle).unless(:evaluates_to_false!)
end
it "should not find callbacks that are not there entirely" do
expect(@model).not_to callback(:scream!).after(lifecycle).unless(:evaluates_to_false!)
end
it "should have a meaningful description" do
matcher = callback(:dance!).after(lifecycle).unless(:evaluates_to_false!)
expect(matcher.description).to eq("callback dance! after #{lifecycle} unless evaluates_to_false! evaluates to false")
end
it "should match the if condition" do
expect(@model).to callback(@callback_object_class).after(lifecycle).if(:evaluates_to_false!)
end
it "should match the unless condition" do
expect(@model).to callback(@callback_object_class).after(lifecycle).unless(:evaluates_to_true!)
end
it "should not find callbacks not matching the conditions" do
expect(@model).not_to callback(@callback_object_class).after(lifecycle).unless(:evaluates_to_false!)
end
it "should not find callbacks that are not there entirely" do
expect(@model).not_to callback(@callback_object_not_found_class).after(lifecycle).unless(:evaluates_to_false!)
end
it "should have a meaningful description" do
matcher = callback(@callback_object_class).after(lifecycle).unless(:evaluates_to_false!)
expect(matcher.description).to eq("callback Callback after #{lifecycle} unless evaluates_to_false! evaluates to false")
end
end
context "with conditions and additional lifecycles" do
it "should find the callback before the fact on create" do
expect(@model).to callback(:dress!).after(lifecycle).on(:create)
end
it "should find the callback after the fact on update with the unless condition" do
expect(@model).to callback(:shriek!).after(lifecycle).on(:update).unless(:evaluates_to_true!)
end
it "should find the callback after the fact on save with the if condition" do
expect(@model).to callback(:pucker!).after(lifecycle).on(:destroy).if(:evaluates_to_false!)
end
it "should not find a callback for pucker! after the fact on save with the wrong condition" do
expect(@model).not_to callback(:pucker!).after(lifecycle).on(:destroy).unless(:evaluates_to_false!)
end
it "should have a meaningful description" do
matcher = callback(:dance!).after(lifecycle).on(:save).unless(:evaluates_to_false!)
expect(matcher.description).to eq("callback dance! after #{lifecycle} on save unless evaluates_to_false! evaluates to false")
end
it "should find the callback before the fact on create" do
expect(@model).to callback(@callback_object_class).after(lifecycle).on(:create)
end
it "should find the callback after the fact on update with the unless condition" do
expect(@model).to callback(@callback_object_class).after(lifecycle).on(:update).unless(:evaluates_to_true!)
end
it "should find the callback after the fact on save with the if condition" do
expect(@model).to callback(@callback_object_class2).after(lifecycle).on(:destroy).if(:evaluates_to_false!)
end
it "should not find a callback for Callback after the fact on save with the wrong condition" do
expect(@model).not_to callback(@callback_object_class).after(lifecycle).on(:destroy).unless(:evaluates_to_false!)
end
it "should have a meaningful description" do
matcher = callback(@callback_object_class).after(lifecycle).on(:destroy).unless(:evaluates_to_false!)
expect(matcher.description).to eq("callback Callback after #{lifecycle} on destroy unless evaluates_to_false! evaluates to false")
end
end
end
end
[:initialize, :find, :touch].each do |lifecycle|
context "on #{lifecycle}" do
before do
@callback_object_class = define_model(:callback) do
define_method("after_#{lifecycle}"){}
end
@callback_object_class2 = define_model(:callback2) do
define_method("after_#{lifecycle}"){}
end
callback_object = @callback_object_class.new
callback_object2 = @callback_object_class2.new
@callback_object_not_found_class = define_model(:callback_not_found) do
define_method("after_#{lifecycle}"){}
end
@model = define_model(:example, :attr => :string,
:other => :integer) do
send(:"after_#{lifecycle}", :dance!, :if => :evaluates_to_false!)
send(:"after_#{lifecycle}", :shake!, :unless => :evaluates_to_true!)
send(:"after_#{lifecycle}", callback_object, :if => :evaluates_to_false!)
send(:"after_#{lifecycle}", callback_object2, :unless => :evaluates_to_true!)
define_method(:shake!){}
define_method(:dance!){}
define_method :evaluates_to_false! do
false
end
define_method :evaluates_to_true! do
true
end
end.new
end
context "as a simple callback test" do
it "should not find a callback before the fact" do
expect(@model).not_to callback(:dance!).before(lifecycle)
end
it "should find the callback after the fact" do
expect(@model).to callback(:shake!).after(lifecycle)
end
it "should not find a callback around the fact" do
expect(@model).not_to callback(:giggle!).around(lifecycle)
end
it "should not find callbacks that are not there" do
expect(@model).not_to callback(:scream!).around(lifecycle)
end
it "should have a meaningful description" do
matcher = callback(:dance!).before(lifecycle)
expect(matcher.description).to eq("callback dance! before #{lifecycle}")
end
it "should not find a callback before the fact" do
expect(@model).not_to callback(@callback_object_class).before(lifecycle)
end
it "should find the callback after the fact" do
expect(@model).to callback(@callback_object_class).after(lifecycle)
end
it "should not find a callback around the fact" do
expect(@model).not_to callback(@callback_object_class).around(lifecycle)
end
it "should not find callbacks that are not there" do
expect(@model).not_to callback(@callback_object_not_found_class).around(lifecycle)
end
it "should have a meaningful description" do
matcher = callback(@callback_object_class).before(lifecycle)
expect(matcher.description).to eq("callback Callback before #{lifecycle}")
end
end
context "with conditions" do
it "should match the if condition" do
expect(@model).to callback(:dance!).after(lifecycle).if(:evaluates_to_false!)
end
it "should match the unless condition" do
expect(@model).to callback(:shake!).after(lifecycle).unless(:evaluates_to_true!)
end
it "should not find callbacks not matching the conditions" do
expect(@model).not_to callback(:giggle!).around(lifecycle).unless(:evaluates_to_false!)
end
it "should not find callbacks that are not there entirely" do
expect(@model).not_to callback(:scream!).before(lifecycle).unless(:evaluates_to_false!)
end
it "should have a meaningful description" do
matcher = callback(:dance!).after(lifecycle).unless(:evaluates_to_false!)
expect(matcher.description).to eq("callback dance! after #{lifecycle} unless evaluates_to_false! evaluates to false")
end
| ruby | MIT | b8a3680bc1d19ac713e43054a2b33238ce845698 | 2026-01-04T17:47:17.480742Z | true |
jdliss/shoulda-callback-matchers | https://github.com/jdliss/shoulda-callback-matchers/blob/b8a3680bc1d19ac713e43054a2b33238ce845698/lib/shoulda-callback-matchers.rb | lib/shoulda-callback-matchers.rb | require_relative 'shoulda/callback/matchers'
| ruby | MIT | b8a3680bc1d19ac713e43054a2b33238ce845698 | 2026-01-04T17:47:17.480742Z | false |
jdliss/shoulda-callback-matchers | https://github.com/jdliss/shoulda-callback-matchers/blob/b8a3680bc1d19ac713e43054a2b33238ce845698/lib/shoulda/callback/matchers.rb | lib/shoulda/callback/matchers.rb | require_relative 'matchers/version'
require_relative 'matchers/rails_version_helper'
if defined?(RSpec)
require_relative 'matchers/integrations/rspec'
end
require_relative 'matchers/integrations/test_unit'
| ruby | MIT | b8a3680bc1d19ac713e43054a2b33238ce845698 | 2026-01-04T17:47:17.480742Z | false |
jdliss/shoulda-callback-matchers | https://github.com/jdliss/shoulda-callback-matchers/blob/b8a3680bc1d19ac713e43054a2b33238ce845698/lib/shoulda/callback/matchers/version.rb | lib/shoulda/callback/matchers/version.rb | module Shoulda
module Callback
module Matchers
VERSION = '1.1.4'.freeze
end
end
end
| ruby | MIT | b8a3680bc1d19ac713e43054a2b33238ce845698 | 2026-01-04T17:47:17.480742Z | false |
jdliss/shoulda-callback-matchers | https://github.com/jdliss/shoulda-callback-matchers/blob/b8a3680bc1d19ac713e43054a2b33238ce845698/lib/shoulda/callback/matchers/active_model.rb | lib/shoulda/callback/matchers/active_model.rb | require 'ostruct'
module Shoulda # :nodoc:
module Callback # :nodoc:
module Matchers # :nodoc:
module ActiveModel # :nodoc:
# Ensures that the given model has a callback defined for the given method
#
# Options:
# * <tt>before(:lifecycle)</tt>. <tt>Symbol</tt>. - define the callback as a callback before the fact. :lifecycle can be :save, :create, :update, :destroy, :validation
# * <tt>after(:lifecycle)</tt>. <tt>Symbol</tt>. - define the callback as a callback after the fact. :lifecycle can be :save, :create, :update, :destroy, :validation, :initialize, :find, :touch
# * <tt>around(:lifecycle)</tt>. <tt>Symbol</tt>. - define the callback as a callback around the fact. :lifecycle can be :save, :create, :update, :destroy
# <tt>if(:condition)</tt>. <tt>Symbol</tt>. - add a positive condition to the callback to be matched against
# <tt>unless(:condition)</tt>. <tt>Symbol</tt>. - add a negative condition to the callback to be matched against
#
# Examples:
# it { should callback(:method).after(:create) }
# it { should callback(:method).before(:validation).unless(:should_it_not?) }
# it { should callback(CallbackClass).before(:validation).unless(:should_it_not?) }
#
def callback method
CallbackMatcher.new method
end
class CallbackMatcher # :nodoc:
VALID_OPTIONAL_LIFECYCLES = [:validation, :commit, :rollback].freeze
include RailsVersionHelper
def initialize method
@method = method
end
# @todo replace with %i() as soon as 1.9 is deprecated
[:before, :after, :around].each do |hook|
define_method hook do |lifecycle|
@hook = hook
@lifecycle = lifecycle
check_for_undefined_callbacks!
self
end
end
[:if, :unless].each do |condition_type|
define_method condition_type do |condition|
@condition_type = condition_type
@condition = condition
self
end
end
def on optional_lifecycle
check_for_valid_optional_lifecycles!
@optional_lifecycle = optional_lifecycle
self
end
def matches? subject
check_preconditions!
callbacks = subject.send :"_#{@lifecycle}_callbacks"
callbacks.any? do |callback|
has_callback?(subject, callback) &&
matches_hook?(callback) &&
matches_conditions?(callback) &&
matches_optional_lifecycle?(callback) &&
callback_method_exists?(subject, callback)
end
end
def callback_method_exists? object, callback
if is_class_callback?(object, callback) && !callback_object(object, callback).respond_to?(:"#{@hook}_#{@lifecycle}", true)
@failure_message = "callback #{@method} is listed as a callback #{@hook} #{@lifecycle}#{optional_lifecycle_phrase}#{condition_phrase}, but the given object does not respond to #{@hook}_#{@lifecycle} (using respond_to?(:#{@hook}_#{@lifecycle}, true)"
false
elsif !is_class_callback?(object, callback) && !object.respond_to?(callback.filter, true)
@failure_message = "callback #{@method} is listed as a callback #{@hook} #{@lifecycle}#{optional_lifecycle_phrase}#{condition_phrase}, but the model does not respond to #{@method} (using respond_to?(:#{@method}, true)"
false
else
true
end
end
def failure_message
@failure_message || "expected #{@method} to be listed as a callback #{@hook} #{@lifecycle}#{optional_lifecycle_phrase}#{condition_phrase}, but was not"
end
def failure_message_when_negated
@failure_message || "expected #{@method} not to be listed as a callback #{@hook} #{@lifecycle}#{optional_lifecycle_phrase}#{condition_phrase}, but was"
end
def negative_failure_message
failure_message_when_negated
end
def description
"callback #{@method} #{@hook} #{@lifecycle}#{optional_lifecycle_phrase}#{condition_phrase}"
end
private
def check_preconditions!
check_lifecycle_present!
end
def check_lifecycle_present!
unless @lifecycle
raise UsageError, "callback #{@method} can not be tested against an undefined lifecycle, use .before, .after or .around", caller
end
end
def check_for_undefined_callbacks!
if [:rollback, :commit].include?(@lifecycle) && @hook != :after
raise UsageError, "Can not callback before or around #{@lifecycle}, use after.", caller
end
end
def check_for_valid_optional_lifecycles!
unless VALID_OPTIONAL_LIFECYCLES.include?(@lifecycle)
raise UsageError, "The .on option is only valid for #{VALID_OPTIONAL_LIFECYCLES.to_sentence} and cannot be used with #{@lifecycle}, use with .before(:validation) or .after(:validation)", caller
end
end
def precondition_failed?
@failure_message.present?
end
def matches_hook? callback
callback.kind == @hook
end
def has_callback? subject, callback
has_callback_object?(subject, callback) || has_callback_method?(callback) || has_callback_class?(callback)
end
def has_callback_method? callback
callback.filter == @method
end
def has_callback_class? callback
class_callback_required? && callback.filter.is_a?(@method)
end
def has_callback_object? subject, callback
callback.filter.respond_to?(:match) &&
callback.filter.match(/\A_callback/) &&
subject.respond_to?(:"#{callback.filter}_object") &&
callback_object(subject, callback).class == @method
end
def matches_conditions? callback
if rails_version >= '4.1'
!@condition || callback.instance_variable_get(:"@#{@condition_type}").include?(@condition)
else
!@condition || callback.options[@condition_type].include?(@condition)
end
end
def matches_optional_lifecycle? callback
if rails_version >= '4.1'
if_conditions = callback.instance_variable_get(:@if)
!@optional_lifecycle || if_conditions.include?(lifecycle_context_string) || active_model_proc_matches_optional_lifecycle?(if_conditions)
else
!@optional_lifecycle || callback.options[:if].include?(lifecycle_context_string)
end
end
def condition_phrase
" #{@condition_type} #{@condition} evaluates to #{@condition_type == :if ? 'true' : 'false'}" if @condition
end
def optional_lifecycle_phrase
" on #{@optional_lifecycle}" if @optional_lifecycle
end
def lifecycle_context_string
if rails_version >= '4.0'
rails_4_lifecycle_context_string
else
rails_3_lifecycle_context_string
end
end
def rails_3_lifecycle_context_string
if @lifecycle == :validation
"self.validation_context == :#{@optional_lifecycle}"
else
"transaction_include_action?(:#{@optional_lifecycle})"
end
end
def rails_4_lifecycle_context_string
if @lifecycle == :validation
"[:#{@optional_lifecycle}].include? self.validation_context"
elsif @optional_lifecycle.kind_of?(Array)
"transaction_include_any_action?(#{@optional_lifecycle})"
else
"transaction_include_any_action?([:#{@optional_lifecycle}])"
end
end
def active_model_proc_matches_optional_lifecycle? if_conditions
if_conditions.select{|i| i.is_a? Proc }.any? do |condition|
condition.call ValidationContext.new(@optional_lifecycle)
end
end
def class_callback_required?
!@method.is_a?(Symbol) && !@method.is_a?(String)
end
def is_class_callback? subject, callback
!callback_object(subject, callback).is_a?(Symbol) && !callback_object(subject, callback).is_a?(String)
end
def callback_object subject, callback
if (rails_version >= '3.0' && rails_version < '4.1') && !callback.filter.is_a?(Symbol)
subject.send("#{callback.filter}_object")
else
callback.filter
end
end
end
ValidationContext = Struct.new :validation_context
UsageError = Class.new NameError
end
end
end
end
| ruby | MIT | b8a3680bc1d19ac713e43054a2b33238ce845698 | 2026-01-04T17:47:17.480742Z | false |
jdliss/shoulda-callback-matchers | https://github.com/jdliss/shoulda-callback-matchers/blob/b8a3680bc1d19ac713e43054a2b33238ce845698/lib/shoulda/callback/matchers/rails_version_helper.rb | lib/shoulda/callback/matchers/rails_version_helper.rb | # :enddoc:
module Shoulda
module Callback
module Matchers
module RailsVersionHelper
class RailsVersion
%w(< <= > >= ==).each do |operand|
define_method operand do |version_string|
version_int = convert_str_to_int(version_string)
rails_version_int.send(operand, version_int)
end
end
private
def rails_version_int
calculate_version_int(rails_major_version, rails_minor_version)
end
def convert_str_to_int(version_string)
major, minor = version_string.split('.').map(&:to_i)
calculate_version_int(major, minor)
end
def calculate_version_int(major, minor)
major * 100 + minor
end
def rails_major_version
version_module::MAJOR
end
def rails_minor_version
version_module::MINOR
end
def version_module
(defined?(::ActiveRecord) ? ::ActiveRecord : ::ActiveModel)::VERSION
end
end
def rails_version
@rails_version ||= RailsVersion.new
end
end
end
end
end
| ruby | MIT | b8a3680bc1d19ac713e43054a2b33238ce845698 | 2026-01-04T17:47:17.480742Z | false |
jdliss/shoulda-callback-matchers | https://github.com/jdliss/shoulda-callback-matchers/blob/b8a3680bc1d19ac713e43054a2b33238ce845698/lib/shoulda/callback/matchers/integrations/test_unit.rb | lib/shoulda/callback/matchers/integrations/test_unit.rb | # :enddoc:
include Shoulda::Callback::Matchers::RailsVersionHelper
# in environments where test/unit is not required, this is necessary
unless defined?(Test::Unit::TestCase)
begin
require rails_version >= '4.1' ? 'minitest' : 'test/unit/testcase'
rescue LoadError
# silent
end
end
if defined?(Test::Unit::TestCase) && (defined?(::ActiveModel) || defined?(::ActiveRecord))
require 'shoulda/callback/matchers/active_model'
Test::Unit::TestCase.tap do |test_unit|
test_unit.send :include, Shoulda::Callback::Matchers::ActiveModel
test_unit.send :extend, Shoulda::Callback::Matchers::ActiveModel
end
elsif defined?(MiniTest::Unit::TestCase) && (defined?(::ActiveModel) || defined?(::ActiveRecord))
require 'shoulda/callback/matchers/active_model'
MiniTest::Unit::TestCase.tap do |minitest_unit|
minitest_unit.send :include, Shoulda::Callback::Matchers::ActiveModel
minitest_unit.send :extend, Shoulda::Callback::Matchers::ActiveModel
end
end
| ruby | MIT | b8a3680bc1d19ac713e43054a2b33238ce845698 | 2026-01-04T17:47:17.480742Z | false |
jdliss/shoulda-callback-matchers | https://github.com/jdliss/shoulda-callback-matchers/blob/b8a3680bc1d19ac713e43054a2b33238ce845698/lib/shoulda/callback/matchers/integrations/rspec.rb | lib/shoulda/callback/matchers/integrations/rspec.rb | # :enddoc:
if defined?(::ActiveRecord)
require 'shoulda/callback/matchers/active_model'
module RSpec::Matchers
include Shoulda::Callback::Matchers::ActiveModel
end
elsif defined?(::ActiveModel)
require 'shoulda/callback/matchers/active_model'
module RSpec::Matchers
include Shoulda::Callback::Matchers::ActiveModel
end
end | ruby | MIT | b8a3680bc1d19ac713e43054a2b33238ce845698 | 2026-01-04T17:47:17.480742Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/scripts/internal_sources.rb | scripts/internal_sources.rb | #!/usr/bin/env ruby
require "net/http"
require "openssl"
require "tmpdir"
require "yaml"
ARTIFACTORY_REPO_URL = ENV["ARTIFACTORY_REPO_URL"]
ARTIFACTORY_PASSWORD = ENV["ARTIFACTORY_TOKEN"]
def print_usage
puts "Must provide path to internal_sources.yml file."
puts "Usage: ./internal_sources.rb <file path> [only]"
puts ""
puts " <file path>: Path to an internal_sources.yml file."
puts " [only]: (Optional) Name of software to upload. Skips all others."
end
def validate_checksum!(response, source)
if source.key?("sha256")
response.header["x-checksum-sha256"] == source["sha256"]
elsif source.key?("md5")
response.header["x-checksum-md5"] == source["md5"]
elsif source.key?("sha1")
response.header["x-checksum-sha1"] == source["sha1"]
else
raise "Unknown checksum format supplied for '#{source["url"]}'"
end
end
def exists_in_artifactory?(name, source)
uri = URI(ARTIFACTORY_REPO_URL)
file_name = File.basename(source["url"])
dir_name = name
path = File.join(uri.path, dir_name, file_name)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
response = http.head(path)
validate_checksum!(response, source)
end
def maybe_upload(name, source)
unless exists_in_artifactory?(name, source)
Dir.mktmpdir do |dir|
puts "Downloading #{name} from #{source["url"]}"
raise "Failed to download" unless system("wget -q -P #{dir} #{source["url"]}")
file_name = File.basename(source["url"])
downloaded_file = File.join(dir, file_name)
repo_url = File.join(ARTIFACTORY_REPO_URL, name, file_name)
puts "Uploading #{downloaded_file} to #{repo_url}"
raise "Failed to upload" unless system("curl -s -H 'X-JFrog-Art-Api:#{ARTIFACTORY_PASSWORD}' -T '#{downloaded_file}' #{repo_url}")
puts ""
end
else
puts "#{File.basename(source["url"])} exists in artifactory already...skipping"
end
end
if ARGV.size < 1 || ARGV.size > 2
print_usage
exit(1)
end
file_path = ARGV[0]
only = ARGV[1]
unless File.exist?(file_path)
abort("File '#{file_path}' does not exist")
end
yaml = YAML.load_file file_path
yaml["software"].each do |software|
next if only && software["name"] != only
name = software["name"]
software["sources"].each { |source| maybe_upload(name, source) }
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/test/generate_steps.rb | test/generate_steps.rb | #!/usr/bin/env ruby
require "open3"
# Get the branch to compare against (rename default to 'main' once migration occurs)
BRANCH = ENV["BUILDKITE_PULL_REQUEST_BASE_BRANCH"] || "main"
# Read in all the versions that are specified by SOFTWARE
def version(version = nil)
$versions << version
end
def default_version(version = nil)
$versions << version
end
# Get a list of all the config/software definitions that have been added or modified
_, status = Open3.capture2e("git config --global --add safe.directory /workdir")
exit 1 if status != 0
_, status = Open3.capture2e("git fetch origin #{BRANCH}")
exit 1 if status != 0
stdout, status = Open3.capture2("git diff --name-status origin/#{BRANCH}...HEAD config/software | awk 'match($1, \"A\"){print $2; next} match($1, \"M\"){print $2}'")
exit 1 if status != 0
files = stdout.lines.compact.uniq.map(&:chomp)
exit 0 if files.empty?
puts "steps:"
files.each do |file|
software = File.basename(file, ".rb")
$versions = []
File.readlines(file).each do |line|
# match if line starts with "default_version" or "version"
if line.match(/^\s*(default_)?version/)
# remove the beginning of any ruby block if it exists
line.sub!(/\s*(do|{).*/, "")
# rubocop:disable Security/Eval
eval(line)
end
end
# Skip health check when it is not relevant
health_check_skip_list = %w{ cacerts xproto util-macros }
deprecated_skip_list = %w{ git-windows cmake ruby-msys2-devkit }
$versions.compact.uniq.each do |version|
next if deprecated_skip_list.include?(software)
skip_health_check = ""
if health_check_skip_list.include?(software)
skip_health_check = "-e SKIP_HEALTH_CHECK=1"
end
puts <<~EOH
- label: "test-build (#{software} #{version})"
key: "test-build-#{software.gsub(/[^a-zA-Z0-9_-]/, "-")}-#{version.gsub(/[^a-zA-Z0-9_-]/, "-")}"
command: docker-compose run --rm -e SOFTWARE=#{software} -e VERSION=#{version} #{skip_health_check} -e CI builder
timeout_in_minutes: 30
expeditor:
executor:
linux:
privileged: true
EOH
# Add OpenSSL validation steps
if software == "openssl" && Gem::Version.new(version) >= Gem::Version.new("3.0.9")
puts <<~EOH
- label: "validate-openssl-executable (#{software} #{version})"
key: "validate-openssl-executable-#{software.gsub(/[^a-zA-Z0-9_-]/, "-")}-#{version.gsub(/[^a-zA-Z0-9_-]/, "-")}"
command: docker-compose run --rm -e SOFTWARE=#{software} -e VERSION=#{version} -e CI builder /omnibus-software/test/validation/build_and_validate_openssl_executable.sh
timeout_in_minutes: 40
expeditor:
executor:
linux:
privileged: true
- label: "validate-openssl-ruby-integration (#{software} #{version})"
key: "validate-openssl-ruby-integration-#{software.gsub(/[^a-zA-Z0-9_-]/, "-")}-#{version.gsub(/[^a-zA-Z0-9_-]/, "-")}"
command: docker-compose run --rm -e SOFTWARE=#{software} -e VERSION=#{version} -e CI builder /omnibus-software/test/validation/build_and_validate_openssl_ruby.sh
timeout_in_minutes: 40
expeditor:
executor:
linux:
privileged: true
- label: "validate-openssl-providers-config (#{software} #{version})"
key: "validate-openssl-providers-config-#{software.gsub(/[^a-zA-Z0-9_-]/, "-")}-#{version.gsub(/[^a-zA-Z0-9_-]/, "-")}"
command: docker-compose run --rm -e SOFTWARE=#{software} -e VERSION=#{version} -e CI builder /omnibus-software/test/validation/build_and_validate_openssl_providers.sh
timeout_in_minutes: 40
expeditor:
executor:
linux:
privileged: true
EOH
end
end
end | ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/test/omnibus.rb | test/omnibus.rb | #
# This file is used to configure the harmony project. It contains
# some minimal configuration examples for working with Omnibus. For a full list
# of configurable options, please see the documentation for +omnibus/config.rb+.
#
# Build internally
# ------------------------------
# By default, Omnibus uses system folders (like +/var+ and +/opt+) to build and
# cache components. If you would to build everything internally, you can
# uncomment the following options. This will prevent the need for root
# permissions in most cases. You will also need to update the harmony
# project configuration to build at +./local/omnibus/build+ instead of
# +/opt/harmony+
#
# Uncomment this line to change the default base directory to "local"
# -------------------------------------------------------------------
# base_dir './local'
#
# Alternatively you can tune the individual values
# ------------------------------------------------
# cache_dir './local/omnibus/cache'
# git_cache_dir './local/omnibus/cache/git_cache'
# source_dir './local/omnibus/src'
# build_dir './local/omnibus/build'
# package_dir './local/omnibus/pkg'
# package_tmp './local/omnibus/pkg-tmp'
# Windows architecture defaults - set to x86 unless otherwise specified.
# ------------------------------
env_omnibus_windows_arch = (ENV["OMNIBUS_WINDOWS_ARCH"] || "").downcase
env_omnibus_windows_arch = :x64 unless %w{x86 x64}.include?(env_omnibus_windows_arch)
windows_arch env_omnibus_windows_arch
# Disable git caching
# ------------------------------
use_git_caching false
# Enable S3 asset caching
# ------------------------------
use_s3_caching false
# Customize compiler bits
# ------------------------------
# solaris_compiler 'gcc'
# Do not retry builds
# ------------------------------
build_retries 0
if ENV["SKIP_HEALTH_CHECK"]
health_check false
end
fips_mode ENV["OMNIBUS_FIPS_MODE"] if ENV["OMNIBUS_FIPS_MODE"]
# Load additional software
# ------------------------------
# software_gems ['omnibus-software', 'my-company-software']
# local_software_dirs ['/path/to/local/software']
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/test/validation/validate_openssl_ruby.rb | test/validation/validate_openssl_ruby.rb | #!/opt/test/embedded/bin/ruby
# Check if the omnibus Ruby is installed (this should exist after build)
# The test project installs to /opt/test
omnibus_ruby = "/opt/test/embedded/bin/ruby"
unless File.exist?(omnibus_ruby)
puts "ERROR: Omnibus Ruby not found at #{omnibus_ruby}"
puts "Build may not have completed successfully or Ruby installation failed"
puts "Checking alternative locations..."
begin
paths = Dir.glob("/opt/*/embedded/bin/ruby")
if paths.any?
puts "Found Ruby installations at: #{paths.join(", ")}"
else
puts "No omnibus Ruby installations found in /opt"
end
rescue => e
puts "Error searching for Ruby: #{e.message}"
end
exit 1
end
# Use the omnibus Ruby to run the actual tests
exec(omnibus_ruby, "-e", <<~RUBY_CODE)
# Check if OpenSSL library exists
unless File.exist?("/opt/test/embedded/lib") && Dir.glob("/opt/test/embedded/lib/*ssl*").any?
puts "ERROR: OpenSSL libraries not found in /opt/test/embedded/lib"
puts "Build may not have completed successfully or OpenSSL installation failed"
exit 1
end
require "openssl"
# Get expected version from environment variable
expected_version = ENV['VERSION']
errors = []
puts "--- Ruby OpenSSL Library Version ---"
puts "OpenSSL::OPENSSL_LIBRARY_VERSION: \#{OpenSSL::OPENSSL_LIBRARY_VERSION}"
if expected_version && !OpenSSL::OPENSSL_LIBRARY_VERSION.include?(expected_version)
errors << "OpenSSL library version mismatch: expected to contain \#{expected_version}, got \#{OpenSSL::OPENSSL_LIBRARY_VERSION}"
end
puts "OpenSSL::OPENSSL_VERSION: \#{OpenSSL::OPENSSL_VERSION}"
puts "--- Testing FIPS mode capability ---"
begin
if OpenSSL.respond_to?(:fips_mode)
puts "FIPS mode available: \#{OpenSSL.fips_mode}"
puts "Attempting to enable FIPS mode..."
# Try to enable FIPS mode (may fail if FIPS provider not configured)
begin
OpenSSL.fips_mode = true
puts "FIPS mode enabled successfully: \#{OpenSSL.fips_mode}"
OpenSSL.fips_mode = false
puts "FIPS mode disabled successfully: \#{OpenSSL.fips_mode}"
rescue => e
puts "FIPS mode activation failed (expected if FIPS provider not configured): \#{e.message}"
end
else
puts "FIPS mode methods not available (OpenSSL < 3.0 or Ruby OpenSSL gem limitation)"
errors << "FIPS mode methods not available (OpenSSL < 3.0 or Ruby OpenSSL gem limitation)"
end
rescue => e
puts "Error testing FIPS mode: \#{e.message}"
errors << "Error testing FIPS mode: \#{e.message}"
end
puts "--- Testing basic cryptographic operations ---"
begin
# Test basic encryption/decryption
cipher = OpenSSL::Cipher.new("AES-256-CBC")
cipher.encrypt
key = cipher.random_key
iv = cipher.random_iv
encrypted = cipher.update("test data") + cipher.final
#{" "}
cipher.decrypt
cipher.key = key
cipher.iv = iv
decrypted = cipher.update(encrypted) + cipher.final
#{" "}
if decrypted == "test data"
puts "Basic AES-256-CBC encryption/decryption: PASS"
else
puts "Basic AES-256-CBC encryption/decryption: FAIL"
errors << "Basic AES-256-CBC encryption/decryption: FAIL"
end
rescue => e
puts "Cryptographic operation failed: \#{e.message}"
errors << "Cryptographic operation failed: \#{e.message}"
end
unless errors.empty?
puts "Errors encountered during OpenSSL validation:"
errors.each { |error| puts "- \#{error}" }
exit 1
end
puts "All OpenSSL Ruby integration tests passed!"
RUBY_CODE
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/test/config/projects/test.rb | test/config/projects/test.rb | name "test"
maintainer "Chef Software, Inc."
homepage "https://www.chef.io"
install_dir "#{default_root}/#{name}"
build_version Omnibus::BuildVersion.semver
build_iteration 1
dependency ENV["SOFTWARE"]
if ENV["VERSION"]
override ENV["SOFTWARE"].to_sym, version: ENV["VERSION"]
end | ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/lib/omnibus-software.rb | lib/omnibus-software.rb | #
# Copyright 2012-2014 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
require "pathname" unless defined?(Pathname)
require "omnibus"
require "highline"
module OmnibusSoftware
class << self
#
# The root where Omnibus Software lives.
#
# @return [Pathname]
#
def root
@root ||= Pathname.new(File.expand_path("..", __dir__))
end
#
# Verify the given software definitions, iterating over each software and
# loading it. This is probably the most primitive test ever - just load the
# DSL files - but it is the best thing we have for CI in omnibus-software.
#
# @return [void]
#
def verify!
for_each_software do |_software|
$stdout.print "."
end
end
def fetch(name, path)
fetch_software(load_software(name), path)
end
def fetch_all(path)
for_each_software do |software|
# only fetch net_fetcher sources for now
next if software.source.nil? || software.source[:url].nil?
fetch_software(software, path)
end
end
def fetch_software(software, path)
Omnibus::Config.cache_dir File.expand_path(path)
Omnibus::Config.use_s3_caching false
Omnibus.logger.level = :debug
puts "Fetching #{software.name}"
software.fetcher.fetch
end
def list
Omnibus.logger.level = :fatal
h = HighLine.new
for_output = ["Name", "Default Version", "Source"]
for_each_software do |software|
for_output += [software.name, software.default_version, maybe_source(software.source)]
end
puts h.list(for_output, :uneven_columns_across, 3)
end
private
def maybe_source(source)
if source
if source[:git]
"GIT #{source[:git]}"
elsif source[:url]
"NET #{source[:url]}"
else
"OTHER"
end
else
"NONE"
end
end
def fake_project
@fake_project ||= Omnibus::Project.new.evaluate do
name "project.sample"
install_dir "tmp/project.sample"
end
end
def software_dir
OmnibusSoftware.root.join("config/software")
end
def load_software(software_name)
Omnibus::Config.local_software_dirs(OmnibusSoftware.root)
Omnibus::Software.load(fake_project, software_name, nil)
end
def for_each_software
Dir.glob("#{software_dir}/*.rb").each do |filepath|
name = File.basename(filepath, ".rb")
yield load_software(name)
end
end
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/lib/omnibus-software/version.rb | lib/omnibus-software/version.rb | module OmnibusSoftware
VERSION = File.read(File.join(__dir__, "../../VERSION")).strip.freeze
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/automake.rb | config/software/automake.rb | #
# Copyright 2012-2014 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: deprecated 2021-04
name "automake"
default_version "1.16"
dependency "autoconf"
dependency "perl-thread-queue"
license "GPL-2.0"
license_file "COPYING"
skip_transitive_dependency_licensing true
version("1.16") { source sha256: "80da43bb5665596ee389e6d8b64b4f122ea4b92a685b1dbd813cd1f0e0c2d83f" }
version("1.15") { source sha256: "7946e945a96e28152ba5a6beb0625ca715c6e32ac55f2e353ef54def0c8ed924" }
version("1.11.2") { source sha256: "c339e3871d6595620760725da61de02cf1c293af8a05b14592d6587ac39ce546" }
source url: "https://ftp.gnu.org/gnu/automake/automake-#{version}.tar.gz"
relative_path "automake-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
if version == "1.15"
command "./bootstrap.sh", env: env
else
command "./bootstrap", env: env
end
command "./configure" \
" --prefix=#{install_dir}/embedded", env: env
make "-j #{workers}", env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/patchelf.rb | config/software/patchelf.rb | #
# Copyright 2019-2020 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This software definition installs project called 'patchelf' which can be
# used to change rpath of a precompiled binary.
name "patchelf"
default_version "0.13.1" # version greater than 0.13.1 require C++17 compiler to build
license :project_license
skip_transitive_dependency_licensing true
# version_list: url=https://github.com/NixOS/patchelf/releases filter=*.tar.gz
version "0.15.0" do
source sha256: "53a8d58ed4e060412b8fdcb6489562b3c62be6f65cee5af30eba60f4423bfa0f"
relative_path "patchelf-#{version}"
end
version "0.14.5" do
source sha256: "113ada3f1ace08f0a7224aa8500f1fa6b08320d8f7df05ff58585286ec5faa6f"
relative_path "patchelf-#{version}"
end
version "0.13.1" do
source sha256: "08c0237e89be74d61ddf8f6ff218439cdd62af572d568fb38913b53e222831de"
relative_path "patchelf-0.13.1.20211127.72b6d44"
end
version "0.11" do
source sha256: "e52378cc2f9379c6e84a04ac100a3589145533a7b0cd26ef23c79dfd8a9038f9"
relative_path "patchelf-0.11.20200609.d6b2a72"
end
version "0.10" do
source sha256: "b2deabce05c34ce98558c0efb965f209de592197b2c88e930298d740ead09019"
relative_path "patchelf-0.10"
end
if version.satisfies?(">= 0.12")
source url: "https://github.com/NixOS/patchelf/releases/download/#{version}/patchelf-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
else
source url: "https://nixos.org/releases/patchelf/patchelf-#{version}/patchelf-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
build do
env = with_standard_compiler_flags(with_embedded_path)
configure "--prefix #{install_dir}/embedded"
make env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/erlang.rb | config/software/erlang.rb | #
# Copyright:: Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "erlang"
default_version "26.2.5.14"
license "Apache-2.0"
license_file "LICENSE.txt"
skip_transitive_dependency_licensing true
dependency "zlib"
dependency "openssl"
dependency "ncurses"
dependency "config_guess"
# grab from github so we can get patch releases if we need to
source url: "https://github.com/erlang/otp/archive/OTP-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/OTP-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "otp-OTP-#{version}"
# versions_list: https://github.com/erlang/otp/tags filter=*.tar.gz
# to get the SHA256, download the tar.gz, then calculate the SHA256 on it
version("26.2.5.14") { source sha256: "5378dc60382c3d43ecdc0e8666c5db0f8a1df1525fff706779f720ad1d54c56c" }
version("26.2.5.2") { source sha256: "8e537e2d984770796cc7f0c7c079a9e5fbc67b8c368e0dcd9aa2ceaeb2844da2" }
version("25.2") { source sha256: "d33a988f39e534aff67799c5b9635612858459c9d8890772546d71ea38de897a" }
version("25.0.4") { source sha256: "05878cb51a64b33c86836b12a21903075c300409b609ad5e941ddb0feb8c2120" }
version("25.0.2") { source sha256: "f78764c6fd504f7b264c47e469c0fcb86a01c92344dc9d625dfd42f6c3ed8224" }
version("25.0") { source sha256: "5988e3bca208486494446e885ca2149fe487ee115cbc3770535fd22a795af5d2" }
version("24.3.4.7") { source sha256: "80c08cf1c181a124dd805bb1d91ff5c1996bd8a27b3f4d008b1ababf48d9947e" }
version("24.3.4") { source sha256: "e59bedbb871af52244ca5284fd0a572d52128abd4decf4347fe2aef047b65c58" }
version("24.3.3") { source sha256: "a5f4d83426fd3dc2f08c0c823ae29bcf72b69008a2baee66d27ad614ec7ab607" }
version("24.3.2") { source sha256: "cdc9cf788d28a492eb6b24881fbd06a0a5c785dc374ad415b3be1db96326583c" }
version("18.3") { source sha256: "a6d08eb7df06e749ccaf3049b33ceae617a3c466c6a640ee8d248c2372d48f4e" }
build do
# Don't listen on 127.0.0.1/::1 implicitly whenever ERL_EPMD_ADDRESS is given
if version.satisfies?("<= 24.3.3")
patch source: "epmd-require-explicitly-adding-loopback-address.patch", plevel: 1
else
patch source: "updated-epmd-require-explicitly-adding-loopback-address.patch", plevel: 1
end
env = with_standard_compiler_flags(with_embedded_path).merge(
# WARNING!
"CFLAGS" => "-L#{install_dir}/embedded/lib -O3 -I#{install_dir}/embedded/erlang/include",
"LDFLAGS" => "-Wl,-rpath #{install_dir}/embedded/lib -L#{install_dir}/embedded/lib -I#{install_dir}/embedded/erlang/include"
)
env.delete("CPPFLAGS")
# The TYPE env var sets the type of emulator you want
# We want the default so we give TYPE and empty value
# in case it was set by CI.
env["TYPE"] = ""
update_config_guess(target: "erts/autoconf")
update_config_guess(target: "lib/common_test/priv/auxdir")
update_config_guess(target: "lib/wx/autoconf")
if version.satisfies?(">= 19.0")
update_config_guess(target: "lib/common_test/test_server/src")
else
update_config_guess(target: "lib/test_server/src")
end
# Setup the erlang include dir
mkdir "#{install_dir}/embedded/erlang/include"
# At this time, erlang does not expose a way to specify the path(s) to these
# libraries, but it looks in its local +include+ directory as part of the
# search, so we will symlink them here so they are picked up.
#
# In future releases of erlang, someone should check if these flags (or
# environment variables) are avaiable to remove this ugly hack.
%w{ncurses openssl zlib.h zconf.h}.each do |name|
link "#{install_dir}/embedded/include/#{name}", "#{install_dir}/embedded/erlang/include/#{name}"
end
# Note 2017-02-28 sr: HiPE doesn't compile with OTP 18.3 on ppc64le (https://bugs.erlang.org/browse/ERL-369)
# Compiling fails when linking beam.smp, with
# powerpc64le-linux-gnu/libutil.so: error adding symbols: File in wrong format
#
# We've been having issues with ppc64le and hipe before, too:
# https://github.com/chef/chef-server/commit/4fa25ed695acaf819b11f71c6db1aab5c8adcaee
#
# It's trying to compile using a linker script for ppc64, it seems:
# https://github.com/erlang/otp/blob/c1ea854fac3d8ed14/erts/emulator/hipe/elf64ppc.x
# Probably introduced with https://github.com/erlang/otp/commit/37d63e9b8a0a96
# See also https://sourceware.org/ml/binutils/2015-05/msg00148.html
hipe = ppc64le? ? "disable" : "enable"
unless File.exist?("./configure")
# Building from github source requires this step
command "./otp_build autoconf"
end
# Note: et, debugger and observer applications require wx to
# build. The tarballs from the downloads site has prebuilt the beam
# files, so we were able to get away without disabling them and
# still build. When building from raw source we must disable them
# explicitly.
wx = "without"
command "./configure" \
" --prefix=#{install_dir}/embedded" \
" --enable-threads" \
" --enable-smp-support" \
" --enable-kernel-poll" \
" --enable-dynamic-ssl-lib" \
" --enable-shared-zlib" \
" --enable-fips" \
" --#{hipe}-hipe" \
" --#{wx}-wx" \
" --#{wx}-et" \
" --#{wx}-debugger" \
" --#{wx}-observer" \
" --without-megaco" \
" --without-javac" \
" --with-ssl=#{install_dir}/embedded" \
" --disable-debug", env: env
make "-j #{workers}", env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/nokogiri.rb | config/software/nokogiri.rb | # Copyright:: Copyright (c) Chef Software Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: no version pinning
name "nokogiri"
license "MIT"
license_file "https://raw.githubusercontent.com/sparklemotion/nokogiri/master/LICENSE.md"
# We install only nokogiri from rubygems here.
skip_transitive_dependency_licensing true
dependency "ruby"
using_prebuilt_ruby = windows? && (project.overrides[:ruby].nil? || project.overrides[:ruby][:version] == "ruby-windows")
unless using_prebuilt_ruby
dependency "libxml2"
dependency "libxslt"
dependency "liblzma"
dependency "zlib"
end
#
# NOTE: As of nokogiri 1.6.4 it will superficially 'work' to remove most
# of the nonsense in this file and simply gem install nokogiri on most
# platforms. This is because nokogiri has improved its packaging so that
# all of the dynamic libraries are 'statically' compiled into nokogiri.so
# with -lz -llzma -lxslt -lxml2, etc. What will happen in that case is
# that the nokogiri build system will pull zlib, lzma, etc out of the
# system and link it inside of nokogiri.so and ship it as one big
# dynamic library. This will essentially defeat one aspect of our
# health_check system so that we will be shipping an embedded zlib inside
# of nokogiri.so that we do not track and will have a high likelihood that
# if there are security errata that we ship exploitable code without
# knowing it. For all other purposes, the built executable will work,
# however, so it is likely that someone will 'discover' that 'everything
# works' and remove all the junk in this file. That will, however, have
# unintended side effects. We do not have a mechanism to inspect the
# nokogiri.so and determine that it is shipping with an embedded zlib that
# does not match the one that we ship in /opt/chef/embedded/lib, so there
# will be nothing that alerts or fails on this.
#
# TL;DR: do not remove --use-system-libraries even if everything appears to
# be green after you do.
#
build do
env = with_standard_compiler_flags(with_embedded_path)
gem_command = [ "install nokogiri" ]
gem_command << "--version '#{version}'" unless version.nil?
# windows uses the 'fat' precompiled binaries'
unless using_prebuilt_ruby
# Tell nokogiri to use the system libraries instead of compiling its own
env["NOKOGIRI_USE_SYSTEM_LIBRARIES"] = "true"
gem_command += [
"--platform ruby",
"--conservative",
"--minimal-deps",
"--",
"--use-system-libraries",
"--with-xml2-lib=#{install_dir}/embedded/lib",
"--with-xml2-include=#{install_dir}/embedded/include/libxml2",
"--with-xslt-lib=#{install_dir}/embedded/lib",
"--with-xslt-include=#{install_dir}/embedded/include/libxslt",
"--without-iconv",
"--with-zlib-dir=#{install_dir}/embedded",
]
end
gem gem_command.join(" "), env: env
# The mini-portile2 gem ships with some test fixture data compressed in a format Apple's notarization
# service cannot understand. We need to delete that archive to pass notarization.
block "Delete test folder of mini-portile2 gem so downstream projects pass notarization" do
env["VISUAL"] = "echo"
gem_install_dir = shellout!("#{install_dir}/embedded/bin/gem open mini_portile2", env: env).stdout.chomp
remove_directory "#{gem_install_dir}/test"
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/valkey.rb | config/software/valkey.rb | #
# Copyright:: Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "valkey"
license "BSD-3-Clause"
license_file "COPYING"
skip_transitive_dependency_licensing true
dependency "config_guess"
dependency "openssl"
dependency "libuuid"
dependency "curl"
default_version "7.2.11"
source url: "https://github.com/valkey-io/valkey/archive/refs/tags/#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "valkey-#{version}"
# version_list: url=https://github.com/valkey-io/valkey/archive/refs/tags/ filter=*.tar.gz
version("9.0.0") { source sha256: "088f47e167eb640ea31af48c81c5d62ee56321f25a4b05d4e54a0ef34232724b" }
version("7.2.11") { source sha256: "12acb6e5c07c71460761eee4361310dbd3618cecd42c70f02223d0ccf31fc6d8" }
build do
env = with_standard_compiler_flags(with_embedded_path).merge(
"PREFIX" => "#{install_dir}/embedded"
)
env["CFLAGS"] << " -I#{install_dir}/embedded/include"
env["LDFLAGS"] << " -L#{install_dir}/embedded/lib"
if suse?
env["CFLAGS"] << " -fno-lto"
env["CXXFLAGS"] << " -fno-lto"
end
update_config_guess
make "-j #{workers}", env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/config_guess.rb | config/software/config_guess.rb | #
# Copyright 2015 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: no version pinning
name "config_guess"
default_version "master"
# Use our github mirror of the savannah repository
source git: "https://github.com/chef/config-mirror.git"
# http://savannah.gnu.org/projects/config
license "GPL-3.0 (with exception)"
license_file "config.guess"
license_file "config.sub"
skip_transitive_dependency_licensing true
relative_path "config_guess-#{version}"
build do
mkdir "#{install_dir}/embedded/lib/config_guess"
copy "#{project_dir}/config.guess", "#{install_dir}/embedded/lib/config_guess/config.guess"
copy "#{project_dir}/config.sub", "#{install_dir}/embedded/lib/config_guess/config.sub"
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/libedit.rb | config/software/libedit.rb |
# Copyright 2012-2014 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "libedit"
default_version "20120601-3.0"
license "BSD-3-Clause"
license_file "COPYING"
skip_transitive_dependency_licensing true
dependency "ncurses"
dependency "config_guess"
# version_list: url=http://thrysoee.dk/editline/ filter=*.tar.gz
version("20221030-3.1") { source sha256: "f0925a5adf4b1bf116ee19766b7daa766917aec198747943b1c4edf67a4be2bb" }
version("20210910-3.1") { source sha256: "6792a6a992050762edcca28ff3318cdb7de37dccf7bc30db59fcd7017eed13c5" }
version("20210419-3.1") { source sha256: "571ebe44b74860823e24a08cf04086ff104fd7dfa1020abf26c52543134f5602" }
version("20150325-3.1") { source sha256: "c88a5e4af83c5f40dda8455886ac98923a9c33125699742603a88a0253fcc8c5" }
version("20141030-3.1") { source sha256: "9701e16570fb8f7fa407b506986652221b701a9dd61defc05bb7d1c61cdf5a40" }
version("20130712-3.1") { source sha256: "5d9b1a9dd66f1fe28bbd98e4d8ed1a22d8da0d08d902407dcc4a0702c8d88a37" }
version("20120601-3.0") { source sha256: "51f0f4b4a97b7ebab26e7b5c2564c47628cdb3042fd8ba8d0605c719d2541918" }
source url: "https://www.thrysoee.dk/editline/libedit-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
if version == "20141030-3.1"
# released tar file has name discrepency in folder name for this version
relative_path "libedit-20141029-3.1"
else
relative_path "libedit-#{version}"
end
build do
env = with_standard_compiler_flags(with_embedded_path)
# The patch is from the FreeBSD ports tree and is for GCC compatibility.
# http://svnweb.freebsd.org/ports/head/devel/libedit/files/patch-vi.c?annotate=300896
if version.to_i < 20150325 && (freebsd? || openbsd?)
patch source: "freebsd-vi-fix.patch", env: env
end
if openbsd?
patch source: "openbsd-weak-alias-fix.patch", plevel: 1, env: env
elsif aix?
# this forces us to build correctly, in the event that the system locale
# is non-standard.
env["LC_ALL"] = "en_US"
end
if solaris2?
patch source: "solaris.patch", plevel: 1, env: env
end
update_config_guess
command "./configure" \
" --prefix=#{install_dir}/embedded", env: env
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/keepalived.rb | config/software/keepalived.rb | #
# Copyright 2012-2014 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: deprecated 2021-04
name "keepalived"
default_version "1.2.9"
license "GPL-2.0"
license_file "COPYING"
skip_transitive_dependency_licensing true
dependency "popt"
dependency "openssl"
source url: "http://www.keepalived.org/software/keepalived-#{version}.tar.gz"
version "1.2.19" do
source md5: "5c98b06639dd50a6bff76901b53febb6"
end
version "1.2.9" do
source md5: "adfad98a2cc34230867d794ebc633492"
end
version "1.1.20" do
source md5: "6c3065c94bb9e2187c4b5a80f6d8be31"
end
relative_path "keepalived-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
# This is cherry-picked from change
# d384ce8b3492b9d76af23e621a20bed8da9c6016 of keepalived, (master
# branch), and should be no longer necessary after 1.2.9.
if version == "1.2.9"
patch source: "keepalived-1.2.9_opscode_centos_5.patch", env: env
end
configure = [
"./configure",
"--prefix=#{install_dir}/embedded",
" --disable-iconv",
]
if suse?
configure << "--with-kernel-dir=/usr/src/linux/include/uapi"
end
command configure.join(" "), env: env
make "-j #{workers}", env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/rbzmq.rb | config/software/rbzmq.rb | #
# Copyright 2012-2017 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: deprecated 2021-04
name "rbzmq"
default_version "master"
source git: "https://github.com/chef/rbzmq.git"
license "LGPL-3.0"
license_file "LICENSE.txt"
skip_transitive_dependency_licensing true
dependency "libzmq"
dependency "libsodium"
dependency "ruby"
build do
env = with_standard_compiler_flags(with_embedded_path)
gem "build rbzmq.gemspec", env: env
gem_command = [
"install rbzmq*.gem",
"--",
"--use-system-libraries",
"--with-zmq-dir==#{install_dir}/embedded",
"--no-doc",
]
gem gem_command.join(" "), env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/libsodium.rb | config/software/libsodium.rb | #
# Copyright:: Copyright (c) 2012-2019, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# We use the version in util-linux, and only build the libuuid subdirectory
name "libsodium"
default_version "1.0.18"
license "ISC"
license_file "LICENSE"
skip_transitive_dependency_licensing true
# version_list: url=https://download.libsodium.org/libsodium/releases/ filter=*.tar.gz
version("1.0.17") { source sha256: "0cc3dae33e642cc187b5ceb467e0ad0e1b51dcba577de1190e9ffa17766ac2b1" }
version("1.0.18") { source sha256: "6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1" }
source url: "https://download.libsodium.org/libsodium/releases/libsodium-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "libsodium-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
configure "--disable-dependency-tracking", env: env
make "-j #{workers}", env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/rsync.rb | config/software/rsync.rb | #
# Copyright 2012-2014 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: deprecated 2022-05
name "rsync"
default_version "3.1.1"
dependency "popt"
license_file "COPYING"
skip_transitive_dependency_licensing true
version "3.1.2" do
source md5: "0f758d7e000c0f7f7d3792610fad70cb"
license "GPL-3.0"
license_file "COPYING"
end
version "3.1.1" do
source md5: "43bd6676f0b404326eee2d63be3cdcfe"
license "GPL-3.0"
end
version "2.6.9" do
source md5: "996d8d8831dbca17910094e56dcb5942"
license "GPL-2.0"
end
source url: "https://rsync.samba.org/ftp/rsync/src/rsync-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "rsync-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
command "./configure" \
" --prefix=#{install_dir}/embedded" \
" --disable-iconv", env: env
make "-j #{workers}", env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/jre-from-jdk.rb | config/software/jre-from-jdk.rb | #
# Copyright 2013-2014 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Oracle doesn't distribute JRE builds for ARM, only JDK
# builds. Since we do no want to ship a larger package with a
# different layout, we just pick the 'jre' folder inside the jdk.
# This allows us to get as close as an ARM JRE package as we can.
#
# expeditor/ignore: deprecated 2021-04
name "jre-from-jdk"
default_version "8u91"
unless _64_bit? || armhf?
raise "The 'jre-from-jdk' can only be installed on armhf and x86_64"
end
license "Oracle-Binary"
license_file "LICENSE"
skip_transitive_dependency_licensing true
whitelist_file "jre/bin/javaws"
whitelist_file "jre/bin/policytool"
whitelist_file "jre/lib"
whitelist_file "jre/plugin"
whitelist_file "jre/bin/appletviewer"
license_warning = "By including the JRE, you accept the terms of the Oracle Binary Code License Agreement for the Java SE Platform Products and JavaFX, which can be found at http://www.oracle.com/technetwork/java/javase/terms/license/index.html"
license_cookie = "gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie"
version "8u91" do
# https://www.oracle.com/webfolder/s/digest/8u91checksum.html
if armhf?
file = "jdk-8u91-linux-arm32-vfp-hflt.tar.gz"
md5 = "1dd3934a493b474dd79b50adbd6df6a2"
else
file = "jdk-8u91-linux-x64.tar.gz"
md5 = "3f3d7d0cd70bfe0feab382ed4b0e45c0"
end
source url: "http://download.oracle.com/otn-pub/java/jdk/8u91-b14/#{file}",
md5: md5,
cookie: license_cookie,
warning: license_warning,
unsafe: true
relative_path "jdk1.8.0_91"
end
build do
mkdir "#{install_dir}/embedded/jre"
sync "#{project_dir}/jre", "#{install_dir}/embedded/jre"
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/gecode.rb | config/software/gecode.rb | #
# Copyright 2012-2014 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "gecode"
default_version "3.7.3"
license "MIT"
license_file "LICENSE"
skip_transitive_dependency_licensing true
# version_list: url=https://github.com/Gecode/gecode/releases/ filter=gecode-release-*.tar.gz
version("3.7.3") { source sha256: "75faaaa025a154ec0aef8b3b6ed9e78113efb543a92b8f4b2b971a0b0e898108" }
# Major version, have not tried yet
version("6.2.0") { source sha256: "27d91721a690db1e96fa9bb97cec0d73a937e9dc8062c3327f8a4ccb08e951fd" }
version("5.1.0") { source sha256: "77863f4638c6b77d24a29bf6aeac370c56cd808fe9aabc1fca96655581f6c83d" }
version("4.4.0") { source sha256: "ca261c6c876950191d4ec2f277e5bfee1c3eae8a81af9b5c970d9b0c2930db37" }
source url: "https://github.com/Gecode/gecode/archive/refs/tags/release-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/release-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "gecode-release-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
# On some RHEL-based systems, the default GCC that's installed is 4.1. We
# need to use 4.4, which is provided by the gcc44 and gcc44-c++ packages.
# These do not use the gcc binaries so we set the flags to point to the
# correct version here.
if File.exist?("/usr/bin/gcc44")
env["CC"] = "gcc44"
env["CXX"] = "g++44"
end
command "./configure" \
" --prefix=#{install_dir}/embedded" \
" --disable-doc-dot" \
" --disable-doc-search" \
" --disable-doc-tagfile" \
" --disable-doc-chm" \
" --disable-doc-docset" \
" --disable-qt" \
" --disable-examples", env: env
make "-j #{workers}", env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/redis-gem.rb | config/software/redis-gem.rb | #
# Copyright 2014 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: deprecated 2021-04
name "redis-gem"
default_version "3.3.3"
license "MIT"
license_file "https://raw.githubusercontent.com/redis/redis-rb/master/LICENSE"
# redis gem does not have any dependencies. We only install it from
# rubygems here.
skip_transitive_dependency_licensing true
dependency "ruby"
build do
env = with_standard_compiler_flags(with_embedded_path)
gem "install redis" \
" --version '#{version}'" \
" --bindir '#{install_dir}/embedded/bin'" \
" --no-document", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/ruby-cleanup.rb | config/software/ruby-cleanup.rb | #
# Copyright:: Copyright (c) 2014-2020, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Common cleanup routines for ruby apps (InSpec, Workstation, Chef, etc)
# expeditor/ignore: logic only
require "fileutils"
name "ruby-cleanup"
default_version "1.0.0"
license :project_license
skip_transitive_dependency_licensing true
dependency "zlib" # just so we clear health-check & zlib is ruby dependency
build do
env = with_standard_compiler_flags(with_embedded_path)
# patchelf was only installed to change the rpath for adoptopenjre binary
# delete
command "find #{install_dir} -name patchelf -exec rm -rf \\{\\} \\;" unless windows?
# Remove static object files for all platforms
# except AIX which uses them at runtime.
unless aix?
block "Remove static libraries" do
gemfile = "#{install_dir}/embedded/bin/gem"
next unless File.exist?(gemfile)
gemdir = shellout!("#{gemfile} environment gemdir", env: env).stdout.chomp
# find all the static *.a files and delete them
Dir.glob("#{gemdir}/**/*.a").each do |f|
puts "Deleting #{f}"
File.delete(f)
end
end
end
# Clear the now-unnecessary git caches, docs, and build information
block "Delete bundler git cache, docs, and build info" do
gemfile = "#{install_dir}/embedded/bin/gem"
next unless File.exist?(gemfile)
gemdir = shellout!("#{gemfile} environment gemdir", env: env).stdout.chomp
remove_directory "#{gemdir}/cache"
remove_directory "#{gemdir}/doc"
remove_directory "#{gemdir}/build_info"
end
block "Remove bundler gem caches" do
gemfile = "#{install_dir}/embedded/bin/gem"
next unless File.exist?(gemfile)
gemdir = shellout!("#{gemfile} environment gemdir", env: env).stdout.chomp
Dir.glob("#{gemdir}/bundler/gems/**").each do |f|
puts "Deleting #{f}"
remove_directory f
end
end
block "Remove leftovers from compiling gems" do
# find the embedded ruby gems dir and clean it up for globbing
next unless File.directory?("#{install_dir}/embedded/lib/ruby/gems")
target_dir = "#{install_dir}/embedded/lib/ruby/gems/*/".tr("\\", "/")
# find gem_make.out and mkmf.log files
Dir.glob(Dir.glob("#{target_dir}/**/{gem_make.out,mkmf.log}")).each do |f|
puts "Deleting #{f}"
File.delete(f)
end
end
# Clean up docs
delete "#{install_dir}/embedded/docs"
delete "#{install_dir}/embedded/share/man"
delete "#{install_dir}/embedded/share/doc"
delete "#{install_dir}/embedded/share/gtk-doc"
delete "#{install_dir}/embedded/ssl/man"
delete "#{install_dir}/embedded/man"
delete "#{install_dir}/embedded/share/info"
delete "#{install_dir}/embedded/info"
block "Remove leftovers from compiling gems" do
gemfile = "#{install_dir}/embedded/bin/gem"
next unless File.exist?(gemfile)
gemdir = shellout!("#{gemfile} environment gemdir", env: env).stdout.chomp
# find gem_make.out and mkmf.log files
Dir.glob("#{gemdir}/extensions/**/{gem_make.out,mkmf.log}").each do |f|
puts "Deleting #{f}"
File.delete(f)
end
end
block "Removing random non-code files from installed gems" do
gemfile = "#{install_dir}/embedded/bin/gem"
next unless File.exist?(gemfile)
gemdir = shellout!("#{gemfile} environment gemdir", env: env).stdout.chomp
# find the embedded ruby gems dir and clean it up for globbing
files = %w{
.appveyor.yml
.autotest
.bnsignore
.circleci
.codeclimate.yml
.concourse.yml
.coveralls.yml
.dockerignore
.document
.ebert.yml
.gemtest
.github
.gitignore
.gitmodules
.hound.yml
.irbrc
.kokoro
.pelusa.yml
.repo-metadata.json
.rock.yml
.rspec
.rubocop_*.yml
.rubocop.yml
.ruby-gemset
.ruby-version
.rvmrc
.simplecov
.tool-versions
.travis.yml
.yardopts
.yardopts_guide
.yardopts_i18n
.yardstick.yml
.zuul.yaml
*.blurb
**/.gitkeep
*Upgrade.md
Appraisals
appveyor.yml
ARCHITECTURE.md
autotest
azure-pipelines.yml
bench
benchmark
benchmarks
bundle_install_all_ruby_versions.sh
CHANGELOG
CHANGELOG.md
CHANGELOG.rdoc
CHANGELOG.txt
CHANGES
CHANGES.md
CHANGES.txt
CODE_OF_CONDUCT.md
Code-of-Conduct.md
codecov.yml
concourse
CONTRIBUTING.md
CONTRIBUTING.rdoc
CONTRIBUTORS.md
design_rationale.rb
doc
doc-api
docker-compose.yml
Dockerfile*
docs
donate.png
ed25519.png
FAQ.txt
features
frozen_old_spec
Gemfile.devtools
Gemfile.travis
Gemfile.noed25519*
Guardfile
GUIDE.md
HISTORY
HISTORY.md
History.rdoc
HISTORY.txt
INSTALL
INSTALL.txt
ISSUE_TEMPLATE.md
JSON-Schema-Test-Suite
logo.png
man
Manifest
Manifest.txt
MIGRATING.md
minitest
NEWS.md
on_what.rb
README
README_INDEX.rdoc
README.*md
readme.erb
README.euc
README.markdown
README.rdoc
README.txt
release-script.txt
run_specs_all_ruby_versions.sh
samus.json
SECURITY.md
SPEC.rdoc
test
tests
THANKS.txt
TODO
TODO*.md
travis_build_script.sh
UPGRADING.md
website
yard-template
}
Dir.glob(Dir.glob("#{gemdir}/gems/*/{#{files.join(",")}}")).each do |f|
puts "Deleting #{f}"
if File.directory?(f)
# recursively removes files and the dir
FileUtils.remove_dir(f)
else
File.delete(f)
end
end
end
# Check for multiple versions of the `bundler` gem and fail the build if we find more than 1.
# Having multiple versions has burned us too many times in the past - causes warnings when
# invoking binaries.
# block "Ensure only 1 copy of bundler is installed" do
# # The bundler regex must be surrounded by double-quotes (not single) for Windows
# # Under powershell, it would have to be escaped with a ` character, i.e. `"^bundler$`"
# bundler = shellout!("#{install_dir}/embedded/bin/gem list \"^bundler$\"", env: env).stdout.chomp
# if bundler.include?(",")
# raise "Multiple copies of bundler installed, ensure only 1 remains. Output:\n" + bundler
# end
# end
block "Remove empty gem dirs from Ruby's built-in gems" do
Dir.glob("#{install_dir}/embedded/lib/ruby/gems/*/gems/*".tr("\\", "/")).each do |d|
# skip unless the dir is empty
next unless Dir.children(d).empty?
puts "Deleting empty gem dir: #{d}"
FileUtils.rm_rf(d)
end
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/dep-selector-libgecode.rb | config/software/dep-selector-libgecode.rb | #
# Copyright 2014-2018 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: deprecated 2021-04
name "dep-selector-libgecode"
default_version "1.3.1"
license "Apache-2.0"
license_file "https://raw.githubusercontent.com/chef/dep-selector-libgecode/master/LICENSE"
# dep-selector-libgecode does not have any dependencies. We only install it from
# rubygems here.
skip_transitive_dependency_licensing true
dependency "ruby"
build do
env = with_standard_compiler_flags(with_embedded_path)
# On some RHEL-based systems, the default GCC that's installed is 4.1. We
# need to use 4.4, which is provided by the gcc44 and gcc44-c++ packages.
# These do not use the gcc binaries so we set the flags to point to the
# correct version here.
if File.exist?("/usr/bin/gcc44")
env["CC"] = "gcc44"
env["CXX"] = "g++44"
end
# Ruby DevKit ships with BSD Tar
env["PROG_TAR"] = "bsdtar" if windows?
env["ARFLAGS"] = "rv #{env["ARFLAGS"]}" if env["ARFLAGS"]
gem "install dep-selector-libgecode" \
" --version '#{version}'" \
" --no-document", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/curl.rb | config/software/curl.rb | #
# Copyright:: Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "curl"
default_version "8.4.0"
dependency "zlib"
dependency "openssl"
dependency "cacerts"
dependency "libnghttp2" if version.satisfies?(">= 8.0")
license "MIT"
license_file "COPYING"
skip_transitive_dependency_licensing true
# version_list: url=https://curl.se/download/ filter=*.tar.gz
version("8.16.0") { source sha256: "a21e20476e39eca5a4fc5cfb00acf84bbc1f5d8443ec3853ad14c26b3c85b970" }
version("8.14.1") { source sha256: "6766ada7101d292b42b8b15681120acd68effa4a9660935853cf6d61f0d984d4" }
version("8.12.1") { source sha256: "7b40ea64947e0b440716a4d7f0b7aa56230a5341c8377d7b609649d4aea8dbcf" }
version("8.6.0") { source sha256: "9c6db808160015f30f3c656c0dec125feb9dc00753596bf858a272b5dd8dc398" }
version("8.4.0") { source sha256: "816e41809c043ff285e8c0f06a75a1fa250211bbfb2dc0a037eeef39f1a9e427" }
version("7.85.0") { source sha256: "78a06f918bd5fde3c4573ef4f9806f56372b32ec1829c9ec474799eeee641c27" }
version("7.84.0") { source sha256: "3c6893d38d054d4e378267166858698899e9d87258e8ff1419d020c395384535" }
version("7.83.1") { source sha256: "93fb2cd4b880656b4e8589c912a9fd092750166d555166370247f09d18f5d0c0" }
version("7.82.0") { source sha256: "910cc5fe279dc36e2cca534172c94364cf3fcf7d6494ba56e6c61a390881ddce" }
version("7.81.0") { source sha256: "ac8e1087711084548d788ef18b9b732c8de887457b81f616fc681d1044b32f98" }
version("7.80.0") { source sha256: "dab997c9b08cb4a636a03f2f7f985eaba33279c1c52692430018fae4a4878dc7" }
version("7.79.1") { source sha256: "370b11201349816287fb0ccc995e420277fbfcaf76206e309b3f60f0eda090c2" }
source url: "https://curl.haxx.se/download/curl-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "curl-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
if freebsd? && version.satisfies?("< 7.82.0")
# from freebsd ports - IPv6 Hostcheck patch
patch source: "curl-freebsd-hostcheck.patch", plevel: 1, env: env
end
delete "#{project_dir}/src/tool_hugehelp.c"
if solaris2?
# Without /usr/gnu/bin first in PATH the libtool fails during make on Solaris
env["PATH"] = "/usr/gnu/bin:#{env["PATH"]}"
end
configure_options = [
"--prefix=#{install_dir}/embedded",
"--disable-option-checking",
"--disable-manual",
"--disable-debug",
"--enable-optimize",
"--disable-ldap",
"--disable-ldaps",
"--disable-rtsp",
"--enable-proxy",
"--disable-pop3",
"--disable-imap",
"--disable-smtp",
"--disable-gopher",
"--disable-dependency-tracking",
"--enable-ipv6",
"--without-brotli",
"--without-libidn2",
"--without-gnutls",
"--without-librtmp",
"--without-zsh-functions-dir",
"--without-fish-functions-dir",
"--disable-mqtt",
"--with-ssl=#{install_dir}/embedded",
"--with-zlib=#{install_dir}/embedded",
"--with-ca-bundle=#{install_dir}/embedded/ssl/certs/cacert.pem",
"--without-zstd",
]
configure_options += [ "--without-libpsl" ] if version.satisfies?(">=8.6.0")
configure(*configure_options, env: env)
make "-j #{workers}", env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/perl.rb | config/software/perl.rb | #
# Copyright:: Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "perl"
license "Artistic-2.0"
license_file "Artistic"
skip_transitive_dependency_licensing true
default_version "5.36.0"
# versions_list: http://www.cpan.org/src/ filter=*.tar.gz
version("5.36.0") { source sha256: "e26085af8ac396f62add8a533c3a0ea8c8497d836f0689347ac5abd7b7a4e00a" }
version("5.34.1") { source sha256: "357951a491b0ba1ce3611263922feec78ccd581dddc24a446b033e25acf242a1" }
version("5.34.0") { source sha256: "551efc818b968b05216024fb0b727ef2ad4c100f8cb6b43fab615fa78ae5be9a" }
version("5.32.1") { source sha256: "03b693901cd8ae807231b1787798cf1f2e0b8a56218d07b7da44f784a7caeb2c" }
version("5.30.0") { source sha256: "851213c754d98ccff042caa40ba7a796b2cee88c5325f121be5cbb61bbf975f2" }
version("5.22.1") { source sha256: "2b475d0849d54c4250e9cba4241b7b7291cffb45dfd083b677ca7b5d38118f27" }
version("5.18.1") { source sha256: "655e11a8ffba8853efcdce568a142c232600ed120ac24aaebb4e6efe74e85b2b" }
source url: "https://www.cpan.org/src/5.0/perl-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
# perl builds perl as libraries into a special directory. We need to include
# that directory in lib_dirs so omnibus can sign them during macOS deep signing.
lib_dirs lib_dirs.concat ["#{install_dir}/embedded/lib/perl5/**"]
relative_path "perl-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
if version.satisfies?("<= 5.34.0")
patch source: "perl-#{version}-remove_lnsl.patch", plevel: 1, env: env
end
if solaris2?
cc_command = "-Dcc='gcc -m64 -static-libgcc'"
elsif aix?
cc_command = "-Dcc='/opt/IBM/xlc/13.1.0/bin/cc_r -q64'"
elsif freebsd? && ohai["os_version"].to_i >= 1000024
cc_command = "-Dcc='clang'"
elsif mac_os_x?
cc_command = "-Dcc='clang'"
else
cc_command = "-Dcc='gcc -static-libgcc'"
end
configure_command = ["sh Configure",
" -de",
" -Dprefix=#{install_dir}/embedded",
" -Duseshrplib",
" -Dusethreads",
" #{cc_command}",
" -Dnoextensions='DB_File GDBM_File NDBM_File ODBM_File'"]
if aix?
configure_command << "-Dmake=gmake"
configure_command << "-Duse64bitall"
end
command configure_command.join(" "), env: env
make "-j #{workers}", env: env
# using the install.perl target lets
# us skip install the manpages
make "install.perl", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/ncurses.rb | config/software/ncurses.rb | #
# Copyright 2012-2019, Chef Software Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "ncurses"
default_version "6.4"
license "MIT"
license_file "http://invisible-island.net/ncurses/ncurses-license.html"
license_file "http://invisible-island.net/ncurses/ncurses.faq.html"
skip_transitive_dependency_licensing true
dependency "config_guess"
# versions_list: https://ftp.gnu.org/gnu/ncurses/ filter=*.tar.gz
version("6.4") { source sha256: "6931283d9ac87c5073f30b6290c4c75f21632bb4fc3603ac8100812bed248159" }
version("6.3") { source sha256: "97fc51ac2b085d4cde31ef4d2c3122c21abc217e9090a43a30fc5ec21684e059" }
version("6.2") { source sha256: "30306e0c76e0f9f1f0de987cf1c82a5c21e1ce6568b9227f7da5b71cbea86c9d" }
version("6.1") { source sha256: "aa057eeeb4a14d470101eff4597d5833dcef5965331be3528c08d99cebaa0d17" }
version("5.9") { source sha256: "9046298fb440324c9d4135ecea7879ffed8546dd1b58e59430ea07a4633f563b" }
source url: "https://mirror.team-cymru.com/gnu/ncurses/ncurses-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "ncurses-#{version}"
########################################################################
#
# wide-character support:
# Ruby 1.9 optimistically builds against libncursesw for UTF-8
# support. In order to prevent Ruby from linking against a
# package-installed version of ncursesw, we build wide-character
# support into ncurses with the "--enable-widec" configure parameter.
# To support other applications and libraries that still try to link
# against libncurses, we also have to create non-wide libraries.
#
# The methods below are adapted from:
# http://www.linuxfromscratch.org/lfs/view/development/chapter06/ncurses.html
#
########################################################################
build do
env = with_standard_compiler_flags(with_embedded_path)
env.delete("CPPFLAGS")
if smartos?
# SmartOS is Illumos Kernel, plus NetBSD userland with a GNU toolchain.
# These patches are taken from NetBSD pkgsrc and provide GCC 4.7.0
# compatibility:
# http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/devel/ncurses/patches/
patch source: "patch-aa", plevel: 0, env: env
patch source: "patch-ab", plevel: 0, env: env
patch source: "patch-ac", plevel: 0, env: env
patch source: "patch-ad", plevel: 0, env: env
patch source: "patch-cxx_cursesf.h", plevel: 0, env: env
patch source: "patch-cxx_cursesm.h", plevel: 0, env: env
# Chef patches - <sean@sean.io>
# The configure script from the pristine tarball detects xopen_source_extended incorrectly.
# Manually working around a false positive.
patch source: "ncurses-5.9-solaris-xopen_source_extended-detection.patch", plevel: 0, env: env
end
update_config_guess
# AIX's old version of patch doesn't like the patches here
unless aix?
if version == "5.9"
# Patch to add support for GCC 5, doesn't break previous versions
patch source: "ncurses-5.9-gcc-5.patch", plevel: 1, env: env
end
end
if mac_os_x? ||
# Clang became the default compiler in FreeBSD 10+
(freebsd? && ohai["os_version"].to_i >= 1000024)
# References:
# https://github.com/Homebrew/homebrew-dupes/issues/43
# http://invisible-island.net/ncurses/NEWS.html#t20110409
#
# Patches ncurses for clang compiler. Changes have been accepted into
# upstream, but occurred shortly after the 5.9 release. We should be able
# to remove this after upgrading to any release created after June 2012
patch source: "ncurses-clang.patch", env: env
end
if openbsd?
patch source: "patch-ncurses_tinfo_lib__baudrate.c", plevel: 0, env: env
end
configure_command = [
"./configure",
"--prefix=#{install_dir}/embedded",
"--enable-overwrite",
"--with-shared",
"--with-termlib",
"--without-ada",
"--without-cxx-binding",
"--without-debug",
"--without-manpages",
]
if aix?
# AIX kinda needs 5.9-20140621 or later
# because of a naming snafu in shared library naming.
# see http://invisible-island.net/ncurses/NEWS.html#t20140621
# let libtool deal with library silliness
configure_command << "--with-libtool=\"#{install_dir}/embedded/bin/libtool\""
# stick with just the shared libs on AIX
configure_command << "--without-normal"
# ncurses's ./configure incorrectly
# "figures out" ARFLAGS if you try
# to set them yourself
env.delete("ARFLAGS")
# use gnu install from the coreutils IBM rpm package
env["INSTALL"] = "/opt/freeware/bin/install"
end
command configure_command.join(" "), env: env
# unfortunately, libtool may try to link to libtinfo
# before it has been assembled; so we have to build in serial
make "libs", env: env if aix?
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
# Build non-wide-character libraries
make "distclean", env: env
configure_command << "--enable-widec"
command configure_command.join(" "), env: env
make "libs", env: env if aix?
make "-j #{workers}", env: env
# Installing the non-wide libraries will also install the non-wide
# binaries, which doesn't happen to be a problem since we don't
# utilize the ncurses binaries in private-chef (or oss chef)
make "-j #{workers} install", env: env
# Ensure embedded ncurses wins in the LD search path
if smartos?
link "#{install_dir}/embedded/lib/libcurses.so", "#{install_dir}/embedded/lib/libcurses.so.1"
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/python.rb | config/software/python.rb | #
# Copyright 2013-2015 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "python"
default_version "3.12.0"
license "Python-2.0"
license_file "LICENSE"
skip_transitive_dependency_licensing true
dependency "ncurses"
dependency "zlib"
dependency "openssl"
dependency "bzip2"
if version >= "3.9.0"
dependency "libffi"
end
# version_list: url=https://www.python.org/ftp/python/#{version}/ filter=*.tgz
version("3.12.0") { source sha256: "51412956d24a1ef7c97f1cb5f70e185c13e3de1f50d131c0aac6338080687afb" }
version("3.11.1") { source sha256: "baed518e26b337d4d8105679caf68c5c32630d702614fc174e98cb95c46bdfa4" }
version("3.11.0") { source sha256: "64424e96e2457abbac899b90f9530985b51eef2905951febd935f0e73414caeb" }
version("3.10.5") { source sha256: "18f57182a2de3b0be76dfc39fdcfd28156bb6dd23e5f08696f7492e9e3d0bf2d" }
version("3.10.4") { source sha256: "f3bcc65b1d5f1dc78675c746c98fcee823c038168fc629c5935b044d0911ad28" }
version("3.10.2") { source sha256: "3c0ede893011319f9b0a56b44953a3d52c7abf9657c23fb4bc9ced93b86e9c97" }
version("3.9.9") { source sha256: "2cc7b67c1f3f66c571acc42479cdf691d8ed6b47bee12c9b68430413a17a44ea" }
version("2.7.18") { source sha256: "da3080e3b488f648a3d7a4560ddee895284c3380b11d6de75edb986526b9a814" }
version("2.7.14") { source sha256: "304c9b202ea6fbd0a4a8e0ad3733715fbd4749f2204a9173a58ec53c32ea73e8" }
version("2.7.9") { source sha256: "c8bba33e66ac3201dabdc556f0ea7cfe6ac11946ec32d357c4c6f9b018c12c5b" }
source url: "https://python.org/ftp/python/#{version}/Python-#{version}.tgz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "Python-#{version}"
major_version, minor_version = version.split(".")
build do
env = with_standard_compiler_flags(with_embedded_path)
if mac_os_x?
os_x_release = ohai["platform_version"].match(/([0-9]+\.[0-9]+).*/).captures[0]
env["MACOSX_DEPLOYMENT_TARGET"] = os_x_release
end
command "./configure" \
" --prefix=#{install_dir}/embedded" \
" --enable-shared" \
" --with-dbmliborder=", env: env
make env: env
make "install", env: env
# There exists no configure flag to tell Python to not compile readline
delete "#{install_dir}/embedded/lib/python#{major_version}.#{minor_version}/lib-dynload/readline.*"
# Ditto for sqlite3
delete "#{install_dir}/embedded/lib/python#{major_version}.#{minor_version}/lib-dynload/_sqlite3.*"
delete "#{install_dir}/embedded/lib/python#{major_version}.#{minor_version}/sqlite3/"
# Remove unused extension which is known to make healthchecks fail on CentOS 6
delete "#{install_dir}/embedded/lib/python#{major_version}.#{minor_version}/lib-dynload/_bsddb.*"
# Remove sqlite3 libraries, if you want to include sqlite, create a new def
# in your software project and build it explicitly. This removes the adapter
# library from python, which links incorrectly to a system library. Adding
# your own sqlite definition will fix this.
delete "#{install_dir}/embedded/lib/python#{major_version}.#{minor_version}/lib-dynload/_sqlite3.*"
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/libxslt.rb | config/software/libxslt.rb | #
# Copyright 2012-2014 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "libxslt"
default_version "1.1.39"
license "MIT"
license_file "COPYING"
skip_transitive_dependency_licensing true
dependency "libxml2"
dependency "liblzma"
dependency "config_guess"
# versions_list: url=https://download.gnome.org/sources/libxslt/1.1/ filter=*.tar.xz
version("1.1.43") { source sha256: "5a3d6b383ca5afc235b171118e90f5ff6aa27e9fea3303065231a6d403f0183a" }
version("1.1.42") { source sha256: "85ca62cac0d41fc77d3f6033da9df6fd73d20ea2fc18b0a3609ffb4110e1baeb" }
version("1.1.39") { source sha256: "2a20ad621148339b0759c4d4e96719362dee64c9a096dbba625ba053846349f0" }
version("1.1.37") { source sha256: "3a4b27dc8027ccd6146725950336f1ec520928f320f144eb5fa7990ae6123ab4" }
version("1.1.36") { source sha256: "12848f0a4408f65b530d3962cd9ff670b6ae796191cfeff37522b5772de8dc8e" }
version("1.1.35") { source sha256: "8247f33e9a872c6ac859aa45018bc4c4d00b97e2feac9eebc10c93ce1f34dd79" }
source url: "https://download.gnome.org/sources/libxslt/1.1/libxslt-#{version}.tar.xz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.xz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "libxslt-#{version}"
build do
update_config_guess
env = with_standard_compiler_flags(with_embedded_path)
if version.satisfies?("< 1.1.39")
patch source: "libxslt-solaris-configure.patch", env: env if solaris2? || omnios? || smartos?
else
patch source: "update-libxslt-solaris-configure.patch", env: env if solaris2? || omnios? || smartos?
end
if windows?
patch source: "libxslt-windows-relocate.patch", env: env
end
# the libxslt configure script iterates directories specified in
# --with-libxml-prefix looking for the libxml2 config script. That
# iteration treats colons as a delimiter so we are using a cygwin
# style path to accomodate
configure_commands = [
"--with-libxml-prefix=#{install_dir.sub("C:", "/C")}/embedded",
"--without-python",
"--without-crypto",
"--without-profiler",
"--without-debugger",
"--without-deprecated-declarations",
]
configure(*configure_commands, env: env)
make "-j #{workers}", env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/libffi.rb | config/software/libffi.rb | #
# Copyright:: Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "libffi"
default_version "3.4.4"
license "MIT"
license_file "LICENSE"
skip_transitive_dependency_licensing true
# version_list: url=https://github.com/libffi/libffi/releases filter=*.tar.gz
version("3.4.6") { source sha256: "b0dea9df23c863a7a50e825440f3ebffabd65df1497108e5d437747843895a4e" }
version("3.4.4") { source sha256: "d66c56ad259a82cf2a9dfc408b32bf5da52371500b84745f7fb8b645712df676" }
version("3.4.2") { source sha256: "540fb721619a6aba3bdeef7d940d8e9e0e6d2c193595bc243241b77ff9e93620" }
version("3.3") { source sha256: "72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056" }
source url: "https://github.com/libffi/libffi/releases/download/v#{version}/libffi-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "libffi-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
env["INSTALL"] = "/opt/freeware/bin/install" if aix?
# disable option checking as disable-docs is 3.3+ only
configure_command = ["--disable-option-checking",
"--disable-docs",
]
if version == "3.3" && mac_os_x? && arm?
patch source: "libffi-3.3-arm64.patch", plevel: 1, env: env
end
if version == "3.4.4" && rhel? && platform_version.satisfies?("~> 10.0")
patch source: "libffi-rhel10-3.4.4-Forward-declare-open_temp_exec_file.patch", plevel: 1, env: env
end
# AIX's old version of patch doesn't like the patch here
unless aix?
# disable multi-os-directory via configure flag (don't use /lib64)
# Works on all platforms, and is compatible on 32bit platforms as well
configure_command << "--disable-multi-os-directory"
# add the --disable-multi-os-directory flag to 3.2.1
if version == "3.2.1"
patch source: "libffi-3.2.1-disable-multi-os-directory.patch", plevel: 1, env: env
end
end
configure(*configure_command, env: env)
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
# libffi's default install location of header files is awful...
mkdir "#{install_dir}/embedded/include"
copy "#{install_dir}/embedded/lib/libffi-#{version}/include/*", "#{install_dir}/embedded/include/"
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/figlet-fonts.rb | config/software/figlet-fonts.rb | #
# Copyright 2015 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: deprecated 2021-04
name "figlet-fonts"
default_version "master"
dependency "figlet"
source git: "https://github.com/cmatsuoka/figlet-fonts.git"
relative_path "figlet-fonts-#{version}"
build do
mkdir "#{install_dir}/share/figlet/fonts"
copy "#{project_dir}/*/*.flc", "#{install_dir}/share/figlet/fonts/"
copy "#{project_dir}/*/*.flf", "#{install_dir}/share/figlet/fonts/"
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/libtool.rb | config/software/libtool.rb | #
# Copyright:: Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "libtool"
default_version "2.4.7"
license "GPL-2.0"
license_file "COPYING"
skip_transitive_dependency_licensing true
dependency "config_guess"
# version_list: url=https://ftp.gnu.org/gnu/libtool/ filter=*.tar.gz
version("2.4.7") { source sha256: "04e96c2404ea70c590c546eba4202a4e12722c640016c12b9b2f1ce3d481e9a8" }
version("2.4.6") { source sha256: "e3bd4d5d3d025a36c21dd6af7ea818a2afcd4dfc1ea5a17b39d7854bcd0c06e3" }
version("2.4.2") { source sha256: "b38de44862a987293cd3d8dfae1c409d514b6c4e794ebc93648febf9afc38918" }
version("2.4") { source sha256: "13df57ab63a94e196c5d6e95d64e53262834fe780d5e82c28f177f9f71ddf62e" }
source url: "https://ftp.gnu.org/gnu/libtool/libtool-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "libtool-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
update_config_guess
update_config_guess(target: "libltdl/config")
if aix?
env["M4"] = "/opt/freeware/bin/m4"
elsif solaris2?
# We hit this bug on Solaris11 platforms bug#14291: libtool 2.4.2 fails to build due to macro_revision reversion
# The problem occurs with LANG=en_US.UTF-8 but not with LANG=C
env["LANG"] = "C"
end
command "./configure" \
" --prefix=#{install_dir}/embedded", env: env
make env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/figlet.rb | config/software/figlet.rb | #
# Copyright 2015 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: deprecated 2021-04
name "figlet"
default_version "2.2.5"
version("2.2.5") { source md5: "eaaeb356007755c9770a842aefd8ed5f" }
source url: "https://github.com/cmatsuoka/figlet/archive/#{version}.tar.gz"
relative_path "figlet-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
env["DEFAULTFONTDIR"] = "#{install_dir}/share/figlet/fonts"
env["prefix"] = "#{install_dir}/embedded"
if aix?
# give us /opt/freeware/bin/patch
env["PATH"] = "/opt/freeware/bin:#{env["PATH"]}"
env["CC"] = "cc_r -q64"
env["LD"] = "cc_r -q64"
patch source: "aix-figlet-cdefs.patch", plevel: 0, env: env
end
mkdir "#{install_dir}/share/figlet/fonts"
make "-j #{workers}", env: env
make "install -j #{workers}", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/relx.rb | config/software/relx.rb | #
# Copyright 2014 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: deprecated 2021-04
name "relx"
# Release tags are available, which you can use via override in
# project config.
default_version "master"
dependency "erlang"
# NOTE: requires rebar > 2.2.0 Not sure what the minimum is, but
# 837df640872d6a5d5d75a7308126e2769d7babad of rebar works.
dependency "rebar"
source git: "https://github.com/erlware/relx.git"
relative_path "relx"
build do
env = with_standard_compiler_flags(with_embedded_path)
make env: env
copy "#{project_dir}/relx", "#{install_dir}/embedded/bin/"
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/redis.rb | config/software/redis.rb | #
# Copyright:: Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "redis"
license "BSD-3-Clause"
license_file "COPYING"
skip_transitive_dependency_licensing true
dependency "config_guess"
default_version "7.0.8"
version("7.2.3") { source sha256: "3e2b196d6eb4ddb9e743088bfc2915ccbb42d40f5a8a3edd8cb69c716ec34be7" }
version("7.0.8") { source sha256: "06a339e491306783dcf55b97f15a5dbcbdc01ccbde6dc23027c475cab735e914" }
version("7.0.4") { source sha256: "f0e65fda74c44a3dd4fa9d512d4d4d833dd0939c934e946a5c622a630d057f2f" }
version("7.0.2") { source sha256: "5e57eafe7d4ac5ecb6a7d64d6b61db775616dbf903293b3fcc660716dbda5eeb" }
version("7.0.0") { source sha256: "284d8bd1fd85d6a55a05ee4e7c31c31977ad56cbf344ed83790beeb148baa720" }
version("6.2.7") { source sha256: "b7a79cc3b46d3c6eb52fa37dde34a4a60824079ebdfb3abfbbfa035947c55319" }
version("6.2.6") { source sha256: "5b2b8b7a50111ef395bf1c1d5be11e6e167ac018125055daa8b5c2317ae131ab" }
version("6.2.5") { source sha256: "4b9a75709a1b74b3785e20a6c158cab94cf52298aa381eea947a678a60d551ae" }
version("5.0.14") { source sha256: "3ea5024766d983249e80d4aa9457c897a9f079957d0fb1f35682df233f997f32" }
source url: "https://download.redis.io/releases/redis-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "redis-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path).merge(
"PREFIX" => "#{install_dir}/embedded"
)
update_config_guess
if version.satisfies?("< 6.0")
patch source: "password-from-environment.patch", plevel: 1, env: env
end
make "-j #{workers}", env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/opensearch.rb | config/software/opensearch.rb | #
# Copyright 2020 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "opensearch"
default_version "2.4.1"
dependency "server-open-jre"
license "Apache-2.0"
license_file "LICENSE.txt"
skip_transitive_dependency_licensing true
source url: "https://artifacts.opensearch.org/releases/bundle/opensearch/#{version}/opensearch-#{version}-linux-x64.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "opensearch-#{version}"
# versions_list:https://opensearch.org/docs/latest/version-history/
version("2.4.1") { source sha256: "f2b71818ad84cdab1b736211efbdd79d33835a92d46f66a237fa1182d012410d" }
version("2.4.0") { source sha256: "82bee5f68ea3d74a7d835d35f1479509b8497d01c1ae758a4737f5ea799e38e8" }
version("2.3.0") { source sha256: "696500b3126d2f2ad7216456cff1c58e8ea89402d76e0544a2e547549cf910ca" }
version("2.2.0") { source sha256: "4480c15682ddcd10cebb8a1103f4efafa789d7aee9d4c8c9201cd9864d5ed58c" }
version("2.1.0") { source sha256: "bccd737e0f4e4554d3918f011a1e379ebda9e53473c70b4264aa28ce719611e3" }
version("2.0.1") { source sha256: "8366dc71c839935330dbe841b415b37f28573de5ae7718e75f2e1c50756e0d99" }
version("2.0.0") { source sha256: "bec706d221052cb962ed0e6973d28e1058f21ef3dfc054c97c991bb279b0564e" }
version("1.3.2") { source sha256: "14199251a8aae2068fd54aa39c778ff29dcc8be33d57f36a8cc2d19e07ff4149" }
version("1.2.4") { source sha256: "d40f2696623b6766aa235997e2847a6c661a226815d4ba173292a219754bd8a8" }
target_path = "#{install_dir}/embedded/opensearch"
build do
mkdir "#{target_path}"
delete "#{project_dir}/config"
# OpenSearch includes a compatible jdk but its files fail the omnibus health check.
# It isn't needed since we use the omnibus built server-open-jre so it can be deleted.
delete "#{project_dir}/jdk"
# Delete the opensearch-knn plugin because it causes health check failures
delete "#{project_dir}/plugins/opensearch-knn"
sync "#{project_dir}/", "#{target_path}"
# Dropping a VERSION file here allows additional software definitions
# to read it to determine ES plugin compatibility.
command "echo #{version} > #{target_path}/VERSION"
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/libuuid.rb | config/software/libuuid.rb | #
# Copyright 2012-2014 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: deprecated 2021-11
#
name "libuuid"
default_version "2.21"
license "LGPL-2.1"
license_file "COPYING"
source url: "https://www.kernel.org/pub/linux/utils/util-linux/v#{version}/util-linux-#{version}.tar.gz"
# We use the version in util-linux, and only build the libuuid subdirectory
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/util-linux-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
version "2.21" do
source md5: "4222aa8c2a1b78889e959a4722f1881a"
end
relative_path "util-linux-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
command "./configure --prefix=#{install_dir}/embedded", env: env
make "-j #{workers}", env: env, cwd: "#{project_dir}/libuuid"
make "-j #{workers} install", env: env, cwd: "#{project_dir}/libuuid"
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/ibm-jre.rb | config/software/ibm-jre.rb | #
# Copyright 2015 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: deprecated 2021-04
name "ibm-jre"
license "IBM-Java-contractual-redistribution"
# This license is stange, it says it cannot be redistributed but Chef has obtained
# a contractual agreement with IBM to repackange and redistribute the JRE free of
# charge and without support or warranty to our mutual customers
license_file "copyright"
license_file "license_en.txt"
skip_transitive_dependency_licensing true
if ppc64?
source url: "https://s3.amazonaws.com/chef-releng/java/jre/ibm-java-ppc64-80.tar.xz",
md5: "face417c3786945c2eb458f058b8616b"
app_version = "ibm-java-ppc64-80"
relative_path "ibm-java-ppc64-80"
elsif ppc64le?
source url: "https://s3.amazonaws.com/chef-releng/java/jre/ibm-java-ppc64le-80.tar.xz",
md5: "199e3f1b5e3035bc813094e2973ffafb"
app_version = "ibm-java-ppc64le-80"
relative_path "ibm-java-ppc64le-80"
elsif s390x?
source url: "https://s3.amazonaws.com/chef-releng/java/jre/ibm-java-s390x-80.tar.gz",
md5: "722bf5ab5436add5fdddbed4b07503c7"
app_version = "ibm-java-s390x-80"
relative_path "ibm-java-s390x-80"
else
puts "The IBM JRE support for this platform was not found, thus it will not be installed"
end
default_version app_version
whitelist_file "jre/bin/javaws"
whitelist_file "jre/bin/policytool"
whitelist_file "jre/lib"
whitelist_file "jre/plugin"
whitelist_file "jre/bin/appletviewer"
whitelist_file "jre/bin/unpack200"
build do
mkdir "#{install_dir}/embedded/jre"
sync "#{project_dir}/jre/", "#{install_dir}/embedded/jre"
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/perl-thread-queue.rb | config/software/perl-thread-queue.rb | #
# Copyright 2019 Oregon State University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: deprecated 2021-04
name "perl-thread-queue"
default_version "3.13"
dependency "perl"
version "3.13" do
source sha256: "6ba3dacddd2fbb66822b4aa1d11a0a5273cd04c825cb3ff31c20d7037cbfdce8"
end
source url: "http://search.cpan.org/CPAN/authors/id/J/JD/JDHEDDEN/Thread-Queue-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "Thread-Queue-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path).merge(
"INSTALL_BASE" => "#{install_dir}/embedded"
)
command "#{install_dir}/embedded/bin/perl Makefile.PL", env: env
make env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/makedepend.rb | config/software/makedepend.rb | #
# Copyright 2014 Chef, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "makedepend"
default_version "1.0.8"
license "MIT"
license_file "COPYING"
skip_transitive_dependency_licensing true
# version_list: url=https://www.x.org/releases/individual/util/ Filter=makedepend-*.tar.gz
version("1.0.8") { source sha256: "275f0d2b196bfdc740aab9f02bb48cb7a97e4dfea011a7b468ed5648d0019e54" }
version("1.0.6") { source sha256: "845f6708fc850bf53f5b1d0fb4352c4feab3949f140b26f71b22faba354c3365" }
version("1.0.5") { source sha256: "503903d41fb5badb73cb70d7b3740c8b30fe1cc68c504d3b6a85e6644c4e5004" }
source url: "https://www.x.org/releases/individual/util/makedepend-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "makedepend-#{version}"
dependency "xproto"
dependency "util-macros"
dependency "pkg-config-lite"
build do
env = with_standard_compiler_flags(with_embedded_path)
command "./configure --prefix=#{install_dir}/embedded", env: env
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/berkshelf.rb | config/software/berkshelf.rb | #
# Copyright 2014-2018 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: deprecated 2021-04
name "berkshelf"
license "Apache-2.0"
license_file "https://raw.githubusercontent.com/berkshelf/berkshelf/main/LICENSE"
# berkshelf does not have any dependencies. We only install it from
# rubygems here.
skip_transitive_dependency_licensing true
dependency "nokogiri"
dependency "dep-selector-libgecode"
build do
env = with_standard_compiler_flags(with_embedded_path)
gem "install berkshelf" \
" --no-document", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/rebar.rb | config/software/rebar.rb | #
# Copyright 2012-2014 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: no version pinning
name "rebar"
# Current version (2.3.0) suffers from a pretty bad bug that breaks tests.
# (see https://github.com/rebar/rebar/pull/279 and https://github.com/rebar/rebar/pull/251)
# Version 2.3.1 Fixes this; we should switch to that if later versions aren't workable.
# Version 2.6.1 includes this fix.
default_version "93621d0d0c98035f79790ffd24beac94581b0758"
license "Apache-2.0"
license_file "LICENSE"
version "2.6.0"
dependency "erlang"
source git: "https://github.com/rebar/rebar.git"
relative_path "rebar"
build do
env = with_standard_compiler_flags(with_embedded_path)
command "./bootstrap", env: env
copy "#{project_dir}/rebar", "#{install_dir}/embedded/bin/"
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/chef.rb | config/software/chef.rb | #
# Copyright:: Copyright (c) Chef Software Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: no version pinning
name "chef"
default_version "main"
license "Apache-2.0"
license_file "LICENSE"
# Grab accompanying notice file.
# So that Open4/deep_merge/diff-lcs disclaimers are present in Omnibus LICENSES tree.
license_file "NOTICE"
# For the specific super-special version "local_source", build the source from
# the local git checkout. This is what you'd want to occur by default if you
# just ran omnibus build locally.
version("local_source") do
source path: "#{project.files_path}/../..",
# Since we are using the local repo, we try to not copy any files
# that are generated in the process of bundle installing omnibus.
# If the install steps are well-behaved, this should not matter
# since we only perform bundle and gem installs from the
# omnibus cache source directory, but we do this regardless
# to maintain consistency between what a local build sees and
# what a github based build will see.
options: { exclude: [ "omnibus/vendor" ] }
end
# For any version other than "local_source", fetch from github.
# This is the behavior the transitive omnibus software deps such as chef-dk
# expect.
if version != "local_source"
source git: "https://github.com/chef/chef.git"
end
relative_path "chef"
dependency "ruby"
dependency "libarchive" # for archive resource
build do
env = with_standard_compiler_flags(with_embedded_path)
# The --without groups here MUST match groups in https://github.com/chef/chef/blob/main/Gemfile
excluded_groups = %w{docgen chefstyle}
excluded_groups << "ruby_prof" if aix?
excluded_groups << "ruby_shadow" if aix?
excluded_groups << "ed25519" if solaris2?
# these are gems which are not shipped but which must be installed in the testers
bundle_excludes = excluded_groups + %w{development test}
bundle "install --without #{bundle_excludes.join(" ")}", env: env
ruby "post-bundle-install.rb", env: env
# use the rake install task to build/install chef-config/chef-utils
command "rake install:local", env: env
# NOTE: Chef18 is packaged and built with ruby31 whereas previous versions of Chef are ONLY built
# with ruby31,the packaged versions differ. So we use Chef's own version to determine the windows gemspec.
gemspec_name = if windows?
project.build_version.partition(".")[0].to_i < 18 ? "chef-universal-mingw32.gemspec" : "chef-universal-mingw-ucrt.gemspec"
else
"chef.gemspec"
end
# This step will build native components as needed - the event log dll is
# generated as part of this step. This is why we need devkit.
gem "build #{gemspec_name}", env: env
# ensure we put the gems in the right place to get picked up by the publish scripts
delete "pkg"
mkdir "pkg"
copy "chef*.gem", "pkg"
# Always deploy the powershell modules in the correct place.
if windows?
mkdir "#{install_dir}/modules/chef"
copy "distro/powershell/chef/*", "#{install_dir}/modules/chef"
end
block do
appbundle "chef", lockdir: project_dir, gem: "inspec-core-bin", without: excluded_groups, env: env
appbundle "chef", lockdir: project_dir, gem: "chef-bin", without: excluded_groups, env: env
appbundle "chef", lockdir: project_dir, gem: "chef", without: excluded_groups, env: env
appbundle "chef", lockdir: project_dir, gem: "ohai", without: excluded_groups, env: env
end
# The rubyzip gem ships with some test fixture data compressed in a format Apple's notarization service
# cannot understand. We need to delete that archive to pass notarization.
block "Delete test folder of rubyzip gem so downstream projects pass notarization" do
env["VISUAL"] = "echo"
%w{rubyzip}.each do |gem|
gem_install_dir = shellout!("#{install_dir}/embedded/bin/gem open #{gem}", env: env).stdout.chomp
remove_directory "#{gem_install_dir}/test"
end
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/ruby-windows-devkit-bash.rb | config/software/ruby-windows-devkit-bash.rb | #
# Copyright:: Copyright (c) 2014-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "ruby-windows-devkit-bash"
default_version "3.1.23-4-msys-1.0.18"
license "GPL-3.0"
license_file "http://www.gnu.org/licenses/gpl-3.0.txt"
skip_transitive_dependency_licensing true
# XXX: this depends on ruby-windows-devkit, but the caller MUST specify that dep, or else the slightly goofy
# library build_order optimizer in omnibus will promote ruby-windows-devkit to being before direct deps of
# the project file which will defeat our current strategy of installing devkit absolutely dead last.
# see: https://github.com/chef/omnibus/blob/2f9687fb1a3d2459b932acb4dcb37f4cb6335f4c/lib/omnibus/library.rb#L64-L77
#
# dependency "ruby-windows-devkit"
source url: "https://github.com/chef/msys-bash/releases/download/bash-#{version}/bash-#{version}-bin.tar.lzma",
md5: "22d5dbbd9bd0b3e0380d7a0e79c3108e"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}-#{version}/#{name}-#{version}-bin.tar.lzma",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "bin"
build do
# Copy over the required bins into embedded/bin
["bash.exe", "sh.exe"].each do |exe|
copy "#{exe}", "#{install_dir}/embedded/bin/#{exe}"
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/omnibus-ctl.rb | config/software/omnibus-ctl.rb | #
# Copyright 2012-2015 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "omnibus-ctl"
default_version "v0.6.0"
license "Apache-2.0"
license_file "https://raw.githubusercontent.com/chef/omnibus-ctl/main/LICENSE"
# Even though omnibus-ctl is a gem, it does not have any dependencies.
skip_transitive_dependency_licensing true
dependency "ruby"
# versions_list: https://github.com/chef/omnibus-ctl/tags filter=*.tar.gz
source git: "https://github.com/chef/omnibus-ctl.git"
relative_path "omnibus-ctl"
build do
env = with_standard_compiler_flags(with_embedded_path)
# Remove existing built gems in case they exist in the current dir
delete "omnibus-ctl-*.gem"
gem "build omnibus-ctl.gemspec", env: env
gem "install omnibus-ctl-*.gem --no-document ", env: env
touch "#{install_dir}/embedded/service/omnibus-ctl/.gitkeep"
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/bzip2.rb | config/software/bzip2.rb | #
# Copyright 2013-2018 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Install bzip2 and its shared library, libbz2.so
# This library object is required for building Python with the bz2 module,
# and should be picked up automatically when building Python.
name "bzip2"
default_version "1.0.8"
license "BSD-2-Clause"
license_file "LICENSE"
skip_transitive_dependency_licensing true
dependency "zlib"
dependency "openssl"
# version_list: url=https://sourceware.org/pub/bzip2/ filter=*.tar.gz
version("1.0.8") { source sha256: "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269" }
source url: "https://fossies.org/linux/misc/#{name}-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "#{name}-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
# Avoid warning where .rodata cannot be used when making a shared object
env["CFLAGS"] << " -fPIC" unless aix?
# The list of arguments to pass to make
args = "PREFIX='#{install_dir}/embedded' VERSION='#{version}'"
args << " CFLAGS='-qpic=small -qpic=large -O2 -g -D_ALL_SOURCE -D_LARGE_FILES'" if aix?
patch source: "makefile_take_env_vars.patch", plevel: 1, env: env
patch source: "makefile_no_bins.patch", plevel: 1, env: env # removes various binaries we don't want to ship
patch source: "soname_install_dir.patch", env: env if mac_os_x?
patch source: "aix_makefile.patch", env: env if aix?
make "#{args}", env: env
make "#{args} -f Makefile-libbz2_so", env: env
make "#{args} install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/elixir.rb | config/software/elixir.rb | #
# Copyright 2017 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: deprecated 2021-04
name "elixir"
default_version "1.4.2"
license "Apache-2.0"
license_file "LICENSE"
dependency "erlang"
version("1.4.2") { source sha256: "cb4e2ec4d68b3c8b800179b7ae5779e2999aa3375f74bd188d7d6703497f553f" }
source url: "https://github.com/elixir-lang/elixir/archive/v#{version}.tar.gz"
relative_path "elixir-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
make env: env
make "install PREFIX=#{install_dir}/embedded", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/libnghttp2.rb | config/software/libnghttp2.rb | #
# Copyright:: Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "libnghttp2"
default_version "1.58.0"
dependency "openssl"
license "MIT"
license_file "COPYING"
skip_transitive_dependency_licensing true
version("1.58.0") { source sha256: "9ebdfbfbca164ef72bdf5fd2a94a4e6dfb54ec39d2ef249aeb750a91ae361dfb" }
source url: "https://github.com/nghttp2/nghttp2/releases/download/v#{version}/nghttp2-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/nghttp2-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "nghttp2-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
configure_options = [
"--prefix=#{install_dir}/embedded",
"--with-openssl",
]
configure(*configure_options, env: env)
make "-j #{workers}", env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/gmp.rb | config/software/gmp.rb | #
# Copyright 2014 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "gmp"
default_version "6.3.0"
# version_list: url=https://ftp.gnu.org/gnu/gmp/ filter=*.tar.bz2
version("6.2.1") { source sha256: "eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c" }
version("6.1.0") { source sha256: "498449a994efeba527885c10405993427995d3f86b8768d8cdf8d9dd7c6b73e8" }
version("6.0.0a") { source sha256: "7f8e9a804b9c6d07164cf754207be838ece1219425d64e28cfa3e70d5c759aaf" }
version("6.3.0") { source sha256: "ac28211a7cfb609bae2e2c8d6058d66c8fe96434f740cf6fe2e47b000d1c20cb" }
source url: "https://ftp.gnu.org/gnu/gmp/gmp-#{version}.tar.bz2"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.bz2",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
if version == "6.0.0a"
# version 6.0.0a expands to 6.0.0
relative_path "gmp-6.0.0"
else
relative_path "gmp-#{version}"
end
build do
env = with_standard_compiler_flags(with_embedded_path)
if solaris2?
env["ABI"] = "32"
end
configure_command = ["./configure",
"--prefix=#{install_dir}/embedded"]
command configure_command.join(" "), env: env
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/libxml2.rb | config/software/libxml2.rb | #
# Copyright:: Chef Software Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "libxml2"
default_version "2.11.7"
license "MIT"
license_file "COPYING"
skip_transitive_dependency_licensing true
dependency "zlib"
dependency "liblzma"
dependency "config_guess"
# version_list: url=https://download.gnome.org/sources/libxml2/ filter=*.tar.xz
version("2.14.4") { source sha256: "24175ec30a97cfa86bdf9befb7ccf4613f8f4b2713c5103e0dd0bc9c711a2773" }
version("2.14.2") { source sha256: "353f3c83535d4224a4e5f1e88c90b5d4563ea8fec11f6407df640fd28fc8b8c6" }
version("2.13.8") { source sha256: "277294cb33119ab71b2bc81f2f445e9bc9435b893ad15bb2cd2b0e859a0ee84a" }
version("2.13.5") { source sha256: "74fc163217a3964257d3be39af943e08861263c4231f9ef5b496b6f6d4c7b2b6" }
version("2.12.10") { source sha256: "c3d8c0c34aa39098f66576fe51969db12a5100b956233dc56506f7a8679be995" }
version("2.12.7") { source sha256: "24ae78ff1363a973e6d8beba941a7945da2ac056e19b53956aeb6927fd6cfb56" }
version("2.12.5") { source sha256: "a972796696afd38073e0f59c283c3a2f5a560b5268b4babc391b286166526b21" }
version("2.11.7") { source sha256: "fb27720e25eaf457f94fd3d7189bcf2626c6dccf4201553bc8874d50e3560162" }
version("2.10.4") { source sha256: "ed0c91c5845008f1936739e4eee2035531c1c94742c6541f44ee66d885948d45" }
version("2.9.14") { source sha256: "60d74a257d1ccec0475e749cba2f21559e48139efba6ff28224357c7c798dfee" }
version("2.9.13") { source sha256: "276130602d12fe484ecc03447ee5e759d0465558fbc9d6bd144e3745306ebf0e" }
version("2.9.12") { source sha256: "28a92f6ab1f311acf5e478564c49088ef0ac77090d9c719bbc5d518f1fe62eb9" }
version("2.9.10") { source sha256: "593b7b751dd18c2d6abcd0c4bcb29efc203d0b4373a6df98e3a455ea74ae2813" }
version("2.9.9") { source sha256: "58a5c05a2951f8b47656b676ce1017921a29f6b1419c45e3baed0d6435ba03f5" }
minor_version = version.gsub(/\.\d+\z/, "")
source url: "https://download.gnome.org/sources/libxml2/#{minor_version}/libxml2-#{version}.tar.xz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.xz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "libxml2-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
configure_command = [
"--with-zlib=#{install_dir}/embedded",
"--with-lzma=#{install_dir}/embedded",
"--with-sax1", # required for nokogiri to compile
"--without-iconv",
"--without-python",
"--without-icu",
"--without-debug",
"--without-mem-debug",
"--without-run-debug",
"--without-legacy", # we don't need legacy interfaces
"--without-catalog",
"--without-docbook",
]
update_config_guess
configure(*configure_command, env: env)
make "-j #{workers}", env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/google-protobuf.rb | config/software/google-protobuf.rb | #
# Copyright 2018 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
### NOTE ###
# We build this definition from source rather than installing from the
# gem so the native extension builds against the correct ruby rather than shipping
# a vendored library for each 2.x version of ruby, which is what is packaged
# with the gem.
name "google-protobuf"
default_version "v3.21.12"
dependency "ruby"
source git: "https://github.com/google/protobuf.git"
# versions_list: https://github.com/protocolbuffers/protobuf/tags filter=*.tar.gz
license :project_license
build do
mkdir "#{project_dir}/ruby/ext/google/protobuf_c/third_party/utf8_range"
copy "#{project_dir}/third_party/utf8_range/utf8_range.h", "#{project_dir}/ruby/ext/google/protobuf_c/third_party/utf8_range"
copy "#{project_dir}/third_party/utf8_range/naive.c", "#{project_dir}/ruby/ext/google/protobuf_c/third_party/utf8_range"
copy "#{project_dir}/third_party/utf8_range/range2-neon.c", "#{project_dir}/ruby/ext/google/protobuf_c/third_party/utf8_range"
copy "#{project_dir}/third_party/utf8_range/range2-sse.c", "#{project_dir}/ruby/ext/google/protobuf_c/third_party/utf8_range"
copy "#{project_dir}/third_party/utf8_range/LICENSE", "#{project_dir}/ruby/ext/google/protobuf_c/third_party/utf8_range"
env = with_standard_compiler_flags(with_embedded_path)
gem "build google-protobuf.gemspec", env: env, cwd: "#{project_dir}/ruby"
gem "install google-protobuf-*.gem", env: env, cwd: "#{project_dir}/ruby"
end | ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/help2man.rb | config/software/help2man.rb | #
# Copyright 2012-2014 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: deprecated 2021-04
name "help2man"
default_version "1.40.5"
version "1.47.3" do
source url: "https://ftp.gnu.org/gnu/help2man/help2man-1.47.3.tar.xz",
md5: "d1d44a7a7b2bd61755a2045d96ecaea0"
end
version "1.40.5" do
source url: "https://ftp.gnu.org/gnu/help2man/help2man-1.40.5.tar.gz",
md5: "75a7d2f93765cd367aab98986a75f88c"
end
relative_path "help2man-1.40.5"
build do
env = with_standard_compiler_flags(with_embedded_path)
command "./configure --prefix=#{install_dir}/embedded", env: env
make env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/ruby-msys2-devkit.rb | config/software/ruby-msys2-devkit.rb | #
# Copyright 2022 Progress Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "ruby-msys2-devkit"
default_version "3.0.6-1"
license "BSD-3-Clause"
license_file "https://raw.githubusercontent.com/oneclick/rubyinstaller2/master/LICENSE.txt"
skip_transitive_dependency_licensing true
arch = "x64"
msys_dir = "msys64"
version "3.3.0-1" do
source url: "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-#{version}/rubyinstaller-devkit-#{version}-x64.exe",
sha256: "01fc7d7889f161e94ae515c15fc1c22b7db506ab91af891cf7e1a764e96d8298"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/rubyinstaller-devkit-#{version}-x64.exe",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
version "3.3.1-1" do
source url: "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-#{version}/rubyinstaller-devkit-#{version}-x64.exe",
sha256: "dc590fb3d1c4254e7d33179bb84df378ead943fece2159eada5f3582bf643cc3"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/rubyinstaller-devkit-#{version}-x64.exe",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
version "3.0.6-1" do
source url: "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-#{version}/rubyinstaller-devkit-#{version}-x64.exe",
sha256: "c44256eae6a934db39e4f3a56d39178ac87b8b754e9b66221910417adb59a3a1"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/rubyinstaller-devkit-#{version}-x64.exe",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
version "3.1.2-1" do
source url: "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-#{version}/rubyinstaller-devkit-#{version}-x64.exe",
sha256: "5f0fd4a206b164a627c46e619d2babbcafb0ed4bc3e409267b9a73b6c58bdec1"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/rubyinstaller-devkit-#{version}-x64.exe",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
version "3.1.4-1" do
source url: "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-#{version}/rubyinstaller-devkit-#{version}-x64.exe",
sha256: "d3dd7451bdae502894925a90c9e87685ec18fd3f73a6ca50e4282b8879d385e2"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/rubyinstaller-devkit-#{version}-x64.exe",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
version "3.1.5-1" do
source url: "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-#{version}/rubyinstaller-devkit-#{version}-x64.exe",
sha256: ""
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/rubyinstaller-devkit-#{version}-x64.exe",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
version "3.1.6-1" do
source url: "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-#{version}/rubyinstaller-devkit-#{version}-x64.exe",
sha256: "42f71849f0ae053df8d40182e00ee82a98ac5faa69d815fa850566f2d3711174"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/rubyinstaller-devkit-#{version}-x64.exe",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
version "3.1.7-1" do
source url: "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-#{version}/rubyinstaller-devkit-#{version}-x64.exe",
sha256: "c643bf00680aa21f20b34587aa0613e9970d9b63adaef2c0228925a7f9cdfc7a"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/rubyinstaller-devkit-#{version}-x64.exe",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
version "3.2.2-1" do
source url: "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-#{version}/rubyinstaller-devkit-#{version}-x64.exe",
sha256: "678619631c7e0e9b06bd53fd50689b47770fb577a8e49a35f615d2c8691aa6b7"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/rubyinstaller-devkit-#{version}-x64.exe",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
build do
if windows?
embedded_dir = "#{install_dir}/embedded"
Dir.mktmpdir do |tmpdir|
command "#{project_dir}/rubyinstaller-devkit-#{version}-#{arch}.exe /SP- /NORESTART /VERYSILENT /SUPPRESSMSGBOXES /NOPATH /DIR=#{tmpdir}"
copy "#{tmpdir}/#{msys_dir}", embedded_dir
if version.start_with?("3.0")
copy "#{tmpdir}/lib/ruby/site_ruby/3.0.0/devkit.rb", "#{embedded_dir}/lib/ruby/site_ruby/3.0.0"
copy "#{tmpdir}/lib/ruby/site_ruby/3.0.0/ruby_installer.rb", "#{embedded_dir}/lib/ruby/site_ruby/3.0.0"
copy "#{tmpdir}/lib/ruby/site_ruby/3.0.0/ruby_installer", "#{embedded_dir}/lib/ruby/site_ruby/3.0.0"
copy "#{tmpdir}/lib/ruby/3.0.0/rubygems/defaults", "#{embedded_dir}/lib/ruby/3.0.0/rubygems/defaults"
elsif version.start_with?("3.1")
copy "#{tmpdir}/lib/ruby/site_ruby/3.1.0/devkit.rb", "#{embedded_dir}/lib/ruby/site_ruby/3.1.0"
copy "#{tmpdir}/lib/ruby/site_ruby/3.1.0/ruby_installer.rb", "#{embedded_dir}/lib/ruby/site_ruby/3.1.0"
copy "#{tmpdir}/lib/ruby/site_ruby/3.1.0/ruby_installer", "#{embedded_dir}/lib/ruby/site_ruby/3.1.0"
copy "#{tmpdir}/lib/ruby/3.1.0/rubygems/defaults", "#{embedded_dir}/lib/ruby/3.1.0/rubygems/defaults"
elsif version.start_with?("3.2")
copy "#{tmpdir}/lib/ruby/site_ruby/3.2.0/devkit.rb", "#{embedded_dir}/lib/ruby/site_ruby/3.2.0"
copy "#{tmpdir}/lib/ruby/site_ruby/3.2.0/ruby_installer.rb", "#{embedded_dir}/lib/ruby/site_ruby/3.2.0"
copy "#{tmpdir}/lib/ruby/site_ruby/3.2.0/ruby_installer", "#{embedded_dir}/lib/ruby/site_ruby/3.2.0"
copy "#{tmpdir}/lib/ruby/3.2.0/rubygems/defaults", "#{embedded_dir}/lib/ruby/3.2.0/rubygems/defaults"
end
# Normally we would symlink the required unix tools.
# However with the introduction of git-cache to speed up omnibus builds,
# we can't do that anymore since git on windows doesn't support symlinks.
# https://groups.google.com/forum/#!topic/msysgit/arTTH5GmHRk
# Therefore we copy the tools to the necessary places.
# We need tar for 'knife cookbook site install' to function correctly and
# many gems that ship with native extensions assume tar will be available
# in the PATH.
copy "#{tmpdir}/#{msys_dir}/usr/bin/bsdtar.exe", "#{install_dir}/bin/tar.exe"
if version >= "3.1.6-1"
copy "#{tmpdir}/#{msys_dir}/usr/bin/msys-crypto-3.dll", "#{install_dir}/bin/msys-crypto-3.dll"
copy "#{tmpdir}/#{msys_dir}/usr/bin/msys-bz2-1.dll", "#{install_dir}/bin/msys-bz2-1.dll"
copy "#{tmpdir}/#{msys_dir}/usr/bin/msys-iconv-2.dll", "#{install_dir}/bin/msys-iconv-2.dll"
copy "#{tmpdir}/#{msys_dir}/usr/bin/msys-expat-1.dll", "#{install_dir}/bin/msys-expat-1.dll"
copy "#{tmpdir}/#{msys_dir}/usr/bin/msys-lzma-5.dll", "#{install_dir}/bin/msys-lzma-5.dll"
copy "#{tmpdir}/#{msys_dir}/usr/bin/msys-lz4-1.dll", "#{install_dir}/bin/msys-lz4-1.dll"
copy "#{tmpdir}/#{msys_dir}/usr/bin/msys-2.0.dll", "#{install_dir}/bin/msys-2.0.dll"
copy "#{tmpdir}/#{msys_dir}/usr/bin/msys-z.dll", "#{install_dir}/bin/msys-z.dll"
copy "#{tmpdir}/#{msys_dir}/usr/bin/msys-zstd-1.dll", "#{install_dir}/bin/msys-zstd-1.dll"
end
end
command "#{embedded_dir}/#{msys_dir}/msys2_shell.cmd -defterm -no-start -c exit", env: { "CONFIG" => "" }
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/go-uninstall.rb | config/software/go-uninstall.rb | #
# Copyright 2019 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: logic only
name "go-uninstall"
default_version "0.0.1"
license :project_license
dependency "go"
build do
# Until Omnibus has full support for build depedencies (see chef/omnibus#483)
# we are going to manually uninstall Go
%w{go gofmt}.each do |bin|
delete "#{install_dir}/embedded/bin/#{bin}"
end
block "Delete Go language from embedded directory" do
remove_directory "#{install_dir}/embedded/go"
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/autoconf.rb | config/software/autoconf.rb | #
# Copyright:: Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: deprecated 2021-04
name "autoconf"
default_version "2.69"
license "GPL-3.0"
license_file "COPYING"
license_file "COPYING.EXCEPTION"
skip_transitive_dependency_licensing true
dependency "m4"
version("2.69") { source sha256: "954bd69b391edc12d6a4a51a2dd1476543da5c6bbf05a95b59dc0dd6fd4c2969" }
source url: "https://ftp.gnu.org/gnu/autoconf/autoconf-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "autoconf-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
if solaris2?
env["M4"] = "#{install_dir}/embedded/bin/m4"
end
command "./configure" \
" --prefix=#{install_dir}/embedded", env: env
make "-j #{workers}", env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/inspec.rb | config/software/inspec.rb | #
# Copyright:: Copyright (c) Chef Software Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# expeditor/ignore: no version pinning
name "inspec"
default_version "main"
license "Apache-2.0"
license_file "LICENSE"
source git: "https://github.com/chef/inspec.git"
dependency "ruby"
dependency "nokogiri"
# Dependency added to avoid this pry error:
# "Sorry, you can't use Pry without Readline or a compatible library."
dependency "rb-readline"
build do
env = with_standard_compiler_flags(with_embedded_path)
bundle "config set --local without test integration tools maintenance", env: env
bundle "install", env: env
gem "build inspec.gemspec", env: env
gem "install inspec-*.gem" \
" --no-document", env: env
appbundle "inspec", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/expat.rb | config/software/expat.rb | #
# Copyright 2014 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "expat"
default_version "2.6.4" # 2.6.4 is the latest version as of 2024-11-6, v2.5.0 has a CVE in it.
relative_path "expat-#{version}"
dependency "config_guess"
license "MIT"
license_file "COPYING"
skip_transitive_dependency_licensing true
# version_list: url=https://github.com/libexpat/libexpat/releases filter=*.tar.gz
source url: "https://github.com/libexpat/libexpat/releases/download/R_#{version.gsub(".", "_")}/expat-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
version("2.6.4") { source sha256: "fd03b7172b3bd7427a3e7a812063f74754f24542429b634e0db6511b53fb2278" }
version("2.5.0") { source sha256: "6b902ab103843592be5e99504f846ec109c1abb692e85347587f237a4ffa1033" }
version("2.4.9") { source sha256: "4415710268555b32c4e5ab06a583bea9fec8ff89333b218b70b43d4ca10e38fa" }
version("2.4.8") { source sha256: "398f6d95bf808d3108e27547b372cb4ac8dc2298a3c4251eb7aa3d4c6d4bb3e2" }
version("2.4.7") { source sha256: "72644d5f0f313e2a5cf81275b09b9770c866dd87a2b62ab19981657ac0d4af5f" }
version("2.4.6") { source sha256: "a0eb5af56b1c2ba812051c49bf3b4e5763293fe5394a0219df7208845c3efb8c" }
version("2.4.1") { source sha256: "a00ae8a6b96b63a3910ddc1100b1a7ef50dc26dceb65ced18ded31ab392f132b" }
version("2.3.0") { source sha256: "89df123c62f2c2e2b235692d9fe76def6a9ab03dbe95835345bf412726eb1987" }
version("2.1.0") { source sha256: "823705472f816df21c8f6aa026dd162b280806838bb55b3432b0fb1fcca7eb86" }
build do
env = with_standard_compiler_flags(with_embedded_path)
update_config_guess(target: "conftools")
# AIX needs two fixes to compile the latest version.
# 1. We need to add -lm to link in the proper math declarations
# 2. Since we are using xlc to compile, we need to use qvisibility instead of fvisibility
# Refer to https://www.ibm.com/docs/en/xl-c-and-cpp-aix/16.1?topic=descriptions-qvisibility-fvisibility
if aix?
env["LDFLAGS"] << " -lm"
if version <= "2.4.1"
patch source: "configure_xlc_visibility.patch", plevel: 1, env: env
else
patch source: "configure_xlc_visibility_2.4.7.patch", plevel: 1, env: env
end
end
command "./configure" \
" --without-examples" \
" --without-tests" \
" --prefix=#{install_dir}/embedded", env: env
make "-j #{workers}", env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.