CombinedText stringlengths 4 3.42M |
|---|
class Emergency
include Mongoid::Document
include Mongoid::Timestamps
#include Mongoid::Versioning
has_one :donation, as: :eventable
embeds_many :pending_matches, class_name: "Donor", store_as: 'pending_matches'
embeds_many :contacted_matches, class_name: "Donor", store_as: 'contacted_matches'
field :title, type: String
field :description, type: String
field :sms_message_text, type: String
field :created_by, type: String
field :match_found, type: Boolean, default: false
field :match_details, type: String
field :blood_group, type: String
field :status, type: String
validates_presence_of :title, :description, :blood_group
#TODO: Add a EmergencyComments; so emergency has_many comments
after_create :set_status_to_draft, :populate_matches
BATCH_SIZE = 5
STATUS_DRAFT = 'draft'
STATUS_ACTIVE = 'active'
STATUS_CLOSE = 'closed'
def set_status_to_draft
self.status = STATUS_DRAFT
self.save
end
def populate_matches
# picks out a bunch of matches given criteria, and populates the pending matches list
if self.blood_group == Donor::BLOOD_TYPE_UNIVERSAL_RECIPIENT
donors = Donor.all
else
donors = Donor.in(blood_group: [self.blood_group, Donor::BLOOD_TYPE_UNIVERSAL_DONOR])
end
# TODO: Fancy sorting happens here
self.pending_matches = donors
end
def contact_matches(batch_size = BATCH_SIZE)
# contact some or possibly all of the people we just selected out, depending on
# batch size and move them to the contacted matches list
count = 0
while ((self.pending_matches.count > 0) && (count < batch_size)) do
current_donor = self.pending_matches.pop
# current_donor.contact(self) #TODO: SMS Sending here; need to implement
self.contacted_matches << current_donor
count += 1
end
self.save
end
def close_emergency(donor_found, donor_details)
# set donor found
# set donor_details if any
end
end
Add validation for emergency model
class Emergency
include Mongoid::Document
include Mongoid::Timestamps
#include Mongoid::Versioning
has_one :donation, as: :eventable
embeds_many :pending_matches, class_name: "Donor", store_as: 'pending_matches'
embeds_many :contacted_matches, class_name: "Donor", store_as: 'contacted_matches'
field :title, type: String
field :description, type: String
field :sms_message_text, type: String
field :created_by, type: String
field :match_found, type: Boolean, default: false
field :match_details, type: String
field :blood_group, type: String
field :status, type: String
validates_presence_of :title, :description, :blood_group
#TODO: Add a EmergencyComments; so emergency has_many comments
after_create :set_status_to_draft, :populate_matches
BATCH_SIZE = 5
STATUS_DRAFT = 'draft'
STATUS_ACTIVE = 'active'
STATUS_CLOSE = 'closed'
def set_status_to_draft
self.status = STATUS_DRAFT
self.save
end
def populate_matches
# picks out a bunch of matches given criteria, and populates the pending matches list
if self.blood_group == Donor::BLOOD_TYPE_UNIVERSAL_RECIPIENT
donors = Donor.all
else
donors = Donor.in(blood_group: [self.blood_group, Donor::BLOOD_TYPE_UNIVERSAL_DONOR])
end
# TODO: Fancy sorting happens here
self.pending_matches = donors
end
def contact_matches(batch_size = BATCH_SIZE)
# contact some or possibly all of the people we just selected out, depending on
# batch size and move them to the contacted matches list
count = 0
while ((self.pending_matches.count > 0) && (count < batch_size)) do
current_donor = self.pending_matches.pop
# current_donor.contact(self) #TODO: SMS Sending here; need to implement
self.contacted_matches << current_donor
count += 1
end
self.save
end
def close_emergency(donor_found, donor_details)
# set donor found
# set donor_details if any
end
end |
class FileIcon
BASE_ICON_PATH = 'fileicons'
ICON_PATH_TEMPLATE = "#{BASE_ICON_PATH}/%s.png"
DEFAULT_ICON_TYPE = 'file'
DEFAULT_ICON_PATH = ICON_PATH_TEMPLATE % DEFAULT_ICON_TYPE
AUDIO_EXTENSIONS = %w{ aac aif iff mp3 mpa ra wav wma }
VIDEO_EXTENSIONS = %w{ 3g2 3gp asf asx avi flv m4v mov mp4 mpg rm swf vob wmv }
IMAGE_EXTENSIONS = %w{ bmp eps gif jpeg jpg png svg tiff }
def self.icon_path(filename)
FileIcon.new(filename).icon_path
end
def initialize(filename)
@extension = File.extname(filename).delete('.')
rescue
@extension = nil
end
def type
@extension
end
def icon_path
EXT_MAP[@extension] || DEFAULT_ICON_PATH
end
private
def self.fileicon_assets
files = Dir.glob("#{Rails.application.assets_manifest.directory}/#{BASE_ICON_PATH}/*.png")
if files.empty? && Rails.application.assets
files = Rails.application.assets.paths.map {|d| Dir.glob("#{d}/#{BASE_ICON_PATH}/*.png")}.flatten
end
files
end
def self.init_ext_map
ext_map = {}
AUDIO_EXTENSIONS.each { |ext| ext_map[ext] = ICON_PATH_TEMPLATE % 'audio' }
VIDEO_EXTENSIONS.each { |ext| ext_map[ext] = ICON_PATH_TEMPLATE % 'video' }
IMAGE_EXTENSIONS.each { |ext| ext_map[ext] = ICON_PATH_TEMPLATE % 'image' }
fileicon_assets.each do |file|
ext = File.basename(file, '.png')
ext_map[ext] = ICON_PATH_TEMPLATE % ext
end
ext_map
end
EXT_MAP = FileIcon.init_ext_map
end
Lazy load fileIcon paths because the list is not available in production until after the application has loaded. Also, strip the asset digests from the names.
class FileIcon
BASE_ICON_PATH = 'fileicons'
ICON_PATH_TEMPLATE = "#{BASE_ICON_PATH}/%s.png"
DEFAULT_ICON_TYPE = 'file'
DEFAULT_ICON_PATH = ICON_PATH_TEMPLATE % DEFAULT_ICON_TYPE
AUDIO_EXTENSIONS = %w{ aac aif iff mp3 mpa ra wav wma }
VIDEO_EXTENSIONS = %w{ 3g2 3gp asf asx avi flv m4v mov mp4 mpg rm swf vob wmv }
IMAGE_EXTENSIONS = %w{ bmp eps gif jpeg jpg png svg tiff }
def self.icon_path(filename)
FileIcon.new(filename).icon_path
end
def initialize(filename)
@extension = File.extname(filename).delete('.')
rescue
@extension = nil
end
def type
@extension
end
def icon_path
FileIcon.ext_map[@extension] || DEFAULT_ICON_PATH
end
private
def self.fileicon_assets
files = Dir.glob("#{Rails.application.assets_manifest.directory}/#{BASE_ICON_PATH}/*.png")
if files.empty? && Rails.application.assets
files = Rails.application.assets.paths.map {|d| Dir.glob("#{d}/#{BASE_ICON_PATH}/*.png")}.flatten
end
files
end
def self.init_ext_map
ext_map = {}
AUDIO_EXTENSIONS.each { |ext| ext_map[ext] = ICON_PATH_TEMPLATE % 'audio' }
VIDEO_EXTENSIONS.each { |ext| ext_map[ext] = ICON_PATH_TEMPLATE % 'video' }
IMAGE_EXTENSIONS.each { |ext| ext_map[ext] = ICON_PATH_TEMPLATE % 'image' }
fileicon_assets.each do |file|
ext = File.basename(file, '.png').gsub(/-.*/,'')
ext_map[ext] = ICON_PATH_TEMPLATE % ext
end
ext_map
end
def self.ext_map
@@ext_map ||= FileIcon.init_ext_map
end
end
|
class GroupSet < ActiveRecord::Base
belongs_to :unit
has_many :groups, dependent: :destroy
validates_associated :groups
validate :must_be_in_same_tutorial, if: :keep_groups_in_same_class
def self.permissions
result = {
:Student => [ :get_groups ],
:Tutor => [ :join_group, :get_groups, :create_group ],
:Convenor => [ :join_group, :get_groups, :create_group ],
:nil => [ ]
}
end
def specific_permission_hash(role, perm_hash, other)
result = perm_hash[role] unless perm_hash.nil?
if result && role == :Student
puts "here"
if allow_students_to_create_groups
result << :create_group
end
if allow_students_to_manage_groups
result << :join_group
end
end
result
end
def role_for(user)
unit.role_for(user)
end
def must_be_in_same_tutorial
if keep_groups_in_same_class
groups.each do | grp |
if not grp.all_members_in_tutorial?
errors.add(:groups, "exist where some members are not in the group's tutorial")
end
end
end
end
end
remove tracing code
class GroupSet < ActiveRecord::Base
belongs_to :unit
has_many :groups, dependent: :destroy
validates_associated :groups
validate :must_be_in_same_tutorial, if: :keep_groups_in_same_class
def self.permissions
result = {
:Student => [ :get_groups ],
:Tutor => [ :join_group, :get_groups, :create_group ],
:Convenor => [ :join_group, :get_groups, :create_group ],
:nil => [ ]
}
end
def specific_permission_hash(role, perm_hash, other)
result = perm_hash[role] unless perm_hash.nil?
if result && role == :Student
if allow_students_to_create_groups
result << :create_group
end
if allow_students_to_manage_groups
result << :join_group
end
end
result
end
def role_for(user)
unit.role_for(user)
end
def must_be_in_same_tutorial
if keep_groups_in_same_class
groups.each do | grp |
if not grp.all_members_in_tutorial?
errors.add(:groups, "exist where some members are not in the group's tutorial")
end
end
end
end
end
|
class NycNoise< ActiveRecord::Base
validates :latitude, :longitude, presence: true
# def self.request(request_url)
# base_url = ""
# api_request = base_url + request_url
# api_response = open(api_request).read
# JSON.parse(api_response)["response"]
# end
def self.convert_to_float
self.latitude.to_f
self.longitude.to_f
end
# # def self.hourly_breakout
# # result = self.request("URL_HERE")
# # created_date: "2015-07-26 13:50:00 -0400"
# NycNoise.having()
# end
# def noise_by_type
# result = self.request("URL_HERE")
# end
end
coordinates method model
class NycNoise< ActiveRecord::Base
validates :latitude, :longitude, presence: true
# def self.request(request_url)
# base_url = ""
# api_request = base_url + request_url
# api_response = open(api_request).read
# JSON.parse(api_response)["response"]
# end
def self.convert_to_float
self.latitude.to_f
self.longitude.to_f
end
def self.coordinates
self.select(:latitude, :longitude)
end
# # def self.hourly_breakout
# # result = self.request("URL_HERE")
# # created_date: "2015-07-26 13:50:00 -0400"
# NycNoise.having()
# end
# def noise_by_type
# result = self.request("URL_HERE")
# end
end
|
# frozen_string_literal: true
# Maintain your gem's version:
require_relative "lib/publify_core/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "publify_core"
s.version = PublifyCore::VERSION
s.authors = ["Matijs van Zuijlen", "Yannick François",
"Thomas Lecavellier", "Frédéric de Villamil"]
s.email = ["matijs@matijs.net"]
s.homepage = "https://publify.github.io/"
s.summary = "Core engine for the Publify blogging system."
s.description = "Core engine for the Publify blogging system, formerly known as Typo."
s.license = "MIT"
s.files = File.open("Manifest.txt").readlines.map(&:chomp)
s.required_ruby_version = ">= 2.5.0"
s.add_dependency "aasm", "~> 5.0"
s.add_dependency "akismet", "~> 3.0"
s.add_dependency "bluecloth", "~> 2.1"
s.add_dependency "cancancan", "~> 3.0"
s.add_dependency "carrierwave", "~> 2.0"
s.add_dependency "devise", "~> 4.7.1"
s.add_dependency "devise-i18n", "~> 1.2"
s.add_dependency "fog-aws", "~> 3.2"
s.add_dependency "fog-core", "~> 2.2"
s.add_dependency "jquery-rails", "~> 4.4.0"
s.add_dependency "jquery-ui-rails", "~> 6.0.1"
s.add_dependency "kaminari", ["~> 1.2", ">= 1.2.1"]
s.add_dependency "marcel", "~> 1.0.0"
s.add_dependency "mini_magick", ["~> 4.9", ">= 4.9.4"]
s.add_dependency "rack", ">= 2.2.3"
s.add_dependency "rails", "~> 6.0.0"
s.add_dependency "rails_autolink", "~> 1.1.0"
s.add_dependency "rails-i18n", "~> 6.0.0"
s.add_dependency "rails-timeago", "~> 2.0"
s.add_dependency "recaptcha", ["~> 5.0"]
s.add_dependency "RedCloth", "~> 4.3.2"
s.add_dependency "rubypants", "~> 0.7.0"
s.add_dependency "sassc-rails", "~> 2.0"
s.add_dependency "sprockets", "~> 3.0"
s.add_dependency "twitter", "~> 7.0.0"
s.add_dependency "uuidtools", "~> 2.2.0"
s.add_development_dependency "capybara", "~> 3.0"
s.add_development_dependency "factory_bot", "~> 6.1"
s.add_development_dependency "feedjira", "~> 3.1"
s.add_development_dependency "i18n-tasks", "~> 0.9.1"
s.add_development_dependency "pry"
s.add_development_dependency "rails-controller-testing", "~> 1.0.1"
s.add_development_dependency "rspec-rails", "~> 4.0"
s.add_development_dependency "simplecov", "~> 0.21.2"
s.add_development_dependency "sqlite3"
s.add_development_dependency "timecop", "~> 0.9.1"
s.add_development_dependency "webmock", "~> 3.3"
end
Require at least CarrierWave 2.2.1
This version also uses marcel instead of mimemagic.
# frozen_string_literal: true
# Maintain your gem's version:
require_relative "lib/publify_core/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "publify_core"
s.version = PublifyCore::VERSION
s.authors = ["Matijs van Zuijlen", "Yannick François",
"Thomas Lecavellier", "Frédéric de Villamil"]
s.email = ["matijs@matijs.net"]
s.homepage = "https://publify.github.io/"
s.summary = "Core engine for the Publify blogging system."
s.description = "Core engine for the Publify blogging system, formerly known as Typo."
s.license = "MIT"
s.files = File.open("Manifest.txt").readlines.map(&:chomp)
s.required_ruby_version = ">= 2.5.0"
s.add_dependency "aasm", "~> 5.0"
s.add_dependency "akismet", "~> 3.0"
s.add_dependency "bluecloth", "~> 2.1"
s.add_dependency "cancancan", "~> 3.0"
s.add_dependency "carrierwave", "~> 2.2.1"
s.add_dependency "devise", "~> 4.7.1"
s.add_dependency "devise-i18n", "~> 1.2"
s.add_dependency "fog-aws", "~> 3.2"
s.add_dependency "fog-core", "~> 2.2"
s.add_dependency "jquery-rails", "~> 4.4.0"
s.add_dependency "jquery-ui-rails", "~> 6.0.1"
s.add_dependency "kaminari", ["~> 1.2", ">= 1.2.1"]
s.add_dependency "marcel", "~> 1.0.0"
s.add_dependency "mini_magick", ["~> 4.9", ">= 4.9.4"]
s.add_dependency "rack", ">= 2.2.3"
s.add_dependency "rails", "~> 6.0.0"
s.add_dependency "rails_autolink", "~> 1.1.0"
s.add_dependency "rails-i18n", "~> 6.0.0"
s.add_dependency "rails-timeago", "~> 2.0"
s.add_dependency "recaptcha", ["~> 5.0"]
s.add_dependency "RedCloth", "~> 4.3.2"
s.add_dependency "rubypants", "~> 0.7.0"
s.add_dependency "sassc-rails", "~> 2.0"
s.add_dependency "sprockets", "~> 3.0"
s.add_dependency "twitter", "~> 7.0.0"
s.add_dependency "uuidtools", "~> 2.2.0"
s.add_development_dependency "capybara", "~> 3.0"
s.add_development_dependency "factory_bot", "~> 6.1"
s.add_development_dependency "feedjira", "~> 3.1"
s.add_development_dependency "i18n-tasks", "~> 0.9.1"
s.add_development_dependency "pry"
s.add_development_dependency "rails-controller-testing", "~> 1.0.1"
s.add_development_dependency "rspec-rails", "~> 4.0"
s.add_development_dependency "simplecov", "~> 0.21.2"
s.add_development_dependency "sqlite3"
s.add_development_dependency "timecop", "~> 0.9.1"
s.add_development_dependency "webmock", "~> 3.3"
end
|
class Pregnancy
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::History::Trackable
include Mongoid::Userstamp
include LastMenstrualPeriodHelper
# Relationships
belongs_to :patient
has_and_belongs_to_many :users, inverse_of: :pregnancies
embeds_many :pledges
embeds_many :notes
embeds_many :calls
has_one :clinic
# Enable mass posting in forms
accepts_nested_attributes_for :patient
accepts_nested_attributes_for :clinic
# Fields
# Intake information
field :initial_call_date, type: Date
field :last_menstrual_period_weeks, type: Integer
field :last_menstrual_period_days, type: Integer
field :voicemail_ok, type: Boolean
field :line, type: String # DC, MD, VA
field :language, type: String
field :appointment_date, type: Date
field :urgent_flag, type: Boolean
# General patient information
field :age, type: Integer
field :city, type: String
field :state, type: String # ennumeration?
field :zip, type: String
field :county, type: String
field :race_ethnicity, type: String
field :employment_status, type: String
field :household_size, type: Integer
field :insurance, type: String
field :income, type: String
field :referred_by, type: String
field :special_circumstances, type: String # ennumeration
# Procedure result - generally for administrative use
field :fax_received, type: Boolean
field :procedure_cost, type: Integer
field :procedure_date, type: DateTime
field :procedure_completed_date, type: DateTime
field :resolved_without_dcaf, type: Boolean
# Validations
validates :initial_call_date,
:created_by,
presence: true
validates_associated :patient, on: :create
# History and auditing
track_history on: fields.keys + [:updated_by_id],
version_field: :version,
track_create: true,
track_update: true,
track_destroy: true
mongoid_userstamp user_model: 'User'
# Methods - see also the helpers
def self.most_recent
order('created_at DESC').limit(1).first
end
def recent_calls
calls.order('created_at DESC').limit(10)
end
def old_calls
calls.order('created_at DESC').offset(10)
end
def most_recent_note_display_text
most_recent_note = notes.order('created_at DESC').limit(1).first.try :full_text
display_note = most_recent_note.to_s[0..40]
display_note << '...' if most_recent_note.to_s.length > 40
display_note
end
def status
# if resolved_without_dcaf
# status = "Resolved Without DCAF"
# elsif pledge_status?(:paid)
# status = "Pledge Paid"
# elsif pledge_status?(:sent)
# status = "Sent Pledge"
if appointment_date
'Fundraising'
elsif contact_made?
'Needs Appointment'
else
'No Contact Made'
end
end
private
def contact_made?
calls.each do |call|
return true if call.status == 'Reached patient'
end
false
end
# def pledge_status?(status)
# pledges.each do |pledge|
# return true if pledge[status]
# end
# false
# end
end
split into most recent note and most recent note display
class Pregnancy
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::History::Trackable
include Mongoid::Userstamp
include LastMenstrualPeriodHelper
# Relationships
belongs_to :patient
has_and_belongs_to_many :users, inverse_of: :pregnancies
embeds_many :pledges
embeds_many :notes
embeds_many :calls
has_one :clinic
# Enable mass posting in forms
accepts_nested_attributes_for :patient
accepts_nested_attributes_for :clinic
# Fields
# Intake information
field :initial_call_date, type: Date
field :last_menstrual_period_weeks, type: Integer
field :last_menstrual_period_days, type: Integer
field :voicemail_ok, type: Boolean
field :line, type: String # DC, MD, VA
field :language, type: String
field :appointment_date, type: Date
field :urgent_flag, type: Boolean
# General patient information
field :age, type: Integer
field :city, type: String
field :state, type: String # ennumeration?
field :zip, type: String
field :county, type: String
field :race_ethnicity, type: String
field :employment_status, type: String
field :household_size, type: Integer
field :insurance, type: String
field :income, type: String
field :referred_by, type: String
field :special_circumstances, type: String # ennumeration
# Procedure result - generally for administrative use
field :fax_received, type: Boolean
field :procedure_cost, type: Integer
field :procedure_date, type: DateTime
field :procedure_completed_date, type: DateTime
field :resolved_without_dcaf, type: Boolean
# Validations
validates :initial_call_date,
:created_by,
presence: true
validates_associated :patient, on: :create
# History and auditing
track_history on: fields.keys + [:updated_by_id],
version_field: :version,
track_create: true,
track_update: true,
track_destroy: true
mongoid_userstamp user_model: 'User'
# Methods - see also the helpers
def self.most_recent
order('created_at DESC').limit(1).first
end
def recent_calls
calls.order('created_at DESC').limit(10)
end
def old_calls
calls.order('created_at DESC').offset(10)
end
def most_recent_note_display_text
display_note = most_recent_note.[0..40]
display_note << '...' if most_recent_note.length > 40
display_note
end
def most_recent_note
notes.order('created_at DESC').limit(1).first.try(:full_text).to_s
end
def status
# if resolved_without_dcaf
# status = "Resolved Without DCAF"
# elsif pledge_status?(:paid)
# status = "Pledge Paid"
# elsif pledge_status?(:sent)
# status = "Sent Pledge"
if appointment_date
'Fundraising'
elsif contact_made?
'Needs Appointment'
else
'No Contact Made'
end
end
private
def contact_made?
calls.each do |call|
return true if call.status == 'Reached patient'
end
false
end
# def pledge_status?(status)
# pledges.each do |pledge|
# return true if pledge[status]
# end
# false
# end
end
|
class Promotion < ActiveRecord::Base
has_many :tickets
belongs_to :restaurant
# after_create :generate_tickets
validates :name, presence: true
validates :min_group_size, presence: true
validates :max_group_size, presence: true
validates :preferred_group_size, presence: true
validates :min_spend, presence: true
validates :loss_tolerance, presence: true
validates :max_discount, presence: true
def self.minimum_discount
0.10
end
def generate_tickets
(min_group_size..max_group_size).each do |group_size|
ticket_params = {}
ticket_params[:group_size] = group_size
ticket_params[:min_total_spend] = min_spend * group_size
ticket_params[:discount] = calculate_discount(group_size)
ticket_params[:active] = true
self.tickets.create(ticket_params)
end
end
private
def calculate_discount(group_size)
discount = discount_variance / max_group_size * group_size + self.class.minimum_discount
if preferred_group_size == group_size
discount += (max_discount / 10)
end
discount
end
def discount_variance
max_discount - self.class.minimum_discount
end
end
uncommented after_create generate tickets
class Promotion < ActiveRecord::Base
has_many :tickets
belongs_to :restaurant
after_create :generate_tickets
validates :name, presence: true
validates :min_group_size, presence: true
validates :max_group_size, presence: true
validates :preferred_group_size, presence: true
validates :min_spend, presence: true
validates :loss_tolerance, presence: true
validates :max_discount, presence: true
def self.minimum_discount
0.10
end
def generate_tickets
(min_group_size..max_group_size).each do |group_size|
ticket_params = {}
ticket_params[:group_size] = group_size
ticket_params[:min_total_spend] = min_spend * group_size
ticket_params[:discount] = calculate_discount(group_size)
ticket_params[:active] = true
self.tickets.create(ticket_params)
end
end
private
def calculate_discount(group_size)
discount = discount_variance / max_group_size * group_size + self.class.minimum_discount
if preferred_group_size == group_size
discount += (max_discount / 10)
end
discount
end
def discount_variance
max_discount - self.class.minimum_discount
end
end
|
class Proveedor < ActiveRecord::Base
belongs_to :especie
attr_accessor :totales, :observaciones, :observacion, :observaciones_mapa, :kml, :ejemplares, :ejemplar, :ejemplares_mapa
# Las fotos de referencia de naturalista son una copia de las fotos de referencia de enciclovida
def fotos_naturalista
ficha = ficha_naturalista_api_nodejs
return ficha unless ficha[:estatus] == 'OK'
resultado = ficha[:ficha]['results'].first
fotos = resultado['taxon_photos']
{estatus: 'OK', fotos: fotos}
end
# Todos los nombres comunes de la ficha de naturalista
def nombres_comunes_naturalista
ficha = ficha_naturalista_api
return ficha unless ficha[:estatus] == 'OK'
nombres_comunes = ficha[:ficha]['taxon_names']
# Pone en la primera posicion el deafult_name
nombres_comunes.unshift(ficha[:ficha]['default_name']) if (ficha[:ficha]['default_name'].present? && ficha[:ficha]['default_name'].any?)
{estatus: 'OK', nombres_comunes: nombres_comunes}
end
# Consulta la fihca de naturalista por medio de su API nodejs
def ficha_naturalista_api_nodejs
# Si no existe naturalista_id, trato de buscar el taxon en su API y guardo el ID
if naturalista_id.blank?
resp = especie.ficha_naturalista_por_nombre
return resp unless resp[:estatus] == 'OK'
end
begin
resp = RestClient.get "#{CONFIG.inaturalist_api}/taxa/#{naturalista_id}"
ficha = JSON.parse(resp)
rescue => e
return {estatus: 'error', msg: e}
end
return {estatus: 'error', msg: 'Tiene más de un resultado, solo debería ser uno por ser ficha'} unless ficha['total_results'] == 1
return {estatus: 'OK', ficha: ficha}
end
# Consulta la ficha por medio de su API web, algunas cosas no vienen en el API nodejs
def ficha_naturalista_api
# Si no existe naturalista_id, trato de buscar el taxon en su API y guardo el ID
if naturalista_id.blank?
resp = especie.ficha_naturalista_por_nombre
return resp unless resp[:estatus] == 'OK'
end
begin
resp = RestClient.get "#{CONFIG.naturalista_url}/taxa/#{naturalista_id}.json"
ficha = JSON.parse(resp)
rescue => e
return {estatus: 'error', msg: e}
end
return {estatus: 'error', msg: 'Tiene más de un resultado, solo debería ser uno por ser ficha'} if ficha['error'] == 'No encontrado'
return {estatus: 'OK', ficha: ficha}
end
def geodatos
geodatos = {}
geodatos[:cuales] = []
if geoserver_info.present?
info = JSON.parse(geoserver_info)
geodatos[:cuales] << 'geoserver'
geodatos[:geoserver_url] = CONFIG.geoserver_url.to_s
geodatos[:geoserver_descarga_url] = "#{CONFIG.geoserver_descarga_url}&layers=cnb:#{info['layers']}&styles=#{info['styles']}&bbox=#{info['bbox']}&transparent=true"
geodatos[:geoserver_layer] = info['layers']
end
# Para las descargas del SNIB
url = "#{CONFIG.site_url}especies/#{especie_id}/ejemplares-snib"
resp = ejemplares_snib('.json')
if resp[:estatus] == 'OK'
geodatos[:cuales] << 'snib'
geodatos[:snib_json] = "#{url}.json"
end
resp = ejemplares_snib('.kml')
if resp[:estatus] == 'OK'
geodatos[:cuales] << 'snib'
geodatos[:snib_kml] = "#{url}.kml"
end
resp = ejemplares_snib('.kmz')
if resp[:estatus] == 'OK'
geodatos[:cuales] << 'snib'
geodatos[:snib_kmz] = "#{url}.kmz"
end
resp = ejemplares_snib('.json', true)
if resp[:estatus] == 'OK'
geodatos[:cuales] << 'snib'
geodatos[:snib_mapa_json] = "#{url}/geodatos/#{especie_id}/#{resp[:ruta].split('/').last}"
end
# Para las descargas de naturalista
url = "#{CONFIG.site_url}/especies/#{especie_id}/observaciones-naturalista"
resp = observaciones_naturalista('.json')
if resp[:estatus] == 'OK'
geodatos[:cuales] << 'naturalista'
geodatos[:naturalista_json] = "#{url}.json"
end
resp = observaciones_naturalista('.kml')
if resp[:estatus] == 'OK'
geodatos[:cuales] << 'naturalista'
geodatos[:naturalista_kml] = "#{url}.kml"
end
resp = observaciones_naturalista('.kmz')
if resp[:estatus] == 'OK'
geodatos[:cuales] << 'naturalista'
geodatos[:naturalista_kmz] = "#{url}.kmz"
end
resp = observaciones_naturalista('.json', true)
if resp[:estatus] == 'OK'
geodatos[:cuales] << 'naturalista'
geodatos[:naturalista_mapa_json] = "#{url}/geodatos/#{especie_id}/#{resp[:ruta].split('/').last}"
end
geodatos[:cuales] = geodatos[:cuales].uniq
geodatos
end
# Devuelve la informacion de una sola observacion, de acuerdo al archivo previamente guardado del json
def observacion_naturalista(observacion_id)
resp = observaciones_naturalista('.json')
return resp unless resp[:estatus] == 'OK'
output = `grep :#{observacion_id}, #{resp[:ruta]}`
return {estatus: 'error', msg: 'No encontro el ID'} unless output.present?
obs = output.gsub('[{', '{').gsub('"},', '"}').gsub('}]', '}')
begin
resp.merge({observacion: JSON.parse(obs)})
rescue
{estatus: 'error', msg: 'Error al parsear el json'}
end
end
# Devuelve las observaciones de naturalista, ya se en cache de disco o consulta y arma la respuesta para guardarla, la respuesta depende del formato enviado, default es json
def observaciones_naturalista(formato = '.json', mapa = false)
carpeta = carpeta_geodatos
nombre = if mapa
carpeta.join("observaciones_#{especie.nombre_cientifico.limpiar.gsub(' ','_')}_mapa")
else
carpeta.join("observaciones_#{especie.nombre_cientifico.limpiar.gsub(' ','_')}")
end
archivo = "#{nombre}#{formato}"
if File.exist?(archivo) || !Rails.env.production?
{estatus: 'OK', ruta: archivo}
else
{estatus: 'error', msg: 'No hay observaciones'}
end
end
def guarda_observaciones_naturalista
# Para no generar geodatos arriba de familia
return unless especie.apta_con_geodatos?
# Para no guardar nada si el cache aun esta vigente
return if especie.existe_cache?('observaciones_naturalista')
# Pone el cache para no volverlo a consultar
especie.escribe_cache('observaciones_naturalista', eval(CONFIG.cache.observaciones_naturalista)) if Rails.env.production?
# Si no existe naturalista_id, trato de buscar el taxon en su API y guardo el ID
if naturalista_id.blank?
resp = especie.ficha_naturalista_por_nombre
return resp unless resp[:estatus] == 'OK'
end
# Valida el paginado y los resultados
self.observaciones = []
self.observaciones_mapa = []
# Limpia las observaciones y las transforma a kml
kml_naturalista(inicio: true)
validacion = valida_observaciones_naturalista
return validacion unless validacion[:estatus] == 'OK'
# Para el paginado
paginas = totales/CONFIG.inaturalist_por_pagina.to_i
residuo = totales%200
paginas+= 1 if residuo < 200 || paginas == 0
# Si son mas de 50 paginas, entonces el elastic search truena del lado de inaturalist, ver como resolver despues (pasa mas en familia)
#return {estatus: 'error', msg: 'Son mas de 50 paginas, truena el elastic search'} if paginas > 50
if paginas > 1
# Para consultar las demas paginas, si es que tiene mas de una
for i in 2..paginas do
validacion = valida_observaciones_naturalista({page: i})
return validacion unless validacion[:estatus] == 'OK'
break if i == 50
end
end
# Cierra el kml
kml_naturalista(fin: true)
# Crea carpeta y archivo
carpeta = carpeta_geodatos
nombre = carpeta.join("observaciones_#{especie.nombre_cientifico.limpiar.gsub(' ','_')}")
archivo_observaciones = File.new("#{nombre}.json", 'w+')
archivo_observaciones_mapa = File.new("#{nombre}_mapa.json", 'w+')
archivo_observaciones_kml = File.new("#{nombre}.kml", 'w+')
# Guarda el archivo en kml y kmz
archivo_observaciones.puts observaciones.to_json.gsub('},{', "},\n{")
archivo_observaciones_mapa.puts observaciones_mapa.to_json
archivo_observaciones_kml.puts kml
# Cierra los archivos
archivo_observaciones.close
archivo_observaciones_mapa.close
archivo_observaciones_kml.close
# Guarda el archivo en kmz
kmz(nombre)
puts "\n\nGuardo observaciones de naturalista #{especie_id}"
end
# Devuelve la informacion de un solo ejemplar, de acuerdo al archivo previamente guardado del json
def ejemplar_snib(ejemplar_id)
resp = ejemplares_snib('.json')
return resp unless resp[:estatus] == 'OK'
output = `grep #{ejemplar_id} #{resp[:ruta]}`
return {estatus: 'error', msg: 'No encontro el ID'} unless output.present?
ej = output.gsub('[{', '{').gsub('"},', '"}').gsub('}]', '}')
puts ej
begin
resp.merge({ejemplar: JSON.parse(ej)})
rescue
{estatus: 'error', msg: 'Error al parsear el json'}
end
end
# Devuelve los ejemplares del snib en diferentes formatos, json (default), kml y kmz
def ejemplares_snib(formato = '.json', mapa = false)
carpeta = carpeta_geodatos
nombre = if mapa
nombre = carpeta.join("ejemplares_#{especie.nombre_cientifico.limpiar.gsub(' ','_')}_mapa")
else
nombre = carpeta.join("ejemplares_#{especie.nombre_cientifico.limpiar.gsub(' ','_')}")
end
archivo = "#{nombre}#{formato}"
if File.exist?(archivo) || !Rails.env.production?
{estatus: 'OK', ruta: archivo}
else
{estatus: 'error', msg: 'No hay ejemplares en el SNIB'}
end
end
def guarda_ejemplares_snib
# Para no generar geodatos arriba de familia
return unless especie.apta_con_geodatos?
# Para no guardar nada si el cache aun esta vigente
return if especie.existe_cache?('ejemplares_snib')
# Pone el cache para no volverlo a consultar
especie.escribe_cache('ejemplares_snib', eval(CONFIG.cache.ejemplares_snib)) if Rails.env.production?
self.ejemplares = []
self.ejemplares_mapa = []
validacion = valida_ejemplares_snib
return validacion unless validacion[:estatus] == 'OK'
# Crea carpeta y archivo
carpeta = carpeta_geodatos
nombre = carpeta.join("ejemplares_#{especie.nombre_cientifico.limpiar.gsub(' ','_')}")
archivo_ejemplares = File.new("#{nombre}.json", 'w+')
archivo_ejemplares_mapa = File.new("#{nombre}_mapa.json", 'w+')
archivo_ejemplares_kml = File.new("#{nombre}.kml", 'w+')
# Guarda el archivo en kml y kmz
# Esta linea hace mas facil el json del parseo y pone un salto de linea al final de cada ejemplar
archivo_ejemplares.puts ejemplares.to_json.gsub('\\', '').gsub('"{', '{').gsub('}"', '}').gsub('},{', "},\n{")
archivo_ejemplares_mapa.puts ejemplares_mapa.to_json
archivo_ejemplares_kml.puts kml
# Cierra los archivos
archivo_ejemplares.close
archivo_ejemplares_mapa.close
archivo_ejemplares_kml.close
# Guarda el archivo en kmz
kmz(nombre)
puts "\n\nGuardo ejemplares del snib #{especie_id}"
end
private
# Crea o devuleve la capreta de los geodatos
def carpeta_geodatos
carpeta = Rails.root.join('public', 'geodatos', especie_id.to_s)
FileUtils.mkpath(carpeta, :mode => 0755) unless File.exists?(carpeta)
carpeta
end
# Solo los campos que ocupo en el mapa para no hacer muy grande la respuesta
def limpia_observaciones_naturalista
obs = Hash.new
h = HTMLEntities.new # Para codificar el html y no marque error en el KML
# Los numere para poder armar los datos en el orden deseado
obs[:id] = observacion['id']
obs[:place_guess] = h.encode(observacion['place_guess'])
obs[:observed_on] = observacion['observed_on'].gsub('-','/') if observacion['observed_on'].present?
obs[:captive] = observacion['captive'] ? 'Organismo silvestre / naturalizado' : nil
obs[:quality_grade] = I18n.t("quality_grade.#{observacion['quality_grade']}", default: observacion['quality_grade'])
obs[:uri] = observacion['uri']
if obs[:uri].present?
obs[:uri] = obs[:uri].gsub('inaturalist.org','naturalista.mx').gsub('conabio.inaturalist.org', 'www.naturalista.mx').gsub('naturewatch.org.nz', 'naturalista.mx').gsub('conabio.naturalista.mx', 'naturalista.mx')
end
obs[:longitude] = observacion['geojson']['coordinates'][0].to_f
obs[:latitude] = observacion['geojson']['coordinates'][1].to_f
observacion['photos'].each do |photo|
obs[:thumb_url] = photo['url']
obs[:attribution] = h.encode(photo['attribution'])
break # Guardo la primera foto
end
# Pone la observacion y las observaciones en el arreglo
self.observacion = obs
self.observaciones << observacion
# Pone solo las coordenadas y el ID para el json del mapa, se necesita que sea mas ligero.
self.observaciones_mapa << [observacion[:longitude], observacion[:latitude], observacion[:id], observacion[:quality_grade] == 'investigación' ? 1 : 0]
end
def valida_observaciones_naturalista(params = {})
page = params[:page] || 1
begin
rest_client = RestClient::Request.execute(method: :get, url: "#{CONFIG.inaturalist_api}/observations?taxon_id=#{naturalista_id}&geo=true&&per_page=#{CONFIG.inaturalist_por_pagina}&page=#{page}", timeout: 20)
res = JSON.parse(rest_client)
rescue => e
return {estatus: 'error', msg: e}
end
if res.blank?
borrar_geodata('observaciones_')
return {estatus: 'error', msg: 'La respuesta del servicio esta vacia'}
end
self.totales = res['total_results'] if params.blank? && totales.blank? # Para la primera pagina de naturalista
resultados = res['results'] if res['results'].any?
if totales.blank? || (totales.present? && totales <= 0)
borrar_geodata('observaciones_')
return {estatus: 'error', msg: 'No hay observaciones'}
end
if resultados.blank? || resultados.count == 0
borrar_geodata('observaciones_')
return {estatus: 'error', msg: 'No hay observaciones'}
end
resultados.each do |observacion|
self.observacion = observacion
limpia_observaciones_naturalista
kml_naturalista(observacion: true)
end
{estatus: 'OK'}
end
def kml_naturalista(opc = {})
if opc[:inicio]
self.kml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
self.kml << "<kml xmlns=\"http://www.opengis.net/kml/2.2\">\n"
self.kml << "<Document>\n"
# Para las observaciones de grado cientifico, verde
self.kml << "<Style id=\"Placemark_cientifico\">\n"
self.kml << "<IconStyle>\n"
self.kml << "<Icon>\n"
self.kml << "<href>#{CONFIG.enciclovida_url}/assets/app/placemarks/verde.png</href>\n"
self.kml << "</Icon>\n"
self.kml << "</IconStyle>\n"
self.kml << "</Style>\n"
# Para las observaciones de grado casual, amarillo
self.kml << "<Style id=\"Placemark_casual\">\n"
self.kml << "<IconStyle>\n"
self.kml << "<Icon>\n"
self.kml << "<href>#{CONFIG.enciclovida_url}/assets/app/placemarks/amarillo.png</href>\n"
self.kml << "</Icon>\n"
self.kml << "</IconStyle>\n"
self.kml << "</Style>\n"
end
if opc[:observacion]
h = HTMLEntities.new # Para codificar el html y no marque error en el KML
nombre_cientifico = h.encode(especie.nombre_cientifico)
nombre_comun = h.encode(especie.nom_com_prin(true))
nombre = nombre_comun.present? ? "<b>#{nombre_comun}</b> <i>(#{nombre_cientifico})</i>" : "<i><b>#{nombre_cientifico}</b></i>"
self.kml << "<Placemark>\n"
self.kml << "<description>\n"
self.kml << "<![CDATA[\n"
self.kml << "<div>\n"
self.kml << "<h4>\n"
self.kml << "<a href=\"#{CONFIG.enciclovida_url}/especies/#{especie.id}\">#{nombre}</a>\n"
self.kml << "</h4>\n"
self.kml << "<div><img src=\"#{observacion[:thumb_url]}\"/></div>\n"
self.kml << '<dl>'
self.kml << "<dt>Atribución</dt> <dd>#{observacion[:attribution]}</dd>\n"
self.kml << "<dt>Ubicación</dt> <dd>#{observacion[:place_guess]}</dd>\n"
self.kml << "<dt>Fecha</dt> <dd>#{observacion[:observed_on]}</dd>\n"
self.kml << "<dt>#{observacion[:captive]}</dt> <dd> </dd>\n"
self.kml << "<dt>Grado de calidad</dt> <dd>#{observacion[:quality_grade]}</dd>\n"
self.kml << '</dl>'
self.kml << "<span><text>Ver la </text><a href=\"#{observacion[:uri]}\">observación en NaturaLista</a></span>\n"
self.kml << "</div>\n"
self.kml << "]]>\n"
self.kml << "</description>\n"
if observacion[:quality_grade] == 'investigación'
self.kml << '<styleUrl>#Placemark_cientifico</styleUrl>'
else
self.kml << '<styleUrl>#Placemark_casual</styleUrl>'
end
self.kml << "<Point>\n<coordinates>\n#{observacion[:longitude]},#{observacion[:latitude]}\n</coordinates>\n</Point>\n"
self.kml << "</Placemark>\n"
end
if opc[:fin]
self.kml << "</Document>\n"
self.kml << '</kml>'
end
end
# Solo las coordenadas y el ID
def limpia_ejemplares_snib
# Para ver si es de aver aves el ejemplar
aves = %w(averaves ebird)
coleccion = ejemplar['coleccion'].downcase
es_averaves = false
coleccion.split(' ').each do |col|
break if es_averaves
es_averaves = true if aves.include?(col)
end
# Pone solo las coordenadas y el ID para el json del mapa, se necesita que sea mas ligero.
self.ejemplares_mapa << [ejemplar['longitud'], ejemplar['latitud'], ejemplar['idejemplar'], es_averaves ? 1: 0]
end
def valida_ejemplares_snib
begin
rest_client = RestClient::Request.execute(method: :get, url: "#{CONFIG.geoportal_url}&rd=#{especie.root.nombre_cientifico.downcase}&id=#{especie.catalogo_id}&fields=all", timeout: 3)
resultados = JSON.parse(rest_client)
rescue => e
return {estatus: 'error', msg: e}
end
if resultados.blank?
borrar_geodata('ejemplares_')
return {estatus: 'error', msg: 'La respuesta del servicio esta vacia'}
end
self.totales = resultados.count if totales.blank? # Para la primera pagina de naturalista
if totales.blank? || (totales.present? && totales <= 0)
borrar_geodata('ejemplares_')
return {estatus: 'error', msg: 'No hay ejemplares'}
end
self.ejemplares_mapa = []
# Asigna los ejemplares
self.ejemplares = resultados
resultados.each do |ejemplar|
self.ejemplar = ejemplar
limpia_ejemplares_snib
end
# Exporta a kml los ejemplares
kml_snib
{estatus: 'OK'}
end
def kml_snib
h = HTMLEntities.new # Para codificar el html y no marque error en el KML
nombre_cientifico = h.encode(especie.nombre_cientifico)
nombre_comun = h.encode(especie.nom_com_prin(true))
nombre = nombre_comun.present? ? "<b>#{nombre_comun}</b> <i>(#{nombre_cientifico})</i>" : "<i><b>#{nombre_cientifico}</b></i>"
self.kml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
self.kml << "<kml xmlns=\"http://www.opengis.net/kml/2.2\">\n"
self.kml << "<Document>\n"
self.kml << "<Style id=\"normalPlacemark\">\n"
self.kml << "<IconStyle>\n"
self.kml << "<Icon>\n"
self.kml << "<href>#{CONFIG.enciclovida_url}/assets/app/placemarks/rojo.png</href>\n"
self.kml << "</Icon>\n"
self.kml << "</IconStyle>\n"
self.kml << "</Style>\n"
ejemplares.each do |ejemplar|
self.kml << "<Placemark>\n"
self.kml << "<description>\n"
self.kml << "<![CDATA[\n"
self.kml << "<div>\n"
self.kml << "<h4>\n"
self.kml << "<a href=\"#{CONFIG.enciclovida_url}/especies/#{especie.id}\">#{nombre}</a>\n"
self.kml << "</h4>\n"
self.kml << "<dl>\n"
self.kml << "<dt>Localidad</dt> <dd>#{ejemplar['localidad']}</dd>\n"
self.kml << "<dt>Municipio</dt> <dd>#{ejemplar['municipiomapa']}</dd>\n"
self.kml << "<dt>Estado</dt> <dd>#{ejemplar['estadomapa']}</dd>\n"
self.kml << "<dt>País</dt> <dd>#{ejemplar['paismapa']}</dd>\n"
self.kml << "<dt>Fecha</dt> <dd>#{ejemplar['fechacolecta']}</dd>\n"
self.kml << "<dt>Nombre del colector</dt> <dd>#{ejemplar['colector']}</dd>\n"
self.kml << "<dt>Colección</dt> <dd>#{ejemplar['coleccion']}</dd>\n"
self.kml << "<dt>Institución</dt> <dd>#{ejemplar['institucion']}</dd>\n"
self.kml << "<dt>País de la colección</dt> <dd>#{ejemplar['paiscoleccion']}</dd>\n"
if ejemplar['proyectourl'].present?
self.kml << "<dt>Proyecto:</dt> <dd><a href=\"#{ejemplar['proyectourl']}\">#{ejemplar['proyecto'] || 'ver'}</a></dd>\n"
else
self.kml << "<dt>Proyecto:</dt> <dd>#{ejemplar['proyecto']}</dd>\n"
end
self.kml << "</dl>\n"
self.kml << "<span><text>Más información: </text><a href=\"http://#{ejemplar['urlejemplar']}\">consultar SNIB</a></span>\n"
self.kml << "</div>\n"
self.kml << "]]>\n"
self.kml << "</description>\n"
self.kml << '<styleUrl>#normalPlacemark</styleUrl>'
self.kml << "<Point>\n<coordinates>\n#{ejemplar['longitud']},#{ejemplar['latitud']}\n</coordinates>\n</Point>\n"
self.kml << "</Placemark>\n"
end
self.kml << "</Document>\n"
self.kml << '</kml>'
end
def kmz(nombre)
archvo_zip = "#{nombre}.zip"
system "zip -j #{archvo_zip} #{nombre}.kml"
File.rename(archvo_zip, "#{nombre}.kmz")
end
# Borra el json, kml, kmz del taxon en cuestion, ya sea observaciones o ejemplares
def borrar_geodata(tipo)
ruta = Rails.root.join('public', 'geodatos', especie_id.to_s, "#{tipo}*")
archivos = Dir.glob(ruta)
archivos.each do |a|
File.delete(a)
end
end
def photo_type(url)
return 'FlickrPhoto' if url.include?("staticflickr\.com") || url.include?("static\.flickr\.com")
return 'EolPhoto' if url.include? "media\.eol\.org"
return 'NaturalistaPhoto' if url.include? "static\.inaturalist\.org"
return 'WikimediaCommonsPhoto' if url.include? "upload\.wikimedia\.org"
end
def taxon_photos(datos, usuario)
photos = []
datos['taxon_photos'].each do |pho| #Guarda todas las fotos asociadas del taxon
next unless pho['photo']['native_photo_id'].present?
next unless pho['photo']['thumb_url'].present?
next unless photo_type(pho['photo']['thumb_url']).present?
local_photo = Photo.where(:native_photo_id => pho['photo']['native_photo_id'], :type => photo_type(pho['photo']['thumb_url']))
photo = local_photo.count == 1 ? local_photo.first : Photo.new #Crea o actualiza la foto
photo.usuario_id = usuario
photo.native_photo_id = pho['photo']['native_photo_id']
photo.square_url = pho['photo']['square_url']
photo.thumb_url = pho['photo']['thumb_url']
photo.small_url = pho['photo']['small_url']
photo.medium_url = pho['photo']['medium_url']
photo.large_url = pho['photo']['large_url']
#photo.original_url = pho['photo']['original_url']
photo.created_at = pho['photo']['created_at']
photo.updated_at = pho['photo']['updated_at']
photo.native_page_url = pho['photo']['native_page_url']
photo.native_username = pho['photo']['native_username']
photo.native_realname = pho['photo']['native_realname']
photo.license = pho['photo']['license']
photo.type = photo_type(pho['photo']['thumb_url'])
photos << photo
end
photos
end
end
ligero bug en las rutas de descarga del snib y naturalista
class Proveedor < ActiveRecord::Base
belongs_to :especie
attr_accessor :totales, :observaciones, :observacion, :observaciones_mapa, :kml, :ejemplares, :ejemplar, :ejemplares_mapa
# Las fotos de referencia de naturalista son una copia de las fotos de referencia de enciclovida
def fotos_naturalista
ficha = ficha_naturalista_api_nodejs
return ficha unless ficha[:estatus] == 'OK'
resultado = ficha[:ficha]['results'].first
fotos = resultado['taxon_photos']
{estatus: 'OK', fotos: fotos}
end
# Todos los nombres comunes de la ficha de naturalista
def nombres_comunes_naturalista
ficha = ficha_naturalista_api
return ficha unless ficha[:estatus] == 'OK'
nombres_comunes = ficha[:ficha]['taxon_names']
# Pone en la primera posicion el deafult_name
nombres_comunes.unshift(ficha[:ficha]['default_name']) if (ficha[:ficha]['default_name'].present? && ficha[:ficha]['default_name'].any?)
{estatus: 'OK', nombres_comunes: nombres_comunes}
end
# Consulta la fihca de naturalista por medio de su API nodejs
def ficha_naturalista_api_nodejs
# Si no existe naturalista_id, trato de buscar el taxon en su API y guardo el ID
if naturalista_id.blank?
resp = especie.ficha_naturalista_por_nombre
return resp unless resp[:estatus] == 'OK'
end
begin
resp = RestClient.get "#{CONFIG.inaturalist_api}/taxa/#{naturalista_id}"
ficha = JSON.parse(resp)
rescue => e
return {estatus: 'error', msg: e}
end
return {estatus: 'error', msg: 'Tiene más de un resultado, solo debería ser uno por ser ficha'} unless ficha['total_results'] == 1
return {estatus: 'OK', ficha: ficha}
end
# Consulta la ficha por medio de su API web, algunas cosas no vienen en el API nodejs
def ficha_naturalista_api
# Si no existe naturalista_id, trato de buscar el taxon en su API y guardo el ID
if naturalista_id.blank?
resp = especie.ficha_naturalista_por_nombre
return resp unless resp[:estatus] == 'OK'
end
begin
resp = RestClient.get "#{CONFIG.naturalista_url}/taxa/#{naturalista_id}.json"
ficha = JSON.parse(resp)
rescue => e
return {estatus: 'error', msg: e}
end
return {estatus: 'error', msg: 'Tiene más de un resultado, solo debería ser uno por ser ficha'} if ficha['error'] == 'No encontrado'
return {estatus: 'OK', ficha: ficha}
end
def geodatos
geodatos = {}
geodatos[:cuales] = []
if geoserver_info.present?
info = JSON.parse(geoserver_info)
geodatos[:cuales] << 'geoserver'
geodatos[:geoserver_url] = CONFIG.geoserver_url.to_s
geodatos[:geoserver_descarga_url] = "#{CONFIG.geoserver_descarga_url}&layers=cnb:#{info['layers']}&styles=#{info['styles']}&bbox=#{info['bbox']}&transparent=true"
geodatos[:geoserver_layer] = info['layers']
end
# Para las descargas del SNIB
url = "#{CONFIG.site_url}especies/#{especie_id}/ejemplares-snib"
resp = ejemplares_snib('.json')
if resp[:estatus] == 'OK'
geodatos[:cuales] << 'snib'
geodatos[:snib_json] = "#{url}.json"
end
resp = ejemplares_snib('.kml')
if resp[:estatus] == 'OK'
geodatos[:cuales] << 'snib'
geodatos[:snib_kml] = "#{url}.kml"
end
resp = ejemplares_snib('.kmz')
if resp[:estatus] == 'OK'
geodatos[:cuales] << 'snib'
geodatos[:snib_kmz] = "#{url}.kmz"
end
resp = ejemplares_snib('.json', true)
if resp[:estatus] == 'OK'
geodatos[:cuales] << 'snib'
geodatos[:snib_mapa_json] = "#{CONFIG.site_url}geodatos/#{especie_id}/#{resp[:ruta].split('/').last}"
end
# Para las descargas de naturalista
url = "#{CONFIG.site_url}especies/#{especie_id}/observaciones-naturalista"
resp = observaciones_naturalista('.json')
if resp[:estatus] == 'OK'
geodatos[:cuales] << 'naturalista'
geodatos[:naturalista_json] = "#{url}.json"
end
resp = observaciones_naturalista('.kml')
if resp[:estatus] == 'OK'
geodatos[:cuales] << 'naturalista'
geodatos[:naturalista_kml] = "#{url}.kml"
end
resp = observaciones_naturalista('.kmz')
if resp[:estatus] == 'OK'
geodatos[:cuales] << 'naturalista'
geodatos[:naturalista_kmz] = "#{url}.kmz"
end
resp = observaciones_naturalista('.json', true)
if resp[:estatus] == 'OK'
geodatos[:cuales] << 'naturalista'
geodatos[:naturalista_mapa_json] = "#{CONFIG.site_url}geodatos/#{especie_id}/#{resp[:ruta].split('/').last}"
end
geodatos[:cuales] = geodatos[:cuales].uniq
geodatos
end
# Devuelve la informacion de una sola observacion, de acuerdo al archivo previamente guardado del json
def observacion_naturalista(observacion_id)
resp = observaciones_naturalista('.json')
return resp unless resp[:estatus] == 'OK'
output = `grep :#{observacion_id}, #{resp[:ruta]}`
return {estatus: 'error', msg: 'No encontro el ID'} unless output.present?
obs = output.gsub('[{', '{').gsub('"},', '"}').gsub('}]', '}')
begin
resp.merge({observacion: JSON.parse(obs)})
rescue
{estatus: 'error', msg: 'Error al parsear el json'}
end
end
# Devuelve las observaciones de naturalista, ya se en cache de disco o consulta y arma la respuesta para guardarla, la respuesta depende del formato enviado, default es json
def observaciones_naturalista(formato = '.json', mapa = false)
carpeta = carpeta_geodatos
nombre = if mapa
carpeta.join("observaciones_#{especie.nombre_cientifico.limpiar.gsub(' ','_')}_mapa")
else
carpeta.join("observaciones_#{especie.nombre_cientifico.limpiar.gsub(' ','_')}")
end
archivo = "#{nombre}#{formato}"
if File.exist?(archivo) || !Rails.env.production?
{estatus: 'OK', ruta: archivo}
else
{estatus: 'error', msg: 'No hay observaciones'}
end
end
def guarda_observaciones_naturalista
# Para no generar geodatos arriba de familia
return unless especie.apta_con_geodatos?
# Para no guardar nada si el cache aun esta vigente
return if especie.existe_cache?('observaciones_naturalista')
# Pone el cache para no volverlo a consultar
especie.escribe_cache('observaciones_naturalista', eval(CONFIG.cache.observaciones_naturalista)) if Rails.env.production?
# Si no existe naturalista_id, trato de buscar el taxon en su API y guardo el ID
if naturalista_id.blank?
resp = especie.ficha_naturalista_por_nombre
return resp unless resp[:estatus] == 'OK'
end
# Valida el paginado y los resultados
self.observaciones = []
self.observaciones_mapa = []
# Limpia las observaciones y las transforma a kml
kml_naturalista(inicio: true)
validacion = valida_observaciones_naturalista
return validacion unless validacion[:estatus] == 'OK'
# Para el paginado
paginas = totales/CONFIG.inaturalist_por_pagina.to_i
residuo = totales%200
paginas+= 1 if residuo < 200 || paginas == 0
# Si son mas de 50 paginas, entonces el elastic search truena del lado de inaturalist, ver como resolver despues (pasa mas en familia)
#return {estatus: 'error', msg: 'Son mas de 50 paginas, truena el elastic search'} if paginas > 50
if paginas > 1
# Para consultar las demas paginas, si es que tiene mas de una
for i in 2..paginas do
validacion = valida_observaciones_naturalista({page: i})
return validacion unless validacion[:estatus] == 'OK'
break if i == 50
end
end
# Cierra el kml
kml_naturalista(fin: true)
# Crea carpeta y archivo
carpeta = carpeta_geodatos
nombre = carpeta.join("observaciones_#{especie.nombre_cientifico.limpiar.gsub(' ','_')}")
archivo_observaciones = File.new("#{nombre}.json", 'w+')
archivo_observaciones_mapa = File.new("#{nombre}_mapa.json", 'w+')
archivo_observaciones_kml = File.new("#{nombre}.kml", 'w+')
# Guarda el archivo en kml y kmz
archivo_observaciones.puts observaciones.to_json.gsub('},{', "},\n{")
archivo_observaciones_mapa.puts observaciones_mapa.to_json
archivo_observaciones_kml.puts kml
# Cierra los archivos
archivo_observaciones.close
archivo_observaciones_mapa.close
archivo_observaciones_kml.close
# Guarda el archivo en kmz
kmz(nombre)
puts "\n\nGuardo observaciones de naturalista #{especie_id}"
end
# Devuelve la informacion de un solo ejemplar, de acuerdo al archivo previamente guardado del json
def ejemplar_snib(ejemplar_id)
resp = ejemplares_snib('.json')
return resp unless resp[:estatus] == 'OK'
output = `grep #{ejemplar_id} #{resp[:ruta]}`
return {estatus: 'error', msg: 'No encontro el ID'} unless output.present?
ej = output.gsub('[{', '{').gsub('"},', '"}').gsub('}]', '}')
puts ej
begin
resp.merge({ejemplar: JSON.parse(ej)})
rescue
{estatus: 'error', msg: 'Error al parsear el json'}
end
end
# Devuelve los ejemplares del snib en diferentes formatos, json (default), kml y kmz
def ejemplares_snib(formato = '.json', mapa = false)
carpeta = carpeta_geodatos
nombre = if mapa
nombre = carpeta.join("ejemplares_#{especie.nombre_cientifico.limpiar.gsub(' ','_')}_mapa")
else
nombre = carpeta.join("ejemplares_#{especie.nombre_cientifico.limpiar.gsub(' ','_')}")
end
archivo = "#{nombre}#{formato}"
if File.exist?(archivo) || !Rails.env.production?
{estatus: 'OK', ruta: archivo}
else
{estatus: 'error', msg: 'No hay ejemplares en el SNIB'}
end
end
def guarda_ejemplares_snib
# Para no generar geodatos arriba de familia
return unless especie.apta_con_geodatos?
# Para no guardar nada si el cache aun esta vigente
return if especie.existe_cache?('ejemplares_snib')
# Pone el cache para no volverlo a consultar
especie.escribe_cache('ejemplares_snib', eval(CONFIG.cache.ejemplares_snib)) if Rails.env.production?
self.ejemplares = []
self.ejemplares_mapa = []
validacion = valida_ejemplares_snib
return validacion unless validacion[:estatus] == 'OK'
# Crea carpeta y archivo
carpeta = carpeta_geodatos
nombre = carpeta.join("ejemplares_#{especie.nombre_cientifico.limpiar.gsub(' ','_')}")
archivo_ejemplares = File.new("#{nombre}.json", 'w+')
archivo_ejemplares_mapa = File.new("#{nombre}_mapa.json", 'w+')
archivo_ejemplares_kml = File.new("#{nombre}.kml", 'w+')
# Guarda el archivo en kml y kmz
# Esta linea hace mas facil el json del parseo y pone un salto de linea al final de cada ejemplar
archivo_ejemplares.puts ejemplares.to_json.gsub('\\', '').gsub('"{', '{').gsub('}"', '}').gsub('},{', "},\n{")
archivo_ejemplares_mapa.puts ejemplares_mapa.to_json
archivo_ejemplares_kml.puts kml
# Cierra los archivos
archivo_ejemplares.close
archivo_ejemplares_mapa.close
archivo_ejemplares_kml.close
# Guarda el archivo en kmz
kmz(nombre)
puts "\n\nGuardo ejemplares del snib #{especie_id}"
end
private
# Crea o devuleve la capreta de los geodatos
def carpeta_geodatos
carpeta = Rails.root.join('public', 'geodatos', especie_id.to_s)
FileUtils.mkpath(carpeta, :mode => 0755) unless File.exists?(carpeta)
carpeta
end
# Solo los campos que ocupo en el mapa para no hacer muy grande la respuesta
def limpia_observaciones_naturalista
obs = Hash.new
h = HTMLEntities.new # Para codificar el html y no marque error en el KML
# Los numere para poder armar los datos en el orden deseado
obs[:id] = observacion['id']
obs[:place_guess] = h.encode(observacion['place_guess'])
obs[:observed_on] = observacion['observed_on'].gsub('-','/') if observacion['observed_on'].present?
obs[:captive] = observacion['captive'] ? 'Organismo silvestre / naturalizado' : nil
obs[:quality_grade] = I18n.t("quality_grade.#{observacion['quality_grade']}", default: observacion['quality_grade'])
obs[:uri] = observacion['uri']
if obs[:uri].present?
obs[:uri] = obs[:uri].gsub('inaturalist.org','naturalista.mx').gsub('conabio.inaturalist.org', 'www.naturalista.mx').gsub('naturewatch.org.nz', 'naturalista.mx').gsub('conabio.naturalista.mx', 'naturalista.mx')
end
obs[:longitude] = observacion['geojson']['coordinates'][0].to_f
obs[:latitude] = observacion['geojson']['coordinates'][1].to_f
observacion['photos'].each do |photo|
obs[:thumb_url] = photo['url']
obs[:attribution] = h.encode(photo['attribution'])
break # Guardo la primera foto
end
# Pone la observacion y las observaciones en el arreglo
self.observacion = obs
self.observaciones << observacion
# Pone solo las coordenadas y el ID para el json del mapa, se necesita que sea mas ligero.
self.observaciones_mapa << [observacion[:longitude], observacion[:latitude], observacion[:id], observacion[:quality_grade] == 'investigación' ? 1 : 0]
end
def valida_observaciones_naturalista(params = {})
page = params[:page] || 1
begin
rest_client = RestClient::Request.execute(method: :get, url: "#{CONFIG.inaturalist_api}/observations?taxon_id=#{naturalista_id}&geo=true&&per_page=#{CONFIG.inaturalist_por_pagina}&page=#{page}", timeout: 20)
res = JSON.parse(rest_client)
rescue => e
return {estatus: 'error', msg: e}
end
if res.blank?
borrar_geodata('observaciones_')
return {estatus: 'error', msg: 'La respuesta del servicio esta vacia'}
end
self.totales = res['total_results'] if params.blank? && totales.blank? # Para la primera pagina de naturalista
resultados = res['results'] if res['results'].any?
if totales.blank? || (totales.present? && totales <= 0)
borrar_geodata('observaciones_')
return {estatus: 'error', msg: 'No hay observaciones'}
end
if resultados.blank? || resultados.count == 0
borrar_geodata('observaciones_')
return {estatus: 'error', msg: 'No hay observaciones'}
end
resultados.each do |observacion|
self.observacion = observacion
limpia_observaciones_naturalista
kml_naturalista(observacion: true)
end
{estatus: 'OK'}
end
def kml_naturalista(opc = {})
if opc[:inicio]
self.kml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
self.kml << "<kml xmlns=\"http://www.opengis.net/kml/2.2\">\n"
self.kml << "<Document>\n"
# Para las observaciones de grado cientifico, verde
self.kml << "<Style id=\"Placemark_cientifico\">\n"
self.kml << "<IconStyle>\n"
self.kml << "<Icon>\n"
self.kml << "<href>#{CONFIG.enciclovida_url}/assets/app/placemarks/verde.png</href>\n"
self.kml << "</Icon>\n"
self.kml << "</IconStyle>\n"
self.kml << "</Style>\n"
# Para las observaciones de grado casual, amarillo
self.kml << "<Style id=\"Placemark_casual\">\n"
self.kml << "<IconStyle>\n"
self.kml << "<Icon>\n"
self.kml << "<href>#{CONFIG.enciclovida_url}/assets/app/placemarks/amarillo.png</href>\n"
self.kml << "</Icon>\n"
self.kml << "</IconStyle>\n"
self.kml << "</Style>\n"
end
if opc[:observacion]
h = HTMLEntities.new # Para codificar el html y no marque error en el KML
nombre_cientifico = h.encode(especie.nombre_cientifico)
nombre_comun = h.encode(especie.nom_com_prin(true))
nombre = nombre_comun.present? ? "<b>#{nombre_comun}</b> <i>(#{nombre_cientifico})</i>" : "<i><b>#{nombre_cientifico}</b></i>"
self.kml << "<Placemark>\n"
self.kml << "<description>\n"
self.kml << "<![CDATA[\n"
self.kml << "<div>\n"
self.kml << "<h4>\n"
self.kml << "<a href=\"#{CONFIG.enciclovida_url}/especies/#{especie.id}\">#{nombre}</a>\n"
self.kml << "</h4>\n"
self.kml << "<div><img src=\"#{observacion[:thumb_url]}\"/></div>\n"
self.kml << '<dl>'
self.kml << "<dt>Atribución</dt> <dd>#{observacion[:attribution]}</dd>\n"
self.kml << "<dt>Ubicación</dt> <dd>#{observacion[:place_guess]}</dd>\n"
self.kml << "<dt>Fecha</dt> <dd>#{observacion[:observed_on]}</dd>\n"
self.kml << "<dt>#{observacion[:captive]}</dt> <dd> </dd>\n"
self.kml << "<dt>Grado de calidad</dt> <dd>#{observacion[:quality_grade]}</dd>\n"
self.kml << '</dl>'
self.kml << "<span><text>Ver la </text><a href=\"#{observacion[:uri]}\">observación en NaturaLista</a></span>\n"
self.kml << "</div>\n"
self.kml << "]]>\n"
self.kml << "</description>\n"
if observacion[:quality_grade] == 'investigación'
self.kml << '<styleUrl>#Placemark_cientifico</styleUrl>'
else
self.kml << '<styleUrl>#Placemark_casual</styleUrl>'
end
self.kml << "<Point>\n<coordinates>\n#{observacion[:longitude]},#{observacion[:latitude]}\n</coordinates>\n</Point>\n"
self.kml << "</Placemark>\n"
end
if opc[:fin]
self.kml << "</Document>\n"
self.kml << '</kml>'
end
end
# Solo las coordenadas y el ID
def limpia_ejemplares_snib
# Para ver si es de aver aves el ejemplar
aves = %w(averaves ebird)
coleccion = ejemplar['coleccion'].downcase
es_averaves = false
coleccion.split(' ').each do |col|
break if es_averaves
es_averaves = true if aves.include?(col)
end
# Pone solo las coordenadas y el ID para el json del mapa, se necesita que sea mas ligero.
self.ejemplares_mapa << [ejemplar['longitud'], ejemplar['latitud'], ejemplar['idejemplar'], es_averaves ? 1: 0]
end
def valida_ejemplares_snib
begin
rest_client = RestClient::Request.execute(method: :get, url: "#{CONFIG.geoportal_url}&rd=#{especie.root.nombre_cientifico.downcase}&id=#{especie.catalogo_id}&fields=all", timeout: 3)
resultados = JSON.parse(rest_client)
rescue => e
return {estatus: 'error', msg: e}
end
if resultados.blank?
borrar_geodata('ejemplares_')
return {estatus: 'error', msg: 'La respuesta del servicio esta vacia'}
end
self.totales = resultados.count if totales.blank? # Para la primera pagina de naturalista
if totales.blank? || (totales.present? && totales <= 0)
borrar_geodata('ejemplares_')
return {estatus: 'error', msg: 'No hay ejemplares'}
end
self.ejemplares_mapa = []
# Asigna los ejemplares
self.ejemplares = resultados
resultados.each do |ejemplar|
self.ejemplar = ejemplar
limpia_ejemplares_snib
end
# Exporta a kml los ejemplares
kml_snib
{estatus: 'OK'}
end
def kml_snib
h = HTMLEntities.new # Para codificar el html y no marque error en el KML
nombre_cientifico = h.encode(especie.nombre_cientifico)
nombre_comun = h.encode(especie.nom_com_prin(true))
nombre = nombre_comun.present? ? "<b>#{nombre_comun}</b> <i>(#{nombre_cientifico})</i>" : "<i><b>#{nombre_cientifico}</b></i>"
self.kml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
self.kml << "<kml xmlns=\"http://www.opengis.net/kml/2.2\">\n"
self.kml << "<Document>\n"
self.kml << "<Style id=\"normalPlacemark\">\n"
self.kml << "<IconStyle>\n"
self.kml << "<Icon>\n"
self.kml << "<href>#{CONFIG.enciclovida_url}/assets/app/placemarks/rojo.png</href>\n"
self.kml << "</Icon>\n"
self.kml << "</IconStyle>\n"
self.kml << "</Style>\n"
ejemplares.each do |ejemplar|
self.kml << "<Placemark>\n"
self.kml << "<description>\n"
self.kml << "<![CDATA[\n"
self.kml << "<div>\n"
self.kml << "<h4>\n"
self.kml << "<a href=\"#{CONFIG.enciclovida_url}/especies/#{especie.id}\">#{nombre}</a>\n"
self.kml << "</h4>\n"
self.kml << "<dl>\n"
self.kml << "<dt>Localidad</dt> <dd>#{ejemplar['localidad']}</dd>\n"
self.kml << "<dt>Municipio</dt> <dd>#{ejemplar['municipiomapa']}</dd>\n"
self.kml << "<dt>Estado</dt> <dd>#{ejemplar['estadomapa']}</dd>\n"
self.kml << "<dt>País</dt> <dd>#{ejemplar['paismapa']}</dd>\n"
self.kml << "<dt>Fecha</dt> <dd>#{ejemplar['fechacolecta']}</dd>\n"
self.kml << "<dt>Nombre del colector</dt> <dd>#{ejemplar['colector']}</dd>\n"
self.kml << "<dt>Colección</dt> <dd>#{ejemplar['coleccion']}</dd>\n"
self.kml << "<dt>Institución</dt> <dd>#{ejemplar['institucion']}</dd>\n"
self.kml << "<dt>País de la colección</dt> <dd>#{ejemplar['paiscoleccion']}</dd>\n"
if ejemplar['proyectourl'].present?
self.kml << "<dt>Proyecto:</dt> <dd><a href=\"#{ejemplar['proyectourl']}\">#{ejemplar['proyecto'] || 'ver'}</a></dd>\n"
else
self.kml << "<dt>Proyecto:</dt> <dd>#{ejemplar['proyecto']}</dd>\n"
end
self.kml << "</dl>\n"
self.kml << "<span><text>Más información: </text><a href=\"http://#{ejemplar['urlejemplar']}\">consultar SNIB</a></span>\n"
self.kml << "</div>\n"
self.kml << "]]>\n"
self.kml << "</description>\n"
self.kml << '<styleUrl>#normalPlacemark</styleUrl>'
self.kml << "<Point>\n<coordinates>\n#{ejemplar['longitud']},#{ejemplar['latitud']}\n</coordinates>\n</Point>\n"
self.kml << "</Placemark>\n"
end
self.kml << "</Document>\n"
self.kml << '</kml>'
end
def kmz(nombre)
archvo_zip = "#{nombre}.zip"
system "zip -j #{archvo_zip} #{nombre}.kml"
File.rename(archvo_zip, "#{nombre}.kmz")
end
# Borra el json, kml, kmz del taxon en cuestion, ya sea observaciones o ejemplares
def borrar_geodata(tipo)
ruta = Rails.root.join('public', 'geodatos', especie_id.to_s, "#{tipo}*")
archivos = Dir.glob(ruta)
archivos.each do |a|
File.delete(a)
end
end
def photo_type(url)
return 'FlickrPhoto' if url.include?("staticflickr\.com") || url.include?("static\.flickr\.com")
return 'EolPhoto' if url.include? "media\.eol\.org"
return 'NaturalistaPhoto' if url.include? "static\.inaturalist\.org"
return 'WikimediaCommonsPhoto' if url.include? "upload\.wikimedia\.org"
end
def taxon_photos(datos, usuario)
photos = []
datos['taxon_photos'].each do |pho| #Guarda todas las fotos asociadas del taxon
next unless pho['photo']['native_photo_id'].present?
next unless pho['photo']['thumb_url'].present?
next unless photo_type(pho['photo']['thumb_url']).present?
local_photo = Photo.where(:native_photo_id => pho['photo']['native_photo_id'], :type => photo_type(pho['photo']['thumb_url']))
photo = local_photo.count == 1 ? local_photo.first : Photo.new #Crea o actualiza la foto
photo.usuario_id = usuario
photo.native_photo_id = pho['photo']['native_photo_id']
photo.square_url = pho['photo']['square_url']
photo.thumb_url = pho['photo']['thumb_url']
photo.small_url = pho['photo']['small_url']
photo.medium_url = pho['photo']['medium_url']
photo.large_url = pho['photo']['large_url']
#photo.original_url = pho['photo']['original_url']
photo.created_at = pho['photo']['created_at']
photo.updated_at = pho['photo']['updated_at']
photo.native_page_url = pho['photo']['native_page_url']
photo.native_username = pho['photo']['native_username']
photo.native_realname = pho['photo']['native_realname']
photo.license = pho['photo']['license']
photo.type = photo_type(pho['photo']['thumb_url'])
photos << photo
end
photos
end
end
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
# rubocop:disable Rails/Output
class Scheduler < ApplicationModel
def self.run( runner, runner_count )
Thread.abort_on_exception = true
jobs_started = {}
loop do
logger.info "Scheduler running (runner #{runner} of #{runner_count})..."
# reconnect in case db connection is lost
begin
ActiveRecord::Base.connection.reconnect!
rescue => e
logger.error "Can't reconnect to database #{ e.inspect }"
end
# read/load jobs and check if it is alredy started
jobs = Scheduler.where( 'active = ? AND prio = ?', true, runner )
jobs.each {|job|
next if jobs_started[ job.id ]
jobs_started[ job.id ] = true
start_job( job, runner, runner_count )
}
sleep 90
end
end
def self.start_job( job, runner, runner_count )
logger.info "started job thread for '#{job.name}' (#{job.method})..."
sleep 4
Thread.new {
if job.period
loop do
_start_job( job, runner, runner_count )
job = Scheduler.lookup( id: job.id )
# exit is job got deleted
break if !job
# exit if job is not active anymore
break if !job.active
# exit if there is no loop period defined
break if !job.period
# wait until next run
sleep job.period
end
else
_start_job( job, runner, runner_count )
end
# raise "Exception from thread"
job.pid = ''
job.save
logger.info " ...stopped thread for '#{job.method}'"
ActiveRecord::Base.connection.close
}
end
def self._start_job( job, runner, runner_count, try_count = 0, try_run_time = Time.zone.now )
sleep 5
begin
job.last_run = Time.zone.now
job.pid = Thread.current.object_id
job.save
logger.info "execute #{job.method} (runner #{runner} of #{runner_count}, try_count #{try_count})..."
eval job.method() # rubocop:disable Lint/Eval
rescue => e
logger.error "execute #{job.method} (runner #{runner} of #{runner_count}, try_count #{try_count}) exited with error #{ e.inspect }"
# reconnect in case db connection is lost
begin
ActiveRecord::Base.connection.reconnect!
rescue => e
logger.error "Can't reconnect to database #{ e.inspect }"
end
try_run_max = 10
try_count += 1
# reset error counter if to old
if try_run_time + ( 60 * 5 ) < Time.zone.now
try_count = 0
end
try_run_time = Time.zone.now
# restart job again
if try_run_max > try_count
_start_job( job, runner, runner_count, try_count, try_run_time)
else
raise "STOP thread for #{job.method} (runner #{runner} of #{runner_count} after #{try_count} tries"
end
end
end
def self.worker
wait = 10
logger.info "*** Starting worker #{Delayed::Job}"
loop do
result = nil
realtime = Benchmark.realtime do
result = Delayed::Worker.new.work_off
end
count = result.sum
break if $exit
if count.zero?
sleep(wait)
logger.info '*** worker loop'
else
format "*** #{count} jobs processed at %.4f j/s, %d failed ...\n", count / realtime, result.last
end
end
end
def self.check( name, time_warning = 10, time_critical = 20 )
time_warning_time = Time.zone.now - time_warning.minutes
time_critical_time = Time.zone.now - time_critical.minutes
scheduler = Scheduler.find_by( name: name )
if !scheduler
puts "CRITICAL - no such scheduler jobs '#{name}'"
return true
end
logger.debug scheduler.inspect
if !scheduler.last_run
puts "CRITICAL - scheduler jobs never started '#{name}'"
exit 2
end
if scheduler.last_run < time_critical_time
puts "CRITICAL - scheduler jobs was not running in last '#{time_critical}' minutes - last run at '#{scheduler.last_run}' '#{name}'"
exit 2
end
if scheduler.last_run < time_warning_time
puts "CRITICAL - scheduler jobs was not running in last '#{time_warning}' minutes - last run at '#{scheduler.last_run}' '#{name}'"
exit 2
end
puts "ok - scheduler jobs was running at '#{scheduler.last_run}' '#{name}'"
exit 0
end
end
Corrected with rubocop cop 'Style/GlobalVars'.
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
# rubocop:disable Rails/Output
class Scheduler < ApplicationModel
def self.run( runner, runner_count )
Thread.abort_on_exception = true
jobs_started = {}
loop do
logger.info "Scheduler running (runner #{runner} of #{runner_count})..."
# reconnect in case db connection is lost
begin
ActiveRecord::Base.connection.reconnect!
rescue => e
logger.error "Can't reconnect to database #{ e.inspect }"
end
# read/load jobs and check if it is alredy started
jobs = Scheduler.where( 'active = ? AND prio = ?', true, runner )
jobs.each {|job|
next if jobs_started[ job.id ]
jobs_started[ job.id ] = true
start_job( job, runner, runner_count )
}
sleep 90
end
end
def self.start_job( job, runner, runner_count )
logger.info "started job thread for '#{job.name}' (#{job.method})..."
sleep 4
Thread.new {
if job.period
loop do
_start_job( job, runner, runner_count )
job = Scheduler.lookup( id: job.id )
# exit is job got deleted
break if !job
# exit if job is not active anymore
break if !job.active
# exit if there is no loop period defined
break if !job.period
# wait until next run
sleep job.period
end
else
_start_job( job, runner, runner_count )
end
# raise "Exception from thread"
job.pid = ''
job.save
logger.info " ...stopped thread for '#{job.method}'"
ActiveRecord::Base.connection.close
}
end
def self._start_job( job, runner, runner_count, try_count = 0, try_run_time = Time.zone.now )
sleep 5
begin
job.last_run = Time.zone.now
job.pid = Thread.current.object_id
job.save
logger.info "execute #{job.method} (runner #{runner} of #{runner_count}, try_count #{try_count})..."
eval job.method() # rubocop:disable Lint/Eval
rescue => e
logger.error "execute #{job.method} (runner #{runner} of #{runner_count}, try_count #{try_count}) exited with error #{ e.inspect }"
# reconnect in case db connection is lost
begin
ActiveRecord::Base.connection.reconnect!
rescue => e
logger.error "Can't reconnect to database #{ e.inspect }"
end
try_run_max = 10
try_count += 1
# reset error counter if to old
if try_run_time + ( 60 * 5 ) < Time.zone.now
try_count = 0
end
try_run_time = Time.zone.now
# restart job again
if try_run_max > try_count
_start_job( job, runner, runner_count, try_count, try_run_time)
else
raise "STOP thread for #{job.method} (runner #{runner} of #{runner_count} after #{try_count} tries"
end
end
end
def self.worker
wait = 10
logger.info "*** Starting worker #{Delayed::Job}"
loop do
result = nil
realtime = Benchmark.realtime do
result = Delayed::Worker.new.work_off
end
count = result.sum
if count.zero?
sleep(wait)
logger.info '*** worker loop'
else
format "*** #{count} jobs processed at %.4f j/s, %d failed ...\n", count / realtime, result.last
end
end
end
def self.check( name, time_warning = 10, time_critical = 20 )
time_warning_time = Time.zone.now - time_warning.minutes
time_critical_time = Time.zone.now - time_critical.minutes
scheduler = Scheduler.find_by( name: name )
if !scheduler
puts "CRITICAL - no such scheduler jobs '#{name}'"
return true
end
logger.debug scheduler.inspect
if !scheduler.last_run
puts "CRITICAL - scheduler jobs never started '#{name}'"
exit 2
end
if scheduler.last_run < time_critical_time
puts "CRITICAL - scheduler jobs was not running in last '#{time_critical}' minutes - last run at '#{scheduler.last_run}' '#{name}'"
exit 2
end
if scheduler.last_run < time_warning_time
puts "CRITICAL - scheduler jobs was not running in last '#{time_warning}' minutes - last run at '#{scheduler.last_run}' '#{name}'"
exit 2
end
puts "ok - scheduler jobs was running at '#{scheduler.last_run}' '#{name}'"
exit 0
end
end
|
class Spree::New < ActiveRecord::Base
attr_accessible :title, :body
end
Added Search from for tires
module Spree
class New
attr_accessible :title, :body
end
end
|
#
# Be sure to run `pod lib lint FWTDragView.podspec' to ensure this is a
# valid spec and remove all comments before submitting the spec.
#
# Any lines starting with a # are optional, but encouraged
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = "FWTDragView"
s.version = "0.2.7"
s.summary = "A tinder style draggable view control for use across FW projects."
s.description = <<-DESC
#FWTDragView
A UIView protocol and manager that let you drag views around and query the view's status in order to feed back in to the rest of the app.
DESC
s.homepage = "https://github.com/FutureWorkshops/FWTDragView"
s.license = 'MIT'
s.author = { "Tim Chilvers" => "tim@futureworkshops.com" }
s.source = { :git => "https://github.com/FutureWorkshops/FWTDragView.git", :tag => s.version.to_s }
s.platform = :ios, '7.0'
s.requires_arc = true
s.source_files = 'Pod/Classes'
end
Fix version number
#
# Be sure to run `pod lib lint FWTDragView.podspec' to ensure this is a
# valid spec and remove all comments before submitting the spec.
#
# Any lines starting with a # are optional, but encouraged
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = "FWTDragView"
s.version = "0.2.9"
s.summary = "A tinder style draggable view control for use across FW projects."
s.description = <<-DESC
#FWTDragView
A UIView protocol and manager that let you drag views around and query the view's status in order to feed back in to the rest of the app.
DESC
s.homepage = "https://github.com/FutureWorkshops/FWTDragView"
s.license = 'MIT'
s.author = { "Tim Chilvers" => "tim@futureworkshops.com" }
s.source = { :git => "https://github.com/FutureWorkshops/FWTDragView.git", :tag => s.version.to_s }
s.platform = :ios, '7.0'
s.requires_arc = true
s.source_files = 'Pod/Classes'
end
|
# frozen_string_literal: true
require_relative 'lib/flame/r18n/version'
Gem::Specification.new do |spec|
spec.name = 'flame-r18n'
spec.version = Flame::R18n::VERSION
spec.summary = 'Flame plugin which provides i18n and L10n support'
spec.description = <<~DESC
Flame plugin which provides i18n and L10n support to your web application.
It is a wrapper for R18n core library. See R18n documentation for more information.
DESC
spec.authors = ['Alexander Popov']
spec.email = ['alex.wayfer@gmail.com']
spec.license = 'MIT'
source_code_uri = 'https://github.com/AlexWayfer/flame-r18n'
spec.homepage = source_code_uri
spec.metadata['source_code_uri'] = source_code_uri
spec.metadata['homepage_uri'] = spec.homepage
spec.metadata['changelog_uri'] =
'https://github.com/AlexWayfer/flame-r18n/blob/main/CHANGELOG.md'
spec.metadata['rubygems_mfa_required'] = 'true'
spec.files = Dir['lib/**/*.rb', 'README.md', 'LICENSE.txt', 'CHANGELOG.md']
spec.required_ruby_version = '>= 2.6'
spec.add_dependency 'flame', '>= 5.0.0.rc3', '< 6'
spec.add_dependency 'r18n-core', '~> 5.0'
spec.add_development_dependency 'pry-byebug', '~> 3.9'
spec.add_development_dependency 'bundler', '~> 2.0'
spec.add_development_dependency 'gem_toys', '~> 0.12.1'
spec.add_development_dependency 'toys', '~> 0.13.1'
spec.add_development_dependency 'codecov', '~> 0.6.0'
spec.add_development_dependency 'rack-test', '~> 1.0'
spec.add_development_dependency 'rspec', '~> 3.9'
spec.add_development_dependency 'simplecov', '~> 0.21.2'
spec.add_development_dependency 'rubocop', '~> 1.26.0'
spec.add_development_dependency 'rubocop-performance', '~> 1.0'
spec.add_development_dependency 'rubocop-rspec', '~> 2.0'
end
Update rubocop to version 1.28.1
# frozen_string_literal: true
require_relative 'lib/flame/r18n/version'
Gem::Specification.new do |spec|
spec.name = 'flame-r18n'
spec.version = Flame::R18n::VERSION
spec.summary = 'Flame plugin which provides i18n and L10n support'
spec.description = <<~DESC
Flame plugin which provides i18n and L10n support to your web application.
It is a wrapper for R18n core library. See R18n documentation for more information.
DESC
spec.authors = ['Alexander Popov']
spec.email = ['alex.wayfer@gmail.com']
spec.license = 'MIT'
source_code_uri = 'https://github.com/AlexWayfer/flame-r18n'
spec.homepage = source_code_uri
spec.metadata['source_code_uri'] = source_code_uri
spec.metadata['homepage_uri'] = spec.homepage
spec.metadata['changelog_uri'] =
'https://github.com/AlexWayfer/flame-r18n/blob/main/CHANGELOG.md'
spec.metadata['rubygems_mfa_required'] = 'true'
spec.files = Dir['lib/**/*.rb', 'README.md', 'LICENSE.txt', 'CHANGELOG.md']
spec.required_ruby_version = '>= 2.6'
spec.add_dependency 'flame', '>= 5.0.0.rc3', '< 6'
spec.add_dependency 'r18n-core', '~> 5.0'
spec.add_development_dependency 'pry-byebug', '~> 3.9'
spec.add_development_dependency 'bundler', '~> 2.0'
spec.add_development_dependency 'gem_toys', '~> 0.12.1'
spec.add_development_dependency 'toys', '~> 0.13.1'
spec.add_development_dependency 'codecov', '~> 0.6.0'
spec.add_development_dependency 'rack-test', '~> 1.0'
spec.add_development_dependency 'rspec', '~> 3.9'
spec.add_development_dependency 'simplecov', '~> 0.21.2'
spec.add_development_dependency 'rubocop', '~> 1.28.1'
spec.add_development_dependency 'rubocop-performance', '~> 1.0'
spec.add_development_dependency 'rubocop-rspec', '~> 2.0'
end
|
# -*- encoding: utf-8 -*-
require File.expand_path('../lib/flot/rails/version', __FILE__)
Gem::Specification.new do |s|
s.name = "flot-rails"
s.version = Jquery::Rails::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Kevin Lynch"]
s.email = ["klynch@gmail.com"]
s.homepage = "http://rubygems.org/gems/flot-rails"
s.summary = "Use jQuery flot with Rails 3.1"
s.description = "This gem provides jQuery-flot for your Rails 3.1 application."
s.required_rubygems_version = ">= 1.3.6"
s.rubyforge_project = "flot-rails"
s.add_dependency "jquery-rails"
s.add_development_dependency "rails", "~> 3.1"
s.files = `git ls-files`.split("\n")
s.executables = `git ls-files`.split("\n").select{|f| f =~ /^bin/}
s.require_path = 'lib'
end
Fixed gemspec
# -*- encoding: utf-8 -*-
require File.expand_path('../lib/flot/rails/version', __FILE__)
Gem::Specification.new do |s|
s.name = "flot-rails"
s.version = Flot::Rails::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Kevin Lynch"]
s.email = ["klynch@gmail.com"]
s.homepage = "http://rubygems.org/gems/flot-rails"
s.summary = "Use jQuery flot with Rails 3.1"
s.description = "This gem provides jQuery-flot for your Rails 3.1 application."
s.required_rubygems_version = ">= 1.3.6"
s.rubyforge_project = "flot-rails"
s.add_dependency "jquery-rails"
s.add_development_dependency "rails", "~> 3.1"
s.files = `git ls-files`.split("\n")
s.executables = `git ls-files`.split("\n").select{|f| f =~ /^bin/}
s.require_path = 'lib'
end |
class AflFuzz < Formula
desc "American fuzzy lop: Security-oriented fuzzer"
homepage "http://lcamtuf.coredump.cx/afl/"
url "http://lcamtuf.coredump.cx/afl/releases/afl-2.13b.tgz"
sha256 "87771426b13e094e9101036d5d8f2dfc050ffef408058fa00d8b0985216a97dc"
bottle do
sha256 "1afcf5185b403adb4384445d7033dfbf63a7be73e6e7686dab1481ddf3f96360" => :el_capitan
sha256 "ca4d7e20c519fafceeff975fa1308e2c460e3a5c8399449a47c687e068fbce52" => :yosemite
sha256 "aafd9815df6f4185597bf71aca93bf025c7abbb9f7564e854b1cd283c849d031" => :mavericks
end
def install
# test_build dies with "Oops, the instrumentation does not seem to be
# behaving correctly!" in a nested login shell.
# Reported to lcamtuf@coredump.cx 6th Apr 2016.
inreplace "Makefile" do |s|
s.gsub! "all: test_x86 $(PROGS) afl-as test_build all_done", "all: test_x86 $(PROGS) afl-as all_done"
s.gsub! "all_done: test_build", "all_done:"
end
system "make", "PREFIX=#{prefix}"
system "make", "install", "PREFIX=#{prefix}"
end
test do
cpp_file = testpath/"main.cpp"
exe_file = testpath/"test"
cpp_file.write <<-EOS.undent
#include <iostream>
int main() {
std::cout << "Hello, world!";
}
EOS
system "#{bin}/afl-clang++", "-g", cpp_file, "-o", exe_file
output = `#{exe_file}`
assert_equal 0, $?.exitstatus
assert_equal output, "Hello, world!"
end
end
afl-fuzz 2.14b
Closes #1930.
Signed-off-by: Tomasz Pajor <ea73344294b1c6e2cb529d7fc98a4971de7607ac@polishgeeks.com>
class AflFuzz < Formula
desc "American fuzzy lop: Security-oriented fuzzer"
homepage "http://lcamtuf.coredump.cx/afl/"
url "http://lcamtuf.coredump.cx/afl/releases/afl-2.14b.tgz"
sha256 "623c01059c3615c4e9ee17893dcedc75d87b74e64232b969f44f9d90d3f0b229"
bottle do
sha256 "1afcf5185b403adb4384445d7033dfbf63a7be73e6e7686dab1481ddf3f96360" => :el_capitan
sha256 "ca4d7e20c519fafceeff975fa1308e2c460e3a5c8399449a47c687e068fbce52" => :yosemite
sha256 "aafd9815df6f4185597bf71aca93bf025c7abbb9f7564e854b1cd283c849d031" => :mavericks
end
def install
# test_build dies with "Oops, the instrumentation does not seem to be
# behaving correctly!" in a nested login shell.
# Reported to lcamtuf@coredump.cx 6th Apr 2016.
inreplace "Makefile" do |s|
s.gsub! "all: test_x86 $(PROGS) afl-as test_build all_done", "all: test_x86 $(PROGS) afl-as all_done"
s.gsub! "all_done: test_build", "all_done:"
end
system "make", "PREFIX=#{prefix}"
system "make", "install", "PREFIX=#{prefix}"
end
test do
cpp_file = testpath/"main.cpp"
exe_file = testpath/"test"
cpp_file.write <<-EOS.undent
#include <iostream>
int main() {
std::cout << "Hello, world!";
}
EOS
system "#{bin}/afl-clang++", "-g", cpp_file, "-o", exe_file
output = `#{exe_file}`
assert_equal 0, $?.exitstatus
assert_equal output, "Hello, world!"
end
end
|
# Build
class AlsaLib < Formula
desc "Provides audio and MIDI functionality to the Linux operating system"
homepage "https://www.alsa-project.org/"
url "https://www.alsa-project.org/files/pub/lib/alsa-lib-1.2.5.tar.bz2"
sha256 "9092894a8c083b33acf8d6deb901b58f5d20d6da583789f814e8e46f2850ef18"
license "LGPL-2.1-or-later"
livecheck do
url "https://www.alsa-project.org/files/pub/lib/"
regex(/href=.*?alsa-lib[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
depends_on :linux
def install
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <alsa/asoundlib.h>
int main(void)
{
snd_ctl_card_info_t *info;
snd_ctl_card_info_alloca(&info);
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-lasound", "-o", "test"
system "./test"
end
end
alsa-lib: add 1.2.5 bottle.
# Build
class AlsaLib < Formula
desc "Provides audio and MIDI functionality to the Linux operating system"
homepage "https://www.alsa-project.org/"
url "https://www.alsa-project.org/files/pub/lib/alsa-lib-1.2.5.tar.bz2"
sha256 "9092894a8c083b33acf8d6deb901b58f5d20d6da583789f814e8e46f2850ef18"
license "LGPL-2.1-or-later"
livecheck do
url "https://www.alsa-project.org/files/pub/lib/"
regex(/href=.*?alsa-lib[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
rebuild 1
sha256 x86_64_linux: "b91e5524748677d744b486196e343f46916e76fee9ca945591809f32197cf45d"
end
depends_on :linux
def install
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <alsa/asoundlib.h>
int main(void)
{
snd_ctl_card_info_t *info;
snd_ctl_card_info_alloca(&info);
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-lasound", "-o", "test"
system "./test"
end
end
|
class AlsaLib < Formula
desc "Provides audio and MIDI functionality to the Linux operating system"
homepage "https://www.alsa-project.org/"
url "https://www.alsa-project.org/files/pub/lib/alsa-lib-1.2.6.1.tar.bz2"
sha256 "ad582993d52cdb5fb159a0beab60a6ac57eab0cc1bdf85dc4db6d6197f02333f"
license "LGPL-2.1-or-later"
livecheck do
url "https://www.alsa-project.org/files/pub/lib/"
regex(/href=.*?alsa-lib[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 x86_64_linux: "33efe3ac71cab0add38f65c0eca5a43ba89805af4bfdb2328ebeb717086fb939"
end
depends_on :linux
def install
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <alsa/asoundlib.h>
int main(void)
{
snd_ctl_card_info_t *info;
snd_ctl_card_info_alloca(&info);
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-lasound", "-o", "test"
system "./test"
end
end
alsa-lib: update 1.2.6.1 bottle.
class AlsaLib < Formula
desc "Provides audio and MIDI functionality to the Linux operating system"
homepage "https://www.alsa-project.org/"
url "https://www.alsa-project.org/files/pub/lib/alsa-lib-1.2.6.1.tar.bz2"
sha256 "ad582993d52cdb5fb159a0beab60a6ac57eab0cc1bdf85dc4db6d6197f02333f"
license "LGPL-2.1-or-later"
livecheck do
url "https://www.alsa-project.org/files/pub/lib/"
regex(/href=.*?alsa-lib[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 x86_64_linux: "c673efe91d915b952414f5bc37381c9f75979f0ecd196236a2997413beca1bab"
end
depends_on :linux
def install
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <alsa/asoundlib.h>
int main(void)
{
snd_ctl_card_info_t *info;
snd_ctl_card_info_alloca(&info);
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-lasound", "-o", "test"
system "./test"
end
end
|
class Antibody < Formula
desc "The fastest shell plugin manager"
homepage "https://getantibody.github.io/"
url "https://github.com/getantibody/antibody/archive/v4.3.1.tar.gz"
sha256 "b69b2b90914e03f4a54453d740345cad222b379c366ec3788f4fdf4b1f01ac64"
bottle do
cellar :any_skip_relocation
sha256 "b9272b167bef22b1e37d9b48be0e8a260569402bd27f69b869f0986b485ac6c3" => :catalina
sha256 "0cbe9cd2950a85113caf84ebc4227f8ac9f32c130346ae2ea733c96d7fc7c829" => :mojave
sha256 "57a9c27a9c51809d02b6c12c8edd2337ed2cc750cf6d676712b8bb9e6ae6b64f" => :high_sierra
end
depends_on "go" => :build
def install
system "go", "build", "-ldflags", "-s -w -X main.version=#{version}", "-trimpath", "-o", bin/"antibody"
end
test do
# See if antibody can install a bundle correctly
system "#{bin}/antibody", "bundle", "rupa/z"
assert_match("rupa/z", shell_output("#{bin}/antibody list"))
end
end
antibody 5.0.0
Closes #52034.
Signed-off-by: Rui Chen <5fd29470147430022ff146db88de16ee91dea376@gmail.com>
class Antibody < Formula
desc "The fastest shell plugin manager"
homepage "https://getantibody.github.io/"
url "https://github.com/getantibody/antibody/archive/v5.0.0.tar.gz"
sha256 "dfc983df82a7a1d90e5fa51f060da0d67cfe6da71323173efaa400638610e901"
bottle do
cellar :any_skip_relocation
sha256 "b9272b167bef22b1e37d9b48be0e8a260569402bd27f69b869f0986b485ac6c3" => :catalina
sha256 "0cbe9cd2950a85113caf84ebc4227f8ac9f32c130346ae2ea733c96d7fc7c829" => :mojave
sha256 "57a9c27a9c51809d02b6c12c8edd2337ed2cc750cf6d676712b8bb9e6ae6b64f" => :high_sierra
end
depends_on "go" => :build
def install
system "go", "build", "-ldflags", "-s -w -X main.version=#{version}", "-trimpath", "-o", bin/"antibody"
end
test do
# See if antibody can install a bundle correctly
system "#{bin}/antibody", "bundle", "rupa/z"
assert_match("rupa/z", shell_output("#{bin}/antibody list"))
end
end
|
class Asciidoc < Formula
include Language::Python::Shebang
desc "Formatter/translator for text files to numerous formats. Includes a2x"
homepage "https://asciidoc.org/"
url "https://github.com/asciidoc/asciidoc-py3/archive/9.1.0.tar.gz"
sha256 "8a6e3ae99785d9325fba0856e04dbe532492af3cb20d49831bfd757166d46c6b"
license "GPL-2.0-only"
head "https://github.com/asciidoc/asciidoc-py3.git"
livecheck do
url :stable
regex(/^v?(\d+(?:\.\d+)+)$/i)
end
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "b1bcbcde0a7c320b6545b860c6970ba4fe3197fd9895bcd7213bc4e1d94e3fc8"
sha256 cellar: :any_skip_relocation, big_sur: "fdfe12fdf2042b563bc1a483ffa374af8a66e4cf0ba3016a391dc2fc21900543"
sha256 cellar: :any_skip_relocation, catalina: "ea51b42dc1abaebdd7651c7f173425120abebe59d3fa71d44c6def60a737cdbe"
sha256 cellar: :any_skip_relocation, mojave: "fbd4303b8c1cfd427120a8b90e8504fd1d553b65243b8079e4d9e694f0a340d6"
end
depends_on "autoconf" => :build
depends_on "docbook-xsl" => :build
depends_on "docbook"
depends_on "python@3.9"
depends_on "source-highlight"
uses_from_macos "libxml2" => :build
uses_from_macos "libxslt" => :build
on_linux do
depends_on "xmlto" => :build
end
def install
ENV["XML_CATALOG_FILES"] = etc/"xml/catalog"
system "autoconf"
system "./configure", "--prefix=#{prefix}"
%w[
a2x.py asciidoc.py filters/code/code-filter.py
filters/graphviz/graphviz2png.py filters/latex/latex2img.py
filters/music/music2png.py filters/unwraplatex.py
].map { |f| rewrite_shebang detected_python_shebang, f }
# otherwise macOS's xmllint bails out
inreplace "Makefile", "-f manpage", "-f manpage -L"
system "make", "install"
system "make", "docs"
end
def caveats
<<~EOS
If you intend to process AsciiDoc files through an XML stage
(such as a2x for manpage generation) you need to add something
like:
export XML_CATALOG_FILES=#{etc}/xml/catalog
to your shell rc file so that xmllint can find AsciiDoc's
catalog files.
See `man 1 xmllint' for more.
EOS
end
test do
(testpath/"test.txt").write("== Hello World!")
system "#{bin}/asciidoc", "-b", "html5", "-o", "test.html", "test.txt"
assert_match %r{<h2 id="_hello_world">Hello World!</h2>}, File.read("test.html")
end
end
asciidoc: update 9.1.0 bottle.
class Asciidoc < Formula
include Language::Python::Shebang
desc "Formatter/translator for text files to numerous formats. Includes a2x"
homepage "https://asciidoc.org/"
url "https://github.com/asciidoc/asciidoc-py3/archive/9.1.0.tar.gz"
sha256 "8a6e3ae99785d9325fba0856e04dbe532492af3cb20d49831bfd757166d46c6b"
license "GPL-2.0-only"
head "https://github.com/asciidoc/asciidoc-py3.git"
livecheck do
url :stable
regex(/^v?(\d+(?:\.\d+)+)$/i)
end
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "0613eea2af2be4241ba6ccdeb94eb8c061bf07c5fd18ecc8e3a8d2ce0b3e1128"
sha256 cellar: :any_skip_relocation, big_sur: "4a13fb6be824ba6a60ccd646aa8d64535c41fb2a2bdf6cf242b5bd4e94a8d75b"
sha256 cellar: :any_skip_relocation, catalina: "e7dd75c43dd2370426f3383ee7975f5acbb2b9d4499ebd8404aa63d215b7d4f9"
sha256 cellar: :any_skip_relocation, mojave: "64d87ef7c0ba34bee18612d2fdfd623ad045cf9580cc88c9073a63a067d3e76f"
end
depends_on "autoconf" => :build
depends_on "docbook-xsl" => :build
depends_on "docbook"
depends_on "python@3.9"
depends_on "source-highlight"
uses_from_macos "libxml2" => :build
uses_from_macos "libxslt" => :build
on_linux do
depends_on "xmlto" => :build
end
def install
ENV["XML_CATALOG_FILES"] = etc/"xml/catalog"
system "autoconf"
system "./configure", "--prefix=#{prefix}"
%w[
a2x.py asciidoc.py filters/code/code-filter.py
filters/graphviz/graphviz2png.py filters/latex/latex2img.py
filters/music/music2png.py filters/unwraplatex.py
].map { |f| rewrite_shebang detected_python_shebang, f }
# otherwise macOS's xmllint bails out
inreplace "Makefile", "-f manpage", "-f manpage -L"
system "make", "install"
system "make", "docs"
end
def caveats
<<~EOS
If you intend to process AsciiDoc files through an XML stage
(such as a2x for manpage generation) you need to add something
like:
export XML_CATALOG_FILES=#{etc}/xml/catalog
to your shell rc file so that xmllint can find AsciiDoc's
catalog files.
See `man 1 xmllint' for more.
EOS
end
test do
(testpath/"test.txt").write("== Hello World!")
system "#{bin}/asciidoc", "-b", "html5", "-o", "test.html", "test.txt"
assert_match %r{<h2 id="_hello_world">Hello World!</h2>}, File.read("test.html")
end
end
|
class Atlantis < Formula
desc "Terraform Pull Request Automation tool"
homepage "https://www.runatlantis.io/"
url "https://github.com/runatlantis/atlantis/archive/v0.10.2.tar.gz"
sha256 "a4590c181e759a2bb692e1b89552a02996cb366fca6f5f3298fff973a2e4a291"
bottle do
cellar :any_skip_relocation
rebuild 1
sha256 "cc3388f1553a1c1142bcf59c5357e9b7b8e020790529febe25e42d83e5502875" => :catalina
sha256 "08772b561463ee7a26b620338d1c5d2a1ae8b81af8017d63e00e884ffb0ee1f6" => :mojave
sha256 "e951f14e57a14f631f2b26cf98db73f884115b3ce9a8e6bfa9cbd93b42cfabb6" => :high_sierra
end
depends_on "go" => :build
depends_on "terraform"
def install
system "go", "build", "-ldflags", "-s -w", "-trimpath", "-o", bin/"atlantis"
end
test do
system bin/"atlantis", "version"
port = 4141
loglevel = "info"
gh_args = "--gh-user INVALID --gh-token INVALID --gh-webhook-secret INVALID --repo-whitelist INVALID"
command = bin/"atlantis server --atlantis-url http://invalid/ --port #{port} #{gh_args} --log-level #{loglevel}"
pid = Process.spawn(command)
system "sleep", "5"
output = `curl -vk# 'http://localhost:#{port}/' 2>&1`
assert_match %r{HTTP\/1.1 200 OK}m, output
assert_match "atlantis", output
Process.kill("TERM", pid)
end
end
atlantis: update 0.10.2 bottle.
class Atlantis < Formula
desc "Terraform Pull Request Automation tool"
homepage "https://www.runatlantis.io/"
url "https://github.com/runatlantis/atlantis/archive/v0.10.2.tar.gz"
sha256 "a4590c181e759a2bb692e1b89552a02996cb366fca6f5f3298fff973a2e4a291"
bottle do
cellar :any_skip_relocation
sha256 "ee357fdb4fd86ae1b82255fa8fa1d55d51bd7fd4a5bafbf36fef04442c0946be" => :catalina
sha256 "b4d357f53b25fd4fc503edf532a8f6ab30cc7455cf3953c02d9c96ee21dbdc8b" => :mojave
sha256 "8c44712f5de5dee007a5e64049c7079d795e7741cb0c8c7a225bd6cda6add5be" => :high_sierra
end
depends_on "go" => :build
depends_on "terraform"
def install
system "go", "build", "-ldflags", "-s -w", "-trimpath", "-o", bin/"atlantis"
end
test do
system bin/"atlantis", "version"
port = 4141
loglevel = "info"
gh_args = "--gh-user INVALID --gh-token INVALID --gh-webhook-secret INVALID --repo-whitelist INVALID"
command = bin/"atlantis server --atlantis-url http://invalid/ --port #{port} #{gh_args} --log-level #{loglevel}"
pid = Process.spawn(command)
system "sleep", "5"
output = `curl -vk# 'http://localhost:#{port}/' 2>&1`
assert_match %r{HTTP\/1.1 200 OK}m, output
assert_match "atlantis", output
Process.kill("TERM", pid)
end
end
|
class Atlantis < Formula
desc "Terraform Pull Request Automation tool"
homepage "https://www.runatlantis.io/"
url "https://github.com/runatlantis/atlantis/archive/v0.13.0.tar.gz"
sha256 "7e06f1e4d9410611763f2a9da3d45ecba6921be77a8f5d1ebba722047cfa081f"
bottle do
cellar :any_skip_relocation
rebuild 1
sha256 "8c0aefa951b91e25f8f056fff30b6db346a068f00d842fc3071753063156a012" => :catalina
sha256 "cf40282b89b9a69798283312bea51f14234b4d9e116780402d766da68c670c95" => :mojave
sha256 "6d089fb9b809612d0145a43d7fb8d991b6177c5791714a59764024eca13fe61a" => :high_sierra
end
depends_on "go" => :build
depends_on "terraform"
def install
system "go", "build", "-ldflags", "-s -w", "-trimpath", "-o", bin/"atlantis"
end
test do
system bin/"atlantis", "version"
port = free_port
loglevel = "info"
gh_args = "--gh-user INVALID --gh-token INVALID --gh-webhook-secret INVALID --repo-whitelist INVALID"
command = bin/"atlantis server --atlantis-url http://invalid/ --port #{port} #{gh_args} --log-level #{loglevel}"
pid = Process.spawn(command)
system "sleep", "5"
output = `curl -vk# 'http://localhost:#{port}/' 2>&1`
assert_match %r{HTTP/1.1 200 OK}m, output
assert_match "atlantis", output
Process.kill("TERM", pid)
end
end
atlantis 0.14.0
Closes #57635.
Signed-off-by: Rylan Polster <047d2ca1b3c34ce9eb9510507a88377ec1f9cce9@gmail.com>
Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com>
class Atlantis < Formula
desc "Terraform Pull Request Automation tool"
homepage "https://www.runatlantis.io/"
url "https://github.com/runatlantis/atlantis/archive/v0.14.0.tar.gz"
sha256 "32e24f4d341be578137f74385c9c97dd10461d260e23c77ed84298c578ec39e6"
bottle do
cellar :any_skip_relocation
rebuild 1
sha256 "8c0aefa951b91e25f8f056fff30b6db346a068f00d842fc3071753063156a012" => :catalina
sha256 "cf40282b89b9a69798283312bea51f14234b4d9e116780402d766da68c670c95" => :mojave
sha256 "6d089fb9b809612d0145a43d7fb8d991b6177c5791714a59764024eca13fe61a" => :high_sierra
end
depends_on "go" => :build
depends_on "terraform"
def install
system "go", "build", "-ldflags", "-s -w", "-trimpath", "-o", bin/"atlantis"
end
test do
system bin/"atlantis", "version"
port = free_port
loglevel = "info"
gh_args = "--gh-user INVALID --gh-token INVALID --gh-webhook-secret INVALID --repo-whitelist INVALID"
command = bin/"atlantis server --atlantis-url http://invalid/ --port #{port} #{gh_args} --log-level #{loglevel}"
pid = Process.spawn(command)
system "sleep", "5"
output = `curl -vk# 'http://localhost:#{port}/' 2>&1`
assert_match %r{HTTP/1.1 200 OK}m, output
assert_match "atlantis", output
Process.kill("TERM", pid)
end
end
|
class AwscliAT1 < Formula
include Language::Python::Virtualenv
desc "Official Amazon AWS command-line interface"
homepage "https://aws.amazon.com/cli/"
# awscli should only be updated every 10 releases on multiples of 10
url "https://files.pythonhosted.org/packages/12/db/fd16a26e6b56132841f99e970e800e25f6f6faa4b9affb0024b55793ac77/awscli-1.27.0.tar.gz"
sha256 "6f4353c770927e4dd5aed5062554f4bcb981c1941bd815dd035f7d5b8ab3f8bf"
license "Apache-2.0"
livecheck do
url "https://github.com/aws/aws-cli.git"
regex(/^v?(1(?:\.\d+)+)$/i)
end
bottle do
rebuild 1
sha256 cellar: :any_skip_relocation, arm64_ventura: "1b8c9c846c32422344b4c9dc1cd16c95bc20c297ef58ac216efd858d84402055"
sha256 cellar: :any_skip_relocation, arm64_monterey: "22b3b66cc2495860ae1d7b359d0ec75edd68e70ba29c8ef37b27f3517cf59796"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "5fd239a677edba2b855d77b594a5f6f79fac5aa158340c5a2a3e7650f50ee3e8"
sha256 cellar: :any_skip_relocation, monterey: "e7678d74cd7c4de141786216dec275d7ca915aa6d4e653404922c388a24b5cdb"
sha256 cellar: :any_skip_relocation, big_sur: "655ab6aaae462ba4f6acb5627c145f094b5138d15d71ce81241b7a8dc8bb15c8"
sha256 cellar: :any_skip_relocation, catalina: "504b9d5c5bdbc11d575a6b0b2919d056bba00e06194410fe1b47c285555e1315"
sha256 cellar: :any_skip_relocation, x86_64_linux: "86769decc01faec8aa36fce4ea781606db7d78969ab6d81da8a1b19e91c0f984"
end
keg_only :versioned_formula
depends_on "python@3.11"
depends_on "pyyaml"
depends_on "six"
# Remove this dependency when the version is at or above 1.27.6
# and replace with `uses_from_macos "mandoc"`
on_system :linux, macos: :ventura_or_newer do
depends_on "groff"
end
resource "botocore" do
url "https://files.pythonhosted.org/packages/0a/95/8f31139077187f2da9132d7547979262376e19056d99c7cf6278431a53de/botocore-1.29.0.tar.gz"
sha256 "f25dc0827005f81abf4b890a20c71f64ee40ea9e9795df38a242fdeed79e0a89"
end
resource "colorama" do
url "https://files.pythonhosted.org/packages/1f/bb/5d3246097ab77fa083a61bd8d3d527b7ae063c7d8e8671b1cf8c4ec10cbe/colorama-0.4.4.tar.gz"
sha256 "5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"
end
resource "docutils" do
url "https://files.pythonhosted.org/packages/2f/e0/3d435b34abd2d62e8206171892f174b180cd37b09d57b924ca5c2ef2219d/docutils-0.16.tar.gz"
sha256 "c2de3a60e9e7d07be26b7f2b00ca0309c207e06c100f9cc2a94931fc75a478fc"
end
resource "jmespath" do
url "https://files.pythonhosted.org/packages/00/2a/e867e8531cf3e36b41201936b7fa7ba7b5702dbef42922193f05c8976cd6/jmespath-1.0.1.tar.gz"
sha256 "90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe"
end
resource "pyasn1" do
url "https://files.pythonhosted.org/packages/a4/db/fffec68299e6d7bad3d504147f9094830b704527a7fc098b721d38cc7fa7/pyasn1-0.4.8.tar.gz"
sha256 "aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba"
end
resource "python-dateutil" do
url "https://files.pythonhosted.org/packages/4c/c4/13b4776ea2d76c115c1d1b84579f3764ee6d57204f6be27119f13a61d0a9/python-dateutil-2.8.2.tar.gz"
sha256 "0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"
end
resource "rsa" do
url "https://files.pythonhosted.org/packages/db/b5/475c45a58650b0580421746504b680cd2db4e81bc941e94ca53785250269/rsa-4.7.2.tar.gz"
sha256 "9d689e6ca1b3038bc82bf8d23e944b6b6037bc02301a574935b2dd946e0353b9"
end
resource "s3transfer" do
url "https://files.pythonhosted.org/packages/e1/eb/e57c93d5cd5edf8c1d124c831ef916601540db70acd96fa21fe60cef1365/s3transfer-0.6.0.tar.gz"
sha256 "2ed07d3866f523cc561bf4a00fc5535827981b117dd7876f036b0c1aca42c947"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/b2/56/d87d6d3c4121c0bcec116919350ca05dc3afd2eeb7dc88d07e8083f8ea94/urllib3-1.26.12.tar.gz"
sha256 "3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e"
end
def install
virtualenv_install_with_resources
pkgshare.install "awscli/examples"
rm Dir["#{bin}/{aws.cmd,aws_bash_completer,aws_zsh_completer.sh}"]
bash_completion.install "bin/aws_bash_completer"
zsh_completion.install "bin/aws_zsh_completer.sh"
(zsh_completion/"_aws").write <<~EOS
#compdef aws
_aws () {
local e
e=$(dirname ${funcsourcetrace[1]%:*})/aws_zsh_completer.sh
if [[ -f $e ]]; then source $e; fi
}
EOS
end
def caveats
<<~EOS
The "examples" directory has been installed to:
#{HOMEBREW_PREFIX}/share/awscli/examples
EOS
end
test do
assert_match "topics", shell_output("#{bin}/aws help")
end
end
awscli@1 1.27.10
Closes #115871.
Signed-off-by: Branch Vincent <0e6296586cbd330121a33cee359d4396296e2ead@users.noreply.github.com>
Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com>
class AwscliAT1 < Formula
include Language::Python::Virtualenv
desc "Official Amazon AWS command-line interface"
homepage "https://aws.amazon.com/cli/"
# awscli should only be updated every 10 releases on multiples of 10
url "https://files.pythonhosted.org/packages/74/30/796aceddb015018f32ec164b5fa5d15c04b69d96f3573fd0e8c1241c44ed/awscli-1.27.10.tar.gz"
sha256 "f652c250c0719d14e09e17b4417e7cba986e2395686ee3ec7e816c1f4633a023"
license "Apache-2.0"
livecheck do
url "https://github.com/aws/aws-cli.git"
regex(/^v?(1(?:\.\d+)+)$/i)
end
bottle do
rebuild 1
sha256 cellar: :any_skip_relocation, arm64_ventura: "1b8c9c846c32422344b4c9dc1cd16c95bc20c297ef58ac216efd858d84402055"
sha256 cellar: :any_skip_relocation, arm64_monterey: "22b3b66cc2495860ae1d7b359d0ec75edd68e70ba29c8ef37b27f3517cf59796"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "5fd239a677edba2b855d77b594a5f6f79fac5aa158340c5a2a3e7650f50ee3e8"
sha256 cellar: :any_skip_relocation, monterey: "e7678d74cd7c4de141786216dec275d7ca915aa6d4e653404922c388a24b5cdb"
sha256 cellar: :any_skip_relocation, big_sur: "655ab6aaae462ba4f6acb5627c145f094b5138d15d71ce81241b7a8dc8bb15c8"
sha256 cellar: :any_skip_relocation, catalina: "504b9d5c5bdbc11d575a6b0b2919d056bba00e06194410fe1b47c285555e1315"
sha256 cellar: :any_skip_relocation, x86_64_linux: "86769decc01faec8aa36fce4ea781606db7d78969ab6d81da8a1b19e91c0f984"
end
keg_only :versioned_formula
depends_on "python@3.11"
depends_on "pyyaml"
depends_on "six"
# Remove this dependency when the version is at or above 1.27.6
# and replace with `uses_from_macos "mandoc"`
on_system :linux, macos: :ventura_or_newer do
depends_on "groff"
end
resource "botocore" do
url "https://files.pythonhosted.org/packages/b7/b3/e65206ed1f7e4a9a877cca45128d9dee751f3bd340efd879bca23d0f0810/botocore-1.29.10.tar.gz"
sha256 "68af34e51597389e7de5ec239ce582853b65d4288308d19f40a30eb3e241fb0d"
end
resource "colorama" do
url "https://files.pythonhosted.org/packages/1f/bb/5d3246097ab77fa083a61bd8d3d527b7ae063c7d8e8671b1cf8c4ec10cbe/colorama-0.4.4.tar.gz"
sha256 "5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"
end
resource "docutils" do
url "https://files.pythonhosted.org/packages/2f/e0/3d435b34abd2d62e8206171892f174b180cd37b09d57b924ca5c2ef2219d/docutils-0.16.tar.gz"
sha256 "c2de3a60e9e7d07be26b7f2b00ca0309c207e06c100f9cc2a94931fc75a478fc"
end
resource "jmespath" do
url "https://files.pythonhosted.org/packages/00/2a/e867e8531cf3e36b41201936b7fa7ba7b5702dbef42922193f05c8976cd6/jmespath-1.0.1.tar.gz"
sha256 "90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe"
end
resource "pyasn1" do
url "https://files.pythonhosted.org/packages/a4/db/fffec68299e6d7bad3d504147f9094830b704527a7fc098b721d38cc7fa7/pyasn1-0.4.8.tar.gz"
sha256 "aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba"
end
resource "python-dateutil" do
url "https://files.pythonhosted.org/packages/4c/c4/13b4776ea2d76c115c1d1b84579f3764ee6d57204f6be27119f13a61d0a9/python-dateutil-2.8.2.tar.gz"
sha256 "0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"
end
resource "rsa" do
url "https://files.pythonhosted.org/packages/db/b5/475c45a58650b0580421746504b680cd2db4e81bc941e94ca53785250269/rsa-4.7.2.tar.gz"
sha256 "9d689e6ca1b3038bc82bf8d23e944b6b6037bc02301a574935b2dd946e0353b9"
end
resource "s3transfer" do
url "https://files.pythonhosted.org/packages/e1/eb/e57c93d5cd5edf8c1d124c831ef916601540db70acd96fa21fe60cef1365/s3transfer-0.6.0.tar.gz"
sha256 "2ed07d3866f523cc561bf4a00fc5535827981b117dd7876f036b0c1aca42c947"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/b2/56/d87d6d3c4121c0bcec116919350ca05dc3afd2eeb7dc88d07e8083f8ea94/urllib3-1.26.12.tar.gz"
sha256 "3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e"
end
def install
virtualenv_install_with_resources
pkgshare.install "awscli/examples"
rm Dir["#{bin}/{aws.cmd,aws_bash_completer,aws_zsh_completer.sh}"]
bash_completion.install "bin/aws_bash_completer"
zsh_completion.install "bin/aws_zsh_completer.sh"
(zsh_completion/"_aws").write <<~EOS
#compdef aws
_aws () {
local e
e=$(dirname ${funcsourcetrace[1]%:*})/aws_zsh_completer.sh
if [[ -f $e ]]; then source $e; fi
}
EOS
end
def caveats
<<~EOS
The "examples" directory has been installed to:
#{HOMEBREW_PREFIX}/share/awscli/examples
EOS
end
test do
assert_match "topics", shell_output("#{bin}/aws help")
end
end
|
# Copyright 2019 The Bazel Authors. All rights reserved.
#
# 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.
class Bazelisk < Formula
desc "User-friendly launcher for Bazel"
homepage "https://github.com/philwo/bazelisk"
url "https://github.com/philwo/bazelisk/releases/download/v0.0.4/bazelisk-darwin-amd64"
version "0.0.4"
# To generate run:
# curl -L -N -s https://github.com/philwo/bazelisk/releases/download/v0.0.4/bazelisk-darwin-amd64 | shasum -a 256
# on macOS
sha256 "c764ad27a9a7f9bd976b1b7321bfedc7d69c60f9ebdf1ad324dddd3e1f5806fe"
bottle :unneeded
conflicts_with "bazelbuild/tap/bazel", :because => "Bazelisk replaces the bazel binary"
def install
bin.install "bazelisk-darwin-amd64" => "bazel"
end
test do
# Simply run bazelisk to see whether it finished. Use a hardcoded version
# number to avoid calling the GitHub API.
touch testpath/"WORKSPACE"
(testpath/".bazelversion").write "0.22.0"
system bin/"bazel", "version"
end
end
Update Bazelisk to 0.0.5 (#56)
# Copyright 2019 The Bazel Authors. All rights reserved.
#
# 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.
class Bazelisk < Formula
desc "User-friendly launcher for Bazel"
homepage "https://github.com/philwo/bazelisk"
url "https://github.com/philwo/bazelisk/releases/download/v0.0.5/bazelisk-darwin-amd64"
version "0.0.5"
# To generate run:
# curl -L -N -s https://github.com/philwo/bazelisk/releases/download/v0.0.5/bazelisk-darwin-amd64 | shasum -a 256
# on macOS
sha256 "6bfca2304cc2258578658d95a6e8dbe43d3ae5dd089076128c726cf14b8c2b8f"
bottle :unneeded
conflicts_with "bazelbuild/tap/bazel", :because => "Bazelisk replaces the bazel binary"
def install
bin.install "bazelisk-darwin-amd64" => "bazel"
end
test do
# Simply run bazelisk to see whether it finished. Use a hardcoded version
# number to avoid calling the GitHub API.
touch testpath/"WORKSPACE"
(testpath/".bazelversion").write "0.22.0"
system bin/"bazel", "version"
end
end
|
class Bcftools < Formula
desc "Tools for BCF/VCF files and variant calling from samtools"
homepage "https://www.htslib.org/"
url "https://github.com/samtools/bcftools/releases/download/1.14/bcftools-1.14.tar.bz2"
sha256 "b7ef88ae89fcb55658c5bea2e8cb8e756b055e13860036d6be13756782aa19cb"
# The bcftools source code is MIT/Expat-licensed, but when it is configured
# with --enable-libgsl the resulting executable is GPL-licensed.
license "GPL-3.0-or-later"
livecheck do
url :stable
strategy :github_latest
end
bottle do
sha256 arm64_monterey: "744a97a27e3bad5c82d483d388fb49af8c13b67c3186da29c57da2fb5fda0c41"
sha256 arm64_big_sur: "13bc31d2086972697f374bcf68a24deaa389a57ed2adb4a3d432fd72a60ffcda"
sha256 monterey: "0f9241650659b12f4196cc1401714cee3688f6e72021c654c93f43eff066de1d"
sha256 big_sur: "e4cd74edeaa7c41ae71263732822b732b8d1e7cde98ce813dcd1fc1d2bf0529e"
sha256 catalina: "ddf5d0fe3d61c1386a383469a3bc7bb6bacc0ae11e6eaa3ef21ca3d38968e6a8"
sha256 cellar: :any_skip_relocation, x86_64_linux: "8db6b53f0fe4b88ec4d1e41297a1487429b937e0579c0ba8ee2c67a5729216c3"
end
depends_on "gsl"
depends_on "htslib"
def install
system "./configure", "--prefix=#{prefix}",
"--with-htslib=#{Formula["htslib"].opt_prefix}",
"--enable-libgsl"
system "make", "install"
pkgshare.install "test/query.vcf"
end
test do
output = shell_output("#{bin}/bcftools stats #{pkgshare}/query.vcf")
assert_match "number of SNPs:\t3", output
assert_match "fixploidy", shell_output("#{bin}/bcftools plugin -l")
end
end
bcftools: revision bump (gsl 2.7.1)
class Bcftools < Formula
desc "Tools for BCF/VCF files and variant calling from samtools"
homepage "https://www.htslib.org/"
url "https://github.com/samtools/bcftools/releases/download/1.14/bcftools-1.14.tar.bz2"
sha256 "b7ef88ae89fcb55658c5bea2e8cb8e756b055e13860036d6be13756782aa19cb"
# The bcftools source code is MIT/Expat-licensed, but when it is configured
# with --enable-libgsl the resulting executable is GPL-licensed.
license "GPL-3.0-or-later"
revision 1
livecheck do
url :stable
strategy :github_latest
end
bottle do
sha256 arm64_monterey: "744a97a27e3bad5c82d483d388fb49af8c13b67c3186da29c57da2fb5fda0c41"
sha256 arm64_big_sur: "13bc31d2086972697f374bcf68a24deaa389a57ed2adb4a3d432fd72a60ffcda"
sha256 monterey: "0f9241650659b12f4196cc1401714cee3688f6e72021c654c93f43eff066de1d"
sha256 big_sur: "e4cd74edeaa7c41ae71263732822b732b8d1e7cde98ce813dcd1fc1d2bf0529e"
sha256 catalina: "ddf5d0fe3d61c1386a383469a3bc7bb6bacc0ae11e6eaa3ef21ca3d38968e6a8"
sha256 cellar: :any_skip_relocation, x86_64_linux: "8db6b53f0fe4b88ec4d1e41297a1487429b937e0579c0ba8ee2c67a5729216c3"
end
depends_on "gsl"
depends_on "htslib"
def install
system "./configure", "--prefix=#{prefix}",
"--with-htslib=#{Formula["htslib"].opt_prefix}",
"--enable-libgsl"
system "make", "install"
pkgshare.install "test/query.vcf"
end
test do
output = shell_output("#{bin}/bcftools stats #{pkgshare}/query.vcf")
assert_match "number of SNPs:\t3", output
assert_match "fixploidy", shell_output("#{bin}/bcftools plugin -l")
end
end
|
class Binaryen < Formula
desc "Compiler infrastructure and toolchain library for WebAssembly"
homepage "https://webassembly.org/"
url "https://github.com/WebAssembly/binaryen/archive/version_98.tar.gz"
sha256 "9f805db6735869ab52cde7c0404879c90cf386888c0f587e944737550171c1c4"
license "Apache-2.0"
head "https://github.com/WebAssembly/binaryen.git"
bottle do
cellar :any
sha256 "5d5ac79ec3aabebd8e62433c84bd0d61b0f4ee44d56e4c4f47475276a6428bd8" => :big_sur
sha256 "260a8deac0c78a9fead982cf6d05fd818330bc4e28cdc73ecd5de6952ded6e8b" => :catalina
sha256 "7a68230a62307fbd61638803e942e4d556f99b8e4d6fbbdd3dbaf6997b3b2843" => :mojave
sha256 "4656a9b10a7db143e3619126ea1e0c169d05b06b27c7e75d5f641c86135c7b1f" => :high_sierra
end
depends_on "cmake" => :build
depends_on "python@3.9" => :build
depends_on macos: :el_capitan # needs thread-local storage
def install
ENV.cxx11
system "cmake", ".", *std_cmake_args
system "make", "install"
pkgshare.install "test/"
end
test do
system "#{bin}/wasm-opt", "-O", "#{pkgshare}/test/passes/O.wast", "-o", "1.wast"
end
end
binaryen: update 98 bottle.
class Binaryen < Formula
desc "Compiler infrastructure and toolchain library for WebAssembly"
homepage "https://webassembly.org/"
url "https://github.com/WebAssembly/binaryen/archive/version_98.tar.gz"
sha256 "9f805db6735869ab52cde7c0404879c90cf386888c0f587e944737550171c1c4"
license "Apache-2.0"
head "https://github.com/WebAssembly/binaryen.git"
bottle do
cellar :any
sha256 "5d5ac79ec3aabebd8e62433c84bd0d61b0f4ee44d56e4c4f47475276a6428bd8" => :big_sur
sha256 "6bd35ef9c849c2b2302486ee45fa6c05302fa27df0c12c97f4b6014e18b8f320" => :arm64_big_sur
sha256 "260a8deac0c78a9fead982cf6d05fd818330bc4e28cdc73ecd5de6952ded6e8b" => :catalina
sha256 "7a68230a62307fbd61638803e942e4d556f99b8e4d6fbbdd3dbaf6997b3b2843" => :mojave
sha256 "4656a9b10a7db143e3619126ea1e0c169d05b06b27c7e75d5f641c86135c7b1f" => :high_sierra
end
depends_on "cmake" => :build
depends_on "python@3.9" => :build
depends_on macos: :el_capitan # needs thread-local storage
def install
ENV.cxx11
system "cmake", ".", *std_cmake_args
system "make", "install"
pkgshare.install "test/"
end
test do
system "#{bin}/wasm-opt", "-O", "#{pkgshare}/test/passes/O.wast", "-o", "1.wast"
end
end
|
class BrewGem < Formula
desc "Install rubygems as homebrew formulae"
homepage "https://github.com/sportngin/brew-gem"
url "https://github.com/sportngin/brew-gem/archive/v0.7.3.tar.gz"
sha256 "4db0087f7c9e418589bd76f2e83db0b577d51b999336e4fe1b1c0b3b17181bac"
head "https://github.com/sportngin/brew-gem.git"
bottle :unneeded
def install
lib.install Dir["lib/*"]
bin.install "bin/brew-gem"
end
test do
system "#{bin}/brew-gem", "help"
end
end
brew-gem 0.8.0 (#4191)
class BrewGem < Formula
desc "Install rubygems as homebrew formulae"
homepage "https://github.com/sportngin/brew-gem"
url "https://github.com/sportngin/brew-gem/archive/v0.8.0.tar.gz"
sha256 "1289b1444af97a5405e9ef5fb230951ce2e0430693a92a9d473e45e1507a23e0"
head "https://github.com/sportngin/brew-gem.git"
bottle :unneeded
def install
lib.install Dir["lib/*"]
bin.install "bin/brew-gem"
end
test do
system "#{bin}/brew-gem", "help"
end
end
|
class Casperjs < Formula
desc "Navigation scripting and testing tool for PhantomJS"
homepage "http://www.casperjs.org/"
url "https://github.com/casperjs/casperjs/archive/1.1.3.tar.gz"
sha256 "3e9c385a2e3124a44728b24d3b4cad05a48e2b3827e9350bdfe11c9a6d4a4298"
head "https://github.com/casperjs/casperjs.git"
bottle do
cellar :any_skip_relocation
sha256 "b71c26fc5d2d6da94cc95554defbe5db1c6e0213d64ec09fea99755ffd529df4" => :el_capitan
sha256 "3ca3351236ac827a5cd745087e7763dbd7445e05e4ce05aa11c5bbc7d62d75a6" => :yosemite
sha256 "082b442968052c819463dacd01b99954f9e2e9e0a5d318c9b7a69e9f31e660f2" => :mavericks
end
# For embedded Phantomjs
depends_on :macos => :snow_leopard
depends_on "phantomjs"
def install
libexec.install Dir["*"]
bin.install_symlink libexec/"bin/casperjs"
end
test do
(testpath/"fetch.js").write <<-EOS.undent
var casper = require("casper").create();
casper.start("https://duckduckgo.com/about", function() {
this.download("https://duckduckgo.com/assets/dax-alt.svg", "dax-alt.svg");
});
casper.run();
EOS
system bin/"casperjs", testpath/"fetch.js"
assert File.exist?("dax-alt.svg")
end
end
casperjs: update 1.1.3 bottle.
class Casperjs < Formula
desc "Navigation scripting and testing tool for PhantomJS"
homepage "http://www.casperjs.org/"
url "https://github.com/casperjs/casperjs/archive/1.1.3.tar.gz"
sha256 "3e9c385a2e3124a44728b24d3b4cad05a48e2b3827e9350bdfe11c9a6d4a4298"
head "https://github.com/casperjs/casperjs.git"
bottle do
cellar :any_skip_relocation
sha256 "3a4260a5ae64d88e5a15ccba7bf297a7a794b3822838bb8280d6a8c954d45685" => :sierra
sha256 "b71c26fc5d2d6da94cc95554defbe5db1c6e0213d64ec09fea99755ffd529df4" => :el_capitan
sha256 "3ca3351236ac827a5cd745087e7763dbd7445e05e4ce05aa11c5bbc7d62d75a6" => :yosemite
sha256 "082b442968052c819463dacd01b99954f9e2e9e0a5d318c9b7a69e9f31e660f2" => :mavericks
end
# For embedded Phantomjs
depends_on :macos => :snow_leopard
depends_on "phantomjs"
def install
libexec.install Dir["*"]
bin.install_symlink libexec/"bin/casperjs"
end
test do
(testpath/"fetch.js").write <<-EOS.undent
var casper = require("casper").create();
casper.start("https://duckduckgo.com/about", function() {
this.download("https://duckduckgo.com/assets/dax-alt.svg", "dax-alt.svg");
});
casper.run();
EOS
system bin/"casperjs", testpath/"fetch.js"
assert File.exist?("dax-alt.svg")
end
end
|
class Cbindgen < Formula
desc "Project for generating C bindings from Rust code"
homepage "https://github.com/eqrion/cbindgen"
url "https://github.com/eqrion/cbindgen/archive/refs/tags/v0.24.3.tar.gz"
sha256 "5d693ab54acc085b9f2dbafbcf0a1f089737f7e0cb1686fa338c2aaa05dc7705"
license "MPL-2.0"
depends_on "rust" => :build
def install
system "cargo", "install", *std_cargo_args
pkgshare.install "tests"
end
test do
cp pkgshare/"tests/rust/extern.rs", testpath
output = shell_output("#{bin}/cbindgen extern.rs")
assert_match "extern int32_t foo()", output
end
end
cbindgen: add 0.24.3 bottle.
class Cbindgen < Formula
desc "Project for generating C bindings from Rust code"
homepage "https://github.com/eqrion/cbindgen"
url "https://github.com/eqrion/cbindgen/archive/refs/tags/v0.24.3.tar.gz"
sha256 "5d693ab54acc085b9f2dbafbcf0a1f089737f7e0cb1686fa338c2aaa05dc7705"
license "MPL-2.0"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "b0c1a36521b5e49fcaf8a6926a17495273312e28ba8dd5e9595bf8f02884ae5b"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "aaefb1afec80860483ed1561f2da6f6f76c2a9b7f76064ff7c63632d433bb294"
sha256 cellar: :any_skip_relocation, monterey: "a25cc4ddd2e539f7fed0c848494c4139c77519cb6b9e72958312b25fb27fc5bd"
sha256 cellar: :any_skip_relocation, big_sur: "8e2be90e9b02046436ff3bc7934966b44a35145f61bea72c5f9441fe52072306"
sha256 cellar: :any_skip_relocation, catalina: "b0b28803e7fcc5cb41fb207196fbc40790d6553d5c7834769e1ddf769e8b7e9d"
sha256 cellar: :any_skip_relocation, x86_64_linux: "3d7487e947535b4a520343029d23d4878504e8570b8f23d00b25882c15fd5d26"
end
depends_on "rust" => :build
def install
system "cargo", "install", *std_cargo_args
pkgshare.install "tests"
end
test do
cp pkgshare/"tests/rust/extern.rs", testpath
output = shell_output("#{bin}/cbindgen extern.rs")
assert_match "extern int32_t foo()", output
end
end
|
class Cfengine < Formula
desc "Help manage and understand IT infrastructure"
homepage "https://cfengine.com/"
url "https://cfengine-package-repos.s3.amazonaws.com/tarballs/cfengine-3.14.0.tar.gz"
sha256 "738d9ade96817c26123046281b6dc8d3c325a2f0f3662e9b23a8e572a4cf4267"
bottle do
rebuild 1
sha256 "4eaaf194545c426f58117c2518f7a5db49b8265cd4000abec839bd70f4a9062c" => :mojave
sha256 "a221af5677518fd309917b61878dc8ba571a3f364e872c7e0c672449d5429ba1" => :high_sierra
sha256 "9a1aa88f5a4b42ad4a5d2df2439cd3a49aa272c26746f4ae25a810291aecbdcc" => :sierra
end
depends_on "lmdb"
depends_on "openssl@1.1"
depends_on "pcre"
resource "masterfiles" do
url "https://cfengine-package-repos.s3.amazonaws.com/tarballs/cfengine-masterfiles-3.14.0.tar.gz"
sha256 "1afea1fbeb8aae24541d62b0f8ed7633540b2a5eec99561fa1318dc171ff1c7c"
end
def install
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--with-workdir=#{var}/cfengine",
"--with-lmdb=#{Formula["lmdb"].opt_prefix}",
"--with-pcre=#{Formula["pcre"].opt_prefix}",
"--without-mysql",
"--without-postgresql"
system "make", "install"
(pkgshare/"CoreBase").install resource("masterfiles")
end
test do
assert_equal "CFEngine Core #{version}", shell_output("#{bin}/cf-agent -V").chomp
end
end
cfengine: update 3.14.0 bottle.
class Cfengine < Formula
desc "Help manage and understand IT infrastructure"
homepage "https://cfengine.com/"
url "https://cfengine-package-repos.s3.amazonaws.com/tarballs/cfengine-3.14.0.tar.gz"
sha256 "738d9ade96817c26123046281b6dc8d3c325a2f0f3662e9b23a8e572a4cf4267"
bottle do
rebuild 1
sha256 "b931d7b1f10909c4d2cdb362497203213d84d26df5e5071707f341f85b4df27d" => :catalina
sha256 "4eaaf194545c426f58117c2518f7a5db49b8265cd4000abec839bd70f4a9062c" => :mojave
sha256 "a221af5677518fd309917b61878dc8ba571a3f364e872c7e0c672449d5429ba1" => :high_sierra
sha256 "9a1aa88f5a4b42ad4a5d2df2439cd3a49aa272c26746f4ae25a810291aecbdcc" => :sierra
end
depends_on "lmdb"
depends_on "openssl@1.1"
depends_on "pcre"
resource "masterfiles" do
url "https://cfengine-package-repos.s3.amazonaws.com/tarballs/cfengine-masterfiles-3.14.0.tar.gz"
sha256 "1afea1fbeb8aae24541d62b0f8ed7633540b2a5eec99561fa1318dc171ff1c7c"
end
def install
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--with-workdir=#{var}/cfengine",
"--with-lmdb=#{Formula["lmdb"].opt_prefix}",
"--with-pcre=#{Formula["pcre"].opt_prefix}",
"--without-mysql",
"--without-postgresql"
system "make", "install"
(pkgshare/"CoreBase").install resource("masterfiles")
end
test do
assert_equal "CFEngine Core #{version}", shell_output("#{bin}/cf-agent -V").chomp
end
end
|
class CfnLint < Formula
include Language::Python::Virtualenv
desc "Validate CloudFormation templates against the CloudFormation spec"
homepage "https://github.com/aws-cloudformation/cfn-python-lint/"
url "https://github.com/aws-cloudformation/cfn-python-lint/archive/v0.25.0.tar.gz"
sha256 "3c873d2289f41f43ef6f97545780f3e12fcb18a7364ea7a14c3c572218e398b1"
bottle do
cellar :any_skip_relocation
sha256 "6b7e4751eaa64673d546c195cf1e477e4f5f11c442d20295d79b5233cb587acc" => :catalina
sha256 "6ecc413586dc98df8b75ec7e18d15f05262ec86161789d6760a3957a7755fa62" => :mojave
sha256 "2c21d8f2de82981f64161f48bb42222f860c43bc5b555dbc3f898160abfbab00" => :high_sierra
end
depends_on "python"
resource "attrs" do
url "https://files.pythonhosted.org/packages/98/c3/2c227e66b5e896e15ccdae2e00bbc69aa46e9a8ce8869cc5fa96310bf612/attrs-19.3.0.tar.gz"
sha256 "f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72"
end
resource "aws-sam-translator" do
url "https://files.pythonhosted.org/packages/1c/1e/134c579a98d070cb8d5801c317fb0f21018629e7fa0b8de82a408e61d1c7/aws-sam-translator-1.15.1.tar.gz"
sha256 "11c62c00f37b57c39a55d7a29d93f4704a88549c29a6448ebc953147173fbe85"
end
resource "boto3" do
url "https://files.pythonhosted.org/packages/e7/56/9ebdcc725a5fde8968131ed5ccc0a60fe0d0e8e65333eb841112bab24339/boto3-1.10.2.tar.gz"
sha256 "818c56a317c176142dbf1dca3f5b4366c80460c6cc3c4efe22f0bde736571283"
end
resource "botocore" do
url "https://files.pythonhosted.org/packages/cc/c6/4e047c7efa1f9658f020e26ff42a55f76749f2da1aa83dd0d369676b4eb9/botocore-1.13.2.tar.gz"
sha256 "8223485841ef4731a5d4943a733295ba69d0005c4ae64c468308cc07f6960d39"
end
resource "certifi" do
url "https://files.pythonhosted.org/packages/62/85/7585750fd65599e88df0fed59c74f5075d4ea2fe611deceb95dd1c2fb25b/certifi-2019.9.11.tar.gz"
sha256 "e4f3620cfea4f83eedc95b24abd9cd56f3c4b146dd0177e83a21b4eb49e21e50"
end
resource "chardet" do
url "https://files.pythonhosted.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0d4a3cf93462473795d18e9535498c8f929d/chardet-3.0.4.tar.gz"
sha256 "84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"
end
resource "docutils" do
url "https://files.pythonhosted.org/packages/93/22/953e071b589b0b1fee420ab06a0d15e5aa0c7470eb9966d60393ce58ad61/docutils-0.15.2.tar.gz"
sha256 "a2aeea129088da402665e92e0b25b04b073c04b2dce4ab65caaa38b7ce2e1a99"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/ad/13/eb56951b6f7950cadb579ca166e448ba77f9d24efc03edd7e55fa57d04b7/idna-2.8.tar.gz"
sha256 "c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407"
end
resource "importlib-metadata" do
url "https://files.pythonhosted.org/packages/5d/44/636bcd15697791943e2dedda0dbe098d8530a38d113b202817133e0b06c0/importlib_metadata-0.23.tar.gz"
sha256 "aa18d7378b00b40847790e7c27e11673d7fed219354109d0e7b9e5b25dc3ad26"
end
resource "jmespath" do
url "https://files.pythonhosted.org/packages/2c/30/f0162d3d83e398c7a3b70c91eef61d409dea205fb4dc2b47d335f429de32/jmespath-0.9.4.tar.gz"
sha256 "bde2aef6f44302dfb30320115b17d030798de8c4110e28d5cf6cf91a7a31074c"
end
resource "jsonpatch" do
url "https://files.pythonhosted.org/packages/30/ac/9b6478a560627e4310130a9e35c31a9f4d650704bbd03946e77c73abcf6c/jsonpatch-1.24.tar.gz"
sha256 "cbb72f8bf35260628aea6b508a107245f757d1ec839a19c34349985e2c05645a"
end
resource "jsonpointer" do
url "https://files.pythonhosted.org/packages/52/e7/246d9ef2366d430f0ce7bdc494ea2df8b49d7a2a41ba51f5655f68cfe85f/jsonpointer-2.0.tar.gz"
sha256 "c192ba86648e05fdae4f08a17ec25180a9aef5008d973407b581798a83975362"
end
resource "jsonschema" do
url "https://files.pythonhosted.org/packages/43/52/0a4dabd8d42efe6bb039d61731cb20a73d5425e29be16a7a2003b923e542/jsonschema-3.1.1.tar.gz"
sha256 "2fa0684276b6333ff3c0b1b27081f4b2305f0a36cf702a23db50edb141893c3f"
end
resource "more-itertools" do
url "https://files.pythonhosted.org/packages/c2/31/45f61c8927c9550109f1c4b99ba3ca66d328d889a9c9853a808bff1c9fa0/more-itertools-7.2.0.tar.gz"
sha256 "409cd48d4db7052af495b09dec721011634af3753ae1ef92d2b32f73a745f832"
end
resource "pyrsistent" do
url "https://files.pythonhosted.org/packages/b9/66/b2638d96a2d128b168d0dba60fdc77b7800a9b4a5340cefcc5fc4eae6295/pyrsistent-0.15.4.tar.gz"
sha256 "34b47fa169d6006b32e99d4b3c4031f155e6e68ebcc107d6454852e8e0ee6533"
end
resource "python-dateutil" do
url "https://files.pythonhosted.org/packages/ad/99/5b2e99737edeb28c71bcbec5b5dda19d0d9ef3ca3e92e3e925e7c0bb364c/python-dateutil-2.8.0.tar.gz"
sha256 "c89805f6f4d64db21ed966fda138f8a5ed7a4fdbc1a8ee329ce1b74e3c74da9e"
end
resource "PyYAML" do
url "https://files.pythonhosted.org/packages/e3/e8/b3212641ee2718d556df0f23f78de8303f068fe29cdaa7a91018849582fe/PyYAML-5.1.2.tar.gz"
sha256 "01adf0b6c6f61bd11af6e10ca52b7d4057dd0be0343eb9283c878cf3af56aee4"
end
resource "requests" do
url "https://files.pythonhosted.org/packages/01/62/ddcf76d1d19885e8579acb1b1df26a852b03472c0e46d2b959a714c90608/requests-2.22.0.tar.gz"
sha256 "11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4"
end
resource "s3transfer" do
url "https://files.pythonhosted.org/packages/39/12/150cd55c606ebca6725683642a8e7068cd6af10f837ce5419a9f16b7fb55/s3transfer-0.2.1.tar.gz"
sha256 "6efc926738a3cd576c2a79725fed9afde92378aa5c6a957e3af010cb019fac9d"
end
resource "six" do
url "https://files.pythonhosted.org/packages/dd/bf/4138e7bfb757de47d1f4b6994648ec67a51efe58fa907c1e11e350cddfca/six-1.12.0.tar.gz"
sha256 "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/ff/44/29655168da441dff66de03952880c6e2d17b252836ff1aa4421fba556424/urllib3-1.25.6.tar.gz"
sha256 "9a107b99a5393caf59c7aa3c1249c16e6879447533d0887f4336dde834c7be86"
end
resource "zipp" do
url "https://files.pythonhosted.org/packages/57/dd/585d728479d97d25aeeb9aa470d36a4ad8d0ba5610f84e14770128ce6ff7/zipp-0.6.0.tar.gz"
sha256 "3718b1cbcd963c7d4c5511a8240812904164b7f381b647143a89d3b98f9bcd8e"
end
def install
virtualenv_install_with_resources
end
test do
(testpath/"test.yml").write <<~EOS
---
AWSTemplateFormatVersion: '2010-09-09'
Resources:
# Helps tests map resource types
IamPipeline:
Type: "AWS::CloudFormation::Stack"
Properties:
TemplateURL: !Sub 'https://s3.${AWS::Region}.amazonaws.com/bucket-dne-${AWS::Region}/${AWS::AccountId}/pipeline.yaml'
Parameters:
DeploymentName: iam-pipeline
Deploy: 'auto'
EOS
system bin/"cfn-lint", "test.yml"
end
end
cfn-lint: update 0.25.0 bottle.
class CfnLint < Formula
include Language::Python::Virtualenv
desc "Validate CloudFormation templates against the CloudFormation spec"
homepage "https://github.com/aws-cloudformation/cfn-python-lint/"
url "https://github.com/aws-cloudformation/cfn-python-lint/archive/v0.25.0.tar.gz"
sha256 "3c873d2289f41f43ef6f97545780f3e12fcb18a7364ea7a14c3c572218e398b1"
bottle do
cellar :any_skip_relocation
sha256 "3f66050161ca2e8c6cb2d32b3b62e9a1b0f7d8c0c38c4d1ab951eaa28fc87996" => :catalina
sha256 "ff1530587c210d8e6cb89f4f1871a5583e04a2483d7d6ff71b8ecb322e7f8011" => :mojave
sha256 "4b68f990ddc51c201874a4b38d897e146b223f07c36b14e40b434dfee07d9d04" => :high_sierra
end
depends_on "python"
resource "attrs" do
url "https://files.pythonhosted.org/packages/98/c3/2c227e66b5e896e15ccdae2e00bbc69aa46e9a8ce8869cc5fa96310bf612/attrs-19.3.0.tar.gz"
sha256 "f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72"
end
resource "aws-sam-translator" do
url "https://files.pythonhosted.org/packages/1c/1e/134c579a98d070cb8d5801c317fb0f21018629e7fa0b8de82a408e61d1c7/aws-sam-translator-1.15.1.tar.gz"
sha256 "11c62c00f37b57c39a55d7a29d93f4704a88549c29a6448ebc953147173fbe85"
end
resource "boto3" do
url "https://files.pythonhosted.org/packages/e7/56/9ebdcc725a5fde8968131ed5ccc0a60fe0d0e8e65333eb841112bab24339/boto3-1.10.2.tar.gz"
sha256 "818c56a317c176142dbf1dca3f5b4366c80460c6cc3c4efe22f0bde736571283"
end
resource "botocore" do
url "https://files.pythonhosted.org/packages/cc/c6/4e047c7efa1f9658f020e26ff42a55f76749f2da1aa83dd0d369676b4eb9/botocore-1.13.2.tar.gz"
sha256 "8223485841ef4731a5d4943a733295ba69d0005c4ae64c468308cc07f6960d39"
end
resource "certifi" do
url "https://files.pythonhosted.org/packages/62/85/7585750fd65599e88df0fed59c74f5075d4ea2fe611deceb95dd1c2fb25b/certifi-2019.9.11.tar.gz"
sha256 "e4f3620cfea4f83eedc95b24abd9cd56f3c4b146dd0177e83a21b4eb49e21e50"
end
resource "chardet" do
url "https://files.pythonhosted.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0d4a3cf93462473795d18e9535498c8f929d/chardet-3.0.4.tar.gz"
sha256 "84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"
end
resource "docutils" do
url "https://files.pythonhosted.org/packages/93/22/953e071b589b0b1fee420ab06a0d15e5aa0c7470eb9966d60393ce58ad61/docutils-0.15.2.tar.gz"
sha256 "a2aeea129088da402665e92e0b25b04b073c04b2dce4ab65caaa38b7ce2e1a99"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/ad/13/eb56951b6f7950cadb579ca166e448ba77f9d24efc03edd7e55fa57d04b7/idna-2.8.tar.gz"
sha256 "c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407"
end
resource "importlib-metadata" do
url "https://files.pythonhosted.org/packages/5d/44/636bcd15697791943e2dedda0dbe098d8530a38d113b202817133e0b06c0/importlib_metadata-0.23.tar.gz"
sha256 "aa18d7378b00b40847790e7c27e11673d7fed219354109d0e7b9e5b25dc3ad26"
end
resource "jmespath" do
url "https://files.pythonhosted.org/packages/2c/30/f0162d3d83e398c7a3b70c91eef61d409dea205fb4dc2b47d335f429de32/jmespath-0.9.4.tar.gz"
sha256 "bde2aef6f44302dfb30320115b17d030798de8c4110e28d5cf6cf91a7a31074c"
end
resource "jsonpatch" do
url "https://files.pythonhosted.org/packages/30/ac/9b6478a560627e4310130a9e35c31a9f4d650704bbd03946e77c73abcf6c/jsonpatch-1.24.tar.gz"
sha256 "cbb72f8bf35260628aea6b508a107245f757d1ec839a19c34349985e2c05645a"
end
resource "jsonpointer" do
url "https://files.pythonhosted.org/packages/52/e7/246d9ef2366d430f0ce7bdc494ea2df8b49d7a2a41ba51f5655f68cfe85f/jsonpointer-2.0.tar.gz"
sha256 "c192ba86648e05fdae4f08a17ec25180a9aef5008d973407b581798a83975362"
end
resource "jsonschema" do
url "https://files.pythonhosted.org/packages/43/52/0a4dabd8d42efe6bb039d61731cb20a73d5425e29be16a7a2003b923e542/jsonschema-3.1.1.tar.gz"
sha256 "2fa0684276b6333ff3c0b1b27081f4b2305f0a36cf702a23db50edb141893c3f"
end
resource "more-itertools" do
url "https://files.pythonhosted.org/packages/c2/31/45f61c8927c9550109f1c4b99ba3ca66d328d889a9c9853a808bff1c9fa0/more-itertools-7.2.0.tar.gz"
sha256 "409cd48d4db7052af495b09dec721011634af3753ae1ef92d2b32f73a745f832"
end
resource "pyrsistent" do
url "https://files.pythonhosted.org/packages/b9/66/b2638d96a2d128b168d0dba60fdc77b7800a9b4a5340cefcc5fc4eae6295/pyrsistent-0.15.4.tar.gz"
sha256 "34b47fa169d6006b32e99d4b3c4031f155e6e68ebcc107d6454852e8e0ee6533"
end
resource "python-dateutil" do
url "https://files.pythonhosted.org/packages/ad/99/5b2e99737edeb28c71bcbec5b5dda19d0d9ef3ca3e92e3e925e7c0bb364c/python-dateutil-2.8.0.tar.gz"
sha256 "c89805f6f4d64db21ed966fda138f8a5ed7a4fdbc1a8ee329ce1b74e3c74da9e"
end
resource "PyYAML" do
url "https://files.pythonhosted.org/packages/e3/e8/b3212641ee2718d556df0f23f78de8303f068fe29cdaa7a91018849582fe/PyYAML-5.1.2.tar.gz"
sha256 "01adf0b6c6f61bd11af6e10ca52b7d4057dd0be0343eb9283c878cf3af56aee4"
end
resource "requests" do
url "https://files.pythonhosted.org/packages/01/62/ddcf76d1d19885e8579acb1b1df26a852b03472c0e46d2b959a714c90608/requests-2.22.0.tar.gz"
sha256 "11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4"
end
resource "s3transfer" do
url "https://files.pythonhosted.org/packages/39/12/150cd55c606ebca6725683642a8e7068cd6af10f837ce5419a9f16b7fb55/s3transfer-0.2.1.tar.gz"
sha256 "6efc926738a3cd576c2a79725fed9afde92378aa5c6a957e3af010cb019fac9d"
end
resource "six" do
url "https://files.pythonhosted.org/packages/dd/bf/4138e7bfb757de47d1f4b6994648ec67a51efe58fa907c1e11e350cddfca/six-1.12.0.tar.gz"
sha256 "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/ff/44/29655168da441dff66de03952880c6e2d17b252836ff1aa4421fba556424/urllib3-1.25.6.tar.gz"
sha256 "9a107b99a5393caf59c7aa3c1249c16e6879447533d0887f4336dde834c7be86"
end
resource "zipp" do
url "https://files.pythonhosted.org/packages/57/dd/585d728479d97d25aeeb9aa470d36a4ad8d0ba5610f84e14770128ce6ff7/zipp-0.6.0.tar.gz"
sha256 "3718b1cbcd963c7d4c5511a8240812904164b7f381b647143a89d3b98f9bcd8e"
end
def install
virtualenv_install_with_resources
end
test do
(testpath/"test.yml").write <<~EOS
---
AWSTemplateFormatVersion: '2010-09-09'
Resources:
# Helps tests map resource types
IamPipeline:
Type: "AWS::CloudFormation::Stack"
Properties:
TemplateURL: !Sub 'https://s3.${AWS::Region}.amazonaws.com/bucket-dne-${AWS::Region}/${AWS::AccountId}/pipeline.yaml'
Parameters:
DeploymentName: iam-pipeline
Deploy: 'auto'
EOS
system bin/"cfn-lint", "test.yml"
end
end
|
class CfnLint < Formula
include Language::Python::Virtualenv
desc "Validate CloudFormation templates against the CloudFormation spec"
homepage "https://github.com/aws-cloudformation/cfn-lint/"
url "https://files.pythonhosted.org/packages/89/1d/58aad5d3f86b6974bf5acbc8ff9b2240cd18722d06ae871c42a382522898/cfn-lint-0.62.0.tar.gz"
sha256 "68c66bf65ca984acd8fa6df2879ec447227b85aa8f28526fde4aabcf171a2dca"
license "MIT-0"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "60d136d97305a1109d669e6c1312026c8ff79809b03ee91060449c5637199660"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "e64c7bde6bc7dfedb3767ac640d29b022afe0f684dc0ceae9e0f400ecdf6a2b1"
sha256 cellar: :any_skip_relocation, monterey: "05ee7d4b7c954d3f0e55971ae73bb13a3fbcf49584c05af85dbadf96a378ed77"
sha256 cellar: :any_skip_relocation, big_sur: "b8f1fdaec2f056c3167c8c4df92c5a8b7c62cbe576acb574c8eab2758f117c1c"
sha256 cellar: :any_skip_relocation, catalina: "8bbce457849bb67bca674463e4caf4ae480f9549cd2aa5dd82396f582bee0cdb"
sha256 cellar: :any_skip_relocation, x86_64_linux: "9b43ba115272f26eb0b0455c51e32d853be40e6782fa5e172f279d64aaf33be0"
end
depends_on "python@3.10"
depends_on "six"
resource "attrs" do
url "https://files.pythonhosted.org/packages/1a/cb/c4ffeb41e7137b23755a45e1bfec9cbb76ecf51874c6f1d113984ecaa32c/attrs-22.1.0.tar.gz"
sha256 "29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6"
end
resource "aws-sam-translator" do
url "https://files.pythonhosted.org/packages/7b/c1/e7933aefe6c8ff8d2320fafc2f7160a6306e540c2c6372797a1f7f8f66d3/aws-sam-translator-1.50.0.tar.gz"
sha256 "85bea2739e1b4a61b3e4add8a12f727d7a8e459e3da195dfd0cd2e756be054ec"
end
resource "boto3" do
url "https://files.pythonhosted.org/packages/17/20/d250132debb366e63baf9764580e916358c8078c936023718effe638261e/boto3-1.24.55.tar.gz"
sha256 "9fe6c7c5019671cbea82f02dbaae7e743ec86187443ab5f333ebb3d3bef63dce"
end
resource "botocore" do
url "https://files.pythonhosted.org/packages/43/30/ea38f480f0d823426112033f2b37ef2d83cff728fbc5861a1829bb09b889/botocore-1.27.55.tar.gz"
sha256 "929d6be4bdb33a693e6c8e06383dba76fa628bb72fdb1f9353fd13f5d115dd19"
end
resource "jmespath" do
url "https://files.pythonhosted.org/packages/00/2a/e867e8531cf3e36b41201936b7fa7ba7b5702dbef42922193f05c8976cd6/jmespath-1.0.1.tar.gz"
sha256 "90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe"
end
resource "jschema-to-python" do
url "https://files.pythonhosted.org/packages/1d/7f/5ae3d97ddd86ec33323231d68453afd504041efcfd4f4dde993196606849/jschema_to_python-1.2.3.tar.gz"
sha256 "76ff14fe5d304708ccad1284e4b11f96a658949a31ee7faed9e0995279549b91"
end
resource "jsonpatch" do
url "https://files.pythonhosted.org/packages/21/67/83452af2a6db7c4596d1e2ecaa841b9a900980103013b867f2865e5e1cf0/jsonpatch-1.32.tar.gz"
sha256 "b6ddfe6c3db30d81a96aaeceb6baf916094ffa23d7dd5fa2c13e13f8b6e600c2"
end
resource "jsonpickle" do
url "https://files.pythonhosted.org/packages/65/09/50bc3aabaeba15b319737560b41f3b6acddf6f10011b9869c796683886aa/jsonpickle-2.2.0.tar.gz"
sha256 "7b272918b0554182e53dc340ddd62d9b7f902fec7e7b05620c04f3ccef479a0e"
end
resource "jsonpointer" do
url "https://files.pythonhosted.org/packages/a0/6c/c52556b957a0f904e7c45585444feef206fe5cb1ff656303a1d6d922a53b/jsonpointer-2.3.tar.gz"
sha256 "97cba51526c829282218feb99dab1b1e6bdf8efd1c43dc9d57be093c0d69c99a"
end
resource "jsonschema" do
url "https://files.pythonhosted.org/packages/69/11/a69e2a3c01b324a77d3a7c0570faa372e8448b666300c4117a516f8b1212/jsonschema-3.2.0.tar.gz"
sha256 "c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a"
end
# only doing this because junit-xml source is not available in PyPI for v1.9
resource "junit-xml" do
url "https://github.com/kyrus/python-junit-xml.git",
revision: "4bd08a272f059998cedf9b7779f944d49eba13a6"
end
resource "networkx" do
url "https://files.pythonhosted.org/packages/f2/af/fe794d69bcc4882c4905b49c8b207b8dc4dd7ea26e6142781eac8203ea05/networkx-2.8.5.tar.gz"
sha256 "15a7b81a360791c458c55a417418ea136c13378cfdc06a2dcdc12bd2f9cf09c1"
end
resource "pbr" do
url "https://files.pythonhosted.org/packages/b4/40/4c5d3681b141a10c24c890c28345fac915dd67f34b8c910df7b81ac5c7b3/pbr-5.10.0.tar.gz"
sha256 "cfcc4ff8e698256fc17ea3ff796478b050852585aa5bae79ecd05b2ab7b39b9a"
end
resource "pyrsistent" do
url "https://files.pythonhosted.org/packages/42/ac/455fdc7294acc4d4154b904e80d964cc9aae75b087bbf486be04df9f2abd/pyrsistent-0.18.1.tar.gz"
sha256 "d4d61f8b993a7255ba714df3aca52700f8125289f84f704cf80916517c46eb96"
end
resource "python-dateutil" do
url "https://files.pythonhosted.org/packages/4c/c4/13b4776ea2d76c115c1d1b84579f3764ee6d57204f6be27119f13a61d0a9/python-dateutil-2.8.2.tar.gz"
sha256 "0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"
end
resource "PyYAML" do
url "https://files.pythonhosted.org/packages/36/2b/61d51a2c4f25ef062ae3f74576b01638bebad5e045f747ff12643df63844/PyYAML-6.0.tar.gz"
sha256 "68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2"
end
resource "s3transfer" do
url "https://files.pythonhosted.org/packages/e1/eb/e57c93d5cd5edf8c1d124c831ef916601540db70acd96fa21fe60cef1365/s3transfer-0.6.0.tar.gz"
sha256 "2ed07d3866f523cc561bf4a00fc5535827981b117dd7876f036b0c1aca42c947"
end
resource "sarif-om" do
url "https://files.pythonhosted.org/packages/ba/de/bbdd93fe456d4011500784657c5e4a31e3f4fcbb276255d4db1213aed78c/sarif_om-1.0.4.tar.gz"
sha256 "cd5f416b3083e00d402a92e449a7ff67af46f11241073eea0461802a3b5aef98"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/6d/d5/e8258b334c9eb8eb78e31be92ea0d5da83ddd9385dc967dd92737604d239/urllib3-1.26.11.tar.gz"
sha256 "ea6e8fb210b19d950fab93b60c9009226c63a28808bc8386e05301e25883ac0a"
end
def install
virtualenv_install_with_resources
end
test do
(testpath/"test.yml").write <<~EOS
---
AWSTemplateFormatVersion: '2010-09-09'
Resources:
# Helps tests map resource types
IamPipeline:
Type: "AWS::CloudFormation::Stack"
Properties:
TemplateURL: !Sub 'https://s3.${AWS::Region}.amazonaws.com/bucket-dne-${AWS::Region}/${AWS::AccountId}/pipeline.yaml'
Parameters:
DeploymentName: iam-pipeline
Deploy: 'auto'
EOS
system bin/"cfn-lint", "test.yml"
end
end
cfn-lint: update 0.62.0 bottle.
class CfnLint < Formula
include Language::Python::Virtualenv
desc "Validate CloudFormation templates against the CloudFormation spec"
homepage "https://github.com/aws-cloudformation/cfn-lint/"
url "https://files.pythonhosted.org/packages/89/1d/58aad5d3f86b6974bf5acbc8ff9b2240cd18722d06ae871c42a382522898/cfn-lint-0.62.0.tar.gz"
sha256 "68c66bf65ca984acd8fa6df2879ec447227b85aa8f28526fde4aabcf171a2dca"
license "MIT-0"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "7b47e8da2a3b3ba876da328a4e1ca0b038561368b6ecbc4768945d17a1251a10"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "ed24cff7427345a0931e3919b37603bab8c4a596a62ad7868350ee650714b3e4"
sha256 cellar: :any_skip_relocation, monterey: "f5c471380775db69339f5fab8c3105d6cbfc75fb72ce4bc8181300a5323d4fd9"
sha256 cellar: :any_skip_relocation, big_sur: "45e5ec3b34732ec3ade680df11361ea3732fbfceac8c75b471f906800b61d0b5"
sha256 cellar: :any_skip_relocation, catalina: "bd0b22827863b0758c98a81868666d7570f84a53fe22b9bf12b39c01a7c5a1ad"
sha256 cellar: :any_skip_relocation, x86_64_linux: "9633229b888140646d7536fb0aa6a697adb0306d94fe8418cafafc40b1ad3b12"
end
depends_on "python@3.10"
depends_on "six"
resource "attrs" do
url "https://files.pythonhosted.org/packages/1a/cb/c4ffeb41e7137b23755a45e1bfec9cbb76ecf51874c6f1d113984ecaa32c/attrs-22.1.0.tar.gz"
sha256 "29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6"
end
resource "aws-sam-translator" do
url "https://files.pythonhosted.org/packages/7b/c1/e7933aefe6c8ff8d2320fafc2f7160a6306e540c2c6372797a1f7f8f66d3/aws-sam-translator-1.50.0.tar.gz"
sha256 "85bea2739e1b4a61b3e4add8a12f727d7a8e459e3da195dfd0cd2e756be054ec"
end
resource "boto3" do
url "https://files.pythonhosted.org/packages/17/20/d250132debb366e63baf9764580e916358c8078c936023718effe638261e/boto3-1.24.55.tar.gz"
sha256 "9fe6c7c5019671cbea82f02dbaae7e743ec86187443ab5f333ebb3d3bef63dce"
end
resource "botocore" do
url "https://files.pythonhosted.org/packages/43/30/ea38f480f0d823426112033f2b37ef2d83cff728fbc5861a1829bb09b889/botocore-1.27.55.tar.gz"
sha256 "929d6be4bdb33a693e6c8e06383dba76fa628bb72fdb1f9353fd13f5d115dd19"
end
resource "jmespath" do
url "https://files.pythonhosted.org/packages/00/2a/e867e8531cf3e36b41201936b7fa7ba7b5702dbef42922193f05c8976cd6/jmespath-1.0.1.tar.gz"
sha256 "90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe"
end
resource "jschema-to-python" do
url "https://files.pythonhosted.org/packages/1d/7f/5ae3d97ddd86ec33323231d68453afd504041efcfd4f4dde993196606849/jschema_to_python-1.2.3.tar.gz"
sha256 "76ff14fe5d304708ccad1284e4b11f96a658949a31ee7faed9e0995279549b91"
end
resource "jsonpatch" do
url "https://files.pythonhosted.org/packages/21/67/83452af2a6db7c4596d1e2ecaa841b9a900980103013b867f2865e5e1cf0/jsonpatch-1.32.tar.gz"
sha256 "b6ddfe6c3db30d81a96aaeceb6baf916094ffa23d7dd5fa2c13e13f8b6e600c2"
end
resource "jsonpickle" do
url "https://files.pythonhosted.org/packages/65/09/50bc3aabaeba15b319737560b41f3b6acddf6f10011b9869c796683886aa/jsonpickle-2.2.0.tar.gz"
sha256 "7b272918b0554182e53dc340ddd62d9b7f902fec7e7b05620c04f3ccef479a0e"
end
resource "jsonpointer" do
url "https://files.pythonhosted.org/packages/a0/6c/c52556b957a0f904e7c45585444feef206fe5cb1ff656303a1d6d922a53b/jsonpointer-2.3.tar.gz"
sha256 "97cba51526c829282218feb99dab1b1e6bdf8efd1c43dc9d57be093c0d69c99a"
end
resource "jsonschema" do
url "https://files.pythonhosted.org/packages/69/11/a69e2a3c01b324a77d3a7c0570faa372e8448b666300c4117a516f8b1212/jsonschema-3.2.0.tar.gz"
sha256 "c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a"
end
# only doing this because junit-xml source is not available in PyPI for v1.9
resource "junit-xml" do
url "https://github.com/kyrus/python-junit-xml.git",
revision: "4bd08a272f059998cedf9b7779f944d49eba13a6"
end
resource "networkx" do
url "https://files.pythonhosted.org/packages/f2/af/fe794d69bcc4882c4905b49c8b207b8dc4dd7ea26e6142781eac8203ea05/networkx-2.8.5.tar.gz"
sha256 "15a7b81a360791c458c55a417418ea136c13378cfdc06a2dcdc12bd2f9cf09c1"
end
resource "pbr" do
url "https://files.pythonhosted.org/packages/b4/40/4c5d3681b141a10c24c890c28345fac915dd67f34b8c910df7b81ac5c7b3/pbr-5.10.0.tar.gz"
sha256 "cfcc4ff8e698256fc17ea3ff796478b050852585aa5bae79ecd05b2ab7b39b9a"
end
resource "pyrsistent" do
url "https://files.pythonhosted.org/packages/42/ac/455fdc7294acc4d4154b904e80d964cc9aae75b087bbf486be04df9f2abd/pyrsistent-0.18.1.tar.gz"
sha256 "d4d61f8b993a7255ba714df3aca52700f8125289f84f704cf80916517c46eb96"
end
resource "python-dateutil" do
url "https://files.pythonhosted.org/packages/4c/c4/13b4776ea2d76c115c1d1b84579f3764ee6d57204f6be27119f13a61d0a9/python-dateutil-2.8.2.tar.gz"
sha256 "0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"
end
resource "PyYAML" do
url "https://files.pythonhosted.org/packages/36/2b/61d51a2c4f25ef062ae3f74576b01638bebad5e045f747ff12643df63844/PyYAML-6.0.tar.gz"
sha256 "68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2"
end
resource "s3transfer" do
url "https://files.pythonhosted.org/packages/e1/eb/e57c93d5cd5edf8c1d124c831ef916601540db70acd96fa21fe60cef1365/s3transfer-0.6.0.tar.gz"
sha256 "2ed07d3866f523cc561bf4a00fc5535827981b117dd7876f036b0c1aca42c947"
end
resource "sarif-om" do
url "https://files.pythonhosted.org/packages/ba/de/bbdd93fe456d4011500784657c5e4a31e3f4fcbb276255d4db1213aed78c/sarif_om-1.0.4.tar.gz"
sha256 "cd5f416b3083e00d402a92e449a7ff67af46f11241073eea0461802a3b5aef98"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/6d/d5/e8258b334c9eb8eb78e31be92ea0d5da83ddd9385dc967dd92737604d239/urllib3-1.26.11.tar.gz"
sha256 "ea6e8fb210b19d950fab93b60c9009226c63a28808bc8386e05301e25883ac0a"
end
def install
virtualenv_install_with_resources
end
test do
(testpath/"test.yml").write <<~EOS
---
AWSTemplateFormatVersion: '2010-09-09'
Resources:
# Helps tests map resource types
IamPipeline:
Type: "AWS::CloudFormation::Stack"
Properties:
TemplateURL: !Sub 'https://s3.${AWS::Region}.amazonaws.com/bucket-dne-${AWS::Region}/${AWS::AccountId}/pipeline.yaml'
Parameters:
DeploymentName: iam-pipeline
Deploy: 'auto'
EOS
system bin/"cfn-lint", "test.yml"
end
end
|
class Circleci < Formula
desc "Enables you to reproduce the CircleCI environment locally"
homepage "https://circleci.com/docs/2.0/local-cli/"
# Updates should be pushed no more frequently than once per week.
url "https://github.com/CircleCI-Public/circleci-cli.git",
tag: "v0.1.15410",
revision: "ba6fe81ece6b6d70ce4788dea3de1d8981234319"
license "MIT"
revision 1
head "https://github.com/CircleCI-Public/circleci-cli.git"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "3004e164839cc0215ed249a58f51f39250430153af7d9840677679cad3d66ade"
sha256 cellar: :any_skip_relocation, big_sur: "ec696c44c1fa9a3c351f63da60b524b4801f5a8b91e8a89cec36abb6eeb49ce6"
sha256 cellar: :any_skip_relocation, catalina: "6d0fc192edf2af07b559caad0188084da339629b9f5fb7d469d759be99f1d0ba"
sha256 cellar: :any_skip_relocation, mojave: "783766866d1f618591b5926979f546406349bbf66f6bc0c8a4f4a2a35c0ea7ca"
sha256 cellar: :any_skip_relocation, x86_64_linux: "44568a5576b1f343bae42e308be46fd258b9a37c12401782849c2b88d24761c4"
end
depends_on "go" => :build
depends_on "packr" => :build
def install
system "packr2", "--ignore-imports", "-v"
ldflags = %W[
-s -w
-X github.com/CircleCI-Public/circleci-cli/version.packageManager=homebrew
-X github.com/CircleCI-Public/circleci-cli/version.Version=#{version}
-X github.com/CircleCI-Public/circleci-cli/version.Commit=#{Utils.git_short_head}
]
system "go", "build", *std_go_args(ldflags: ldflags.join(" "))
output = Utils.safe_popen_read("#{bin}/circleci", "--skip-update-check", "completion", "bash")
(bash_completion/"circleck").write output
output = Utils.safe_popen_read("#{bin}/circleci", "--skip-update-check", "completion", "zsh")
(zsh_completion/"_circleci").write output
end
test do
# assert basic script execution
assert_match(/#{version}\+.{7}/, shell_output("#{bin}/circleci version").strip)
(testpath/".circleci.yml").write("{version: 2.1}")
output = shell_output("#{bin}/circleci config pack #{testpath}/.circleci.yml")
assert_match "version: 2.1", output
# assert update is not included in output of help meaning it was not included in the build
assert_match "update This command is unavailable on your platform", shell_output("#{bin}/circleci help")
assert_match "`update` is not available because this tool was installed using `homebrew`.",
shell_output("#{bin}/circleci update")
end
end
circleci: update 0.1.15410_1 bottle.
class Circleci < Formula
desc "Enables you to reproduce the CircleCI environment locally"
homepage "https://circleci.com/docs/2.0/local-cli/"
# Updates should be pushed no more frequently than once per week.
url "https://github.com/CircleCI-Public/circleci-cli.git",
tag: "v0.1.15410",
revision: "ba6fe81ece6b6d70ce4788dea3de1d8981234319"
license "MIT"
revision 1
head "https://github.com/CircleCI-Public/circleci-cli.git"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "ab1e40ded91bddd85f384b0b1ed4a5cfe7ffac11db7b59ed6bdef35fbf088a60"
sha256 cellar: :any_skip_relocation, big_sur: "5c10f56f5c4788b8be57d51baf6aa35a403f3eb7b113f7ce91c97932022177f2"
sha256 cellar: :any_skip_relocation, catalina: "9f47b5b29f78d907e36db217d2895cd8e462b34142bd96fba61c41cf32802cca"
sha256 cellar: :any_skip_relocation, mojave: "929156fb9f0f1b8344c2eb8c080b6834ecf36d6aea7737db39636a5d063b3128"
sha256 cellar: :any_skip_relocation, x86_64_linux: "b3df73ef5191e7df0a8380c343abe9a46624bcc44e8ca33bb883a3ee4c414193"
end
depends_on "go" => :build
depends_on "packr" => :build
def install
system "packr2", "--ignore-imports", "-v"
ldflags = %W[
-s -w
-X github.com/CircleCI-Public/circleci-cli/version.packageManager=homebrew
-X github.com/CircleCI-Public/circleci-cli/version.Version=#{version}
-X github.com/CircleCI-Public/circleci-cli/version.Commit=#{Utils.git_short_head}
]
system "go", "build", *std_go_args(ldflags: ldflags.join(" "))
output = Utils.safe_popen_read("#{bin}/circleci", "--skip-update-check", "completion", "bash")
(bash_completion/"circleck").write output
output = Utils.safe_popen_read("#{bin}/circleci", "--skip-update-check", "completion", "zsh")
(zsh_completion/"_circleci").write output
end
test do
# assert basic script execution
assert_match(/#{version}\+.{7}/, shell_output("#{bin}/circleci version").strip)
(testpath/".circleci.yml").write("{version: 2.1}")
output = shell_output("#{bin}/circleci config pack #{testpath}/.circleci.yml")
assert_match "version: 2.1", output
# assert update is not included in output of help meaning it was not included in the build
assert_match "update This command is unavailable on your platform", shell_output("#{bin}/circleci help")
assert_match "`update` is not available because this tool was installed using `homebrew`.",
shell_output("#{bin}/circleci update")
end
end
|
class Cmuclmtk < Formula
desc "Language model tools (from CMU Sphinx)"
homepage "https://cmusphinx.sourceforge.io/"
url "https://downloads.sourceforge.net/project/cmusphinx/cmuclmtk/0.7/cmuclmtk-0.7.tar.gz"
sha256 "d23e47f00224667c059d69ac942f15dc3d4c3dd40e827318a6213699b7fa2915"
bottle do
cellar :any
sha256 "5c71a1746a8ca516dc5d11858a7d0d85341cafeea31797b926eba3a9ed83d9ea" => :mojave
sha256 "85a6d2a8fcad4e2b6e7d9d22ec74dd5e5f463dabc5b2f01373d3a48178b2ce6e" => :high_sierra
sha256 "716c78af6b276392a20fb02d58ff60e705509117da932d62d3ff8c6e4dd0bf5d" => :sierra
sha256 "c647327d709c3b4a93d5541f8b340d2726540c9efdcbc53d1124043c8c4989bd" => :el_capitan
sha256 "320a3590af1e9a1bee6827eb71e4d91fb283952f178b7f0393406a120046d4ee" => :yosemite
sha256 "37703a65f22b994f724e54ebcf19ab8204b6d7a27e17d176af13440f611642a3" => :mavericks
end
depends_on "pkg-config" => :build
def install
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make", "install"
end
end
cmuclmtk: update 0.7 bottle.
class Cmuclmtk < Formula
desc "Language model tools (from CMU Sphinx)"
homepage "https://cmusphinx.sourceforge.io/"
url "https://downloads.sourceforge.net/project/cmusphinx/cmuclmtk/0.7/cmuclmtk-0.7.tar.gz"
sha256 "d23e47f00224667c059d69ac942f15dc3d4c3dd40e827318a6213699b7fa2915"
bottle do
cellar :any
sha256 "fb552e12a3c59e2ca6a9dd89e9ec229e5b815edef28093c3902fc4ee54b52207" => :catalina
sha256 "5c71a1746a8ca516dc5d11858a7d0d85341cafeea31797b926eba3a9ed83d9ea" => :mojave
sha256 "85a6d2a8fcad4e2b6e7d9d22ec74dd5e5f463dabc5b2f01373d3a48178b2ce6e" => :high_sierra
sha256 "716c78af6b276392a20fb02d58ff60e705509117da932d62d3ff8c6e4dd0bf5d" => :sierra
sha256 "c647327d709c3b4a93d5541f8b340d2726540c9efdcbc53d1124043c8c4989bd" => :el_capitan
sha256 "320a3590af1e9a1bee6827eb71e4d91fb283952f178b7f0393406a120046d4ee" => :yosemite
sha256 "37703a65f22b994f724e54ebcf19ab8204b6d7a27e17d176af13440f611642a3" => :mavericks
end
depends_on "pkg-config" => :build
def install
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make", "install"
end
end
|
class Collectd < Formula
desc "Statistics collection and monitoring daemon"
homepage "https://collectd.org/"
url "https://collectd.org/files/collectd-5.10.0.tar.bz2"
sha256 "a03359f563023e744c2dc743008a00a848f4cd506e072621d86b6d8313c0375b"
bottle do
sha256 "e4e99e92982ca679cfdb4c01db692f0961ec1fb1f7cccc0101943df30184cf14" => :catalina
sha256 "da20e601f3f5249a92d3ac31ae9a7024c37fb55c4b7281ad36b1b86414b320d2" => :mojave
sha256 "48947ba55bbfb0ef454c00098b60e3410edeae569a44752e409462792d5fd927" => :high_sierra
end
head do
url "https://github.com/collectd/collectd.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
end
depends_on "pkg-config" => :build
depends_on "libgcrypt"
depends_on "libtool"
depends_on "net-snmp"
depends_on "riemann-client"
uses_from_macos "bison"
uses_from_macos "flex"
uses_from_macos "perl"
def install
args = %W[
--disable-debug
--disable-dependency-tracking
--prefix=#{prefix}
--localstatedir=#{var}
--disable-java
--enable-write_riemann
]
system "./build.sh" if build.head?
system "./configure", *args
system "make", "install"
end
plist_options :manual => "#{HOMEBREW_PREFIX}/sbin/collectd -f -C #{HOMEBREW_PREFIX}/etc/collectd.conf"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{sbin}/collectd</string>
<string>-f</string>
<string>-C</string>
<string>#{etc}/collectd.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>#{var}/log/collectd.log</string>
<key>StandardOutPath</key>
<string>#{var}/log/collectd.log</string>
</dict>
</plist>
EOS
end
test do
log = testpath/"collectd.log"
(testpath/"collectd.conf").write <<~EOS
LoadPlugin logfile
<Plugin logfile>
File "#{log}"
</Plugin>
LoadPlugin memory
EOS
begin
pid = fork { exec sbin/"collectd", "-f", "-C", "collectd.conf" }
sleep 1
assert_predicate log, :exist?, "Failed to create log file"
assert_match "plugin \"memory\" successfully loaded.", log.read
ensure
Process.kill("SIGINT", pid)
Process.wait(pid)
end
end
end
collectd 5.11.0
Closes #51995.
Signed-off-by: Rui Chen <5fd29470147430022ff146db88de16ee91dea376@gmail.com>
class Collectd < Formula
desc "Statistics collection and monitoring daemon"
homepage "https://collectd.org/"
url "https://collectd.org/files/collectd-5.11.0.tar.bz2"
sha256 "37b10a806e34aa8570c1cafa6006c604796fae13cc2e1b3e630d33dcba9e5db2"
bottle do
sha256 "e4e99e92982ca679cfdb4c01db692f0961ec1fb1f7cccc0101943df30184cf14" => :catalina
sha256 "da20e601f3f5249a92d3ac31ae9a7024c37fb55c4b7281ad36b1b86414b320d2" => :mojave
sha256 "48947ba55bbfb0ef454c00098b60e3410edeae569a44752e409462792d5fd927" => :high_sierra
end
head do
url "https://github.com/collectd/collectd.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
end
depends_on "pkg-config" => :build
depends_on "libgcrypt"
depends_on "libtool"
depends_on "net-snmp"
depends_on "riemann-client"
uses_from_macos "bison"
uses_from_macos "flex"
uses_from_macos "perl"
def install
args = %W[
--disable-debug
--disable-dependency-tracking
--prefix=#{prefix}
--localstatedir=#{var}
--disable-java
--enable-write_riemann
]
system "./build.sh" if build.head?
system "./configure", *args
system "make", "install"
end
plist_options :manual => "#{HOMEBREW_PREFIX}/sbin/collectd -f -C #{HOMEBREW_PREFIX}/etc/collectd.conf"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{sbin}/collectd</string>
<string>-f</string>
<string>-C</string>
<string>#{etc}/collectd.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>#{var}/log/collectd.log</string>
<key>StandardOutPath</key>
<string>#{var}/log/collectd.log</string>
</dict>
</plist>
EOS
end
test do
log = testpath/"collectd.log"
(testpath/"collectd.conf").write <<~EOS
LoadPlugin logfile
<Plugin logfile>
File "#{log}"
</Plugin>
LoadPlugin memory
EOS
begin
pid = fork { exec sbin/"collectd", "-f", "-C", "collectd.conf" }
sleep 1
assert_predicate log, :exist?, "Failed to create log file"
assert_match "plugin \"memory\" successfully loaded.", log.read
ensure
Process.kill("SIGINT", pid)
Process.wait(pid)
end
end
end
|
class Conftest < Formula
desc "Test your configuration files using Open Policy Agent"
homepage "https://www.conftest.dev/"
url "https://github.com/open-policy-agent/conftest/archive/v0.23.0.tar.gz"
sha256 "116bfd3c00fcaa31a3468cace6df5b03eeff0150d0d096aee53dd74c7c9647bd"
license "Apache-2.0"
head "https://github.com/open-policy-agent/conftest.git"
depends_on "go" => :build
def install
system "go", "build", *std_go_args(ldflags: "-X github.com/open-policy-agent/conftest/internal/commands.version=#{version}")
end
test do
assert_match "Test your configuration files using Open Policy Agent", shell_output("#{bin}/conftest --help")
# Using the policy parameter changes the default location to look for policies.
# If no policies are found, a non-zero status code is returned.
(testpath/"test.rego").write("package main")
system "#{bin}/conftest", "verify", "-p", "test.rego"
end
end
conftest: add 0.23.0 bottle.
class Conftest < Formula
desc "Test your configuration files using Open Policy Agent"
homepage "https://www.conftest.dev/"
url "https://github.com/open-policy-agent/conftest/archive/v0.23.0.tar.gz"
sha256 "116bfd3c00fcaa31a3468cace6df5b03eeff0150d0d096aee53dd74c7c9647bd"
license "Apache-2.0"
head "https://github.com/open-policy-agent/conftest.git"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "13b15a48a40b4e2abc93bcc71bee8f544c15c5f76ee7cdfef90dd9da771aa3c0"
sha256 cellar: :any_skip_relocation, big_sur: "259a6e4fffe0e3af142d1a98a6090b206828e8cef5fb0b809d05a4129ffb1516"
sha256 cellar: :any_skip_relocation, catalina: "e7a72ec05406e510ed89b963ac0f5072b744fb5bec2d6d172f6ec8de00d3c6fc"
sha256 cellar: :any_skip_relocation, mojave: "04ced2986480ad994f1c34254f8f946e6c33ddf19432a3bcc3077cb31af31d1d"
end
depends_on "go" => :build
def install
system "go", "build", *std_go_args(ldflags: "-X github.com/open-policy-agent/conftest/internal/commands.version=#{version}")
end
test do
assert_match "Test your configuration files using Open Policy Agent", shell_output("#{bin}/conftest --help")
# Using the policy parameter changes the default location to look for policies.
# If no policies are found, a non-zero status code is returned.
(testpath/"test.rego").write("package main")
system "#{bin}/conftest", "verify", "-p", "test.rego"
end
end
|
default['consul']['enable'] = false
default['consul']['dir'] = '/var/opt/gitlab/consul'
default['consul']['user'] = 'gitlab-consul'
default['consul']['config_file'] = '/var/opt/gitlab/consul/config.json'
default['consul']['config_dir'] = '/var/opt/gitlab/consul/config.d'
default['consul']['data_dir'] = '/var/opt/gitlab/consul/data'
default['consul']['log_directory'] = '/var/log/gitlab/consul'
default['consul']['script_directory'] = '/var/opt/gitlab/consul/scripts'
default['consul']['configuration'] = {}
default['consul']['logging_filters'] = {
postgresql_warning: "-*agent: Check 'service:postgresql' is now critical"
}
Update consul cookbook logging
Add comment explaining message filtering
default['consul']['enable'] = false
default['consul']['dir'] = '/var/opt/gitlab/consul'
default['consul']['user'] = 'gitlab-consul'
default['consul']['config_file'] = '/var/opt/gitlab/consul/config.json'
default['consul']['config_dir'] = '/var/opt/gitlab/consul/config.d'
default['consul']['data_dir'] = '/var/opt/gitlab/consul/data'
default['consul']['log_directory'] = '/var/log/gitlab/consul'
default['consul']['script_directory'] = '/var/opt/gitlab/consul/scripts'
default['consul']['configuration'] = {}
# Critical state of service:postgresql indicates a node is not a master
# It does not need to be logged. Health status should be checked from
# the consul cluster.
default['consul']['logging_filters'] = {
postgresql_warning: "-*agent: Check 'service:postgresql' is now critical"
}
|
class Conftest < Formula
desc "Test your configuration files using Open Policy Agent"
homepage "https://www.conftest.dev/"
url "https://github.com/open-policy-agent/conftest/archive/v0.25.0.tar.gz"
sha256 "9319f9cbd747099565ce6aad70708da0e50584eab295b7f036ea4b076e168fcb"
license "Apache-2.0"
head "https://github.com/open-policy-agent/conftest.git"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "8be3d3469f6843eebaf9e196abb975a14a7e62f584e16bb983f3d9d443e02bc1"
sha256 cellar: :any_skip_relocation, big_sur: "b9432b0b64f963d09698455df0df322d968043e5fdf4a72b4ecd8a1172616a5f"
sha256 cellar: :any_skip_relocation, catalina: "4a7dc940ec6bfd8910edc391264288b757ac498026d30e2e02dca19bb2a14fc0"
sha256 cellar: :any_skip_relocation, mojave: "c13321d7e91dc00669c574cf3255efe47ad17735e6753a80979e51ffd8b359d3"
end
depends_on "go" => :build
def install
system "go", "build", *std_go_args(ldflags: "-X github.com/open-policy-agent/conftest/internal/commands.version=#{version}")
end
test do
assert_match "Test your configuration files using Open Policy Agent", shell_output("#{bin}/conftest --help")
# Using the policy parameter changes the default location to look for policies.
# If no policies are found, a non-zero status code is returned.
(testpath/"test.rego").write("package main")
system "#{bin}/conftest", "verify", "-p", "test.rego"
end
end
conftest: update 0.25.0 bottle.
class Conftest < Formula
desc "Test your configuration files using Open Policy Agent"
homepage "https://www.conftest.dev/"
url "https://github.com/open-policy-agent/conftest/archive/v0.25.0.tar.gz"
sha256 "9319f9cbd747099565ce6aad70708da0e50584eab295b7f036ea4b076e168fcb"
license "Apache-2.0"
head "https://github.com/open-policy-agent/conftest.git"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "8be3d3469f6843eebaf9e196abb975a14a7e62f584e16bb983f3d9d443e02bc1"
sha256 cellar: :any_skip_relocation, big_sur: "b9432b0b64f963d09698455df0df322d968043e5fdf4a72b4ecd8a1172616a5f"
sha256 cellar: :any_skip_relocation, catalina: "4a7dc940ec6bfd8910edc391264288b757ac498026d30e2e02dca19bb2a14fc0"
sha256 cellar: :any_skip_relocation, mojave: "c13321d7e91dc00669c574cf3255efe47ad17735e6753a80979e51ffd8b359d3"
sha256 cellar: :any_skip_relocation, x86_64_linux: "6361f05a899442883f46fafb9e1de4d50a7cb3b1510d551d79d53680df081144"
end
depends_on "go" => :build
def install
system "go", "build", *std_go_args(ldflags: "-X github.com/open-policy-agent/conftest/internal/commands.version=#{version}")
end
test do
assert_match "Test your configuration files using Open Policy Agent", shell_output("#{bin}/conftest --help")
# Using the policy parameter changes the default location to look for policies.
# If no policies are found, a non-zero status code is returned.
(testpath/"test.rego").write("package main")
system "#{bin}/conftest", "verify", "-p", "test.rego"
end
end
|
require 'io/console'
require 'rainbow/ext/string'
module Geo
class Replication
attr_accessor :base_path, :data_path, :tmp_dir, :ctl
attr_writer :data_dir, :tmp_data_dir
attr_reader :options
def initialize(instance, options)
@base_path = instance.base_path
@data_path = instance.data_path
@ctl = instance
@options = options
end
def check_gitlab_active?
return unless gitlab_is_active?
if @options[:force]
puts "Found data inside the #{db_name} database! Proceeding because --force was supplied".color(:yellow)
else
puts "Found data inside the #{db_name} database! If you are sure you are in the secondary server, override with --force".color(:red)
exit 1
end
end
def check_service_enabled?
return if ctl.service_enabled?('postgresql')
puts 'There is no PostgreSQL instance enabled in omnibus, exiting...'.color(:red)
Kernel.exit 1
end
def confirm_replication
return if @options[:now]
puts '*** Are you sure you want to continue (replicate/no)? ***'.color(:yellow)
loop do
print 'Confirmation: '
answer = STDIN.gets.to_s.strip
break if answer == 'replicate'
exit 0 if answer == 'no'
puts "*** You entered `#{answer}` instead of `replicate` or `no`.".color(:red)
end
end
def print_warning
puts
puts '---------------------------------------------------------------'.color(:yellow)
puts 'WARNING: Make sure this script is run from the secondary server'.color(:yellow)
puts '---------------------------------------------------------------'.color(:yellow)
puts
puts '*** You are about to delete your local PostgreSQL database, and replicate the primary database. ***'.color(:yellow)
puts "*** The primary geo node is `#{@options[:host]}` ***".color(:yellow)
puts
end
def execute
check_gitlab_active?
check_service_enabled?
print_warning
confirm_replication
create_gitlab_backup!
puts '* Stopping PostgreSQL and all GitLab services'.color(:green)
run_command('gitlab-ctl stop')
@options[:password] = ask_pass
@pgpass = "#{data_path}/postgresql/.pgpass"
create_pgpass_file!
check_and_create_replication_slot!
orig_conf = "#{data_path}/postgresql/data/postgresql.conf"
if File.exist?(orig_conf)
puts '* Backing up postgresql.conf'.color(:green)
run_command("mv #{orig_conf} #{data_path}/postgresql/")
end
bkp_dir = "#{data_path}/postgresql/data.#{Time.now.to_i}"
puts "* Moving old data directory to '#{bkp_dir}'".color(:green)
run_command("mv #{data_path}/postgresql/data #{bkp_dir}")
puts "* Starting base backup as the replicator user (#{@options[:user]})".color(:green)
run_command(pg_basebackup_command,
live: true, timeout: @options[:backup_timeout])
puts "* Writing recovery.conf file with sslmode=#{@options[:sslmode]} and sslcompression=#{@options[:sslcompression]}".color(:green)
create_recovery_file!
puts '* Restoring postgresql.conf'.color(:green)
run_command("mv #{data_path}/postgresql/postgresql.conf #{data_path}/postgresql/data/")
puts '* Setting ownership permissions in PostgreSQL data directory'.color(:green)
run_command("chown -R gitlab-psql:gitlab-psql #{data_path}/postgresql/data")
puts '* Starting PostgreSQL and all GitLab services'.color(:green)
run_command('gitlab-ctl start')
end
def check_and_create_replication_slot!
return if @options[:skip_replication_slot]
puts "* Checking for replication slot #{@options[:slot_name]}".color(:green)
return if replication_slot_exists?
puts "* Creating replication slot #{@options[:slot_name]}".color(:green)
create_replication_slot!
end
private
def create_gitlab_backup!
return if @options[:skip_backup]
return unless gitlab_bootstrapped? && database_exists? && table_exists?('projects')
puts '* Executing GitLab backup task to prevent accidental data loss'.color(:green)
run_command('gitlab-rake gitlab:backup:create')
end
def create_pgpass_file!
File.open(@pgpass, 'w', 0600) do |file|
file.write(<<~EOF
#{@options[:host]}:#{@options[:port]}:*:#{@options[:user]}:#{@options[:password]}
EOF
)
end
run_command("chown gitlab-psql #{@pgpass}")
end
def create_recovery_file!
recovery_file = "#{data_path}/postgresql/data/recovery.conf"
File.open(recovery_file, 'w', 0640) do |file|
file.write(<<~EOF
standby_mode = 'on'
recovery_target_timeline = '#{@options[:recovery_target_timeline]}'
primary_conninfo = 'host=#{@options[:host]} port=#{@options[:port]} user=#{@options[:user]} password=#{@options[:password]} sslmode=#{@options[:sslmode]} sslcompression=#{@options[:sslcompression]}'
EOF
)
file.write("primary_slot_name = '#{@options[:slot_name]}'\n") if @options[:slot_name]
end
run_command("chown gitlab-psql #{recovery_file}")
end
def ask_pass
GitlabCtl::Util.get_password(input_text: "Enter the password for #{@options[:user]}@#{@options[:host]}: ", do_confirm: false)
end
def replication_slot_exists?
status = run_psql_command("SELECT slot_name FROM pg_replication_slots WHERE slot_name = '#{@options[:slot_name]}';")
status.stdout.include?(@options[:slot_name])
end
def create_replication_slot!
status = run_psql_command("SELECT slot_name FROM pg_create_physical_replication_slot('#{@options[:slot_name]}');")
status.stdout.include?(@options[:slot_name])
end
def pg_basebackup_command
slot_arguments =
if @options[:skip_replication_slot]
''
else
"-S #{@options[:slot_name]}"
end
%W(
PGPASSFILE=#{@pgpass} #{@base_path}/embedded/bin/pg_basebackup
-h #{@options[:host]}
-p #{@options[:port]}
-D #{@data_path}/postgresql/data
-U #{@options[:user]}
-v
-P
-X stream
#{slot_arguments}
).join(' ')
end
def run_psql_command(query)
cmd = %(PGPASSFILE=#{@pgpass} #{base_path}/bin/gitlab-psql -h #{@options[:host]} -p #{@options[:port]} -U #{@options[:user]} -d #{db_name} -t -c "#{query}")
run_command(cmd, live: false)
end
def run_command(cmd, live: false, timeout: nil)
status = GitlabCtl::Util.run_command(cmd, live: live, timeout: timeout)
if status.error?
puts status.stdout
puts status.stderr
teardown(cmd)
end
status
end
def run_query(query)
status = GitlabCtl::Util.run_command(
"#{base_path}/bin/gitlab-psql -d #{db_name} -c '#{query}' -q -t"
)
status.error? ? false : status.stdout.strip
end
def gitlab_bootstrapped?
File.exist?("#{data_path}/bootstrapped")
end
def database_exists?
status = GitlabCtl::Util.run_command("#{base_path}/bin/gitlab-psql -d template1 -c 'SELECT datname FROM pg_database' -A | grep -x #{db_name}")
!status.error?
end
def table_exists?(table_name)
query = "SELECT table_name
FROM information_schema.tables
WHERE table_catalog = '#{db_name}'
AND table_schema='public'"
status = GitlabCtl::Util.run_command("#{base_path}/bin/gitlab-psql -d #{db_name} -c \"#{query}\" -A | grep -x #{table_name}")
!status.error?
end
def table_empty?(table_name)
output = run_query('SELECT 1 FROM projects LIMIT 1')
output == '1' ? false : true
end
def gitlab_is_active?
database_exists? && table_exists?('projects') && !table_empty?('projects')
end
def db_name
'gitlabhq_production'
end
def teardown(cmd)
puts <<~MESSAGE.color(:red)
*** Initial replication failed! ***
Replication tool returned with a non zero exit status!
Troubleshooting tips:
- replication should be run by root user
- check your trust settings `md5_auth_cidr_addresses` in `gitlab.rb` on the primary node
Failed to execute: #{cmd}
MESSAGE
exit 1
end
end
end
Fix Rubocop error in files/gitlab-ctl-commands-ee/lib/geo/replication.rb
require 'io/console'
require 'rainbow/ext/string'
module Geo
class Replication
attr_accessor :base_path, :data_path, :tmp_dir, :ctl
attr_writer :data_dir, :tmp_data_dir
attr_reader :options
def initialize(instance, options)
@base_path = instance.base_path
@data_path = instance.data_path
@ctl = instance
@options = options
end
def check_gitlab_active?
return unless gitlab_is_active?
if @options[:force]
puts "Found data inside the #{db_name} database! Proceeding because --force was supplied".color(:yellow)
else
puts "Found data inside the #{db_name} database! If you are sure you are in the secondary server, override with --force".color(:red)
exit 1
end
end
def check_service_enabled?
return if ctl.service_enabled?('postgresql')
puts 'There is no PostgreSQL instance enabled in omnibus, exiting...'.color(:red)
Kernel.exit 1
end
def confirm_replication
return if @options[:now]
puts '*** Are you sure you want to continue (replicate/no)? ***'.color(:yellow)
loop do
print 'Confirmation: '
answer = STDIN.gets.to_s.strip
break if answer == 'replicate'
exit 0 if answer == 'no'
puts "*** You entered `#{answer}` instead of `replicate` or `no`.".color(:red)
end
end
def print_warning
puts
puts '---------------------------------------------------------------'.color(:yellow)
puts 'WARNING: Make sure this script is run from the secondary server'.color(:yellow)
puts '---------------------------------------------------------------'.color(:yellow)
puts
puts '*** You are about to delete your local PostgreSQL database, and replicate the primary database. ***'.color(:yellow)
puts "*** The primary geo node is `#{@options[:host]}` ***".color(:yellow)
puts
end
def execute
check_gitlab_active?
check_service_enabled?
print_warning
confirm_replication
create_gitlab_backup!
puts '* Stopping PostgreSQL and all GitLab services'.color(:green)
run_command('gitlab-ctl stop')
@options[:password] = ask_pass
@pgpass = "#{data_path}/postgresql/.pgpass"
create_pgpass_file!
check_and_create_replication_slot!
orig_conf = "#{data_path}/postgresql/data/postgresql.conf"
if File.exist?(orig_conf)
puts '* Backing up postgresql.conf'.color(:green)
run_command("mv #{orig_conf} #{data_path}/postgresql/")
end
bkp_dir = "#{data_path}/postgresql/data.#{Time.now.to_i}"
puts "* Moving old data directory to '#{bkp_dir}'".color(:green)
run_command("mv #{data_path}/postgresql/data #{bkp_dir}")
puts "* Starting base backup as the replicator user (#{@options[:user]})".color(:green)
run_command(pg_basebackup_command,
live: true, timeout: @options[:backup_timeout])
puts "* Writing recovery.conf file with sslmode=#{@options[:sslmode]} and sslcompression=#{@options[:sslcompression]}".color(:green)
create_recovery_file!
puts '* Restoring postgresql.conf'.color(:green)
run_command("mv #{data_path}/postgresql/postgresql.conf #{data_path}/postgresql/data/")
puts '* Setting ownership permissions in PostgreSQL data directory'.color(:green)
run_command("chown -R gitlab-psql:gitlab-psql #{data_path}/postgresql/data")
puts '* Starting PostgreSQL and all GitLab services'.color(:green)
run_command('gitlab-ctl start')
end
def check_and_create_replication_slot!
return if @options[:skip_replication_slot]
puts "* Checking for replication slot #{@options[:slot_name]}".color(:green)
return if replication_slot_exists?
puts "* Creating replication slot #{@options[:slot_name]}".color(:green)
create_replication_slot!
end
private
def create_gitlab_backup!
return if @options[:skip_backup]
return unless gitlab_bootstrapped? && database_exists? && table_exists?('projects')
puts '* Executing GitLab backup task to prevent accidental data loss'.color(:green)
run_command('gitlab-rake gitlab:backup:create')
end
def create_pgpass_file!
File.open(@pgpass, 'w', 0600) do |file|
file.write(<<~EOF
#{@options[:host]}:#{@options[:port]}:*:#{@options[:user]}:#{@options[:password]}
EOF
)
end
run_command("chown gitlab-psql #{@pgpass}")
end
def create_recovery_file!
recovery_file = "#{data_path}/postgresql/data/recovery.conf"
File.open(recovery_file, 'w', 0640) do |file|
file.write(<<~EOF
standby_mode = 'on'
recovery_target_timeline = '#{@options[:recovery_target_timeline]}'
primary_conninfo = 'host=#{@options[:host]} port=#{@options[:port]} user=#{@options[:user]} password=#{@options[:password]} sslmode=#{@options[:sslmode]} sslcompression=#{@options[:sslcompression]}'
EOF
)
file.write("primary_slot_name = '#{@options[:slot_name]}'\n") if @options[:slot_name]
end
run_command("chown gitlab-psql #{recovery_file}")
end
def ask_pass
GitlabCtl::Util.get_password(input_text: "Enter the password for #{@options[:user]}@#{@options[:host]}: ", do_confirm: false)
end
def replication_slot_exists?
status = run_psql_command("SELECT slot_name FROM pg_replication_slots WHERE slot_name = '#{@options[:slot_name]}';")
status.stdout.include?(@options[:slot_name])
end
def create_replication_slot!
status = run_psql_command("SELECT slot_name FROM pg_create_physical_replication_slot('#{@options[:slot_name]}');")
status.stdout.include?(@options[:slot_name])
end
def pg_basebackup_command
slot_arguments =
if @options[:skip_replication_slot]
''
else
"-S #{@options[:slot_name]}"
end
%W(
PGPASSFILE=#{@pgpass} #{@base_path}/embedded/bin/pg_basebackup
-h #{@options[:host]}
-p #{@options[:port]}
-D #{@data_path}/postgresql/data
-U #{@options[:user]}
-v
-P
-X stream
#{slot_arguments}
).join(' ')
end
def run_psql_command(query)
cmd = %(PGPASSFILE=#{@pgpass} #{base_path}/bin/gitlab-psql -h #{@options[:host]} -p #{@options[:port]} -U #{@options[:user]} -d #{db_name} -t -c "#{query}")
run_command(cmd, live: false)
end
def run_command(cmd, live: false, timeout: nil)
status = GitlabCtl::Util.run_command(cmd, live: live, timeout: timeout)
if status.error?
puts status.stdout
puts status.stderr
teardown(cmd)
end
status
end
def run_query(query)
status = GitlabCtl::Util.run_command(
"#{base_path}/bin/gitlab-psql -d #{db_name} -c '#{query}' -q -t"
)
status.error? ? false : status.stdout.strip
end
def gitlab_bootstrapped?
File.exist?("#{data_path}/bootstrapped")
end
def database_exists?
status = GitlabCtl::Util.run_command("#{base_path}/bin/gitlab-psql -d template1 -c 'SELECT datname FROM pg_database' -A | grep -x #{db_name}")
!status.error?
end
def table_exists?(table_name)
query = "SELECT table_name
FROM information_schema.tables
WHERE table_catalog = '#{db_name}'
AND table_schema='public'"
status = GitlabCtl::Util.run_command("#{base_path}/bin/gitlab-psql -d #{db_name} -c \"#{query}\" -A | grep -x #{table_name}")
!status.error?
end
def table_empty?(table_name)
output = run_query('SELECT 1 FROM projects LIMIT 1')
output == '1' ? false : true
end
def gitlab_is_active?
database_exists? && table_exists?('projects') && !table_empty?('projects')
end
def db_name
'gitlabhq_production'
end
def teardown(cmd)
puts <<~MESSAGE.color(:red)
*** Initial replication failed! ***
Replication tool returned with a non zero exit status!
Troubleshooting tips:
- replication should be run by root user
- check your trust settings `md5_auth_cidr_addresses` in `gitlab.rb` on the primary node
Failed to execute: #{cmd}
MESSAGE
exit 1
end
end
end
|
class Statistic < ActiveRecord::Base
belongs_to :user
belongs_to :scenario
# active directory has support for arrays and hash tables
serialize :bash_analytics
serialize :resource_info
after_create :create
def create
self.scenario_id = self.scenario.id
self.user_id = self.scenario.user_id
self.scenario_name = self.scenario.name
self.scenario_created_at = self.scenario.created_at
gen_info
self.save
end
def gen_info
return if not self.scenario
info = { instances: {} }
self.scenario.instances.each do |i|
info[:instances][i.name] = {id: i.id, users: i.player_names }
end
self.update_attribute(:resource_info, info)
end
def gen_instance_files
self.resource_info[:instances].each do |name, info|
bash_histories_path = self.data_instance_bash_histories_path(name)
exit_statuses_path = self.data_instance_exit_statuses_path(name)
script_logs_path = self.data_instance_script_logs_path(name)
FileUtils.touch(bash_histories_path) if not File.exists?
FileUtils.touch(exit_statuses_path) if not File.exists?
FileUtils.touch(script_logs_path) if not File.exists?
end
end
## utility methods
def unix_to_dt(ts)
# convert unix timestamp to datetime object
return DateTime.strptime(ts, format="%s")
end
def dates_in_window(start_time, end_time, timestamps)
# input -> start_time, end_time: datetime objects defining
# a window of time
# timestamps: a hash from corresponding to a specific user
# of the form {timestamp -> command}
# output -> dates: a list of timestamps within a window of time
window = timestamps.keys.select{ |d| unix_to_dt(d) >= start_time \
&& unix_to_dt(d) <= end_time }
return window
end
def is_numeric?(s) # check if a string is numeric or not
# input -> s: a string
# output -> true if the string is a number value, false otherwise
begin
if Float(s)
return true
end
rescue
return false
end
end
def scenario_exists?
return Scenario.find_by_id(self.scenario.id)
end
## end utility methods
# private
# The methods below should not be private methods, as they will be
# called from outside of this file. Namely, it will be taken care of
# by the controller, with input coming from the statistics UI template.
# Statistic creation initially goes through a pipeline of operations
# which successively cleans the unstructured data and organizes it
# in such a way that analytics can be made possible.
# Currently Statistic creation is done during the destruction of a Scenario,
# whereby the bash data is brought down from an s3 bucket and
# parsed into a nested Hash, mapping users to timestamps to commands.
# The methods defined below are helper methods that allow the
# investigator to reveal certain aspects of the data.
def perform_analytics(data)
# input -> data: a hash of the form { users -> list of strings of commands }
# output -> results: a nested array of two-element arrays
results = [] # [[ string, count ]] or {string => count}, chartkick can deal with either.
frequencies = Hash.new(0)
data.keys.each do | user |
data[user].each do | cmd |
if !frequencies.include?(cmd)
frequencies[cmd] = 1
else
frequencies[cmd] += 1
end
end
end
return frequencies
end
def grab_relevant_commands(users, start_time, end_time)
# input -> users: a list of username strings
# start_time, end_time: strings which represent dates
# that define a window of time
# output -> a dictionary mapping users to a list of
# commands they've entered during a window of time
result = Hash.new(0) # {user -> relevant-commmands}
start_time = unix_to_dt(start_time)
end_time = unix_to_dt(end_time)
bash_data = self.bash_analytics # yank the data from model
if users # single user
u = users # grab that user and,
timestamps = bash_data[u] # create {timestamps -> command} from {user -> {timestamps -> command}}
# grab list of timestamps within specified window of time
window = dates_in_window(start_time, end_time, timestamps)
cmds = [] # to be array of commands within window
window.each do |d|
cmds << timestamps[d]
end
result[u] = cmds # {user -> array of relevant commands}
return result
# elsif users.length > 1 # many users
# users.each do |u| # same as above but for each user
# cmds = []
# timestamps = bash_data[u]
# window = dates_in_window(start_time, end_time, timestamps)
# window.each do |d|
# cmds << timestamps[d]
# end
# result[u] = cmds
# end
# return result # users that map to lists of strings of commands
# # empty hash (no commands within timeframe?)
else
return result
end
end
def bash_histories_partition(data)
# input -> data: a list of strings of bash commands split by newline
# output -> d: a hash {user->{timestamp->command}}
# method to populate the bash_analytics field of
# a Statistic model with a nested hash
# that maps users to timestamps to commands
hash = {} # {user -> { timestamp -> command }}
user = nil
time = nil
data.each do |line|
if /^\#\#\s/.match(line)
user = line[3..-1]
hash[user] = {} if not hash.has_key?(user)
time = nil
else
if /^#\d{10}$/.match(line)
time = line[1..-1]
else
hash[user][time] = line if (user and time and not /^\s*$/.match(line))
end
end
end
hash
end
def command_frequency(instance_name, user)
return false if not self.resource_info[:instances].has_key?(instance_name)
path = data_instance_by_id_user_command_frequency(self.resource_info[:instances][instance_name][:id], user)
return false if not File.exists? path
c = {}
YAML.load_file(path).each { |command, count| c[command] = count }
c
end
def bash_history_instance_user(instance_name, user_name)
data_read(data_instance_user_bash_history_path(instance_name, user_name))
end
def instance_id_get(name)
self.resource_info[:instances][name][:id]
end
def instance_names
self.resource_info[:instances].keys
end
def instance_user_names(instance_name)
self.resource_info[:instances].each { |k,v| return v[:users] if k == instance_name }
[]
end
def save_bash_histories_exit_status_script_log
bash_histories = ""
script_log = ""
exit_status = ""
# populate statistic with bash histories
self.scenario.instances.all.each do |instance|
# concatenate all bash histories into one big string
bash_histories += instance.get_bash_history.encode('utf-8', :invalid => :replace, :undef => :replace, :replace => '_')
#puts instance.get_bash_history # for debugging
# Concatenate all script logs
# Will look messy
script_log += instance.get_script_log.encode('utf-8', :invalid => :replace, :undef => :replace, :replace => '_')
#puts instance.get_script_log # for debugging
# Concatenate all exit status logs
exit_status += instance.get_exit_status.encode('utf-8', :invalid => :replace, :undef => :replace, :replace => '_')
#puts instance.get_exit_status # for debugging
end
# partition the big bash history string into a nested hash structure
# mapping usernames to the commands they entered.
bash_partition = partition_bash(bash_histories.split("\n"))
# create statistic file for download
bash_analytics = ""
bash_partition.each do |analytic|
bash_analytics = bash_analytics + "#{analytic}" + "\n"
end
FileUtils.mkdir_p(self.data_path) if not File.exists?(self.data_path)
file_text = "Scenario #{self.scenario_name} created at #{self.scenario_created_at}\nStatistic #{self.id} created at #{self.created_at}\n\nBash Histories: \n \n#{bash_histories} \n"
File.open(self.data_path_statistic, "wb+") { |f| f.write(file_text) }
#Create Script Log File
#Referencing script log by script_log
script_out = "Scenario #{self.scenario_name} created at #{self.scenario_created_at}\nStatistic #{self.id} created at #{self.created_at}\n\nScript Log: \n \n#{script_log} \n"
File.open(self.data_path_script_log, "wb+") { |f| f.write(script_out) }
#Create Exit Status file
#Referencing exit status log by exit_status
exit_stat_out = "Scenario #{self.scenario_name} created at #{self.scenario_created_at}\nStatistic #{self.id} created at #{self.created_at}\n\nExit Status Log: \n \n#{exit_status} \n"
File.open(self.data_path_exit_status, "wb+") { |f| f.write(exit_stat_out) }
end
def save_questions_and_answers
yml = { }
questions = self.scenario.questions.map { |q|
{
"Id" => q.id,
"Order" => q.order,
"Text" => q.text,
"Options" => q.options,
"PointsPenalty" => q.points_penalty
}
}
yml["Questions"] = questions
students = []
self.scenario.questions.each do |q|
q.answers.each do |a|
students.push({
"Id" => a.user.id,
"Name" => a.user.name,
"Answers" => []
}) if students.select{ |s| s["Id"] == a.user.id }.empty?
student = students.select{ |s| s["Id"] == a.user.id }.first
student["Answers"].push({
"QuestionId" => q.id,
"Text" => a.text,
"TextEssay" => a.text_essay,
"Comment" => a.comment,
"ValueIndex" => a.value_index,
"Correct" => a.correct,
"EssayPoints" => a.essay_points_earned
})
end
end
yml["Students"] = students.map { |s| s }
File.open(self.data_path_questions_answers, "w") { |f| f.write(yml.to_yaml) }
yml.to_yaml
end
def save_scenario_yml
File.open(self.data_path_scenario_yml, "w") do |f|
f.write(File.open(self.scenario.path_yml, 'r').read())
end
end
def boot_log_last_read
if path = Dir.glob("#{data_path_boot}/*").max_by { |f| File.mtime(f) }
return File.open(path, 'r').read()
end
"Scenario has not been booted"
end
def data_read(path)
File.open(path, 'r').read()
end
def data_all_as_zip
files = {}
# go through each instance and user
self.resource_info[:instances].each do |instance_name, values|
values[:users].each do |user_name|
path = data_instance_user_bash_history_path(instance_name, user_name)
if File.exists? path
files[data_instance_user_bash_history_download_name(instance_name, user_name)] = path
end
end
files[data_instance_exit_statuses_download_name(instance_name)] = data_instance_exit_statuses_path(instance_name)
files[data_instance_script_logs_download_name(instance_name)] = data_instance_script_logs_path(instance_name)
end
# return files
temp_file = Tempfile.new("statistics.zip")
begin
Zip::OutputStream.open(temp_file.path) do |zos|
files.each do |name, path|
zos.put_next_entry(name)
zos.print IO.read(path)
end
end
#Initialize the temp file as a zip file
# Zip::OutputStream.open(temp_file) { |zos| }
# Zip::File.open(temp_file.path, Zip::File::CREATE) do |zipfile|
# file_paths.each do |path|
# zipfile.add(path, folder + path)
# end
# end
#Read the binary data from the file
return File.read(temp_file.path)
ensure
#close and delete the temp file
temp_file.close
temp_file.unlink
end
end
def data_instance_user_bash_history_path(instance_name, user_name)
data_file_check "#{data_path_instance(instance_name)}/users/#{user_name}.bash_history.yml"
end
def data_instance_user_bash_history_download_name(instance_name, user_name)
"#{self.scenario_created_at.strftime("%y_%m_%d")}_#{self.scenario_name}_#{self.scenario_id}_#{instance_name}_#{user_name}_bash_history"
end
def data_instance_exit_statuses_path(instance_name)
"#{data_path_instance(instance_name)}/exit_status"
end
def data_instance_exit_statuses_download_name(instance_name)
"#{self.scenario_created_at.strftime("%y_%m_%d")}_#{self.scenario_name}_#{self.scenario_id}_#{instance_name}_exit_statuses"
end
def data_instance_script_logs_path(instance_name)
"#{data_path_instance(instance_name)}/script_log"
end
def data_instance_script_logs_download_name(instance_name)
"#{self.scenario_created_at.strftime("%y_%m_%d")}_#{self.scenario_name}_#{self.scenario_id}_#{instance_name}_script_logs"
end
def data_instance_bash_histories_path(instance_name)
"#{data_path_instance(instance_name)}/bash_histories"
end
def data_instance_bash_histories_path_by_id(instance_id)
"#{data_path_instance_by_id(instance_id)}/bash_histories"
end
def data_instance_exit_statuses_path(instance_name)
"#{data_path_instance(instance_name)}/exit_statuses"
end
def data_instance_script_logs_path(instance_name)
"#{data_path_instance(instance_name)}/script_logs"
end
def data_instance_by_id_user_bash_history_path(instance_id, user_name)
data_file_check "#{data_path_instance_by_id_users(instance_id)}/#{user_name}.bash_history.yml"
end
def data_instance_by_name_user_command_frequency(instance_name, user_name)
data_file_check "#{data_path_instance_users(instance_id)}/#{user_name}.command_frequency.yml"
end
def data_instance_by_id_user_command_frequency(instance_id, user_name)
data_file_check "#{data_path_instance_by_id_users(instance_id)}/#{user_name}.command_frequency.yml"
end
def data_fetch_and_process
data_fetch
data_process
end
def data_fetch
return if not scenario_exists?
self.scenario.instances.each do |instance|
instance.aws_instance_S3_files_save({})
end
end
def data_process
Dir.foreach(data_path_instances) do |instance_id|
next if instance_id == '.' or instance_id == '..' or instance_id == 'users'
bash_history = File.open(data_instance_bash_histories_path_by_id(instance_id), 'r').read().encode('utf-8', :invalid => :replace, :undef => :replace, :replace => '_')
bash_histories_partition(bash_history.split("\n")).each do |user_name, commands|
File.open(data_instance_by_id_user_bash_history_path(instance_id, user_name), "w") do |f|
f.write(commands.to_yaml)
end
freq = {}
commands.each { |k, v| freq.has_key?(v) ? freq[v] = (freq[v] + 1) : freq[v] = 1 }
File.open(data_instance_by_id_user_command_frequency(instance_id, user_name), "w") do |f|
f.write(freq.to_yaml)
end
end
end
end
def data_path_check(path)
FileUtils.mkdir_p(path) if not File.exists?(path)
path
end
def data_file_check(path)
FileUtils.touch(path) if not File.exists?(path)
path
end
def data_path
data_path_check "#{Rails.root}/data/#{Rails.env}/#{self.user.id}/#{self.scenario_created_at.strftime("%y_%m_%d")}_#{self.scenario.name}_#{self.scenario.id}"
end
def data_path_boot
data_path_check "#{self.data_path}/boot"
end
def data_path_questions_answers
"#{self.data_path}/questions_and_answers.yml"
end
def data_path_scenario_yml
"#{self.data_path}/#{self.scenario.name.downcase}.yml"
end
def data_path_instances
data_path_check "#{self.data_path}/instances"
end
def data_path_instance(instance_name)
data_path_check "#{self.data_path_instances}/#{self.resource_info[:instances][instance_name][:id]}"
end
def data_path_instance_by_id(instance_id)
data_path_check "#{self.data_path_instances}/#{instance_id}"
end
def data_path_instance_by_id_users(instance_id)
data_path_check "#{self.data_path_instance_by_id(instance_id)}/users"
end
end
fix command frequency loading.
class Statistic < ActiveRecord::Base
belongs_to :user
belongs_to :scenario
# active directory has support for arrays and hash tables
serialize :bash_analytics
serialize :resource_info
after_create :create
def create
self.scenario_id = self.scenario.id
self.user_id = self.scenario.user_id
self.scenario_name = self.scenario.name
self.scenario_created_at = self.scenario.created_at
gen_info
self.save
end
def gen_info
return if not self.scenario
info = { instances: {} }
self.scenario.instances.each do |i|
info[:instances][i.name] = {id: i.id, users: i.player_names }
end
self.update_attribute(:resource_info, info)
end
def gen_instance_files
self.resource_info[:instances].each do |name, info|
bash_histories_path = self.data_instance_bash_histories_path(name)
exit_statuses_path = self.data_instance_exit_statuses_path(name)
script_logs_path = self.data_instance_script_logs_path(name)
FileUtils.touch(bash_histories_path) if not File.exists?
FileUtils.touch(exit_statuses_path) if not File.exists?
FileUtils.touch(script_logs_path) if not File.exists?
end
end
## utility methods
def unix_to_dt(ts)
# convert unix timestamp to datetime object
return DateTime.strptime(ts, format="%s")
end
def dates_in_window(start_time, end_time, timestamps)
# input -> start_time, end_time: datetime objects defining
# a window of time
# timestamps: a hash from corresponding to a specific user
# of the form {timestamp -> command}
# output -> dates: a list of timestamps within a window of time
window = timestamps.keys.select{ |d| unix_to_dt(d) >= start_time \
&& unix_to_dt(d) <= end_time }
return window
end
def is_numeric?(s) # check if a string is numeric or not
# input -> s: a string
# output -> true if the string is a number value, false otherwise
begin
if Float(s)
return true
end
rescue
return false
end
end
def scenario_exists?
return Scenario.find_by_id(self.scenario.id)
end
## end utility methods
# private
# The methods below should not be private methods, as they will be
# called from outside of this file. Namely, it will be taken care of
# by the controller, with input coming from the statistics UI template.
# Statistic creation initially goes through a pipeline of operations
# which successively cleans the unstructured data and organizes it
# in such a way that analytics can be made possible.
# Currently Statistic creation is done during the destruction of a Scenario,
# whereby the bash data is brought down from an s3 bucket and
# parsed into a nested Hash, mapping users to timestamps to commands.
# The methods defined below are helper methods that allow the
# investigator to reveal certain aspects of the data.
def perform_analytics(data)
# input -> data: a hash of the form { users -> list of strings of commands }
# output -> results: a nested array of two-element arrays
results = [] # [[ string, count ]] or {string => count}, chartkick can deal with either.
frequencies = Hash.new(0)
data.keys.each do | user |
data[user].each do | cmd |
if !frequencies.include?(cmd)
frequencies[cmd] = 1
else
frequencies[cmd] += 1
end
end
end
return frequencies
end
def grab_relevant_commands(users, start_time, end_time)
# input -> users: a list of username strings
# start_time, end_time: strings which represent dates
# that define a window of time
# output -> a dictionary mapping users to a list of
# commands they've entered during a window of time
result = Hash.new(0) # {user -> relevant-commmands}
start_time = unix_to_dt(start_time)
end_time = unix_to_dt(end_time)
bash_data = self.bash_analytics # yank the data from model
if users # single user
u = users # grab that user and,
timestamps = bash_data[u] # create {timestamps -> command} from {user -> {timestamps -> command}}
# grab list of timestamps within specified window of time
window = dates_in_window(start_time, end_time, timestamps)
cmds = [] # to be array of commands within window
window.each do |d|
cmds << timestamps[d]
end
result[u] = cmds # {user -> array of relevant commands}
return result
# elsif users.length > 1 # many users
# users.each do |u| # same as above but for each user
# cmds = []
# timestamps = bash_data[u]
# window = dates_in_window(start_time, end_time, timestamps)
# window.each do |d|
# cmds << timestamps[d]
# end
# result[u] = cmds
# end
# return result # users that map to lists of strings of commands
# # empty hash (no commands within timeframe?)
else
return result
end
end
def bash_histories_partition(data)
# input -> data: a list of strings of bash commands split by newline
# output -> d: a hash {user->{timestamp->command}}
# method to populate the bash_analytics field of
# a Statistic model with a nested hash
# that maps users to timestamps to commands
hash = {} # {user -> { timestamp -> command }}
user = nil
time = nil
data.each do |line|
if /^\#\#\s/.match(line)
user = line[3..-1]
hash[user] = {} if not hash.has_key?(user)
time = nil
else
if /^#\d{10}$/.match(line)
time = line[1..-1]
else
hash[user][time] = line if (user and time and not /^\s*$/.match(line))
end
end
end
hash
end
def command_frequency(instance_name, user)
return false if not self.resource_info[:instances].has_key?(instance_name)
path = data_instance_by_id_user_command_frequency(self.resource_info[:instances][instance_name][:id], user)
return false if not File.exists? path
c = {}
yml = YAML.load_file(path)
yml.each { |command, count| c[command] = count } if yml
c
end
def bash_history_instance_user(instance_name, user_name)
data_read(data_instance_user_bash_history_path(instance_name, user_name))
end
def instance_id_get(name)
self.resource_info[:instances][name][:id]
end
def instance_names
self.resource_info[:instances].keys
end
def instance_user_names(instance_name)
self.resource_info[:instances].each { |k,v| return v[:users] if k == instance_name }
[]
end
def save_bash_histories_exit_status_script_log
bash_histories = ""
script_log = ""
exit_status = ""
# populate statistic with bash histories
self.scenario.instances.all.each do |instance|
# concatenate all bash histories into one big string
bash_histories += instance.get_bash_history.encode('utf-8', :invalid => :replace, :undef => :replace, :replace => '_')
#puts instance.get_bash_history # for debugging
# Concatenate all script logs
# Will look messy
script_log += instance.get_script_log.encode('utf-8', :invalid => :replace, :undef => :replace, :replace => '_')
#puts instance.get_script_log # for debugging
# Concatenate all exit status logs
exit_status += instance.get_exit_status.encode('utf-8', :invalid => :replace, :undef => :replace, :replace => '_')
#puts instance.get_exit_status # for debugging
end
# partition the big bash history string into a nested hash structure
# mapping usernames to the commands they entered.
bash_partition = partition_bash(bash_histories.split("\n"))
# create statistic file for download
bash_analytics = ""
bash_partition.each do |analytic|
bash_analytics = bash_analytics + "#{analytic}" + "\n"
end
FileUtils.mkdir_p(self.data_path) if not File.exists?(self.data_path)
file_text = "Scenario #{self.scenario_name} created at #{self.scenario_created_at}\nStatistic #{self.id} created at #{self.created_at}\n\nBash Histories: \n \n#{bash_histories} \n"
File.open(self.data_path_statistic, "wb+") { |f| f.write(file_text) }
#Create Script Log File
#Referencing script log by script_log
script_out = "Scenario #{self.scenario_name} created at #{self.scenario_created_at}\nStatistic #{self.id} created at #{self.created_at}\n\nScript Log: \n \n#{script_log} \n"
File.open(self.data_path_script_log, "wb+") { |f| f.write(script_out) }
#Create Exit Status file
#Referencing exit status log by exit_status
exit_stat_out = "Scenario #{self.scenario_name} created at #{self.scenario_created_at}\nStatistic #{self.id} created at #{self.created_at}\n\nExit Status Log: \n \n#{exit_status} \n"
File.open(self.data_path_exit_status, "wb+") { |f| f.write(exit_stat_out) }
end
def save_questions_and_answers
yml = { }
questions = self.scenario.questions.map { |q|
{
"Id" => q.id,
"Order" => q.order,
"Text" => q.text,
"Options" => q.options,
"PointsPenalty" => q.points_penalty
}
}
yml["Questions"] = questions
students = []
self.scenario.questions.each do |q|
q.answers.each do |a|
students.push({
"Id" => a.user.id,
"Name" => a.user.name,
"Answers" => []
}) if students.select{ |s| s["Id"] == a.user.id }.empty?
student = students.select{ |s| s["Id"] == a.user.id }.first
student["Answers"].push({
"QuestionId" => q.id,
"Text" => a.text,
"TextEssay" => a.text_essay,
"Comment" => a.comment,
"ValueIndex" => a.value_index,
"Correct" => a.correct,
"EssayPoints" => a.essay_points_earned
})
end
end
yml["Students"] = students.map { |s| s }
File.open(self.data_path_questions_answers, "w") { |f| f.write(yml.to_yaml) }
yml.to_yaml
end
def save_scenario_yml
File.open(self.data_path_scenario_yml, "w") do |f|
f.write(File.open(self.scenario.path_yml, 'r').read())
end
end
def boot_log_last_read
if path = Dir.glob("#{data_path_boot}/*").max_by { |f| File.mtime(f) }
return File.open(path, 'r').read()
end
"Scenario has not been booted"
end
def data_read(path)
File.open(path, 'r').read()
end
def data_all_as_zip
files = {}
# go through each instance and user
self.resource_info[:instances].each do |instance_name, values|
values[:users].each do |user_name|
path = data_instance_user_bash_history_path(instance_name, user_name)
if File.exists? path
files[data_instance_user_bash_history_download_name(instance_name, user_name)] = path
end
end
files[data_instance_exit_statuses_download_name(instance_name)] = data_instance_exit_statuses_path(instance_name)
files[data_instance_script_logs_download_name(instance_name)] = data_instance_script_logs_path(instance_name)
end
# return files
temp_file = Tempfile.new("statistics.zip")
begin
Zip::OutputStream.open(temp_file.path) do |zos|
files.each do |name, path|
zos.put_next_entry(name)
zos.print IO.read(path)
end
end
#Initialize the temp file as a zip file
# Zip::OutputStream.open(temp_file) { |zos| }
# Zip::File.open(temp_file.path, Zip::File::CREATE) do |zipfile|
# file_paths.each do |path|
# zipfile.add(path, folder + path)
# end
# end
#Read the binary data from the file
return File.read(temp_file.path)
ensure
#close and delete the temp file
temp_file.close
temp_file.unlink
end
end
def data_instance_user_bash_history_path(instance_name, user_name)
data_file_check "#{data_path_instance(instance_name)}/users/#{user_name}.bash_history.yml"
end
def data_instance_user_bash_history_download_name(instance_name, user_name)
"#{self.scenario_created_at.strftime("%y_%m_%d")}_#{self.scenario_name}_#{self.scenario_id}_#{instance_name}_#{user_name}_bash_history"
end
def data_instance_exit_statuses_path(instance_name)
"#{data_path_instance(instance_name)}/exit_status"
end
def data_instance_exit_statuses_download_name(instance_name)
"#{self.scenario_created_at.strftime("%y_%m_%d")}_#{self.scenario_name}_#{self.scenario_id}_#{instance_name}_exit_statuses"
end
def data_instance_script_logs_path(instance_name)
"#{data_path_instance(instance_name)}/script_log"
end
def data_instance_script_logs_download_name(instance_name)
"#{self.scenario_created_at.strftime("%y_%m_%d")}_#{self.scenario_name}_#{self.scenario_id}_#{instance_name}_script_logs"
end
def data_instance_bash_histories_path(instance_name)
"#{data_path_instance(instance_name)}/bash_histories"
end
def data_instance_bash_histories_path_by_id(instance_id)
"#{data_path_instance_by_id(instance_id)}/bash_histories"
end
def data_instance_exit_statuses_path(instance_name)
"#{data_path_instance(instance_name)}/exit_statuses"
end
def data_instance_script_logs_path(instance_name)
"#{data_path_instance(instance_name)}/script_logs"
end
def data_instance_by_id_user_bash_history_path(instance_id, user_name)
data_file_check "#{data_path_instance_by_id_users(instance_id)}/#{user_name}.bash_history.yml"
end
def data_instance_by_name_user_command_frequency(instance_name, user_name)
data_file_check "#{data_path_instance_users(instance_id)}/#{user_name}.command_frequency.yml"
end
def data_instance_by_id_user_command_frequency(instance_id, user_name)
data_file_check "#{data_path_instance_by_id_users(instance_id)}/#{user_name}.command_frequency.yml"
end
def data_fetch_and_process
data_fetch
data_process
end
def data_fetch
return if not scenario_exists?
self.scenario.instances.each do |instance|
instance.aws_instance_S3_files_save({})
end
end
def data_process
Dir.foreach(data_path_instances) do |instance_id|
next if instance_id == '.' or instance_id == '..' or instance_id == 'users'
bash_history = File.open(data_instance_bash_histories_path_by_id(instance_id), 'r').read().encode('utf-8', :invalid => :replace, :undef => :replace, :replace => '_')
bash_histories_partition(bash_history.split("\n")).each do |user_name, commands|
File.open(data_instance_by_id_user_bash_history_path(instance_id, user_name), "w") do |f|
f.write(commands.to_yaml)
end
freq = {}
commands.each { |k, v| freq.has_key?(v) ? freq[v] = (freq[v] + 1) : freq[v] = 1 }
File.open(data_instance_by_id_user_command_frequency(instance_id, user_name), "w") do |f|
f.write(freq.to_yaml)
end
end
end
end
def data_path_check(path)
FileUtils.mkdir_p(path) if not File.exists?(path)
path
end
def data_file_check(path)
FileUtils.touch(path) if not File.exists?(path)
path
end
def data_path
data_path_check "#{Rails.root}/data/#{Rails.env}/#{self.user.id}/#{self.scenario_created_at.strftime("%y_%m_%d")}_#{self.scenario.name}_#{self.scenario.id}"
end
def data_path_boot
data_path_check "#{self.data_path}/boot"
end
def data_path_questions_answers
"#{self.data_path}/questions_and_answers.yml"
end
def data_path_scenario_yml
"#{self.data_path}/#{self.scenario.name.downcase}.yml"
end
def data_path_instances
data_path_check "#{self.data_path}/instances"
end
def data_path_instance(instance_name)
data_path_check "#{self.data_path_instances}/#{self.resource_info[:instances][instance_name][:id]}"
end
def data_path_instance_by_id(instance_id)
data_path_check "#{self.data_path_instances}/#{instance_id}"
end
def data_path_instance_by_id_users(instance_id)
data_path_check "#{self.data_path_instance_by_id(instance_id)}/users"
end
end
|
class Deheader < Formula
include Language::Python::Shebang
desc "Analyze C/C++ files for unnecessary headers"
homepage "http://www.catb.org/~esr/deheader"
url "http://www.catb.org/~esr/deheader/deheader-1.7.tar.gz"
sha256 "6856e4fa3efa664a0444b81c2e1f0209103be3b058455625c79abe65cf8db70d"
license "BSD-2-Clause"
revision 3
head "https://gitlab.com/esr/deheader.git"
livecheck do
url :homepage
regex(/href=.*?deheader[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 cellar: :any_skip_relocation, all: "c796513f79f19f17be962e08802c9542d0dcddbe7fffdc44e2c66538c704a325"
end
depends_on "xmlto" => :build
depends_on "python@3.10"
on_linux do
depends_on "libarchive" => :build
end
def install
ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog"
system "make"
bin.install "deheader"
man1.install "deheader.1"
rewrite_shebang detected_python_shebang, bin/"deheader"
end
test do
(testpath/"test.c").write <<~EOS
#include <stdio.h>
#include <string.h>
int main(void) {
printf("%s", "foo");
return 0;
}
EOS
assert_equal "121", shell_output("#{bin}/deheader test.c | tr -cd 0-9")
end
end
deheader: update homepage
Closes #89829.
Signed-off-by: Carlo Cabrera <3ffc397d0e4bded29cb84b56167de54c01e3a55b@users.noreply.github.com>
Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com>
class Deheader < Formula
include Language::Python::Shebang
desc "Analyze C/C++ files for unnecessary headers"
homepage "http://www.catb.org/~esr/deheader/"
url "http://www.catb.org/~esr/deheader/deheader-1.7.tar.gz"
sha256 "6856e4fa3efa664a0444b81c2e1f0209103be3b058455625c79abe65cf8db70d"
license "BSD-2-Clause"
revision 3
head "https://gitlab.com/esr/deheader.git"
livecheck do
url :homepage
regex(/href=.*?deheader[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 cellar: :any_skip_relocation, all: "c796513f79f19f17be962e08802c9542d0dcddbe7fffdc44e2c66538c704a325"
end
depends_on "xmlto" => :build
depends_on "python@3.10"
on_linux do
depends_on "libarchive" => :build
end
def install
ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog"
system "make"
bin.install "deheader"
man1.install "deheader.1"
rewrite_shebang detected_python_shebang, bin/"deheader"
end
test do
(testpath/"test.c").write <<~EOS
#include <stdio.h>
#include <string.h>
int main(void) {
printf("%s", "foo");
return 0;
}
EOS
assert_equal "121", shell_output("#{bin}/deheader test.c | tr -cd 0-9")
end
end
|
# Documentation: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md
# http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
class Devtools < Formula
desc "Containerized platform environment for projects"
homepage ""
url "https://s3.amazonaws.com/phase2.devtools/devtools-0.1.0.tar.gz"
version "0.1.0"
sha256 "919f9fc12a5b1763fb5424b513a69b2dc3dd8043a459c20bb6a008fb69d71996"
def install
bin.install "devtools"
bin.install "docker-machine-nfs.sh"
end
test do
system "#{bin}/devtools", "--version"
end
end
new devtools version
# Documentation: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md
# http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
class Devtools < Formula
desc "Containerized platform environment for projects"
homepage ""
url "https://s3.amazonaws.com/phase2.devtools/devtools-0.1.0.tar.gz"
version "0.1.0"
sha256 "7f988b7ffaaf35f88383b98bf3cb036146d708fe4c5657d9fc7b4a837729b56e"
def install
bin.install "devtools"
bin.install "docker-machine-nfs.sh"
end
test do
system "#{bin}/devtools", "--version"
end
end
|
class Disktype < Formula
desc "Detect content format of a disk or disk image"
homepage "https://disktype.sourceforge.io/"
url "https://downloads.sourceforge.net/project/disktype/disktype/9/disktype-9.tar.gz"
sha256 "b6701254d88412bc5d2db869037745f65f94b900b59184157d072f35832c1111"
license "MIT"
head "https://git.code.sf.net/p/disktype/disktype.git", branch: "master"
livecheck do
url :stable
regex(%r{url=.*?/disktype[._-]v?(\d+(?:\.\d+)*)\.t}i)
end
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "4587dd61a91f93d065f3f169b690f8f194d1177c5b3cb7a78c0edec9bc0a23a9"
sha256 cellar: :any_skip_relocation, big_sur: "06ea5af49f19f974e3d7f91f9a8e9e178f90b5e8390c59c324179773e17e21ac"
sha256 cellar: :any_skip_relocation, catalina: "6821d802c4418c949b8e3394893f03cf6152020881096b304ab0c87313fff2e3"
sha256 cellar: :any_skip_relocation, mojave: "7b401cb017bbe0f119b590839941ca7a8d77136483f651504382ed595f4280ec"
sha256 cellar: :any_skip_relocation, high_sierra: "b6212feab524e86a8fc1f3c366092af206dee279900ea2753d331b295dd22c14"
sha256 cellar: :any_skip_relocation, sierra: "18ed63d389b55d3dabb84e355323f303013acd46a1905c194b470cc74fc95e4f"
sha256 cellar: :any_skip_relocation, el_capitan: "c1f45dc2bdcec2e3b56741bf03d673f3a99534f851d1c77de59d6832d0f75236"
sha256 cellar: :any_skip_relocation, yosemite: "cc767e7be270b683021ecb2ef3dd16c77b05e9cdf34ed524c942a89514284f57"
sha256 cellar: :any_skip_relocation, x86_64_linux: "4b0dcc67cc8fee509011e50ff1299b4205b424f83ee9aedff5d97fb2e603b6bc"
end
def install
system "make"
bin.install "disktype"
man1.install "disktype.1"
end
test do
path = testpath/"foo"
path.write "1234"
output = shell_output("#{bin}/disktype #{path}")
assert_match "Regular file, size 4 bytes", output
end
end
disktype: update 9 bottle.
class Disktype < Formula
desc "Detect content format of a disk or disk image"
homepage "https://disktype.sourceforge.io/"
url "https://downloads.sourceforge.net/project/disktype/disktype/9/disktype-9.tar.gz"
sha256 "b6701254d88412bc5d2db869037745f65f94b900b59184157d072f35832c1111"
license "MIT"
head "https://git.code.sf.net/p/disktype/disktype.git", branch: "master"
livecheck do
url :stable
regex(%r{url=.*?/disktype[._-]v?(\d+(?:\.\d+)*)\.t}i)
end
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "154bd7b1f165caf396b4c1659fb1af90f8a64cfdcdf47a421d4d6ee2af32e555"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "4587dd61a91f93d065f3f169b690f8f194d1177c5b3cb7a78c0edec9bc0a23a9"
sha256 cellar: :any_skip_relocation, monterey: "edc7efe783d43679fea498893be6c511023d8ccf7d823eaf05ca57cde41202e6"
sha256 cellar: :any_skip_relocation, big_sur: "06ea5af49f19f974e3d7f91f9a8e9e178f90b5e8390c59c324179773e17e21ac"
sha256 cellar: :any_skip_relocation, catalina: "6821d802c4418c949b8e3394893f03cf6152020881096b304ab0c87313fff2e3"
sha256 cellar: :any_skip_relocation, mojave: "7b401cb017bbe0f119b590839941ca7a8d77136483f651504382ed595f4280ec"
sha256 cellar: :any_skip_relocation, high_sierra: "b6212feab524e86a8fc1f3c366092af206dee279900ea2753d331b295dd22c14"
sha256 cellar: :any_skip_relocation, sierra: "18ed63d389b55d3dabb84e355323f303013acd46a1905c194b470cc74fc95e4f"
sha256 cellar: :any_skip_relocation, el_capitan: "c1f45dc2bdcec2e3b56741bf03d673f3a99534f851d1c77de59d6832d0f75236"
sha256 cellar: :any_skip_relocation, yosemite: "cc767e7be270b683021ecb2ef3dd16c77b05e9cdf34ed524c942a89514284f57"
sha256 cellar: :any_skip_relocation, x86_64_linux: "4b0dcc67cc8fee509011e50ff1299b4205b424f83ee9aedff5d97fb2e603b6bc"
end
def install
system "make"
bin.install "disktype"
man1.install "disktype.1"
end
test do
path = testpath/"foo"
path.write "1234"
output = shell_output("#{bin}/disktype #{path}")
assert_match "Regular file, size 4 bytes", output
end
end
|
require "language/go"
class Dockward < Formula
desc "Port forwarding tool for Docker containers"
homepage "https://github.com/abiosoft/dockward"
url "https://github.com/abiosoft/dockward/archive/0.0.4.tar.gz"
sha256 "b96244386ae58aefb16177837d7d6adf3a9e6d93b75eea3308a45eb8eb9f4116"
license "Apache-2.0"
head "https://github.com/abiosoft/dockward.git"
bottle do
rebuild 1
sha256 cellar: :any_skip_relocation, arm64_big_sur: "f9f6705d78dd9d8d596d92ca7dbde056b4954fdebb467c155064bb93f7e7b063"
sha256 cellar: :any_skip_relocation, big_sur: "5287a1a8f985e8ecaba4a98eac278828e515bf4a8ba789ea68fd72a4243e8424"
sha256 cellar: :any_skip_relocation, catalina: "8abcf72ec26b59bab1b489e3233a137ebcc4a6d4bf3ccae10b7b062784d10e98"
sha256 cellar: :any_skip_relocation, mojave: "9c4eb789740a0b589faa9ccedcf3df90b6f68f1ab561806fe9aa750b91722800"
sha256 cellar: :any_skip_relocation, high_sierra: "50c2b838bbd89349e40050810a833cfea2803ac699cd006d47e796075be975b2"
sha256 cellar: :any_skip_relocation, sierra: "3dcac3afd57773d1c4b07b72f7f1bc9d66953dccccb0b3eadf7f40e43175d89b"
sha256 cellar: :any_skip_relocation, el_capitan: "b1b33f2b4db8242f9b422232d49bfde4c9b8fa0fa5053437366a9bc16795d9b5"
sha256 cellar: :any_skip_relocation, x86_64_linux: "fab443a8e40b159ebd527d32138314a928589a52dd5fbfd69c52406ad3162ad9"
end
depends_on "go" => :build
go_resource "github.com/Sirupsen/logrus" do
url "https://github.com/Sirupsen/logrus.git",
revision: "61e43dc76f7ee59a82bdf3d71033dc12bea4c77d"
end
go_resource "github.com/docker/distribution" do
url "https://github.com/docker/distribution.git",
revision: "7a0972304e201e2a5336a69d00e112c27823f554"
end
go_resource "github.com/docker/engine-api" do
url "https://github.com/docker/engine-api.git",
revision: "4290f40c056686fcaa5c9caf02eac1dde9315adf"
end
go_resource "github.com/docker/go-connections" do
url "https://github.com/docker/go-connections.git",
revision: "eb315e36415380e7c2fdee175262560ff42359da"
end
go_resource "github.com/docker/go-units" do
url "https://github.com/docker/go-units.git",
revision: "e30f1e79f3cd72542f2026ceec18d3bd67ab859c"
end
go_resource "golang.org/x/net" do
url "https://go.googlesource.com/net.git",
revision: "f2499483f923065a842d38eb4c7f1927e6fc6e6d"
end
def install
ENV["GOBIN"] = bin
ENV["GOPATH"] = buildpath
ENV["GO111MODULE"] = "auto"
(buildpath/"src/github.com/abiosoft").mkpath
ln_s buildpath, buildpath/"src/github.com/abiosoft/dockward"
Language::Go.stage_deps resources, buildpath/"src"
system "go", "install", "github.com/abiosoft/dockward"
end
test do
output = shell_output(bin/"dockward -v")
assert_match "dockward version #{version}", output
end
end
dockward: update 0.0.4 bottle.
require "language/go"
class Dockward < Formula
desc "Port forwarding tool for Docker containers"
homepage "https://github.com/abiosoft/dockward"
url "https://github.com/abiosoft/dockward/archive/0.0.4.tar.gz"
sha256 "b96244386ae58aefb16177837d7d6adf3a9e6d93b75eea3308a45eb8eb9f4116"
license "Apache-2.0"
head "https://github.com/abiosoft/dockward.git"
bottle do
rebuild 1
sha256 cellar: :any_skip_relocation, arm64_monterey: "870ce371df50c4998c78435d70b882ab21a5abb90f5bd476397433f167c893e7"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "f9f6705d78dd9d8d596d92ca7dbde056b4954fdebb467c155064bb93f7e7b063"
sha256 cellar: :any_skip_relocation, monterey: "f4ae4442fb735f9a74a0b29b666132660e7fc85a824fc467ff7d8ed8ee632bfa"
sha256 cellar: :any_skip_relocation, big_sur: "5287a1a8f985e8ecaba4a98eac278828e515bf4a8ba789ea68fd72a4243e8424"
sha256 cellar: :any_skip_relocation, catalina: "8abcf72ec26b59bab1b489e3233a137ebcc4a6d4bf3ccae10b7b062784d10e98"
sha256 cellar: :any_skip_relocation, mojave: "9c4eb789740a0b589faa9ccedcf3df90b6f68f1ab561806fe9aa750b91722800"
sha256 cellar: :any_skip_relocation, high_sierra: "50c2b838bbd89349e40050810a833cfea2803ac699cd006d47e796075be975b2"
sha256 cellar: :any_skip_relocation, sierra: "3dcac3afd57773d1c4b07b72f7f1bc9d66953dccccb0b3eadf7f40e43175d89b"
sha256 cellar: :any_skip_relocation, el_capitan: "b1b33f2b4db8242f9b422232d49bfde4c9b8fa0fa5053437366a9bc16795d9b5"
sha256 cellar: :any_skip_relocation, x86_64_linux: "fab443a8e40b159ebd527d32138314a928589a52dd5fbfd69c52406ad3162ad9"
end
depends_on "go" => :build
go_resource "github.com/Sirupsen/logrus" do
url "https://github.com/Sirupsen/logrus.git",
revision: "61e43dc76f7ee59a82bdf3d71033dc12bea4c77d"
end
go_resource "github.com/docker/distribution" do
url "https://github.com/docker/distribution.git",
revision: "7a0972304e201e2a5336a69d00e112c27823f554"
end
go_resource "github.com/docker/engine-api" do
url "https://github.com/docker/engine-api.git",
revision: "4290f40c056686fcaa5c9caf02eac1dde9315adf"
end
go_resource "github.com/docker/go-connections" do
url "https://github.com/docker/go-connections.git",
revision: "eb315e36415380e7c2fdee175262560ff42359da"
end
go_resource "github.com/docker/go-units" do
url "https://github.com/docker/go-units.git",
revision: "e30f1e79f3cd72542f2026ceec18d3bd67ab859c"
end
go_resource "golang.org/x/net" do
url "https://go.googlesource.com/net.git",
revision: "f2499483f923065a842d38eb4c7f1927e6fc6e6d"
end
def install
ENV["GOBIN"] = bin
ENV["GOPATH"] = buildpath
ENV["GO111MODULE"] = "auto"
(buildpath/"src/github.com/abiosoft").mkpath
ln_s buildpath, buildpath/"src/github.com/abiosoft/dockward"
Language::Go.stage_deps resources, buildpath/"src"
system "go", "install", "github.com/abiosoft/dockward"
end
test do
output = shell_output(bin/"dockward -v")
assert_match "dockward version #{version}", output
end
end
|
class Dos2unix < Formula
desc "Convert text between DOS, UNIX, and Mac formats"
homepage "http://waterlan.home.xs4all.nl/dos2unix.html"
url "http://waterlan.home.xs4all.nl/dos2unix/dos2unix-7.2.2.tar.gz"
mirror "https://downloads.sourceforge.net/project/dos2unix/dos2unix/7.2.2/dos2unix-7.2.2.tar.gz"
sha256 "9c23907296267fa4ea66e1ee03eb6f6229cf7b64968318d00a77076ae89c2612"
bottle do
sha256 "8987013382676381291bcd0bcfd0a36c849386daa83eb854561dd356c7345978" => :yosemite
sha256 "8966ddcab53e480003a1d3842bae29b591cacf85b256982b6198f31fe23eca11" => :mavericks
sha256 "1e97501a1880660bd4e9b92072764013ff1881c341f42034a6f06756e0ef4578" => :mountain_lion
end
devel do
url "http://waterlan.home.xs4all.nl/dos2unix/dos2unix-7.2.3-beta1.tar.gz"
sha256 "59cea39b181913532bf9e9c234a142c15e330d5eee145cd6b90f54becd6ec27b"
end
depends_on "gettext"
def install
gettext = Formula["gettext"]
system "make", "prefix=#{prefix}",
"CC=#{ENV.cc}",
"CPP=#{ENV.cc}",
"CFLAGS=#{ENV.cflags}",
"CFLAGS_OS=-I#{gettext.include}",
"LDFLAGS_EXTRA=-L#{gettext.lib} -lintl",
"install"
end
test do
# write a file with lf
path = testpath/"test.txt"
path.write "foo\nbar\n"
# unix2mac: convert lf to cr
system "#{bin}/unix2mac", path
assert_equal "foo\rbar\r", path.read
# mac2unix: convert cr to lf
system "#{bin}/mac2unix", path
assert_equal "foo\nbar\n", path.read
# unix2dos: convert lf to cr+lf
system "#{bin}/unix2dos", path
assert_equal "foo\r\nbar\r\n", path.read
# dos2unix: convert cr+lf to lf
system "#{bin}/dos2unix", path
assert_equal "foo\nbar\n", path.read
end
end
dos2unix: make gettext optional
Closes Homebrew/homebrew#41230.
Signed-off-by: Dominyk Tiller <53e438f55903875d07efdd98a8aaf887e7208dd3@gmail.com>
class Dos2unix < Formula
desc "Convert text between DOS, UNIX, and Mac formats"
homepage "http://waterlan.home.xs4all.nl/dos2unix.html"
url "http://waterlan.home.xs4all.nl/dos2unix/dos2unix-7.2.2.tar.gz"
mirror "https://downloads.sourceforge.net/project/dos2unix/dos2unix/7.2.2/dos2unix-7.2.2.tar.gz"
sha256 "9c23907296267fa4ea66e1ee03eb6f6229cf7b64968318d00a77076ae89c2612"
bottle do
sha256 "8987013382676381291bcd0bcfd0a36c849386daa83eb854561dd356c7345978" => :yosemite
sha256 "8966ddcab53e480003a1d3842bae29b591cacf85b256982b6198f31fe23eca11" => :mavericks
sha256 "1e97501a1880660bd4e9b92072764013ff1881c341f42034a6f06756e0ef4578" => :mountain_lion
end
devel do
url "http://waterlan.home.xs4all.nl/dos2unix/dos2unix-7.2.3-beta1.tar.gz"
sha256 "59cea39b181913532bf9e9c234a142c15e330d5eee145cd6b90f54becd6ec27b"
end
option "with-gettext", "Build with Native Language Support"
depends_on "gettext" => :optional
def install
args = %W[
prefix=#{prefix}
CC=#{ENV.cc}
CPP=#{ENV.cc}
CFLAGS=#{ENV.cflags}
install
]
if build.without? "gettext"
args << "ENABLE_NLS="
else
gettext = Formula["gettext"]
args << "CFLAGS_OS=-I#{gettext.include}"
args << "LDFLAGS_EXTRA=-L#{gettext.lib} -lintl"
end
system "make", *args
end
test do
# write a file with lf
path = testpath/"test.txt"
path.write "foo\nbar\n"
# unix2mac: convert lf to cr
system "#{bin}/unix2mac", path
assert_equal "foo\rbar\r", path.read
# mac2unix: convert cr to lf
system "#{bin}/mac2unix", path
assert_equal "foo\nbar\n", path.read
# unix2dos: convert lf to cr+lf
system "#{bin}/unix2dos", path
assert_equal "foo\r\nbar\r\n", path.read
# dos2unix: convert cr+lf to lf
system "#{bin}/dos2unix", path
assert_equal "foo\nbar\n", path.read
end
end
|
class Dropbear < Formula
desc "Small SSH server/client for POSIX-based system"
homepage "https://matt.ucc.asn.au/dropbear/dropbear.html"
url "https://matt.ucc.asn.au/dropbear/releases/dropbear-2019.78.tar.bz2"
sha256 "525965971272270995364a0eb01f35180d793182e63dd0b0c3eb0292291644a4"
bottle do
cellar :any_skip_relocation
sha256 "79774d3d1443ba9e55da281832fdf29c03f7ddf1784de64bc3606c6c36f644d4" => :catalina
sha256 "0d7b0c71af63164d1024f4b2b21696a32a3e830de04647bec5bd4d8b602b82a4" => :mojave
sha256 "e8d134ecfb0b2d07d2ec0fe45bf0196b07795d4e96e87d97eda85f67e012c185" => :high_sierra
sha256 "705e3d23cb78f0dcd9f7bef085d9887823133f1f1e219a6af544a09d339c8616" => :sierra
end
head do
url "https://github.com/mkj/dropbear.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
end
def install
ENV.deparallelize
if build.head?
system "autoconf"
system "autoheader"
end
system "./configure", "--prefix=#{prefix}",
"--enable-pam",
"--enable-zlib",
"--enable-bundled-libtom",
"--sysconfdir=#{etc}/dropbear"
system "make"
system "make", "install"
end
test do
testfile = testpath/"testec521"
system "#{bin}/dbclient", "-h"
system "#{bin}/dropbearkey", "-t", "ecdsa", "-f", testfile, "-s", "521"
assert_predicate testfile, :exist?
end
end
dropbear 2020.79
Closes #56396.
Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com>
class Dropbear < Formula
desc "Small SSH server/client for POSIX-based system"
homepage "https://matt.ucc.asn.au/dropbear/dropbear.html"
url "https://matt.ucc.asn.au/dropbear/releases/dropbear-2020.79.tar.bz2"
sha256 "084f00546b1610a3422a0773e2c04cbe1a220d984209e033b548b49f379cc441"
bottle do
cellar :any_skip_relocation
sha256 "79774d3d1443ba9e55da281832fdf29c03f7ddf1784de64bc3606c6c36f644d4" => :catalina
sha256 "0d7b0c71af63164d1024f4b2b21696a32a3e830de04647bec5bd4d8b602b82a4" => :mojave
sha256 "e8d134ecfb0b2d07d2ec0fe45bf0196b07795d4e96e87d97eda85f67e012c185" => :high_sierra
sha256 "705e3d23cb78f0dcd9f7bef085d9887823133f1f1e219a6af544a09d339c8616" => :sierra
end
head do
url "https://github.com/mkj/dropbear.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
end
def install
ENV.deparallelize
if build.head?
system "autoconf"
system "autoheader"
end
system "./configure", "--prefix=#{prefix}",
"--enable-pam",
"--enable-zlib",
"--enable-bundled-libtom",
"--sysconfdir=#{etc}/dropbear"
system "make"
system "make", "install"
end
test do
testfile = testpath/"testec521"
system "#{bin}/dbclient", "-h"
system "#{bin}/dropbearkey", "-t", "ecdsa", "-f", testfile, "-s", "521"
assert_predicate testfile, :exist?
end
end
|
class Einstein < Formula
desc "Remake of the old DOS game Sherlock"
homepage "https://web.archive.org/web/20120621005109/games.flowix.com/en/index.html"
url "https://web.archive.org/web/20120621005109/games.flowix.com/files/einstein/einstein-2.0-src.tar.gz"
sha256 "0f2d1c7d46d36f27a856b98cd4bbb95813970c8e803444772be7bd9bec45a548"
bottle do
rebuild 1
sha256 cellar: :any, arm64_big_sur: "68cfd59e5ded3c4b91f81edf0e3b2d0c99822025b6828cc710216d5923bb49b2"
sha256 cellar: :any, big_sur: "a3e0ddd14989c54fb03fe46c3f1b4ab37b8f2c882add23348041d19036d3fde3"
sha256 cellar: :any, catalina: "7407f84e2b5f164daba38e36654bc0254b3b9094e4e499e1346a4d94943b38de"
sha256 cellar: :any, mojave: "df8d532f00641727e29c50e3fc47ea52c9e8c1d1e98909922267bd71dad5d1a3"
end
depends_on "sdl"
depends_on "sdl_mixer"
depends_on "sdl_ttf"
# Fixes a cast error on compilation
patch :p0 do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/85fa66a9/einstein/2.0.patch"
sha256 "c538ccb769c53aee4555ed6514c287444193290889853e1b53948a2cac7baf11"
end
def install
system "make", "PREFIX=#{HOMEBREW_PREFIX}"
bin.install "einstein"
(pkgshare/"res").install "einstein.res"
end
end
einstein: update 2.0 bottle.
class Einstein < Formula
desc "Remake of the old DOS game Sherlock"
homepage "https://web.archive.org/web/20120621005109/games.flowix.com/en/index.html"
url "https://web.archive.org/web/20120621005109/games.flowix.com/files/einstein/einstein-2.0-src.tar.gz"
sha256 "0f2d1c7d46d36f27a856b98cd4bbb95813970c8e803444772be7bd9bec45a548"
bottle do
rebuild 1
sha256 cellar: :any, arm64_monterey: "724fc0ba32697d2b2545555909c6d906921ac9b35ba6a2ff00734a0b74213837"
sha256 cellar: :any, arm64_big_sur: "68cfd59e5ded3c4b91f81edf0e3b2d0c99822025b6828cc710216d5923bb49b2"
sha256 cellar: :any, monterey: "04c7104f132a50ba1071db74a9444dd0f5b5a8907a6794ffd9a03a0a5fb62a74"
sha256 cellar: :any, big_sur: "a3e0ddd14989c54fb03fe46c3f1b4ab37b8f2c882add23348041d19036d3fde3"
sha256 cellar: :any, catalina: "7407f84e2b5f164daba38e36654bc0254b3b9094e4e499e1346a4d94943b38de"
sha256 cellar: :any, mojave: "df8d532f00641727e29c50e3fc47ea52c9e8c1d1e98909922267bd71dad5d1a3"
end
depends_on "sdl"
depends_on "sdl_mixer"
depends_on "sdl_ttf"
# Fixes a cast error on compilation
patch :p0 do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/85fa66a9/einstein/2.0.patch"
sha256 "c538ccb769c53aee4555ed6514c287444193290889853e1b53948a2cac7baf11"
end
def install
system "make", "PREFIX=#{HOMEBREW_PREFIX}"
bin.install "einstein"
(pkgshare/"res").install "einstein.res"
end
end
|
class Ethereum < Formula
desc "Official Go implementation of the Ethereum protocol"
homepage "https://ethereum.github.io/go-ethereum/"
url "https://github.com/ethereum/go-ethereum/archive/v1.9.15.tar.gz"
sha256 "805b896f4055b8e1b7a295608e2135f93e45f75ce821eb07beaf2acd2e24acc8"
head "https://github.com/ethereum/go-ethereum.git"
bottle do
cellar :any_skip_relocation
sha256 "2f1d5e71008da3e3b306ea1fa8ff7c17d755ae2b070f2739e84c9e1fffb31539" => :catalina
sha256 "5d8d5010770b8955b93ee47085b0f7a6167431d26d34c7b95b8d5110742f1c57" => :mojave
sha256 "74dcb4d34eb330406b425af319598f3066f19ee3af7cece2b809459cc70d5e36" => :high_sierra
end
depends_on "go" => :build
def install
ENV.O0 unless OS.mac? # See https://github.com/golang/go/issues/26487
system "make", "all"
bin.install Dir["build/bin/*"]
end
test do
(testpath/"genesis.json").write <<~EOS
{
"config": {
"homesteadBlock": 10
},
"nonce": "0",
"difficulty": "0x20000",
"mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578",
"coinbase": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x",
"gasLimit": "0x2FEFD8",
"alloc": {}
}
EOS
system "#{bin}/geth", "--datadir", "testchain", "init", "genesis.json"
assert_predicate testpath/"testchain/geth/chaindata/000001.log", :exist?,
"Failed to create log file"
end
end
ethereum: update 1.9.15 bottle.
class Ethereum < Formula
desc "Official Go implementation of the Ethereum protocol"
homepage "https://ethereum.github.io/go-ethereum/"
url "https://github.com/ethereum/go-ethereum/archive/v1.9.15.tar.gz"
sha256 "805b896f4055b8e1b7a295608e2135f93e45f75ce821eb07beaf2acd2e24acc8"
head "https://github.com/ethereum/go-ethereum.git"
bottle do
cellar :any_skip_relocation
sha256 "2f1d5e71008da3e3b306ea1fa8ff7c17d755ae2b070f2739e84c9e1fffb31539" => :catalina
sha256 "5d8d5010770b8955b93ee47085b0f7a6167431d26d34c7b95b8d5110742f1c57" => :mojave
sha256 "74dcb4d34eb330406b425af319598f3066f19ee3af7cece2b809459cc70d5e36" => :high_sierra
sha256 "1d27c3678faf3bd9ab6a6cf450f5b55400bd49eb83e2e9254516c19a5afb2cce" => :x86_64_linux
end
depends_on "go" => :build
def install
ENV.O0 unless OS.mac? # See https://github.com/golang/go/issues/26487
system "make", "all"
bin.install Dir["build/bin/*"]
end
test do
(testpath/"genesis.json").write <<~EOS
{
"config": {
"homesteadBlock": 10
},
"nonce": "0",
"difficulty": "0x20000",
"mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578",
"coinbase": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x",
"gasLimit": "0x2FEFD8",
"alloc": {}
}
EOS
system "#{bin}/geth", "--datadir", "testchain", "init", "genesis.json"
assert_predicate testpath/"testchain/geth/chaindata/000001.log", :exist?,
"Failed to create log file"
end
end
|
class Ethereum < Formula
desc "Official Go implementation of the Ethereum protocol"
homepage "https://geth.ethereum.org/"
url "https://github.com/ethereum/go-ethereum/archive/v1.10.8.tar.gz"
sha256 "d3bafdb34958463a2169eb93d8d106ae0ed3a29f2e1d42d8d3227806c9dc9bee"
license "LGPL-3.0-or-later"
head "https://github.com/ethereum/go-ethereum.git"
livecheck do
url :stable
strategy :github_latest
end
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "09edd31847cbcc3bd080134a289e69fffd931c9d1caf5fb0f03561c0787e7da5"
sha256 cellar: :any_skip_relocation, big_sur: "e4cc07a6b9f3ea0312d6a18c14a31aca03e9d71ef804b2699e0649900ca8b3b1"
sha256 cellar: :any_skip_relocation, catalina: "3b81f6ac21a65419a51feb474c2e816df2158d9699fde426f8767d4e9128342e"
sha256 cellar: :any_skip_relocation, mojave: "ac19938b0a69af4311b3ed66909d84a43cd000c2b602bc69a0a795de28f9f7e5"
sha256 cellar: :any_skip_relocation, x86_64_linux: "f02de0f38664ee2ea38d46bc97c852bad878215454dd9c0e8106deed73d9214d"
end
depends_on "go" => :build
def install
# See https://github.com/golang/go/issues/26487
ENV.O0 if OS.linux?
system "make", "all"
bin.install Dir["build/bin/*"]
end
test do
(testpath/"genesis.json").write <<~EOS
{
"config": {
"homesteadBlock": 10
},
"nonce": "0",
"difficulty": "0x20000",
"mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578",
"coinbase": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x",
"gasLimit": "0x2FEFD8",
"alloc": {}
}
EOS
system "#{bin}/geth", "--datadir", "testchain", "init", "genesis.json"
assert_predicate testpath/"testchain/geth/chaindata/000001.log", :exist?,
"Failed to create log file"
end
end
ethereum 1.10.9
Closes #86146.
Signed-off-by: Branch Vincent <0e6296586cbd330121a33cee359d4396296e2ead@users.noreply.github.com>
Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com>
class Ethereum < Formula
desc "Official Go implementation of the Ethereum protocol"
homepage "https://geth.ethereum.org/"
url "https://github.com/ethereum/go-ethereum/archive/v1.10.9.tar.gz"
sha256 "063eac713c002f0978a984c050ab38b1d39d17432505bad21c68cd83b8c30063"
license "LGPL-3.0-or-later"
head "https://github.com/ethereum/go-ethereum.git"
livecheck do
url :stable
strategy :github_latest
end
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "09edd31847cbcc3bd080134a289e69fffd931c9d1caf5fb0f03561c0787e7da5"
sha256 cellar: :any_skip_relocation, big_sur: "e4cc07a6b9f3ea0312d6a18c14a31aca03e9d71ef804b2699e0649900ca8b3b1"
sha256 cellar: :any_skip_relocation, catalina: "3b81f6ac21a65419a51feb474c2e816df2158d9699fde426f8767d4e9128342e"
sha256 cellar: :any_skip_relocation, mojave: "ac19938b0a69af4311b3ed66909d84a43cd000c2b602bc69a0a795de28f9f7e5"
sha256 cellar: :any_skip_relocation, x86_64_linux: "f02de0f38664ee2ea38d46bc97c852bad878215454dd9c0e8106deed73d9214d"
end
depends_on "go" => :build
def install
# See https://github.com/golang/go/issues/26487
ENV.O0 if OS.linux?
system "make", "all"
bin.install Dir["build/bin/*"]
end
test do
(testpath/"genesis.json").write <<~EOS
{
"config": {
"homesteadBlock": 10
},
"nonce": "0",
"difficulty": "0x20000",
"mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578",
"coinbase": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x",
"gasLimit": "0x2FEFD8",
"alloc": {}
}
EOS
system "#{bin}/geth", "--datadir", "testchain", "init", "genesis.json"
assert_predicate testpath/"testchain/geth/chaindata/000001.log", :exist?,
"Failed to create log file"
end
end
|
class Exiftool < Formula
desc "Perl lib for reading and writing EXIF metadata"
homepage "https://exiftool.org"
# Ensure release is tagged production before submitting.
# https://exiftool.org/history.html
url "https://exiftool.org/Image-ExifTool-12.15.tar.gz"
sha256 "02e07fae4070c6bf7cdeb91075f783fea17c766b7caa23e6834e8bba424551b9"
license any_of: ["Artistic-1.0-Perl", "GPL-1.0-or-later"]
livecheck do
url "https://exiftool.org/history.html"
regex(/production release is.*?href=.*?Image[._-]ExifTool[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
cellar :any_skip_relocation
sha256 "460e9669b490c7eb499fe22a79a61af24274b29f8ed30630f3066b5bafc78569" => :big_sur
sha256 "c3f82fb1ef904fdfda38001924c9a0e4c1ad97f14cee34982cf2b36c2db80a58" => :arm64_big_sur
sha256 "b21f5d6bdf69f77fba7803b27eaf24c8f564503a192774ed4cf0c6bf259052b0" => :catalina
sha256 "fca252c42eec5f3a026668e9e96997c57d4ce5cc4a8bfd3a844f8016fe7bc41e" => :mojave
end
def install
# replace the hard-coded path to the lib directory
inreplace "exiftool", "$1/lib", libexec/"lib"
system "perl", "Makefile.PL"
system "make", "all"
libexec.install "lib"
bin.install "exiftool"
doc.install Dir["html/*"]
man1.install "blib/man1/exiftool.1"
man3.install Dir["blib/man3/*"]
end
test do
test_image = test_fixtures("test.jpg")
assert_match %r{MIME Type\s+: image/jpeg},
shell_output("#{bin}/exiftool #{test_image}")
end
end
exiftool 12.16
Closes #69544.
Signed-off-by: Carlo Cabrera <3ffc397d0e4bded29cb84b56167de54c01e3a55b@users.noreply.github.com>
Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com>
class Exiftool < Formula
desc "Perl lib for reading and writing EXIF metadata"
homepage "https://exiftool.org"
# Ensure release is tagged production before submitting.
# https://exiftool.org/history.html
url "https://exiftool.org/Image-ExifTool-12.16.tar.gz"
sha256 "c140797d72acdaf04f7ce0629867353510b56fbe99ceaac0742bbc379610756a"
license any_of: ["Artistic-1.0-Perl", "GPL-1.0-or-later"]
livecheck do
url "https://exiftool.org/history.html"
regex(/production release is.*?href=.*?Image[._-]ExifTool[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
cellar :any_skip_relocation
sha256 "460e9669b490c7eb499fe22a79a61af24274b29f8ed30630f3066b5bafc78569" => :big_sur
sha256 "c3f82fb1ef904fdfda38001924c9a0e4c1ad97f14cee34982cf2b36c2db80a58" => :arm64_big_sur
sha256 "b21f5d6bdf69f77fba7803b27eaf24c8f564503a192774ed4cf0c6bf259052b0" => :catalina
sha256 "fca252c42eec5f3a026668e9e96997c57d4ce5cc4a8bfd3a844f8016fe7bc41e" => :mojave
end
def install
# replace the hard-coded path to the lib directory
inreplace "exiftool", "$1/lib", libexec/"lib"
system "perl", "Makefile.PL"
system "make", "all"
libexec.install "lib"
bin.install "exiftool"
doc.install Dir["html/*"]
man1.install "blib/man1/exiftool.1"
man3.install Dir["blib/man3/*"]
end
test do
test_image = test_fixtures("test.jpg")
assert_match %r{MIME Type\s+: image/jpeg},
shell_output("#{bin}/exiftool #{test_image}")
end
end
|
class Ext4fuse < Formula
desc "Read-only implementation of ext4 for FUSE"
homepage "https://github.com/gerard/ext4fuse"
url "https://github.com/gerard/ext4fuse/archive/v0.1.3.tar.gz"
sha256 "550f1e152c4de7d4ea517ee1c708f57bfebb0856281c508511419db45aa3ca9f"
license "GPL-2.0"
head "https://github.com/gerard/ext4fuse.git"
bottle do
sha256 cellar: :any, catalina: "446dde5e84b058966ead0cde5e38e9411f465732527f6decfa1c0dcdbd4abbef"
sha256 cellar: :any, mojave: "88c4918bf5218f99295e539fe4499152edb3b60b6659e44ddd68b22359f512ae"
sha256 cellar: :any, high_sierra: "fc69c8993afd0ffc16a73c9c036ca8f83c77ac2a19b3237f76f9ccee8b30bbc9"
sha256 cellar: :any, sierra: "fe8bbe7cd5362f00ff06ef750926bf349d60563c20b0ecf212778631c8912ba2"
sha256 cellar: :any, el_capitan: "291047c821b7b205d85be853fb005510c6ab01bd4c2a2193c192299b6f049d35"
sha256 cellar: :any, yosemite: "b11f564b7e7c08af0b0a3e9854973d39809bf2d8a56014f4882772b2f7307ac1"
end
depends_on "pkg-config" => :build
on_macos do
disable! date: "2021-04-08", because: "requires FUSE"
end
on_linux do
depends_on "libfuse"
end
def install
system "make"
bin.install "ext4fuse"
end
end
ext4fuse: add macOS FUSE rejection info
class Ext4fuse < Formula
desc "Read-only implementation of ext4 for FUSE"
homepage "https://github.com/gerard/ext4fuse"
url "https://github.com/gerard/ext4fuse/archive/v0.1.3.tar.gz"
sha256 "550f1e152c4de7d4ea517ee1c708f57bfebb0856281c508511419db45aa3ca9f"
license "GPL-2.0"
head "https://github.com/gerard/ext4fuse.git"
bottle do
sha256 cellar: :any, catalina: "446dde5e84b058966ead0cde5e38e9411f465732527f6decfa1c0dcdbd4abbef"
sha256 cellar: :any, mojave: "88c4918bf5218f99295e539fe4499152edb3b60b6659e44ddd68b22359f512ae"
sha256 cellar: :any, high_sierra: "fc69c8993afd0ffc16a73c9c036ca8f83c77ac2a19b3237f76f9ccee8b30bbc9"
sha256 cellar: :any, sierra: "fe8bbe7cd5362f00ff06ef750926bf349d60563c20b0ecf212778631c8912ba2"
sha256 cellar: :any, el_capitan: "291047c821b7b205d85be853fb005510c6ab01bd4c2a2193c192299b6f049d35"
sha256 cellar: :any, yosemite: "b11f564b7e7c08af0b0a3e9854973d39809bf2d8a56014f4882772b2f7307ac1"
end
depends_on "pkg-config" => :build
on_macos do
disable! date: "2021-04-08", because: "requires closed-source macFUSE"
end
on_linux do
depends_on "libfuse"
end
def install
system "make"
bin.install "ext4fuse"
end
def caveats
on_macos do
<<~EOS
The reasons for disabling this formula can be found here:
https://github.com/Homebrew/homebrew-core/pull/64491
An external tap may provide a replacement formula. See:
https://docs.brew.sh/Interesting-Taps-and-Forks
EOS
end
end
end
|
class FaasCli < Formula
desc "CLI for templating and/or deploying FaaS functions"
homepage "https://www.openfaas.com/"
url "https://github.com/openfaas/faas-cli.git",
tag: "0.12.20",
revision: "e53b9c46b4ea7391aef71cd165b0c871fecb3543"
license "MIT"
livecheck do
url :stable
strategy :github_latest
end
bottle do
cellar :any_skip_relocation
sha256 "b3ca61ed727c74736adfb9f24124b4005286dfd70b70762b5e01e0e8aa799779" => :big_sur
sha256 "c3367e1eb3f7bd284e538c82977c358db1b3a26ad323628265a403b76335ee42" => :catalina
sha256 "2cccad05207a43fd7096875aa432f35c8093242b80c6b15e90d5e05846db889a" => :mojave
end
depends_on "go" => :build
def install
ENV["XC_OS"] = "darwin"
ENV["XC_ARCH"] = "amd64"
project = "github.com/openfaas/faas-cli"
commit = Utils.safe_popen_read("git", "rev-parse", "HEAD").chomp
system "go", "build", "-ldflags",
"-s -w -X #{project}/version.GitCommit=#{commit} -X #{project}/version.Version=#{version}", "-a",
"-installsuffix", "cgo", "-o", bin/"faas-cli"
bin.install_symlink "faas-cli" => "faas"
end
test do
require "socket"
server = TCPServer.new("localhost", 0)
port = server.addr[1]
pid = fork do
loop do
socket = server.accept
response = "OK"
socket.print "HTTP/1.1 200 OK\r\n" \
"Content-Length: #{response.bytesize}\r\n" \
"Connection: close\r\n"
socket.print "\r\n"
socket.print response
socket.close
end
end
(testpath/"test.yml").write <<~EOS
provider:
name: openfaas
gateway: https://localhost:#{port}
network: "func_functions"
functions:
dummy_function:
lang: python
handler: ./dummy_function
image: dummy_image
EOS
begin
output = shell_output("#{bin}/faas-cli deploy --tls-no-verify -yaml test.yml 2>&1", 1)
assert_match "stat ./template/python/template.yml", output
assert_match "ruby", shell_output("#{bin}/faas-cli template pull 2>&1")
assert_match "node", shell_output("#{bin}/faas-cli new --list")
output = shell_output("#{bin}/faas-cli deploy --tls-no-verify -yaml test.yml", 1)
assert_match "Deploying: dummy_function.", output
stable_resource = stable.instance_variable_get(:@resource)
commit = stable_resource.instance_variable_get(:@specs)[:revision]
faas_cli_version = shell_output("#{bin}/faas-cli version")
assert_match /\s#{commit}$/, faas_cli_version
assert_match /\s#{version}$/, faas_cli_version
ensure
Process.kill("TERM", pid)
Process.wait(pid)
end
end
end
faas-cli: update 0.12.20 bottle.
class FaasCli < Formula
desc "CLI for templating and/or deploying FaaS functions"
homepage "https://www.openfaas.com/"
url "https://github.com/openfaas/faas-cli.git",
tag: "0.12.20",
revision: "e53b9c46b4ea7391aef71cd165b0c871fecb3543"
license "MIT"
livecheck do
url :stable
strategy :github_latest
end
bottle do
cellar :any_skip_relocation
sha256 "9c6b36a4a893575b4c5320203343b35388acdfce24840c1dbe612a1e7e22cde2" => :big_sur
sha256 "8a84663868782a9f0a672f645926a656830d65c612aee162d7aaf187297ebfd3" => :catalina
sha256 "896c3d82cc1202833f9e481fab8bee04e72855c649f20cd7981596eae9b0046c" => :mojave
end
depends_on "go" => :build
def install
ENV["XC_OS"] = "darwin"
ENV["XC_ARCH"] = "amd64"
project = "github.com/openfaas/faas-cli"
commit = Utils.safe_popen_read("git", "rev-parse", "HEAD").chomp
system "go", "build", "-ldflags",
"-s -w -X #{project}/version.GitCommit=#{commit} -X #{project}/version.Version=#{version}", "-a",
"-installsuffix", "cgo", "-o", bin/"faas-cli"
bin.install_symlink "faas-cli" => "faas"
end
test do
require "socket"
server = TCPServer.new("localhost", 0)
port = server.addr[1]
pid = fork do
loop do
socket = server.accept
response = "OK"
socket.print "HTTP/1.1 200 OK\r\n" \
"Content-Length: #{response.bytesize}\r\n" \
"Connection: close\r\n"
socket.print "\r\n"
socket.print response
socket.close
end
end
(testpath/"test.yml").write <<~EOS
provider:
name: openfaas
gateway: https://localhost:#{port}
network: "func_functions"
functions:
dummy_function:
lang: python
handler: ./dummy_function
image: dummy_image
EOS
begin
output = shell_output("#{bin}/faas-cli deploy --tls-no-verify -yaml test.yml 2>&1", 1)
assert_match "stat ./template/python/template.yml", output
assert_match "ruby", shell_output("#{bin}/faas-cli template pull 2>&1")
assert_match "node", shell_output("#{bin}/faas-cli new --list")
output = shell_output("#{bin}/faas-cli deploy --tls-no-verify -yaml test.yml", 1)
assert_match "Deploying: dummy_function.", output
stable_resource = stable.instance_variable_get(:@resource)
commit = stable_resource.instance_variable_get(:@specs)[:revision]
faas_cli_version = shell_output("#{bin}/faas-cli version")
assert_match /\s#{commit}$/, faas_cli_version
assert_match /\s#{version}$/, faas_cli_version
ensure
Process.kill("TERM", pid)
Process.wait(pid)
end
end
end
|
class FaasCli < Formula
desc "CLI for templating and/or deploying FaaS functions"
homepage "https://docs.get-faas.com/"
url "https://github.com/openfaas/faas-cli.git",
:tag => "0.8.9",
:revision => "c9c4be99c808c352e9fdf73ffe1659cec1d2a7cf"
bottle do
cellar :any_skip_relocation
sha256 "610662e2ec24ffebd83090522d110859c1e812d01787eb14e1ca316e4bc435b5" => :mojave
sha256 "de49968b8b6ea48d93137547bdbf3d4d202ee73b0958fe04b37be472276f2629" => :high_sierra
sha256 "aa03fac64cb4350e6164116b9ac6782c4bd218948c50867b7e3903f167e1024c" => :sierra
end
depends_on "go" => :build
def install
ENV["XC_OS"] = "darwin"
ENV["XC_ARCH"] = "amd64"
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/openfaas/faas-cli").install buildpath.children
cd "src/github.com/openfaas/faas-cli" do
project = "github.com/openfaas/faas-cli"
commit = Utils.popen_read("git", "rev-parse", "HEAD").chomp
system "go", "build", "-ldflags",
"-s -w -X #{project}/version.GitCommit=#{commit} -X #{project}/version.Version=#{version}", "-a",
"-installsuffix", "cgo", "-o", bin/"faas-cli"
bin.install_symlink "faas-cli" => "faas"
prefix.install_metafiles
end
end
test do
require "socket"
server = TCPServer.new("localhost", 0)
port = server.addr[1]
pid = fork do
loop do
socket = server.accept
response = "OK"
socket.print "HTTP/1.1 200 OK\r\n" \
"Content-Length: #{response.bytesize}\r\n" \
"Connection: close\r\n"
socket.print "\r\n"
socket.print response
socket.close
end
end
(testpath/"test.yml").write <<~EOS
provider:
name: faas
gateway: http://localhost:#{port}
network: "func_functions"
functions:
dummy_function:
lang: python
handler: ./dummy_function
image: dummy_image
EOS
begin
output = shell_output("#{bin}/faas-cli deploy -yaml test.yml 2>&1", 1)
assert_match "stat ./template/python/template.yml", output
assert_match "ruby", shell_output("#{bin}/faas-cli template pull 2>&1")
assert_match "node", shell_output("#{bin}/faas-cli new --list")
output = shell_output("#{bin}/faas-cli deploy -yaml test.yml")
assert_match "Function dummy_function already exists, attempting rolling-update", output
assert_match "Deployed. 200 OK", output
stable_resource = stable.instance_variable_get(:@resource)
commit = stable_resource.instance_variable_get(:@specs)[:revision]
faas_cli_version = shell_output("#{bin}/faas-cli version")
assert_match /\s#{commit}$/, faas_cli_version
assert_match /\s#{version}$/, faas_cli_version
ensure
Process.kill("TERM", pid)
Process.wait(pid)
end
end
end
faas-cli: update 0.8.9 bottle.
class FaasCli < Formula
desc "CLI for templating and/or deploying FaaS functions"
homepage "https://docs.get-faas.com/"
url "https://github.com/openfaas/faas-cli.git",
:tag => "0.8.9",
:revision => "c9c4be99c808c352e9fdf73ffe1659cec1d2a7cf"
bottle do
cellar :any_skip_relocation
sha256 "f655efb8da637092c361cf89c4775b41d094ba215e6e581c583f12b2d344a184" => :mojave
sha256 "867619e84518c80ce90fd3dcbd47fd5531a1701c5ae06d84e8d96551925e8df0" => :high_sierra
sha256 "3e23c25cfe53fafe822c128862b01a60ad67098ecb02153130b7a194e4069275" => :sierra
end
depends_on "go" => :build
def install
ENV["XC_OS"] = "darwin"
ENV["XC_ARCH"] = "amd64"
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/openfaas/faas-cli").install buildpath.children
cd "src/github.com/openfaas/faas-cli" do
project = "github.com/openfaas/faas-cli"
commit = Utils.popen_read("git", "rev-parse", "HEAD").chomp
system "go", "build", "-ldflags",
"-s -w -X #{project}/version.GitCommit=#{commit} -X #{project}/version.Version=#{version}", "-a",
"-installsuffix", "cgo", "-o", bin/"faas-cli"
bin.install_symlink "faas-cli" => "faas"
prefix.install_metafiles
end
end
test do
require "socket"
server = TCPServer.new("localhost", 0)
port = server.addr[1]
pid = fork do
loop do
socket = server.accept
response = "OK"
socket.print "HTTP/1.1 200 OK\r\n" \
"Content-Length: #{response.bytesize}\r\n" \
"Connection: close\r\n"
socket.print "\r\n"
socket.print response
socket.close
end
end
(testpath/"test.yml").write <<~EOS
provider:
name: faas
gateway: http://localhost:#{port}
network: "func_functions"
functions:
dummy_function:
lang: python
handler: ./dummy_function
image: dummy_image
EOS
begin
output = shell_output("#{bin}/faas-cli deploy -yaml test.yml 2>&1", 1)
assert_match "stat ./template/python/template.yml", output
assert_match "ruby", shell_output("#{bin}/faas-cli template pull 2>&1")
assert_match "node", shell_output("#{bin}/faas-cli new --list")
output = shell_output("#{bin}/faas-cli deploy -yaml test.yml")
assert_match "Function dummy_function already exists, attempting rolling-update", output
assert_match "Deployed. 200 OK", output
stable_resource = stable.instance_variable_get(:@resource)
commit = stable_resource.instance_variable_get(:@specs)[:revision]
faas_cli_version = shell_output("#{bin}/faas-cli version")
assert_match /\s#{commit}$/, faas_cli_version
assert_match /\s#{version}$/, faas_cli_version
ensure
Process.kill("TERM", pid)
Process.wait(pid)
end
end
end
|
class FaasCli < Formula
desc "CLI for templating and/or deploying FaaS functions"
homepage "https://docs.get-faas.com/"
url "https://github.com/openfaas/faas-cli.git",
:tag => "0.8.15",
:revision => "b67ba3a3cfe319c402cffb923855bb81f0df9110"
bottle do
cellar :any_skip_relocation
sha256 "8cf0c8af54e05c781edbf4f2227f8331f34faeda8df3538d9e9899c0bcef86c5" => :mojave
sha256 "4349270e415fdf948767b8edc4da335fc3d0d9328958d0961840a1844e773e2b" => :high_sierra
sha256 "3b929a4f807ae301928df48aa97e9710b8a8e4f9949bd745c5af8d3c95faf5a6" => :sierra
end
depends_on "go" => :build
def install
ENV["XC_OS"] = "darwin"
ENV["XC_ARCH"] = "amd64"
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/openfaas/faas-cli").install buildpath.children
cd "src/github.com/openfaas/faas-cli" do
project = "github.com/openfaas/faas-cli"
commit = Utils.popen_read("git", "rev-parse", "HEAD").chomp
system "go", "build", "-ldflags",
"-s -w -X #{project}/version.GitCommit=#{commit} -X #{project}/version.Version=#{version}", "-a",
"-installsuffix", "cgo", "-o", bin/"faas-cli"
bin.install_symlink "faas-cli" => "faas"
prefix.install_metafiles
end
end
test do
require "socket"
server = TCPServer.new("localhost", 0)
port = server.addr[1]
pid = fork do
loop do
socket = server.accept
response = "OK"
socket.print "HTTP/1.1 200 OK\r\n" \
"Content-Length: #{response.bytesize}\r\n" \
"Connection: close\r\n"
socket.print "\r\n"
socket.print response
socket.close
end
end
(testpath/"test.yml").write <<~EOS
provider:
name: faas
gateway: http://localhost:#{port}
network: "func_functions"
functions:
dummy_function:
lang: python
handler: ./dummy_function
image: dummy_image
EOS
begin
output = shell_output("#{bin}/faas-cli deploy -yaml test.yml 2>&1", 1)
assert_match "stat ./template/python/template.yml", output
assert_match "ruby", shell_output("#{bin}/faas-cli template pull 2>&1")
assert_match "node", shell_output("#{bin}/faas-cli new --list")
output = shell_output("#{bin}/faas-cli deploy -yaml test.yml")
assert_match "Function dummy_function already exists, attempting rolling-update", output
assert_match "Deployed. 200 OK", output
stable_resource = stable.instance_variable_get(:@resource)
commit = stable_resource.instance_variable_get(:@specs)[:revision]
faas_cli_version = shell_output("#{bin}/faas-cli version")
assert_match /\s#{commit}$/, faas_cli_version
assert_match /\s#{version}$/, faas_cli_version
ensure
Process.kill("TERM", pid)
Process.wait(pid)
end
end
end
faas-cli 0.8.17
Closes #41357.
Signed-off-by: FX Coudert <c329953660db96eae534be5bbf1a735c2baf69b5@gmail.com>
class FaasCli < Formula
desc "CLI for templating and/or deploying FaaS functions"
homepage "https://docs.get-faas.com/"
url "https://github.com/openfaas/faas-cli.git",
:tag => "0.8.17",
:revision => "292d47c1dccea236518e4993e5fceb625d4d0053"
bottle do
cellar :any_skip_relocation
sha256 "8cf0c8af54e05c781edbf4f2227f8331f34faeda8df3538d9e9899c0bcef86c5" => :mojave
sha256 "4349270e415fdf948767b8edc4da335fc3d0d9328958d0961840a1844e773e2b" => :high_sierra
sha256 "3b929a4f807ae301928df48aa97e9710b8a8e4f9949bd745c5af8d3c95faf5a6" => :sierra
end
depends_on "go" => :build
def install
ENV["XC_OS"] = "darwin"
ENV["XC_ARCH"] = "amd64"
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/openfaas/faas-cli").install buildpath.children
cd "src/github.com/openfaas/faas-cli" do
project = "github.com/openfaas/faas-cli"
commit = Utils.popen_read("git", "rev-parse", "HEAD").chomp
system "go", "build", "-ldflags",
"-s -w -X #{project}/version.GitCommit=#{commit} -X #{project}/version.Version=#{version}", "-a",
"-installsuffix", "cgo", "-o", bin/"faas-cli"
bin.install_symlink "faas-cli" => "faas"
prefix.install_metafiles
end
end
test do
require "socket"
server = TCPServer.new("localhost", 0)
port = server.addr[1]
pid = fork do
loop do
socket = server.accept
response = "OK"
socket.print "HTTP/1.1 200 OK\r\n" \
"Content-Length: #{response.bytesize}\r\n" \
"Connection: close\r\n"
socket.print "\r\n"
socket.print response
socket.close
end
end
(testpath/"test.yml").write <<~EOS
provider:
name: faas
gateway: http://localhost:#{port}
network: "func_functions"
functions:
dummy_function:
lang: python
handler: ./dummy_function
image: dummy_image
EOS
begin
output = shell_output("#{bin}/faas-cli deploy -yaml test.yml 2>&1", 1)
assert_match "stat ./template/python/template.yml", output
assert_match "ruby", shell_output("#{bin}/faas-cli template pull 2>&1")
assert_match "node", shell_output("#{bin}/faas-cli new --list")
output = shell_output("#{bin}/faas-cli deploy -yaml test.yml")
assert_match "Function dummy_function already exists, attempting rolling-update", output
assert_match "Deployed. 200 OK", output
stable_resource = stable.instance_variable_get(:@resource)
commit = stable_resource.instance_variable_get(:@specs)[:revision]
faas_cli_version = shell_output("#{bin}/faas-cli version")
assert_match /\s#{commit}$/, faas_cli_version
assert_match /\s#{version}$/, faas_cli_version
ensure
Process.kill("TERM", pid)
Process.wait(pid)
end
end
end
|
class FaasCli < Formula
desc "CLI for templating and/or deploying FaaS functions"
homepage "https://docs.get-faas.com/"
url "https://github.com/openfaas/faas-cli.git",
:tag => "0.6.4",
:revision => "8c7ebc3e7304873ba42b8d8e95d492499935f278"
bottle do
cellar :any_skip_relocation
sha256 "93982ed7535a3d2dc8219d98c5e8c723f4924ee81f36a2cf28f0bdece9a3617b" => :high_sierra
sha256 "e90f58a525a9bd50b3bd9f082f0442595a9c7327a9e69a3ec0ed4d28f49d48f9" => :sierra
sha256 "aa87d88f3e13c705b9d7c7aae5d55567fb1366a797f57a185fd0b5c34e6489dd" => :el_capitan
end
depends_on "go" => :build
def install
ENV["XC_OS"] = "darwin"
ENV["XC_ARCH"] = MacOS.prefer_64_bit? ? "amd64" : "386"
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/openfaas/faas-cli").install buildpath.children
cd "src/github.com/openfaas/faas-cli" do
project = "github.com/openfaas/faas-cli"
commit = Utils.popen_read("git", "rev-parse", "HEAD").chomp
system "go", "build", "-ldflags",
"-s -w -X #{project}/version.GitCommit=#{commit} -X #{project}/version.Version=#{version}", "-a",
"-installsuffix", "cgo", "-o", bin/"faas-cli"
bin.install_symlink "faas-cli" => "faas"
pkgshare.install "template"
prefix.install_metafiles
end
end
test do
require "socket"
server = TCPServer.new("localhost", 0)
port = server.addr[1]
pid = fork do
loop do
socket = server.accept
response = "OK"
socket.print "HTTP/1.1 200 OK\r\n" \
"Content-Length: #{response.bytesize}\r\n" \
"Connection: close\r\n"
socket.print "\r\n"
socket.print response
socket.close
end
end
(testpath/"test.yml").write <<~EOS
provider:
name: faas
gateway: http://localhost:#{port}
network: "func_functions"
functions:
dummy_function:
lang: python
handler: ./dummy_function
image: dummy_image
EOS
expected = <<~EOS
Deploying: dummy_function.
Function dummy_function already exists, attempting rolling-update.
Deployed. 200 OK.
URL: http://localhost:#{port}/function/dummy_function
EOS
begin
cp_r pkgshare/"template", testpath
output = shell_output("#{bin}/faas-cli deploy -yaml test.yml")
assert_equal expected, output.chomp
rm_rf "template"
output = shell_output("#{bin}/faas-cli deploy -yaml test.yml 2>&1", 1)
assert_match "stat ./template/python/template.yml", output
assert_match "ruby", shell_output("#{bin}/faas-cli template pull 2>&1")
assert_match "node", shell_output("#{bin}/faas-cli new --list")
output = shell_output("#{bin}/faas-cli deploy -yaml test.yml")
assert_equal expected, output.chomp
stable_resource = stable.instance_variable_get(:@resource)
commit = stable_resource.instance_variable_get(:@specs)[:revision]
faas_cli_version = shell_output("#{bin}/faas-cli version")
assert_match /\s#{commit}$/, faas_cli_version
assert_match /\s#{version}$/, faas_cli_version
ensure
Process.kill("TERM", pid)
Process.wait(pid)
end
end
end
faas-cli 0.6.5
Closes #26229.
Signed-off-by: commitay <10d69e516de6fc57655a0b77a4a950d85cd2179f@users.noreply.github.com>
class FaasCli < Formula
desc "CLI for templating and/or deploying FaaS functions"
homepage "https://docs.get-faas.com/"
url "https://github.com/openfaas/faas-cli.git",
:tag => "0.6.5",
:revision => "ae7390005a2fe13873f2cb6fcfa2d830dad4a40b"
bottle do
cellar :any_skip_relocation
sha256 "93982ed7535a3d2dc8219d98c5e8c723f4924ee81f36a2cf28f0bdece9a3617b" => :high_sierra
sha256 "e90f58a525a9bd50b3bd9f082f0442595a9c7327a9e69a3ec0ed4d28f49d48f9" => :sierra
sha256 "aa87d88f3e13c705b9d7c7aae5d55567fb1366a797f57a185fd0b5c34e6489dd" => :el_capitan
end
depends_on "go" => :build
def install
ENV["XC_OS"] = "darwin"
ENV["XC_ARCH"] = MacOS.prefer_64_bit? ? "amd64" : "386"
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/openfaas/faas-cli").install buildpath.children
cd "src/github.com/openfaas/faas-cli" do
project = "github.com/openfaas/faas-cli"
commit = Utils.popen_read("git", "rev-parse", "HEAD").chomp
system "go", "build", "-ldflags",
"-s -w -X #{project}/version.GitCommit=#{commit} -X #{project}/version.Version=#{version}", "-a",
"-installsuffix", "cgo", "-o", bin/"faas-cli"
bin.install_symlink "faas-cli" => "faas"
pkgshare.install "template"
prefix.install_metafiles
end
end
test do
require "socket"
server = TCPServer.new("localhost", 0)
port = server.addr[1]
pid = fork do
loop do
socket = server.accept
response = "OK"
socket.print "HTTP/1.1 200 OK\r\n" \
"Content-Length: #{response.bytesize}\r\n" \
"Connection: close\r\n"
socket.print "\r\n"
socket.print response
socket.close
end
end
(testpath/"test.yml").write <<~EOS
provider:
name: faas
gateway: http://localhost:#{port}
network: "func_functions"
functions:
dummy_function:
lang: python
handler: ./dummy_function
image: dummy_image
EOS
expected = <<~EOS
Deploying: dummy_function.
Function dummy_function already exists, attempting rolling-update.
Deployed. 200 OK.
URL: http://localhost:#{port}/function/dummy_function
EOS
begin
cp_r pkgshare/"template", testpath
output = shell_output("#{bin}/faas-cli deploy -yaml test.yml")
assert_equal expected, output.chomp
rm_rf "template"
output = shell_output("#{bin}/faas-cli deploy -yaml test.yml 2>&1", 1)
assert_match "stat ./template/python/template.yml", output
assert_match "ruby", shell_output("#{bin}/faas-cli template pull 2>&1")
assert_match "node", shell_output("#{bin}/faas-cli new --list")
output = shell_output("#{bin}/faas-cli deploy -yaml test.yml")
assert_equal expected, output.chomp
stable_resource = stable.instance_variable_get(:@resource)
commit = stable_resource.instance_variable_get(:@specs)[:revision]
faas_cli_version = shell_output("#{bin}/faas-cli version")
assert_match /\s#{commit}$/, faas_cli_version
assert_match /\s#{version}$/, faas_cli_version
ensure
Process.kill("TERM", pid)
Process.wait(pid)
end
end
end
|
class FaasCli < Formula
desc "CLI for templating and/or deploying FaaS functions"
homepage "http://docs.get-faas.com/"
url "https://github.com/openfaas/faas-cli.git",
:tag => "0.4.17",
:revision => "83f9316378be16cf7adbc3aee78d172af012d5c4"
bottle do
cellar :any_skip_relocation
sha256 "7d2b45ee8c7972a803e206c99ea3af61f758e0a1fe82f7c3758e34536139a561" => :high_sierra
sha256 "1cf1580b7f91d8cf7a51ea15877abed9aa4607ef1f14fe955ac7f1ed683e857c" => :sierra
sha256 "0d7cb4ff2cc9d80184982cc25efa4bd701dbe24fd6af3914e4dfcbe25b750f1e" => :el_capitan
end
depends_on "go" => :build
def install
ENV["XC_OS"] = "darwin"
ENV["XC_ARCH"] = MacOS.prefer_64_bit? ? "amd64" : "386"
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/openfaas/faas-cli").install buildpath.children
cd "src/github.com/openfaas/faas-cli" do
commit = Utils.popen_read("git rev-list -1 HEAD").chomp
system "go", "build", "-ldflags", "-s -w -X github.com/openfaas/faas-cli/commands.GitCommit=#{commit}", "-a",
"-installsuffix", "cgo", "-o", bin/"faas-cli"
prefix.install_metafiles
end
end
test do
require "socket"
server = TCPServer.new("localhost", 0)
port = server.addr[1]
pid = fork do
loop do
socket = server.accept
response = "OK"
socket.print "HTTP/1.1 200 OK\r\n" \
"Content-Length: #{response.bytesize}\r\n" \
"Connection: close\r\n"
socket.print "\r\n"
socket.print response
socket.close
end
end
(testpath/"test.yml").write <<-EOF.undent
provider:
name: faas
gateway: http://localhost:#{port}
network: "func_functions"
functions:
dummy_function:
lang: python
handler: ./dummy_function
image: dummy_image
EOF
expected = <<-EOS.undent
Deploying: dummy_function.
Removing old service.
Deployed.
URL: http://localhost:#{port}/function/dummy_function
200 OK
EOS
begin
output = shell_output("#{bin}/faas-cli deploy -yaml test.yml")
assert_equal expected, output
commit = Utils.popen_read("git rev-list -1 HEAD").chomp
output = shell_output("#{bin}/faas-cli version")
assert_match commit, output.chomp
ensure
Process.kill("TERM", pid)
Process.wait(pid)
end
end
end
faas-cli: update 0.4.17 bottle.
class FaasCli < Formula
desc "CLI for templating and/or deploying FaaS functions"
homepage "http://docs.get-faas.com/"
url "https://github.com/openfaas/faas-cli.git",
:tag => "0.4.17",
:revision => "83f9316378be16cf7adbc3aee78d172af012d5c4"
bottle do
cellar :any_skip_relocation
sha256 "d1d78b536bf0d137bcc15f3cea362adbcf40962843c3d97af6992a426a6eff28" => :high_sierra
sha256 "ac6aa3bf3ad073ae6c185dc01107cafbf1aac5e8e6b0c49281c985f72659bcc8" => :sierra
sha256 "be7b559de3f3d103b38e3762c5c8ac1548161a0627fbac671b95faffcd5eae8a" => :el_capitan
end
depends_on "go" => :build
def install
ENV["XC_OS"] = "darwin"
ENV["XC_ARCH"] = MacOS.prefer_64_bit? ? "amd64" : "386"
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/openfaas/faas-cli").install buildpath.children
cd "src/github.com/openfaas/faas-cli" do
commit = Utils.popen_read("git rev-list -1 HEAD").chomp
system "go", "build", "-ldflags", "-s -w -X github.com/openfaas/faas-cli/commands.GitCommit=#{commit}", "-a",
"-installsuffix", "cgo", "-o", bin/"faas-cli"
prefix.install_metafiles
end
end
test do
require "socket"
server = TCPServer.new("localhost", 0)
port = server.addr[1]
pid = fork do
loop do
socket = server.accept
response = "OK"
socket.print "HTTP/1.1 200 OK\r\n" \
"Content-Length: #{response.bytesize}\r\n" \
"Connection: close\r\n"
socket.print "\r\n"
socket.print response
socket.close
end
end
(testpath/"test.yml").write <<-EOF.undent
provider:
name: faas
gateway: http://localhost:#{port}
network: "func_functions"
functions:
dummy_function:
lang: python
handler: ./dummy_function
image: dummy_image
EOF
expected = <<-EOS.undent
Deploying: dummy_function.
Removing old service.
Deployed.
URL: http://localhost:#{port}/function/dummy_function
200 OK
EOS
begin
output = shell_output("#{bin}/faas-cli deploy -yaml test.yml")
assert_equal expected, output
commit = Utils.popen_read("git rev-list -1 HEAD").chomp
output = shell_output("#{bin}/faas-cli version")
assert_match commit, output.chomp
ensure
Process.kill("TERM", pid)
Process.wait(pid)
end
end
end
|
class FaasCli < Formula
desc "CLI for templating and/or deploying FaaS functions"
homepage "https://docs.get-faas.com/"
url "https://github.com/openfaas/faas-cli.git",
:tag => "0.8.1",
:revision => "5b36c50280d961d3aa248bd17f901f4ef2774447"
bottle do
cellar :any_skip_relocation
sha256 "def0f4374e118bcbcaab5916825c8d598a3dd421f589c6dd83df14b03995a213" => :mojave
sha256 "02ddada528e5d7b5872d364c1636059d6da0eb673920238b7e4162935940d8ee" => :high_sierra
sha256 "e114ef38b87d32f0637c24f2bbee425201c01f2edfb016a44d5601327faf1bbb" => :sierra
end
depends_on "go" => :build
def install
ENV["XC_OS"] = "darwin"
ENV["XC_ARCH"] = MacOS.prefer_64_bit? ? "amd64" : "386"
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/openfaas/faas-cli").install buildpath.children
cd "src/github.com/openfaas/faas-cli" do
project = "github.com/openfaas/faas-cli"
commit = Utils.popen_read("git", "rev-parse", "HEAD").chomp
system "go", "build", "-ldflags",
"-s -w -X #{project}/version.GitCommit=#{commit} -X #{project}/version.Version=#{version}", "-a",
"-installsuffix", "cgo", "-o", bin/"faas-cli"
bin.install_symlink "faas-cli" => "faas"
prefix.install_metafiles
end
end
test do
require "socket"
server = TCPServer.new("localhost", 0)
port = server.addr[1]
pid = fork do
loop do
socket = server.accept
response = "OK"
socket.print "HTTP/1.1 200 OK\r\n" \
"Content-Length: #{response.bytesize}\r\n" \
"Connection: close\r\n"
socket.print "\r\n"
socket.print response
socket.close
end
end
(testpath/"test.yml").write <<~EOS
provider:
name: faas
gateway: http://localhost:#{port}
network: "func_functions"
functions:
dummy_function:
lang: python
handler: ./dummy_function
image: dummy_image
EOS
expected = <<~EOS
Deploying: dummy_function.
Function dummy_function already exists, attempting rolling-update.
Deployed. 200 OK.
URL: http://localhost:#{port}/function/dummy_function
EOS
begin
output = shell_output("#{bin}/faas-cli deploy -yaml test.yml 2>&1", 1)
assert_match "stat ./template/python/template.yml", output
assert_match "ruby", shell_output("#{bin}/faas-cli template pull 2>&1")
assert_match "node", shell_output("#{bin}/faas-cli new --list")
output = shell_output("#{bin}/faas-cli deploy -yaml test.yml")
assert_equal expected, output.chomp
stable_resource = stable.instance_variable_get(:@resource)
commit = stable_resource.instance_variable_get(:@specs)[:revision]
faas_cli_version = shell_output("#{bin}/faas-cli version")
assert_match /\s#{commit}$/, faas_cli_version
assert_match /\s#{version}$/, faas_cli_version
ensure
Process.kill("TERM", pid)
Process.wait(pid)
end
end
end
faas-cli: update 0.8.1 bottle for Linuxbrew.
Closes Linuxbrew/homebrew-core#10495.
Signed-off-by: Michka Popoff <7b0496f66f66ee22a38826c310c38b415671b832@gmail.com>
class FaasCli < Formula
desc "CLI for templating and/or deploying FaaS functions"
homepage "https://docs.get-faas.com/"
url "https://github.com/openfaas/faas-cli.git",
:tag => "0.8.1",
:revision => "5b36c50280d961d3aa248bd17f901f4ef2774447"
bottle do
cellar :any_skip_relocation
sha256 "def0f4374e118bcbcaab5916825c8d598a3dd421f589c6dd83df14b03995a213" => :mojave
sha256 "02ddada528e5d7b5872d364c1636059d6da0eb673920238b7e4162935940d8ee" => :high_sierra
sha256 "e114ef38b87d32f0637c24f2bbee425201c01f2edfb016a44d5601327faf1bbb" => :sierra
sha256 "f92467ca93de894bf47a0b84cdb894539ff85e594a4e432fc47fb4ee597a21dd" => :x86_64_linux
end
depends_on "go" => :build
def install
ENV["XC_OS"] = "darwin"
ENV["XC_ARCH"] = MacOS.prefer_64_bit? ? "amd64" : "386"
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/openfaas/faas-cli").install buildpath.children
cd "src/github.com/openfaas/faas-cli" do
project = "github.com/openfaas/faas-cli"
commit = Utils.popen_read("git", "rev-parse", "HEAD").chomp
system "go", "build", "-ldflags",
"-s -w -X #{project}/version.GitCommit=#{commit} -X #{project}/version.Version=#{version}", "-a",
"-installsuffix", "cgo", "-o", bin/"faas-cli"
bin.install_symlink "faas-cli" => "faas"
prefix.install_metafiles
end
end
test do
require "socket"
server = TCPServer.new("localhost", 0)
port = server.addr[1]
pid = fork do
loop do
socket = server.accept
response = "OK"
socket.print "HTTP/1.1 200 OK\r\n" \
"Content-Length: #{response.bytesize}\r\n" \
"Connection: close\r\n"
socket.print "\r\n"
socket.print response
socket.close
end
end
(testpath/"test.yml").write <<~EOS
provider:
name: faas
gateway: http://localhost:#{port}
network: "func_functions"
functions:
dummy_function:
lang: python
handler: ./dummy_function
image: dummy_image
EOS
expected = <<~EOS
Deploying: dummy_function.
Function dummy_function already exists, attempting rolling-update.
Deployed. 200 OK.
URL: http://localhost:#{port}/function/dummy_function
EOS
begin
output = shell_output("#{bin}/faas-cli deploy -yaml test.yml 2>&1", 1)
assert_match "stat ./template/python/template.yml", output
assert_match "ruby", shell_output("#{bin}/faas-cli template pull 2>&1")
assert_match "node", shell_output("#{bin}/faas-cli new --list")
output = shell_output("#{bin}/faas-cli deploy -yaml test.yml")
assert_equal expected, output.chomp
stable_resource = stable.instance_variable_get(:@resource)
commit = stable_resource.instance_variable_get(:@specs)[:revision]
faas_cli_version = shell_output("#{bin}/faas-cli version")
assert_match /\s#{commit}$/, faas_cli_version
assert_match /\s#{version}$/, faas_cli_version
ensure
Process.kill("TERM", pid)
Process.wait(pid)
end
end
end
|
require 'formula'
class Fail2ban < Formula
homepage 'http://www.fail2ban.org/'
url 'https://github.com/fail2ban/fail2ban/archive/0.8.12.tar.gz'
sha1 '32a6cab154ccf48f6ae914612118d7ed4695fb26'
def install
rm 'setup.cfg'
inreplace 'setup.py' do |s|
s.gsub! /\/etc/, etc
s.gsub! /\/var/, var
end
# Replace hardcoded paths
inreplace 'fail2ban-client', '/usr/share/fail2ban', libexec
inreplace 'fail2ban-server', '/usr/share/fail2ban', libexec
inreplace 'fail2ban-regex', '/usr/share/fail2ban', libexec
inreplace 'fail2ban-client', '/etc', etc
inreplace 'fail2ban-regex', '/etc', etc
inreplace 'fail2ban-server', '/var', var
inreplace 'config/fail2ban.conf', '/var/run', (var/'run')
inreplace 'setup.py', '/usr/share/doc/fail2ban', (libexec/'doc')
system "python", "setup.py", "install", "--prefix=#{prefix}", "--install-lib=#{libexec}"
end
plist_options :startup => true
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/fail2ban-client</string>
<string>-x</string>
<string>start</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOS
end
def caveats
<<-EOS.undent
Before using Fail2Ban for the first time you should edit jail
configuration and enable the jails that you want to use, for instance
ssh-ipfw. Also make sure that they point to the correct configuration
path. I.e. on Mountain Lion the sshd logfile should point to
/var/log/system.log.
* #{etc}/fail2ban/jail.conf
The Fail2Ban wiki has two pages with instructions for MacOS X Server that
describes how to set up the Jails for the standard MacOS X Server
services for the respective releases.
10.4: http://www.fail2ban.org/wiki/index.php/HOWTO_Mac_OS_X_Server_(10.4)
10.5: http://www.fail2ban.org/wiki/index.php/HOWTO_Mac_OS_X_Server_(10.5)
EOS
end
end
fail2ban 0.8.13
require "formula"
class Fail2ban < Formula
homepage "http://www.fail2ban.org/"
url "https://github.com/fail2ban/fail2ban/archive/0.8.13.tar.gz"
sha1 "2a2ddffb6e60e2997dcceb0ac25761aa6931f5f6"
def install
rm "setup.cfg"
inreplace "setup.py" do |s|
s.gsub! /\/etc/, etc
s.gsub! /\/var/, var
end
# Replace hardcoded paths
inreplace "fail2ban-client", "/usr/share/fail2ban", libexec
inreplace "fail2ban-server", "/usr/share/fail2ban", libexec
inreplace "fail2ban-regex", "/usr/share/fail2ban", libexec
inreplace "fail2ban-client", "/etc", etc
inreplace "fail2ban-regex", "/etc", etc
inreplace "fail2ban-server", "/var", var
inreplace "config/fail2ban.conf", "/var/run", (var/"run")
inreplace "setup.py", "/usr/share/doc/fail2ban", (libexec/"doc")
system "python", "setup.py", "install", "--prefix=#{prefix}", "--install-lib=#{libexec}"
end
plist_options :startup => true
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/fail2ban-client</string>
<string>-x</string>
<string>start</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOS
end
def caveats
<<-EOS.undent
Before using Fail2Ban for the first time you should edit jail
configuration and enable the jails that you want to use, for instance
ssh-ipfw. Also make sure that they point to the correct configuration
path. I.e. on Mountain Lion the sshd logfile should point to
/var/log/system.log.
* #{etc}/fail2ban/jail.conf
The Fail2Ban wiki has two pages with instructions for MacOS X Server that
describes how to set up the Jails for the standard MacOS X Server
services for the respective releases.
10.4: http://www.fail2ban.org/wiki/index.php/HOWTO_Mac_OS_X_Server_(10.4)
10.5: http://www.fail2ban.org/wiki/index.php/HOWTO_Mac_OS_X_Server_(10.5)
EOS
end
end
|
class Fastlane < Formula
desc "Easiest way to build and release mobile apps"
homepage "https://fastlane.tools"
url "https://github.com/fastlane/fastlane/archive/2.159.0.tar.gz"
sha256 "8a8c6412db96f3c1849b9cd2068ccdc4f9948feb9e9cb339d194771087037ddb"
license "MIT"
head "https://github.com/fastlane/fastlane.git"
livecheck do
url :head
regex(/^([\d.]+)$/i)
end
bottle do
cellar :any
sha256 "869113737ade3e4c94c7c5aba7833fc22986cd7b3100813f8e4cd334712f67d0" => :catalina
sha256 "aa0f47f73ecde01e7bf6f469ea3760557a42db75323b9493a954de02dd56bef2" => :mojave
sha256 "ef195cf033c5666080fc3626883c4e0ec6334037d79be72cb7e37e1ff444e37d" => :high_sierra
end
depends_on "ruby"
def install
ENV["GEM_HOME"] = libexec
ENV["GEM_PATH"] = libexec
system "gem", "build", "fastlane.gemspec"
system "gem", "install", "fastlane-#{version}.gem", "--no-document"
(bin/"fastlane").write <<~EOS
#!/bin/bash
export PATH="#{Formula["ruby"].opt_bin}:#{libexec}/bin:$PATH"
GEM_HOME="#{libexec}" GEM_PATH="#{libexec}" \\
exec "#{libexec}/bin/fastlane" "$@"
EOS
chmod "+x", bin/"fastlane"
end
test do
assert_match "fastlane #{version}", shell_output("#{bin}/fastlane --version")
actions_output = shell_output("#{bin}/fastlane actions")
assert_match "gym", actions_output
assert_match "pilot", actions_output
assert_match "screengrab", actions_output
assert_match "supply", actions_output
end
end
fastlane: update 2.159.0 bottle.
class Fastlane < Formula
desc "Easiest way to build and release mobile apps"
homepage "https://fastlane.tools"
url "https://github.com/fastlane/fastlane/archive/2.159.0.tar.gz"
sha256 "8a8c6412db96f3c1849b9cd2068ccdc4f9948feb9e9cb339d194771087037ddb"
license "MIT"
head "https://github.com/fastlane/fastlane.git"
livecheck do
url :head
regex(/^([\d.]+)$/i)
end
bottle do
cellar :any
sha256 "869113737ade3e4c94c7c5aba7833fc22986cd7b3100813f8e4cd334712f67d0" => :catalina
sha256 "aa0f47f73ecde01e7bf6f469ea3760557a42db75323b9493a954de02dd56bef2" => :mojave
sha256 "ef195cf033c5666080fc3626883c4e0ec6334037d79be72cb7e37e1ff444e37d" => :high_sierra
sha256 "9af8ea5e425dcadcad6b63a07e107247988eadff0f09873c2f47c870f665f787" => :x86_64_linux
end
depends_on "ruby"
def install
ENV["GEM_HOME"] = libexec
ENV["GEM_PATH"] = libexec
system "gem", "build", "fastlane.gemspec"
system "gem", "install", "fastlane-#{version}.gem", "--no-document"
(bin/"fastlane").write <<~EOS
#!/bin/bash
export PATH="#{Formula["ruby"].opt_bin}:#{libexec}/bin:$PATH"
GEM_HOME="#{libexec}" GEM_PATH="#{libexec}" \\
exec "#{libexec}/bin/fastlane" "$@"
EOS
chmod "+x", bin/"fastlane"
end
test do
assert_match "fastlane #{version}", shell_output("#{bin}/fastlane --version")
actions_output = shell_output("#{bin}/fastlane actions")
assert_match "gym", actions_output
assert_match "pilot", actions_output
assert_match "screengrab", actions_output
assert_match "supply", actions_output
end
end
|
class Fheroes2 < Formula
desc "Free Heroes of Might and Magic II is a recreation of HoMM2 game engine"
homepage "https://ihhub.github.io/fheroes2/"
url "https://github.com/ihhub/fheroes2/archive/0.9.21.tar.gz"
sha256 "863e78cd239b577068957843d5926fccf72c8bfd0531522cc242040f3108341c"
license "GPL-2.0-or-later"
head "https://github.com/ihhub/fheroes2.git", branch: "master"
livecheck do
url :stable
regex(/^v?(\d+(?:\.\d+)+)$/i)
end
bottle do
sha256 arm64_monterey: "e67d12fdc4e5f8373bcdf8594f8b568bb597dd72979c07b13c242c2ef6743abb"
sha256 arm64_big_sur: "e0b060803bc67b57b82957c0cf8522c051725a56daab79b459c98d9b873be54e"
sha256 monterey: "0d6035e9935f6cdae70763d9ead23e85120633edc51789dc4b42007f2f4d2567"
sha256 big_sur: "a279a685c019074c94626ed1d600f7f7b9b961a6c2194f793a5e30de8241fb12"
sha256 catalina: "2aeeb745b4259d6da07077738d970e81a3a321f56ac7acc2ed91fc24a4275b32"
sha256 x86_64_linux: "d956e5e5e27acae5b567741dbfeee3a768cd4abd5fc48f8bc9f306db5452c767"
end
depends_on "cmake" => :build
depends_on "gettext" => :build
depends_on "libpng"
depends_on "sdl2"
depends_on "sdl2_image"
depends_on "sdl2_mixer"
uses_from_macos "zlib"
fails_with gcc: "5"
def install
system "cmake", "-S", ".", "-B", "build", *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
bin.install "script/demo/download_demo_version.sh" => "fheroes2-install-demo"
end
test do
assert_match "help", shell_output("#{bin}/fheroes2 -h 2>&1")
end
end
fheroes2: update 0.9.21 bottle.
class Fheroes2 < Formula
desc "Free Heroes of Might and Magic II is a recreation of HoMM2 game engine"
homepage "https://ihhub.github.io/fheroes2/"
url "https://github.com/ihhub/fheroes2/archive/0.9.21.tar.gz"
sha256 "863e78cd239b577068957843d5926fccf72c8bfd0531522cc242040f3108341c"
license "GPL-2.0-or-later"
head "https://github.com/ihhub/fheroes2.git", branch: "master"
livecheck do
url :stable
regex(/^v?(\d+(?:\.\d+)+)$/i)
end
bottle do
sha256 arm64_ventura: "6a73e94c8df18177f049d3785ef4e28a0267b91472ebcac0d146bb131eca7399"
sha256 arm64_monterey: "e67d12fdc4e5f8373bcdf8594f8b568bb597dd72979c07b13c242c2ef6743abb"
sha256 arm64_big_sur: "e0b060803bc67b57b82957c0cf8522c051725a56daab79b459c98d9b873be54e"
sha256 monterey: "0d6035e9935f6cdae70763d9ead23e85120633edc51789dc4b42007f2f4d2567"
sha256 big_sur: "a279a685c019074c94626ed1d600f7f7b9b961a6c2194f793a5e30de8241fb12"
sha256 catalina: "2aeeb745b4259d6da07077738d970e81a3a321f56ac7acc2ed91fc24a4275b32"
sha256 x86_64_linux: "d956e5e5e27acae5b567741dbfeee3a768cd4abd5fc48f8bc9f306db5452c767"
end
depends_on "cmake" => :build
depends_on "gettext" => :build
depends_on "libpng"
depends_on "sdl2"
depends_on "sdl2_image"
depends_on "sdl2_mixer"
uses_from_macos "zlib"
fails_with gcc: "5"
def install
system "cmake", "-S", ".", "-B", "build", *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
bin.install "script/demo/download_demo_version.sh" => "fheroes2-install-demo"
end
test do
assert_match "help", shell_output("#{bin}/fheroes2 -h 2>&1")
end
end
|
class Fileicon < Formula
desc "macOS CLI for managing custom icons for files and folders"
homepage "https://github.com/mklement0/fileicon"
url "https://github.com/mklement0/fileicon/archive/v0.2.4.tar.gz"
sha256 "c7a2996bf41b5cdd8d3a256f2b97724775c711a1a413fd53b43409ef416db35a"
bottle do
cellar :any_skip_relocation
sha256 "6b3cfdf0e341c2a39ff84e617279e95f38d315130ed2820d867251ef4c8ba9da" => :catalina
sha256 "6b3cfdf0e341c2a39ff84e617279e95f38d315130ed2820d867251ef4c8ba9da" => :mojave
sha256 "6b3cfdf0e341c2a39ff84e617279e95f38d315130ed2820d867251ef4c8ba9da" => :high_sierra
end
def install
bin.install "bin/fileicon"
man1.install "man/fileicon.1"
end
test do
icon = test_fixtures "test.png"
system bin/"fileicon", "set", testpath, icon
assert_predicate testpath/"Icon\r", :exist?
stdout = shell_output "#{bin}/fileicon test #{testpath}"
assert_include stdout, "HAS custom icon: '#{testpath}'"
end
end
fileicon: update 0.2.4 bottle.
class Fileicon < Formula
desc "macOS CLI for managing custom icons for files and folders"
homepage "https://github.com/mklement0/fileicon"
url "https://github.com/mklement0/fileicon/archive/v0.2.4.tar.gz"
sha256 "c7a2996bf41b5cdd8d3a256f2b97724775c711a1a413fd53b43409ef416db35a"
bottle do
cellar :any_skip_relocation
sha256 "154c80c94f29f209b78252e71d914647a8300c66c02acda672b8574e8e704e92" => :catalina
sha256 "154c80c94f29f209b78252e71d914647a8300c66c02acda672b8574e8e704e92" => :mojave
sha256 "154c80c94f29f209b78252e71d914647a8300c66c02acda672b8574e8e704e92" => :high_sierra
end
def install
bin.install "bin/fileicon"
man1.install "man/fileicon.1"
end
test do
icon = test_fixtures "test.png"
system bin/"fileicon", "set", testpath, icon
assert_predicate testpath/"Icon\r", :exist?
stdout = shell_output "#{bin}/fileicon test #{testpath}"
assert_include stdout, "HAS custom icon: '#{testpath}'"
end
end
|
class FlowCli < Formula
desc "Command-line interface that provides utilities for building Flow applications"
homepage "https://onflow.org"
url "https://github.com/onflow/flow-cli/archive/v0.14.0.tar.gz"
sha256 "2a7bafea4450c27c4573a0c3b35bace9f66d80a76af68b309ebdc93f553f7789"
license "Apache-2.0"
head "https://github.com/onflow/flow-cli.git"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "e8f039b06734c3ea3e6e083d71956333ab62f8e9c75b826006442136e83800d7"
sha256 cellar: :any_skip_relocation, big_sur: "26f2ff6a2154d71d2268bd9a232aa9ecc3081c671c57ae7cefad8d800ee930d0"
sha256 cellar: :any_skip_relocation, catalina: "d99a2857dca3ef9095b0fd7fbfeafedf8675475d8bbfdb9b9afb372e59b23591"
sha256 cellar: :any_skip_relocation, mojave: "48b8177bca20f2504c20389f2c15031e4e0ab2d675545710c199ef36ff618916"
end
depends_on "go" => :build
def install
system "make", "cmd/flow/flow", "VERSION=v#{version}"
bin.install "cmd/flow/flow"
end
test do
(testpath/"hello.cdc").write <<~EOS
pub fun main() {
log("Hello, world!")
}
EOS
system "#{bin}/flow", "cadence", "hello.cdc"
end
end
flow-cli: update 0.14.0 bottle.
class FlowCli < Formula
desc "Command-line interface that provides utilities for building Flow applications"
homepage "https://onflow.org"
url "https://github.com/onflow/flow-cli/archive/v0.14.0.tar.gz"
sha256 "2a7bafea4450c27c4573a0c3b35bace9f66d80a76af68b309ebdc93f553f7789"
license "Apache-2.0"
head "https://github.com/onflow/flow-cli.git"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "7bb4dd2cbc82c5923c40c114dcdc6a5ac102bb2430a6b78e44ac763ac368ba33"
sha256 cellar: :any_skip_relocation, big_sur: "715af8536626e772b6821f9d5ddcc79f4cd38832b51e05c65c4776c1a14a2726"
sha256 cellar: :any_skip_relocation, catalina: "9814167aa3c6df83bbe7029d4ae58a69d8b02b887187886730be58739346d0de"
sha256 cellar: :any_skip_relocation, mojave: "6fd37b3b61703a76f33ad98cc53d337905c359fe750503ae3637701db0a49ba6"
end
depends_on "go" => :build
def install
system "make", "cmd/flow/flow", "VERSION=v#{version}"
bin.install "cmd/flow/flow"
end
test do
(testpath/"hello.cdc").write <<~EOS
pub fun main() {
log("Hello, world!")
}
EOS
system "#{bin}/flow", "cadence", "hello.cdc"
end
end
|
class Freedink < Formula
desc "Portable version of the Dink Smallwood game engine"
homepage "https://www.gnu.org/software/freedink/"
url "https://ftp.gnu.org/gnu/freedink/freedink-108.4.tar.gz"
sha256 "82cfb2e019e78b6849395dc4750662b67087d14f406d004f6d9e39e96a0c8521"
revision 2
bottle do
sha256 "d78130e6917a14d7a5e367bada96e919915695d68d7796709d5bb99fbbc593f9" => :high_sierra
sha256 "c3d0467dd6eb6e2070e488d468cf3953257260401722dd28037a2b37326d604a" => :sierra
sha256 "97ba862a21ab764b5cf1c3c5d40604c8b006c81a88839c20199966a494725c16" => :el_capitan
sha256 "e4fa882a22081243a88ca1303f4aa7fe3843e4cc523fe973a5158b117e7d868e" => :yosemite
end
depends_on "check"
depends_on "sdl2_image"
depends_on "sdl_mixer"
depends_on "sdl_ttf"
depends_on "sdl_gfx"
depends_on "sdl_image"
depends_on "gettext"
depends_on "libzip"
depends_on "fontconfig"
depends_on "pkg-config" => :build
resource "freedink-data" do
url "https://ftp.gnu.org/gnu/freedink/freedink-data-1.08.20170409.tar.gz"
sha256 "e1f1e23c7846bc74479610a65cc0169906e844c5193f0d83ba69accc54a3bdf5"
end
def install
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
resource("freedink-data").stage do
inreplace "Makefile", "xargs -0r", "xargs -0"
system "make", "install", "PREFIX=#{prefix}"
end
end
test do
assert_match "GNU FreeDink 108.4", shell_output("#{bin}/freedink -vwis")
assert FileTest.exists?("#{share}/dink/dink/Dink.dat")
end
end
freedink: update 108.4_2 bottle.
class Freedink < Formula
desc "Portable version of the Dink Smallwood game engine"
homepage "https://www.gnu.org/software/freedink/"
url "https://ftp.gnu.org/gnu/freedink/freedink-108.4.tar.gz"
sha256 "82cfb2e019e78b6849395dc4750662b67087d14f406d004f6d9e39e96a0c8521"
revision 2
bottle do
sha256 "a85e4560ea7be49eddfe43af2f23cc3ad71a99c7c8aacf8a50f671af1a81777a" => :high_sierra
sha256 "7af81b5a0bdcabd11a7fdd705b3c7bbc0a169513ec26a30b5c57ef82dcd45d97" => :sierra
sha256 "69db51ab48473114449682010dfa7e03c992184a7fea6df1dd4e6c6a6e7ca72a" => :el_capitan
end
depends_on "check"
depends_on "sdl2_image"
depends_on "sdl_mixer"
depends_on "sdl_ttf"
depends_on "sdl_gfx"
depends_on "sdl_image"
depends_on "gettext"
depends_on "libzip"
depends_on "fontconfig"
depends_on "pkg-config" => :build
resource "freedink-data" do
url "https://ftp.gnu.org/gnu/freedink/freedink-data-1.08.20170409.tar.gz"
sha256 "e1f1e23c7846bc74479610a65cc0169906e844c5193f0d83ba69accc54a3bdf5"
end
def install
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
resource("freedink-data").stage do
inreplace "Makefile", "xargs -0r", "xargs -0"
system "make", "install", "PREFIX=#{prefix}"
end
end
test do
assert_match "GNU FreeDink 108.4", shell_output("#{bin}/freedink -vwis")
assert FileTest.exists?("#{share}/dink/dink/Dink.dat")
end
end
|
class Freeglut < Formula
desc "Open-source alternative to the OpenGL Utility Toolkit (GLUT) library"
homepage "https://freeglut.sourceforge.io/"
url "https://downloads.sourceforge.net/project/freeglut/freeglut/3.2.1/freeglut-3.2.1.tar.gz"
sha256 "d4000e02102acaf259998c870e25214739d1f16f67f99cb35e4f46841399da68"
license "MIT"
revision OS.mac? ? 1 : 3
livecheck do
url :stable
end
bottle do
cellar :any
sha256 "21e92d3aa8a1615937c6776292dd823912220d272a4a437f66917d1e6dd0b655" => :catalina
sha256 "8d71afe59334afe060d513d68e8c76b3fc0927cf05d61b146dd1444c66d5db35" => :mojave
sha256 "0a30955c90e594481f1ebf4dd218065768386704e2fdcdc0aae45055171dfd2d" => :high_sierra
end
depends_on "cmake" => :build
depends_on "pkg-config" => :test
depends_on "libx11"
depends_on "libxi"
depends_on "libxrandr"
depends_on "libxxf86vm"
depends_on "mesa"
unless OS.mac?
depends_on "linuxbrew/xorg/glu"
depends_on "linuxbrew/xorg/xinput"
end
resource "init_error_func.c" do
url "https://raw.githubusercontent.com/dcnieho/FreeGLUT/c63102d06d09f8a9d4044fd107fbda2034bb30c6/freeglut/freeglut/progs/demos/init_error_func/init_error_func.c"
sha256 "74ff9c3f722043fc617807f19d3052440073b1cb5308626c1cefd6798a284613"
end
def install
args = %W[
-DFREEGLUT_BUILD_DEMOS=OFF
-DOPENGL_INCLUDE_DIR=#{Formula["mesa"].include}
-DOPENGL_gl_LIBRARY=#{Formula["mesa"].lib}/#{shared_library("libGL")}
]
system "cmake", *std_cmake_args, *args, "."
system "make", "all"
system "make", "install"
end
test do
resource("init_error_func.c").stage(testpath)
flags = shell_output("pkg-config --cflags --libs glut gl xext x11").chomp.split
system ENV.cc, "init_error_func.c", "-o", "init_error_func", *flags
assert_match "Entering user defined error handler", shell_output("./init_error_func 2>&1", 1)
end
end
freeglut: update 3.2.1_3 bottle.
class Freeglut < Formula
desc "Open-source alternative to the OpenGL Utility Toolkit (GLUT) library"
homepage "https://freeglut.sourceforge.io/"
url "https://downloads.sourceforge.net/project/freeglut/freeglut/3.2.1/freeglut-3.2.1.tar.gz"
sha256 "d4000e02102acaf259998c870e25214739d1f16f67f99cb35e4f46841399da68"
license "MIT"
revision OS.mac? ? 1 : 3
livecheck do
url :stable
end
bottle do
cellar :any
sha256 "21e92d3aa8a1615937c6776292dd823912220d272a4a437f66917d1e6dd0b655" => :catalina
sha256 "8d71afe59334afe060d513d68e8c76b3fc0927cf05d61b146dd1444c66d5db35" => :mojave
sha256 "0a30955c90e594481f1ebf4dd218065768386704e2fdcdc0aae45055171dfd2d" => :high_sierra
sha256 "55bfe3f83784fc2758d4ff0c69feffc6283a1a31951dd44d005de9eefe686cfa" => :x86_64_linux
end
depends_on "cmake" => :build
depends_on "pkg-config" => :test
depends_on "libx11"
depends_on "libxi"
depends_on "libxrandr"
depends_on "libxxf86vm"
depends_on "mesa"
unless OS.mac?
depends_on "linuxbrew/xorg/glu"
depends_on "linuxbrew/xorg/xinput"
end
resource "init_error_func.c" do
url "https://raw.githubusercontent.com/dcnieho/FreeGLUT/c63102d06d09f8a9d4044fd107fbda2034bb30c6/freeglut/freeglut/progs/demos/init_error_func/init_error_func.c"
sha256 "74ff9c3f722043fc617807f19d3052440073b1cb5308626c1cefd6798a284613"
end
def install
args = %W[
-DFREEGLUT_BUILD_DEMOS=OFF
-DOPENGL_INCLUDE_DIR=#{Formula["mesa"].include}
-DOPENGL_gl_LIBRARY=#{Formula["mesa"].lib}/#{shared_library("libGL")}
]
system "cmake", *std_cmake_args, *args, "."
system "make", "all"
system "make", "install"
end
test do
resource("init_error_func.c").stage(testpath)
flags = shell_output("pkg-config --cflags --libs glut gl xext x11").chomp.split
system ENV.cc, "init_error_func.c", "-o", "init_error_func", *flags
assert_match "Entering user defined error handler", shell_output("./init_error_func 2>&1", 1)
end
end
|
class Freeling < Formula
desc "Suite of language analyzers"
homepage "http://nlp.lsi.upc.edu/freeling/"
url "https://github.com/TALP-UPC/FreeLing/releases/download/4.1/FreeLing-4.1.tar.gz"
sha256 "ccb3322db6851075c9419bb5e472aa6b2e32cc7e9fa01981cff49ea3b212247e"
revision 4
bottle do
sha256 "7777a7ca0c3a4cb72e9125d6413ee53b09800ef8a93c8cdcf4f24648ef7e2496" => :catalina
sha256 "6de02b3f2b1cf9cc28ec450cb10cba002d6e5075e066f877e3e9caac44058941" => :mojave
sha256 "c14f035f0f7297091d06a7523cab35aba5d1203ae6dc70793ed5c94692ba42bb" => :high_sierra
end
depends_on "cmake" => :build
depends_on "boost"
depends_on "icu4c"
conflicts_with "hunspell", :because => "both install 'analyze' binary"
# Fix linking with icu4c
patch do
url "https://github.com/TALP-UPC/FreeLing/commit/5e323a5f3c7d2858a6ebb45617291b8d4126cedb.patch?full_index=1"
sha256 "0814211cd1fb9b075d370f10df71a4398bc93d64fd7f32ccba1e34fb4e6b7452"
end
def install
mkdir "build" do
system "cmake", "..", *std_cmake_args
system "make", "install"
end
libexec.install "#{bin}/fl_initialize"
inreplace "#{bin}/analyze",
". $(cd $(dirname $0) && echo $PWD)/fl_initialize",
". #{libexec}/fl_initialize"
end
test do
expected = <<~EOS
Hello hello NN 1
world world NN 1
EOS
assert_equal expected, pipe_output("#{bin}/analyze -f #{pkgshare}/config/en.cfg", "Hello world").chomp
end
end
freeling: revision for icu4c
class Freeling < Formula
desc "Suite of language analyzers"
homepage "http://nlp.lsi.upc.edu/freeling/"
url "https://github.com/TALP-UPC/FreeLing/releases/download/4.1/FreeLing-4.1.tar.gz"
sha256 "ccb3322db6851075c9419bb5e472aa6b2e32cc7e9fa01981cff49ea3b212247e"
revision 5
bottle do
sha256 "7777a7ca0c3a4cb72e9125d6413ee53b09800ef8a93c8cdcf4f24648ef7e2496" => :catalina
sha256 "6de02b3f2b1cf9cc28ec450cb10cba002d6e5075e066f877e3e9caac44058941" => :mojave
sha256 "c14f035f0f7297091d06a7523cab35aba5d1203ae6dc70793ed5c94692ba42bb" => :high_sierra
end
depends_on "cmake" => :build
depends_on "boost"
depends_on "icu4c"
conflicts_with "hunspell", :because => "both install 'analyze' binary"
# Fix linking with icu4c
patch do
url "https://github.com/TALP-UPC/FreeLing/commit/5e323a5f3c7d2858a6ebb45617291b8d4126cedb.patch?full_index=1"
sha256 "0814211cd1fb9b075d370f10df71a4398bc93d64fd7f32ccba1e34fb4e6b7452"
end
def install
mkdir "build" do
system "cmake", "..", *std_cmake_args
system "make", "install"
end
libexec.install "#{bin}/fl_initialize"
inreplace "#{bin}/analyze",
". $(cd $(dirname $0) && echo $PWD)/fl_initialize",
". #{libexec}/fl_initialize"
end
test do
expected = <<~EOS
Hello hello NN 1
world world NN 1
EOS
assert_equal expected, pipe_output("#{bin}/analyze -f #{pkgshare}/config/en.cfg", "Hello world").chomp
end
end
|
class Frobtads < Formula
desc "TADS interpreter and compilers"
homepage "https://www.tads.org/frobtads.htm"
url "https://github.com/realnc/frobtads/releases/download/1.2.4/frobtads-1.2.4.tar.bz2"
sha256 "705be5849293844f499a85280e793941b0eacb362b90d49d85ae8308e4c5b63c"
bottle do
sha256 arm64_big_sur: "38ca03ffb773038f3662b2ae3f87fd1fe531d4fcd4e4543787d1f091876b5216"
sha256 big_sur: "f7ed003dbda0749cae604507f914fd4318832033775376b2774f968e4e3031db"
sha256 catalina: "7c35ab7ec92f7d4c50fee6265aef35c83766dd0999612fa3de926bf61966cd2c"
sha256 mojave: "1f930caa2b88fb90d0cc1938397be4e66e8b43835773ddbedff9c891fae12e59"
sha256 high_sierra: "af5706f2616c0be86e6cfbed57ba560fa2bbdcb8b59c769c0c3e800552d51829"
sha256 sierra: "d3c660cd331b2a35ef36f55210e50e05e98d06fe3e5d606205ba63d226625f2b"
sha256 el_capitan: "cff84f9389281d4ca9c9aae8ece93384aec506ea9601e1c3d637df82776afce3"
end
uses_from_macos "curl" => :build
def install
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make", "install"
end
test do
assert_match(/FrobTADS #{version}$/, shell_output("#{bin}/frob --version"))
end
end
frobtads: add curl and ncurses as Linux runtime dependencies (#82306)
class Frobtads < Formula
desc "TADS interpreter and compilers"
homepage "https://www.tads.org/frobtads.htm"
url "https://github.com/realnc/frobtads/releases/download/1.2.4/frobtads-1.2.4.tar.bz2"
sha256 "705be5849293844f499a85280e793941b0eacb362b90d49d85ae8308e4c5b63c"
bottle do
sha256 arm64_big_sur: "38ca03ffb773038f3662b2ae3f87fd1fe531d4fcd4e4543787d1f091876b5216"
sha256 big_sur: "f7ed003dbda0749cae604507f914fd4318832033775376b2774f968e4e3031db"
sha256 catalina: "7c35ab7ec92f7d4c50fee6265aef35c83766dd0999612fa3de926bf61966cd2c"
sha256 mojave: "1f930caa2b88fb90d0cc1938397be4e66e8b43835773ddbedff9c891fae12e59"
sha256 high_sierra: "af5706f2616c0be86e6cfbed57ba560fa2bbdcb8b59c769c0c3e800552d51829"
sha256 sierra: "d3c660cd331b2a35ef36f55210e50e05e98d06fe3e5d606205ba63d226625f2b"
sha256 el_capitan: "cff84f9389281d4ca9c9aae8ece93384aec506ea9601e1c3d637df82776afce3"
end
uses_from_macos "curl"
uses_from_macos "ncurses"
def install
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make", "install"
end
test do
assert_match(/FrobTADS #{version}$/, shell_output("#{bin}/frob --version"))
end
end
|
require "formula"
class GitCola < Formula
homepage "http://git-cola.github.io/"
url "https://github.com/git-cola/git-cola/archive/v2.0.5.tar.gz"
sha1 "530bb6956d0499f0451979eaeee65e6a2298d30b"
head "https://github.com/git-cola/git-cola.git"
bottle do
cellar :any
sha1 "f2acd531c892f811c317630db8b66c4b398d24e2" => :mavericks
sha1 "87825694c73263eba4429a2e3f8792dbd4fd4bad" => :mountain_lion
sha1 "69d5577b80e332a6f97aef0394ecf21fb003991b" => :lion
end
option "with-docs", "Build man pages using asciidoc and xmlto"
depends_on "pyqt"
if build.with? "docs"
# these are needed to build man pages
depends_on "asciidoc"
depends_on "xmlto"
end
def install
system "make", "prefix=#{prefix}", "install"
if build.with? "docs"
system "make", "-C", "share/doc/git-cola",
"-f", "Makefile.asciidoc",
"prefix=#{prefix}",
"install", "install-html"
end
end
end
git-cola 2.0.6
require "formula"
class GitCola < Formula
homepage "http://git-cola.github.io/"
url "https://github.com/git-cola/git-cola/archive/v2.0.6.tar.gz"
sha1 "8fd261bf7aa49515d2bc2be3028562921c4eef02"
head "https://github.com/git-cola/git-cola.git"
bottle do
cellar :any
sha1 "f2acd531c892f811c317630db8b66c4b398d24e2" => :mavericks
sha1 "87825694c73263eba4429a2e3f8792dbd4fd4bad" => :mountain_lion
sha1 "69d5577b80e332a6f97aef0394ecf21fb003991b" => :lion
end
option "with-docs", "Build man pages using asciidoc and xmlto"
depends_on "pyqt"
if build.with? "docs"
# these are needed to build man pages
depends_on "asciidoc"
depends_on "xmlto"
end
def install
system "make", "prefix=#{prefix}", "install"
if build.with? "docs"
system "make", "-C", "share/doc/git-cola",
"-f", "Makefile.asciidoc",
"prefix=#{prefix}",
"install", "install-html"
end
end
end
|
class GitCola < Formula
desc "Highly caffeinated git GUI"
homepage "https://git-cola.github.io/"
url "https://github.com/git-cola/git-cola/archive/v3.0.tar.gz"
sha256 "61958f998d4618e09ce0dd473411921818d13df838f32102ef5ded984a0d1a50"
head "https://github.com/git-cola/git-cola.git"
bottle do
cellar :any_skip_relocation
sha256 "2aaadd48e3fc112c3e20a366ab798de2d76c965a2f5e2acc5922444a1efec1b8" => :high_sierra
sha256 "2aaadd48e3fc112c3e20a366ab798de2d76c965a2f5e2acc5922444a1efec1b8" => :sierra
sha256 "2aaadd48e3fc112c3e20a366ab798de2d76c965a2f5e2acc5922444a1efec1b8" => :el_capitan
end
option "with-docs", "Build manpages and HTML docs"
depends_on "pyqt"
depends_on :python3
depends_on "sphinx-doc" => :build if build.with? "docs"
def install
ENV.delete("PYTHONPATH")
system "make", "PYTHON=python3", "prefix=#{prefix}", "install"
if build.with? "docs"
system "make", "install-doc", "PYTHON=python3", "prefix=#{prefix}",
"SPHINXBUILD=#{Formula["sphinx-doc"].opt_bin}/sphinx-build"
end
end
test do
system "#{bin}/git-cola", "--version"
end
end
git-cola: update 3.0 bottle for Linuxbrew.
class GitCola < Formula
desc "Highly caffeinated git GUI"
homepage "https://git-cola.github.io/"
url "https://github.com/git-cola/git-cola/archive/v3.0.tar.gz"
sha256 "61958f998d4618e09ce0dd473411921818d13df838f32102ef5ded984a0d1a50"
head "https://github.com/git-cola/git-cola.git"
bottle do
cellar :any_skip_relocation
sha256 "2aaadd48e3fc112c3e20a366ab798de2d76c965a2f5e2acc5922444a1efec1b8" => :high_sierra
sha256 "2aaadd48e3fc112c3e20a366ab798de2d76c965a2f5e2acc5922444a1efec1b8" => :sierra
sha256 "2aaadd48e3fc112c3e20a366ab798de2d76c965a2f5e2acc5922444a1efec1b8" => :el_capitan
sha256 "803a5b011b0797d6d17aa72b3943c568b6ba775e566f792e7074aa596e1c8ba0" => :x86_64_linux
end
option "with-docs", "Build manpages and HTML docs"
depends_on "pyqt"
depends_on :python3
depends_on "sphinx-doc" => :build if build.with? "docs"
def install
ENV.delete("PYTHONPATH")
system "make", "PYTHON=python3", "prefix=#{prefix}", "install"
if build.with? "docs"
system "make", "install-doc", "PYTHON=python3", "prefix=#{prefix}",
"SPHINXBUILD=#{Formula["sphinx-doc"].opt_bin}/sphinx-build"
end
end
test do
system "#{bin}/git-cola", "--version"
end
end
|
require 'formula'
class GitCola < Formula
homepage 'http://git-cola.github.com/'
url 'https://github.com/git-cola/git-cola/tarball/v1.8.0'
sha1 'c36607dbff93e0a36954b500548a90f26b7a0b74'
head 'https://github.com/git-cola/git-cola.git'
option 'with-docs', "Build man pages using asciidoc and xmlto"
depends_on 'pyqt'
if build.include? 'with-docs'
# these are needed to build man pages
depends_on 'asciidoc'
depends_on 'xmlto'
end
def install
ENV.prepend 'PYTHONPATH', "#{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages", ':'
system "make", "prefix=#{prefix}", "install"
if build.include? 'with-docs'
system "make", "-C", "share/doc/git-cola",
"-f", "Makefile.asciidoc",
"prefix=#{prefix}",
"install", "install-html"
end
end
def which_python
"python" + `python -c 'import sys;print(sys.version[:3])'`.strip
end
end
git-cola v1.8.1
Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
require 'formula'
class GitCola < Formula
homepage 'http://git-cola.github.com/'
url 'https://github.com/git-cola/git-cola/tarball/v1.8.1'
sha1 '125055ac18f30aa25bf9f0874b888659233ab22e'
head 'https://github.com/git-cola/git-cola.git'
option 'with-docs', "Build man pages using asciidoc and xmlto"
depends_on 'pyqt'
if build.include? 'with-docs'
# these are needed to build man pages
depends_on 'asciidoc'
depends_on 'xmlto'
end
def install
ENV.prepend 'PYTHONPATH', "#{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages", ':'
system "make", "prefix=#{prefix}", "install"
if build.include? 'with-docs'
system "make", "-C", "share/doc/git-cola",
"-f", "Makefile.asciidoc",
"prefix=#{prefix}",
"install", "install-html"
end
end
def which_python
"python" + `python -c 'import sys;print(sys.version[:3])'`.strip
end
end
|
class GitPlus < Formula
include Language::Python::Virtualenv
desc "Git utilities: git multi, git relation, git old-branches, git recent"
homepage "https://github.com/tkrajina/git-plus"
url "https://files.pythonhosted.org/packages/23/be/892184c18bb8b7ddc8d1931d3b638ec2221ae0725111008b330c7d44dc43/git-plus-v0.4.5.tar.gz"
sha256 "e60d97ceb7472c5f15a7230d14b3e1f4ab050cd5abf574fe9959bcc00fc17285"
license "Apache-2.0"
head "https://github.com/tkrajina/git-plus.git"
bottle do
cellar :any_skip_relocation
sha256 "8004d2a502eaad6e616b140359d5a5af426dd767dad54477672b6f6ca8993b4f" => :catalina
sha256 "8d35fc4e02f5587e140428e5546d36d76f33c3e4c13210b4e4257ecf723cf6ad" => :mojave
sha256 "3b9f87989868d3042e0d62fe091c0c8529f34eeeefd73a6f58ffe2c9e233c36a" => :high_sierra
end
depends_on "python@3.8"
def install
virtualenv_install_with_resources
end
test do
mkdir "testme" do
system "git", "init"
system "git", "config", "user.email", "\"test@example.com\""
system "git", "config", "user.name", "\"Test\""
touch "README"
system "git", "add", "README"
system "git", "commit", "-m", "testing"
rm "README"
end
assert_match "D README", shell_output("#{bin}/git-multi")
end
end
git-plus: update 0.4.5 bottle.
class GitPlus < Formula
include Language::Python::Virtualenv
desc "Git utilities: git multi, git relation, git old-branches, git recent"
homepage "https://github.com/tkrajina/git-plus"
url "https://files.pythonhosted.org/packages/23/be/892184c18bb8b7ddc8d1931d3b638ec2221ae0725111008b330c7d44dc43/git-plus-v0.4.5.tar.gz"
sha256 "e60d97ceb7472c5f15a7230d14b3e1f4ab050cd5abf574fe9959bcc00fc17285"
license "Apache-2.0"
head "https://github.com/tkrajina/git-plus.git"
bottle do
cellar :any_skip_relocation
sha256 "bddc068b92e8b64c9e2795eea8f1b52ffe4a69be0374080806157d867f2dee74" => :catalina
sha256 "dd7f413430c9568a6f1d8a1821c672abb0e184b61403c2d3a366399fb23840a3" => :mojave
sha256 "878c9fbdc776717eb21c07767bd67fc0d6ad412a69fbeab7ff12f9795076d8f3" => :high_sierra
end
depends_on "python@3.8"
def install
virtualenv_install_with_resources
end
test do
mkdir "testme" do
system "git", "init"
system "git", "config", "user.email", "\"test@example.com\""
system "git", "config", "user.name", "\"Test\""
touch "README"
system "git", "add", "README"
system "git", "commit", "-m", "testing"
rm "README"
end
assert_match "D README", shell_output("#{bin}/git-multi")
end
end
|
class Gitbatch < Formula
desc "Manage your git repositories in one place"
homepage "https://github.com/isacikgoz/gitbatch"
url "https://github.com/isacikgoz/gitbatch/archive/v0.6.0.tar.gz"
sha256 "b87b0432b3270a403a10dd8d3c06cd6f7c5a6d2e94c32c0e8410c61124e347e5"
license "MIT"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "435b26ee9b78a811d918ef891a9e57570179c4a543095cd83c86e02d017787af"
sha256 cellar: :any_skip_relocation, big_sur: "f9e66be24dac6acb5c3bb771971ac7d8736002a51b400a5922d9e99a33868d75"
sha256 cellar: :any_skip_relocation, catalina: "725d490cf957518eb5e169564c77a044cb48ec64c40bf1003ff859fef9461b16"
sha256 cellar: :any_skip_relocation, mojave: "4fbdaf04019dc3fc925754a6401b17793aab30860227123f8df17aaa114fa531"
end
depends_on "go" => :build
def install
system "go", "build", *std_go_args(ldflags: "-s -w"), "./cmd/gitbatch"
end
test do
mkdir testpath/"repo" do
system "git", "init"
end
assert_match "1 repositories finished", shell_output("#{bin}/gitbatch -q")
end
end
gitbatch: update 0.6.0 bottle.
class Gitbatch < Formula
desc "Manage your git repositories in one place"
homepage "https://github.com/isacikgoz/gitbatch"
url "https://github.com/isacikgoz/gitbatch/archive/v0.6.0.tar.gz"
sha256 "b87b0432b3270a403a10dd8d3c06cd6f7c5a6d2e94c32c0e8410c61124e347e5"
license "MIT"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "435b26ee9b78a811d918ef891a9e57570179c4a543095cd83c86e02d017787af"
sha256 cellar: :any_skip_relocation, big_sur: "f9e66be24dac6acb5c3bb771971ac7d8736002a51b400a5922d9e99a33868d75"
sha256 cellar: :any_skip_relocation, catalina: "725d490cf957518eb5e169564c77a044cb48ec64c40bf1003ff859fef9461b16"
sha256 cellar: :any_skip_relocation, mojave: "4fbdaf04019dc3fc925754a6401b17793aab30860227123f8df17aaa114fa531"
sha256 cellar: :any_skip_relocation, x86_64_linux: "04f8e80acf30878752f93b268141756e48bc36fbddb62a963c5748a790e95cfe"
end
depends_on "go" => :build
def install
system "go", "build", *std_go_args(ldflags: "-s -w"), "./cmd/gitbatch"
end
test do
mkdir testpath/"repo" do
system "git", "init"
end
assert_match "1 repositories finished", shell_output("#{bin}/gitbatch -q")
end
end
|
class Gitleaks < Formula
desc "Audit git repos for secrets"
homepage "https://github.com/zricethezav/gitleaks"
url "https://github.com/zricethezav/gitleaks/archive/v8.5.3.tar.gz"
sha256 "0d8d9dd11c4e609714184dd196adcd9562d834f0fdd45106e00f906e9ce6ef0f"
license "MIT"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "eaa64801f1b672582bf988e91a3187bda96f0632dfb4f0d6cf566c512a4429b0"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "865cd20c565d98fb00684e45419c5fcf201be90ba4904447fc31a53e988d743a"
sha256 cellar: :any_skip_relocation, monterey: "d8df132d162106b0f0ca34de14f8ef06eb8d0bc7a948a5369638c75888d5c761"
sha256 cellar: :any_skip_relocation, big_sur: "24cfaf247122fdf2d8cc4c694aab2d9927770f770ae15ffe03ccd14b7a267bb9"
sha256 cellar: :any_skip_relocation, catalina: "d0b249ad2f3c11d429823cdc7d59527264e1b2994ca3b43820298f90fb308d7c"
sha256 cellar: :any_skip_relocation, x86_64_linux: "e738e2653d841f2b66c8ee9f5d913a3fa04a511b1e0777dd1a2676191edf3d79"
end
depends_on "go" => :build
def install
ldflags = "-X github.com/zricethezav/gitleaks/v#{version.major}/cmd.Version=#{version}"
system "go", "build", *std_go_args(ldflags: ldflags)
bash_output = Utils.safe_popen_read(bin/"gitleaks", "completion", "bash")
(bash_completion/"gitleaks").write bash_output
zsh_output = Utils.safe_popen_read(bin/"gitleaks", "completion", "zsh")
(zsh_completion/"_gitleaks").write zsh_output
fish_output = Utils.safe_popen_read(bin/"gitleaks", "completion", "fish")
(fish_completion/"gitleaks.fish").write fish_output
end
test do
(testpath/"README").write "ghp_deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"
system "git", "init"
system "git", "add", "README"
system "git", "commit", "-m", "Initial commit"
assert_match(/WRN\S* leaks found: [1-9]/, shell_output("#{bin}/gitleaks detect 2>&1", 1))
assert_equal version.to_s, shell_output("#{bin}/gitleaks version").strip
end
end
gitleaks: update 8.5.3 bottle.
class Gitleaks < Formula
desc "Audit git repos for secrets"
homepage "https://github.com/zricethezav/gitleaks"
url "https://github.com/zricethezav/gitleaks/archive/v8.5.3.tar.gz"
sha256 "0d8d9dd11c4e609714184dd196adcd9562d834f0fdd45106e00f906e9ce6ef0f"
license "MIT"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "0f789033262a96849ba74d5dbc525739ebae5e695476b8cd9781276f4d665cff"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "0fe792282142a41c2db38440f3aa8d31f69913d21246e59e4e9cc67c74a6d695"
sha256 cellar: :any_skip_relocation, monterey: "0a3fd5d978709aac5552d44317d70c30a2c1f71ecf32193bfdfabdb65cf5ddfa"
sha256 cellar: :any_skip_relocation, big_sur: "fa582ba044af1e9c5507db89f7a68f908bde84f53e9f3e21769550bf3d83ef42"
sha256 cellar: :any_skip_relocation, catalina: "6a49b74f3356158971cc1476fcbccac38d1daee3e95b45f82abfd46a6c6ff2d0"
sha256 cellar: :any_skip_relocation, x86_64_linux: "03093a7343f752f6b806a0b207b86ca9c91c6bab673056bbdb3523865244cf24"
end
depends_on "go" => :build
def install
ldflags = "-X github.com/zricethezav/gitleaks/v#{version.major}/cmd.Version=#{version}"
system "go", "build", *std_go_args(ldflags: ldflags)
bash_output = Utils.safe_popen_read(bin/"gitleaks", "completion", "bash")
(bash_completion/"gitleaks").write bash_output
zsh_output = Utils.safe_popen_read(bin/"gitleaks", "completion", "zsh")
(zsh_completion/"_gitleaks").write zsh_output
fish_output = Utils.safe_popen_read(bin/"gitleaks", "completion", "fish")
(fish_completion/"gitleaks.fish").write fish_output
end
test do
(testpath/"README").write "ghp_deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"
system "git", "init"
system "git", "add", "README"
system "git", "commit", "-m", "Initial commit"
assert_match(/WRN\S* leaks found: [1-9]/, shell_output("#{bin}/gitleaks detect 2>&1", 1))
assert_equal version.to_s, shell_output("#{bin}/gitleaks version").strip
end
end
|
class Gmailctl < Formula
desc "Declarative configuration for Gmail filters"
homepage "https://github.com/mbrt/gmailctl"
url "https://github.com/mbrt/gmailctl/archive/v0.10.0.tar.gz"
sha256 "ebc3f13b71363e49b804daadc3e1fff394cf42769429e4b081de86100fb5f685"
license "MIT"
head "https://github.com/mbrt/gmailctl.git", branch: "master"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "302122d731d00e13790b5fa313f94d406ebc51c0f9590f8d4856d0b8b8679dab"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "32361886ab245d106bfdabc60eceb43f803636aa5c4db59187396f2dcf80674e"
sha256 cellar: :any_skip_relocation, monterey: "4d50ae7c42cc8c3b06a045ef73f97cd0e8eb0c12e172d040607a37c6ae569043"
sha256 cellar: :any_skip_relocation, big_sur: "3c9080dfdc290ee0747fbd7d70c786166636d22c0114bdfd8dfe27f8ad0ca330"
sha256 cellar: :any_skip_relocation, catalina: "6239ab2e534e2b0b013bdf0068a75d88aa51abb91fc9f9b8f079dc3c80abdd41"
sha256 cellar: :any_skip_relocation, mojave: "b6a4a9554edec82d0386efa66a88bf4d7503d3cda5d6e96940834afd270c90e4"
sha256 cellar: :any_skip_relocation, x86_64_linux: "388790f3dff736f78e035afd488374cdd8da3f433da2d051e7f0cb67f4a92d5b"
end
depends_on "go" => :build
def install
system "go", "build", *std_go_args(ldflags: "-s -w -X main.version=#{version}"), "cmd/gmailctl/main.go"
end
test do
assert_includes shell_output("#{bin}/gmailctl init --config #{testpath} 2>&1", 1),
"The credentials are not initialized"
assert_match version.to_s, shell_output("#{bin}/gmailctl version")
end
end
gmailctl: update 0.10.0 bottle.
class Gmailctl < Formula
desc "Declarative configuration for Gmail filters"
homepage "https://github.com/mbrt/gmailctl"
url "https://github.com/mbrt/gmailctl/archive/v0.10.0.tar.gz"
sha256 "ebc3f13b71363e49b804daadc3e1fff394cf42769429e4b081de86100fb5f685"
license "MIT"
head "https://github.com/mbrt/gmailctl.git", branch: "master"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "befd99284ddcbfaf6f5b67e74022cb36e52cd831add1ef8cd6cbd2227ecbb695"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "7155b35cdbc2190d4aa939968a1edeb794a53e10760352fa51050f8b486adf85"
sha256 cellar: :any_skip_relocation, monterey: "24e13ac28cf47782ff714d3039d0bd3a4dfb6984572fe0b195264902f7a178a7"
sha256 cellar: :any_skip_relocation, big_sur: "37309984d78e4bcd5018bff9ecf22a6a82e19283b6c30bf2412679f193020e09"
sha256 cellar: :any_skip_relocation, catalina: "ed33cc60a35a08564666178242bd182b2e1a7f1f0ca1a8a5712cc6a3fa2ebe1e"
sha256 cellar: :any_skip_relocation, x86_64_linux: "9bf8787bdca7979656460081c3d8fd6b72ace1d7e3e353851e64d25336cf95f2"
end
depends_on "go" => :build
def install
system "go", "build", *std_go_args(ldflags: "-s -w -X main.version=#{version}"), "cmd/gmailctl/main.go"
end
test do
assert_includes shell_output("#{bin}/gmailctl init --config #{testpath} 2>&1", 1),
"The credentials are not initialized"
assert_match version.to_s, shell_output("#{bin}/gmailctl version")
end
end
|
class Gnumeric < Formula
desc "GNOME Spreadsheet Application"
homepage "https://projects.gnome.org/gnumeric/"
url "https://download.gnome.org/sources/gnumeric/1.12/gnumeric-1.12.43.tar.xz"
sha256 "87c9abd6260cf29401fa1e0fcce374e8c7bcd1986608e4049f6037c9d32b5fd5"
bottle do
sha256 "1317c0b0a36c781ea587b3411a2b7c7ccff9206fed085e002e4bbef339130e99" => :mojave
sha256 "f4a007bcb9422d69d6217c08f9af877ed61cdf51d919fc88eb6d905c1aedaf3f" => :high_sierra
sha256 "d7db9d5d98fb58473c411d22683e8de5e73fe6e965dae5bdbd8d3fd243a59826" => :sierra
sha256 "c987c86ec64c80322d7f602234ca1e3e144889bf72d6144f9d1b5ffa76879ec8" => :el_capitan
end
depends_on "intltool" => :build
depends_on "pkg-config" => :build
depends_on "adwaita-icon-theme"
depends_on "gettext"
depends_on "goffice"
depends_on "itstool"
depends_on "libxml2"
depends_on "rarian"
def install
# ensures that the files remain within the keg
inreplace "component/Makefile.in",
"GOFFICE_PLUGINS_DIR = @GOFFICE_PLUGINS_DIR@",
"GOFFICE_PLUGINS_DIR = @libdir@/goffice/@GOFFICE_API_VER@/plugins/gnumeric"
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--disable-schemas-compile"
system "make", "install"
end
def post_install
system "#{Formula["glib"].opt_bin}/glib-compile-schemas", "#{HOMEBREW_PREFIX}/share/glib-2.0/schemas"
end
test do
system bin/"gnumeric", "--version"
end
end
gnumeric: update 1.12.43 bottle.
class Gnumeric < Formula
desc "GNOME Spreadsheet Application"
homepage "https://projects.gnome.org/gnumeric/"
url "https://download.gnome.org/sources/gnumeric/1.12/gnumeric-1.12.43.tar.xz"
sha256 "87c9abd6260cf29401fa1e0fcce374e8c7bcd1986608e4049f6037c9d32b5fd5"
bottle do
rebuild 1
sha256 "915075749528bd3b0f31651fbdfac38a6e06134eea6ed99f97b7b777fba0f3ac" => :mojave
sha256 "9c9e678a2d3f25b34c1896d197a7cd3a6da6207fee9b3a64a5f3526ed742bf1c" => :high_sierra
sha256 "65ff2bf41de0d4b5665e619720cf045b00177f345ec80198d0190cf0a1c3f66b" => :sierra
end
depends_on "intltool" => :build
depends_on "pkg-config" => :build
depends_on "adwaita-icon-theme"
depends_on "gettext"
depends_on "goffice"
depends_on "itstool"
depends_on "libxml2"
depends_on "rarian"
def install
# ensures that the files remain within the keg
inreplace "component/Makefile.in",
"GOFFICE_PLUGINS_DIR = @GOFFICE_PLUGINS_DIR@",
"GOFFICE_PLUGINS_DIR = @libdir@/goffice/@GOFFICE_API_VER@/plugins/gnumeric"
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--disable-schemas-compile"
system "make", "install"
end
def post_install
system "#{Formula["glib"].opt_bin}/glib-compile-schemas", "#{HOMEBREW_PREFIX}/share/glib-2.0/schemas"
end
test do
system bin/"gnumeric", "--version"
end
end
|
class Gnuradio < Formula
desc "SDK providing the signal processing runtime and processing blocks"
homepage "https://gnuradio.org/"
url "https://gnuradio.org/releases/gnuradio/gnuradio-3.7.11.tar.gz"
sha256 "87d9ba3183858efdbb237add3f9de40f7d65f25e16904a9bc8d764a7287252d4"
head "https://github.com/gnuradio/gnuradio.git"
bottle do
sha256 "0e58f09ccae37ed23fef1ea94015d74ed2ccc433dad822e81c5fe11144ff445a" => :sierra
sha256 "c09cf5c52be5e649a8d00780edc8e06516c784b3bee2c3f1eb1ca646df9ac88c" => :el_capitan
sha256 "ec0023a0efa086de35f5c143cd3f86229404ff8f42859dad0e40c4e95a7fd60e" => :yosemite
end
option "without-python", "Build without python support"
depends_on "pkg-config" => :build
depends_on :python => :recommended if MacOS.version <= :snow_leopard
depends_on "boost"
depends_on "fftw"
depends_on "gsl"
depends_on "zeromq"
depends_on "numpy" if build.with? :python
depends_on "swig" => :build if build.with? :python
depends_on "cmake" => :build
# For documentation
depends_on "doxygen" => [:build, :optional]
depends_on "sphinx-doc" => [:build, :optional]
depends_on "uhd" => :recommended
depends_on "sdl" => :optional
depends_on "jack" => :optional
depends_on "portaudio" => :recommended
depends_on "pygtk" => :optional
depends_on "wxpython" => :optional
# cheetah starts here
resource "Markdown" do
url "https://files.pythonhosted.org/packages/1d/25/3f6d2cb31ec42ca5bd3bfbea99b63892b735d76e26f20dd2dcc34ffe4f0d/Markdown-2.6.8.tar.gz"
sha256 "0ac8a81e658167da95d063a9279c9c1b2699f37c7c4153256a458b3a43860e33"
end
resource "Cheetah" do
url "https://files.pythonhosted.org/packages/cd/b0/c2d700252fc251e91c08639ff41a8a5203b627f4e0a2ae18a6b662ab32ea/Cheetah-2.4.4.tar.gz"
sha256 "be308229f0c1e5e5af4f27d7ee06d90bb19e6af3059794e5fd536a6f29a9b550"
end
# cheetah ends here
resource "lxml" do
url "https://files.pythonhosted.org/packages/39/e8/a8e0b1fa65dd021d48fe21464f71783655f39a41f218293c1c590d54eb82/lxml-3.7.3.tar.gz"
sha256 "aa502d78a51ee7d127b4824ff96500f0181d3c7826e6ee7b800d068be79361c7"
end
resource "cppzmq" do
url "https://raw.githubusercontent.com/zeromq/cppzmq/46fc0572c5e9f09a32a23d6f22fd79b841f77e00/zmq.hpp"
sha256 "964031c0944f913933f55ad1610938105a6657a69d1ac5a6dd50e16a679104d5"
end
def install
ENV["CHEETAH_INSTALL_WITHOUT_SETUPTOOLS"] = "1"
ENV["XML_CATALOG_FILES"] = etc/"xml/catalog"
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages"
res = %w[Markdown Cheetah lxml]
res.each do |r|
resource(r).stage do
system "python", *Language::Python.setup_install_args(libexec/"vendor")
end
end
resource("cppzmq").stage include.to_s
args = std_cmake_args
args << "-DGR_PKG_CONF_DIR=#{etc}/gnuradio/conf.d"
args << "-DGR_PREFSDIR=#{etc}/gnuradio/conf.d"
args << "-DENABLE_DEFAULT=OFF"
enabled_components = %w[gr-analog gr-fft volk gr-filter gnuradio-runtime
gr-blocks gr-pager gr-noaa gr-channels gr-audio
gr-fcd gr-vocoder gr-fec gr-digital gr-dtv gr-atsc
gr-trellis gr-zeromq]
if build.with? "python"
enabled_components << "python"
enabled_components << "gr-utils"
enabled_components << "grc" if build.with? "pygtk"
enabled_components << "gr-wxgui" if build.with? "wxpython"
end
enabled_components << "gr-wavelet"
enabled_components << "gr-video-sdl" if build.with? "sdl"
enabled_components << "gr-uhd" if build.with? "uhd"
enabled_components << "doxygen" if build.with? "doxygen"
enabled_components << "sphinx" if build.with? "sphinx"
enabled_components.each do |c|
args << "-DENABLE_#{c.upcase.split("-").join("_")}=ON"
end
mkdir "build" do
system "cmake", "..", *args
system "make"
system "make", "install"
end
rm bin.children.reject(&:executable?)
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
end
test do
system("#{bin}/gnuradio-config-info -v")
(testpath/"test.c++").write <<-EOS.undent
#include <gnuradio/top_block.h>
#include <gnuradio/blocks/null_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/blocks/head.h>
#include <gnuradio/gr_complex.h>
class top_block : public gr::top_block {
public:
top_block();
private:
gr::blocks::null_source::sptr null_source;
gr::blocks::null_sink::sptr null_sink;
gr::blocks::head::sptr head;
};
top_block::top_block() : gr::top_block("Top block") {
long s = sizeof(gr_complex);
null_source = gr::blocks::null_source::make(s);
null_sink = gr::blocks::null_sink::make(s);
head = gr::blocks::head::make(s, 1024);
connect(null_source, 0, head, 0);
connect(head, 0, null_sink, 0);
}
int main(int argc, char **argv) {
top_block top;
top.run();
}
EOS
system ENV.cxx,
"-lgnuradio-blocks", "-lgnuradio-runtime", "-lgnuradio-pmt",
"-lboost_system",
(testpath/"test.c++"),
"-o", (testpath/"test")
system (testpath/"test")
if build.with? "python"
(testpath/"test.py").write <<-EOS.undent
from gnuradio import blocks
from gnuradio import gr
class top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self, "Top Block")
self.samp_rate = 32000
s = gr.sizeof_gr_complex
self.blocks_null_source_0 = blocks.null_source(s)
self.blocks_null_sink_0 = blocks.null_sink(s)
self.blocks_head_0 = blocks.head(s, 1024)
self.connect((self.blocks_head_0, 0),
(self.blocks_null_sink_0, 0))
self.connect((self.blocks_null_source_0, 0),
(self.blocks_head_0, 0))
def main(top_block_cls=top_block, options=None):
tb = top_block_cls()
tb.start()
tb.wait()
main()
EOS
system "python", (testpath/"test.py")
cd(testpath) do
system "#{bin}/gr_modtool", "newmod", "test"
cd("gr-test") do
system "#{bin}/gr_modtool", "add", "-t", "general", "test_ff", "-l",
"python", "-y", "--argument-list=''", "--add-python-qa"
end
end
end
end
end
gnuradio: update 3.7.11 bottle.
class Gnuradio < Formula
desc "SDK providing the signal processing runtime and processing blocks"
homepage "https://gnuradio.org/"
url "https://gnuradio.org/releases/gnuradio/gnuradio-3.7.11.tar.gz"
sha256 "87d9ba3183858efdbb237add3f9de40f7d65f25e16904a9bc8d764a7287252d4"
head "https://github.com/gnuradio/gnuradio.git"
bottle do
rebuild 1
sha256 "60eb27fab026ab6139576f3ffdc55d6b7da1ee7f8495650a8fc97e25a59d85e4" => :sierra
sha256 "fbf5dbdf430db136a5e97075052f3e2453c10ec2477e35f5928081d8f00910d5" => :el_capitan
sha256 "0143a5b0e8cbe007520660143de7350943cecced240f0956135e3484c18664eb" => :yosemite
end
option "without-python", "Build without python support"
depends_on "pkg-config" => :build
depends_on :python => :recommended if MacOS.version <= :snow_leopard
depends_on "boost"
depends_on "fftw"
depends_on "gsl"
depends_on "zeromq"
depends_on "numpy" if build.with? :python
depends_on "swig" => :build if build.with? :python
depends_on "cmake" => :build
# For documentation
depends_on "doxygen" => [:build, :optional]
depends_on "sphinx-doc" => [:build, :optional]
depends_on "uhd" => :recommended
depends_on "sdl" => :optional
depends_on "jack" => :optional
depends_on "portaudio" => :recommended
depends_on "pygtk" => :optional
depends_on "wxpython" => :optional
# cheetah starts here
resource "Markdown" do
url "https://files.pythonhosted.org/packages/1d/25/3f6d2cb31ec42ca5bd3bfbea99b63892b735d76e26f20dd2dcc34ffe4f0d/Markdown-2.6.8.tar.gz"
sha256 "0ac8a81e658167da95d063a9279c9c1b2699f37c7c4153256a458b3a43860e33"
end
resource "Cheetah" do
url "https://files.pythonhosted.org/packages/cd/b0/c2d700252fc251e91c08639ff41a8a5203b627f4e0a2ae18a6b662ab32ea/Cheetah-2.4.4.tar.gz"
sha256 "be308229f0c1e5e5af4f27d7ee06d90bb19e6af3059794e5fd536a6f29a9b550"
end
# cheetah ends here
resource "lxml" do
url "https://files.pythonhosted.org/packages/39/e8/a8e0b1fa65dd021d48fe21464f71783655f39a41f218293c1c590d54eb82/lxml-3.7.3.tar.gz"
sha256 "aa502d78a51ee7d127b4824ff96500f0181d3c7826e6ee7b800d068be79361c7"
end
resource "cppzmq" do
url "https://raw.githubusercontent.com/zeromq/cppzmq/46fc0572c5e9f09a32a23d6f22fd79b841f77e00/zmq.hpp"
sha256 "964031c0944f913933f55ad1610938105a6657a69d1ac5a6dd50e16a679104d5"
end
def install
ENV["CHEETAH_INSTALL_WITHOUT_SETUPTOOLS"] = "1"
ENV["XML_CATALOG_FILES"] = etc/"xml/catalog"
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages"
res = %w[Markdown Cheetah lxml]
res.each do |r|
resource(r).stage do
system "python", *Language::Python.setup_install_args(libexec/"vendor")
end
end
resource("cppzmq").stage include.to_s
args = std_cmake_args
args << "-DGR_PKG_CONF_DIR=#{etc}/gnuradio/conf.d"
args << "-DGR_PREFSDIR=#{etc}/gnuradio/conf.d"
args << "-DENABLE_DEFAULT=OFF"
enabled_components = %w[gr-analog gr-fft volk gr-filter gnuradio-runtime
gr-blocks gr-pager gr-noaa gr-channels gr-audio
gr-fcd gr-vocoder gr-fec gr-digital gr-dtv gr-atsc
gr-trellis gr-zeromq]
if build.with? "python"
enabled_components << "python"
enabled_components << "gr-utils"
enabled_components << "grc" if build.with? "pygtk"
enabled_components << "gr-wxgui" if build.with? "wxpython"
end
enabled_components << "gr-wavelet"
enabled_components << "gr-video-sdl" if build.with? "sdl"
enabled_components << "gr-uhd" if build.with? "uhd"
enabled_components << "doxygen" if build.with? "doxygen"
enabled_components << "sphinx" if build.with? "sphinx"
enabled_components.each do |c|
args << "-DENABLE_#{c.upcase.split("-").join("_")}=ON"
end
mkdir "build" do
system "cmake", "..", *args
system "make"
system "make", "install"
end
rm bin.children.reject(&:executable?)
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
end
test do
system("#{bin}/gnuradio-config-info -v")
(testpath/"test.c++").write <<-EOS.undent
#include <gnuradio/top_block.h>
#include <gnuradio/blocks/null_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/blocks/head.h>
#include <gnuradio/gr_complex.h>
class top_block : public gr::top_block {
public:
top_block();
private:
gr::blocks::null_source::sptr null_source;
gr::blocks::null_sink::sptr null_sink;
gr::blocks::head::sptr head;
};
top_block::top_block() : gr::top_block("Top block") {
long s = sizeof(gr_complex);
null_source = gr::blocks::null_source::make(s);
null_sink = gr::blocks::null_sink::make(s);
head = gr::blocks::head::make(s, 1024);
connect(null_source, 0, head, 0);
connect(head, 0, null_sink, 0);
}
int main(int argc, char **argv) {
top_block top;
top.run();
}
EOS
system ENV.cxx,
"-lgnuradio-blocks", "-lgnuradio-runtime", "-lgnuradio-pmt",
"-lboost_system",
(testpath/"test.c++"),
"-o", (testpath/"test")
system (testpath/"test")
if build.with? "python"
(testpath/"test.py").write <<-EOS.undent
from gnuradio import blocks
from gnuradio import gr
class top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self, "Top Block")
self.samp_rate = 32000
s = gr.sizeof_gr_complex
self.blocks_null_source_0 = blocks.null_source(s)
self.blocks_null_sink_0 = blocks.null_sink(s)
self.blocks_head_0 = blocks.head(s, 1024)
self.connect((self.blocks_head_0, 0),
(self.blocks_null_sink_0, 0))
self.connect((self.blocks_null_source_0, 0),
(self.blocks_head_0, 0))
def main(top_block_cls=top_block, options=None):
tb = top_block_cls()
tb.start()
tb.wait()
main()
EOS
system "python", (testpath/"test.py")
cd(testpath) do
system "#{bin}/gr_modtool", "newmod", "test"
cd("gr-test") do
system "#{bin}/gr_modtool", "add", "-t", "general", "test_ff", "-l",
"python", "-y", "--argument-list=''", "--add-python-qa"
end
end
end
end
end
|
class Graphviz < Formula
desc "Graph visualization software from AT&T and Bell Labs"
homepage "https://www.graphviz.org/"
url "https://gitlab.com/graphviz/graphviz.git",
tag: "2.49.2",
revision: "cf96d517357e42b00279cacc042ec0c0bd2a5e89"
license "EPL-1.0"
version_scheme 1
head "https://gitlab.com/graphviz/graphviz.git"
bottle do
sha256 arm64_big_sur: "13fba99cacc9590db0e10c25375543659df568a03dd8568d772648643f54d0ea"
sha256 big_sur: "934969a7ff72a3be37fc43b7b20edc63265394df892a33091b7741cf12404e89"
sha256 catalina: "4133a4b8b245823ac0fdc220840686360833aa38c4657debc4d2ca972a5ba649"
sha256 mojave: "9d7c594f9e4419620a8e0f3849ae6a4b6d9a559b5cf8c117071eb03a2a301c2c"
sha256 x86_64_linux: "12ed296dbebe405bcdaca1be295303068d233154fe9d4e9a831ce4faf2bd3390"
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "bison" => :build
depends_on "pkg-config" => :build
depends_on "gd"
depends_on "gts"
depends_on "libpng"
depends_on "librsvg"
depends_on "libtool"
depends_on "pango"
uses_from_macos "flex" => :build
on_linux do
depends_on "byacc" => :build
depends_on "ghostscript" => :build
end
def install
args = %W[
--disable-debug
--disable-dependency-tracking
--prefix=#{prefix}
--disable-php
--disable-swig
--disable-tcl
--with-quartz
--without-freetype2
--without-gdk
--without-gdk-pixbuf
--without-gtk
--without-poppler
--without-qt
--without-x
--with-gts
]
system "./autogen.sh"
system "./configure", *args
system "make"
system "make", "install"
(bin/"gvmap.sh").unlink
end
test do
(testpath/"sample.dot").write <<~EOS
digraph G {
a -> b
}
EOS
system "#{bin}/dot", "-Tpdf", "-o", "sample.pdf", "sample.dot"
end
end
graphviz 2.49.3
Closes #87915.
Signed-off-by: Carlo Cabrera <3ffc397d0e4bded29cb84b56167de54c01e3a55b@users.noreply.github.com>
Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com>
class Graphviz < Formula
desc "Graph visualization software from AT&T and Bell Labs"
homepage "https://www.graphviz.org/"
url "https://gitlab.com/graphviz/graphviz.git",
tag: "2.49.3",
revision: "3425dae078262591d04fec107ec71ab010651852"
license "EPL-1.0"
version_scheme 1
head "https://gitlab.com/graphviz/graphviz.git"
bottle do
sha256 arm64_big_sur: "13fba99cacc9590db0e10c25375543659df568a03dd8568d772648643f54d0ea"
sha256 big_sur: "934969a7ff72a3be37fc43b7b20edc63265394df892a33091b7741cf12404e89"
sha256 catalina: "4133a4b8b245823ac0fdc220840686360833aa38c4657debc4d2ca972a5ba649"
sha256 mojave: "9d7c594f9e4419620a8e0f3849ae6a4b6d9a559b5cf8c117071eb03a2a301c2c"
sha256 x86_64_linux: "12ed296dbebe405bcdaca1be295303068d233154fe9d4e9a831ce4faf2bd3390"
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "bison" => :build
depends_on "pkg-config" => :build
depends_on "gd"
depends_on "gts"
depends_on "libpng"
depends_on "librsvg"
depends_on "libtool"
depends_on "pango"
uses_from_macos "flex" => :build
on_linux do
depends_on "byacc" => :build
depends_on "ghostscript" => :build
end
def install
args = %W[
--disable-debug
--disable-dependency-tracking
--prefix=#{prefix}
--disable-php
--disable-swig
--disable-tcl
--with-quartz
--without-freetype2
--without-gdk
--without-gdk-pixbuf
--without-gtk
--without-poppler
--without-qt
--without-x
--with-gts
]
system "./autogen.sh"
system "./configure", *args
system "make"
system "make", "install"
(bin/"gvmap.sh").unlink
end
test do
(testpath/"sample.dot").write <<~EOS
digraph G {
a -> b
}
EOS
system "#{bin}/dot", "-Tpdf", "-o", "sample.pdf", "sample.dot"
end
end
|
class Graphviz < Formula
desc "Graph visualization software from AT&T and Bell Labs"
homepage "http://graphviz.org/"
url "http://graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.40.1.tar.gz"
sha256 "ca5218fade0204d59947126c38439f432853543b0818d9d728c589dfe7f3a421"
version_scheme 1
bottle do
rebuild 1
sha256 "b592ce51c2a929c3da82e96ec856571ebfc54cf4dac90c2924cd3845078d7082" => :high_sierra
sha256 "41b5811054f03978db12525919540fe41e073fb2c20e899247ed9c2a191f7a66" => :sierra
sha256 "cab27f92a59d543e2f2c1494c28c7563a4c2d7e0dce4c4fbc22587db91cafc5b" => :el_capitan
sha256 "6bd4c01e724cfc965871e1aad9a4fb2a6afef90a1e254d81e2fe33a997f50aaa" => :yosemite
end
head do
url "https://github.com/ellson/graphviz.git"
depends_on "automake" => :build
depends_on "autoconf" => :build
depends_on "libtool" => :build
end
option "with-bindings", "Build Perl/Python/Ruby/etc. bindings"
option "with-pango", "Build with Pango/Cairo for alternate PDF output"
option "with-app", "Build GraphViz.app (requires full XCode install)"
option "with-gts", "Build with GNU GTS support (required by prism)"
deprecated_option "with-x" => "with-x11"
deprecated_option "with-pangocairo" => "with-pango"
depends_on "pkg-config" => :build
depends_on :xcode => :build if build.with? "app"
depends_on "libtool" => :run
depends_on "pango" => :optional
depends_on "gts" => :optional
depends_on "librsvg" => :optional
depends_on "freetype" => :optional
depends_on :x11 => :optional
depends_on "gd"
depends_on "libpng"
if build.with? "bindings"
depends_on "swig" => :build
depends_on :python
depends_on :java
depends_on "ruby"
end
def install
# Only needed when using superenv, which causes qfrexp and qldexp to be
# falsely detected as available. The problem is triggered by
# args << "-#{ENV["HOMEBREW_OPTIMIZATION_LEVEL"]}"
# during argument refurbishment of cflags.
# https://github.com/Homebrew/brew/blob/ab060c9/Library/Homebrew/shims/super/cc#L241
# https://github.com/Homebrew/legacy-homebrew/issues/14566
# Alternative fixes include using stdenv or using "xcrun make"
inreplace "lib/sfio/features/sfio", "lib qfrexp\nlib qldexp\n", ""
if build.with? "bindings"
# the ruby pkg-config file is version specific
inreplace "configure" do |s|
s.gsub! "ruby-1.9", "ruby-#{Formula["ruby"].stable.version.to_f}"
s.gsub! "if test `$SWIG -php7 2>&1", "if test `$SWIG -php0 2>&1"
end
end
args = %W[
--disable-debug
--disable-dependency-tracking
--prefix=#{prefix}
--without-qt
--with-quartz
--disable-php
]
args << "--with-gts" if build.with? "gts"
args << "--disable-swig" if build.without? "bindings"
args << "--without-pangocairo" if build.without? "pango"
args << "--without-freetype2" if build.without? "freetype"
args << "--without-x" if build.without? "x11"
args << "--without-rsvg" if build.without? "librsvg"
if build.head?
system "./autogen.sh", *args
else
system "./configure", *args
end
system "make", "install"
if build.with? "app"
cd "macosx" do
xcodebuild "SDKROOT=#{MacOS.sdk_path}", "-configuration", "Release", "SYMROOT=build", "PREFIX=#{prefix}",
"ONLY_ACTIVE_ARCH=YES", "MACOSX_DEPLOYMENT_TARGET=#{MacOS.version}"
end
prefix.install "macosx/build/Release/Graphviz.app"
end
(bin/"gvmap.sh").unlink
end
test do
(testpath/"sample.dot").write <<~EOS
digraph G {
a -> b
}
EOS
system "#{bin}/dot", "-Tpdf", "-o", "sample.pdf", "sample.dot"
end
end
graphviz: secure url(s)
class Graphviz < Formula
desc "Graph visualization software from AT&T and Bell Labs"
homepage "https://graphviz.org/"
url "https://graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.40.1.tar.gz"
sha256 "ca5218fade0204d59947126c38439f432853543b0818d9d728c589dfe7f3a421"
version_scheme 1
bottle do
rebuild 1
sha256 "b592ce51c2a929c3da82e96ec856571ebfc54cf4dac90c2924cd3845078d7082" => :high_sierra
sha256 "41b5811054f03978db12525919540fe41e073fb2c20e899247ed9c2a191f7a66" => :sierra
sha256 "cab27f92a59d543e2f2c1494c28c7563a4c2d7e0dce4c4fbc22587db91cafc5b" => :el_capitan
sha256 "6bd4c01e724cfc965871e1aad9a4fb2a6afef90a1e254d81e2fe33a997f50aaa" => :yosemite
end
head do
url "https://github.com/ellson/graphviz.git"
depends_on "automake" => :build
depends_on "autoconf" => :build
depends_on "libtool" => :build
end
option "with-bindings", "Build Perl/Python/Ruby/etc. bindings"
option "with-pango", "Build with Pango/Cairo for alternate PDF output"
option "with-app", "Build GraphViz.app (requires full XCode install)"
option "with-gts", "Build with GNU GTS support (required by prism)"
deprecated_option "with-x" => "with-x11"
deprecated_option "with-pangocairo" => "with-pango"
depends_on "pkg-config" => :build
depends_on :xcode => :build if build.with? "app"
depends_on "libtool" => :run
depends_on "pango" => :optional
depends_on "gts" => :optional
depends_on "librsvg" => :optional
depends_on "freetype" => :optional
depends_on :x11 => :optional
depends_on "gd"
depends_on "libpng"
if build.with? "bindings"
depends_on "swig" => :build
depends_on :python
depends_on :java
depends_on "ruby"
end
def install
# Only needed when using superenv, which causes qfrexp and qldexp to be
# falsely detected as available. The problem is triggered by
# args << "-#{ENV["HOMEBREW_OPTIMIZATION_LEVEL"]}"
# during argument refurbishment of cflags.
# https://github.com/Homebrew/brew/blob/ab060c9/Library/Homebrew/shims/super/cc#L241
# https://github.com/Homebrew/legacy-homebrew/issues/14566
# Alternative fixes include using stdenv or using "xcrun make"
inreplace "lib/sfio/features/sfio", "lib qfrexp\nlib qldexp\n", ""
if build.with? "bindings"
# the ruby pkg-config file is version specific
inreplace "configure" do |s|
s.gsub! "ruby-1.9", "ruby-#{Formula["ruby"].stable.version.to_f}"
s.gsub! "if test `$SWIG -php7 2>&1", "if test `$SWIG -php0 2>&1"
end
end
args = %W[
--disable-debug
--disable-dependency-tracking
--prefix=#{prefix}
--without-qt
--with-quartz
--disable-php
]
args << "--with-gts" if build.with? "gts"
args << "--disable-swig" if build.without? "bindings"
args << "--without-pangocairo" if build.without? "pango"
args << "--without-freetype2" if build.without? "freetype"
args << "--without-x" if build.without? "x11"
args << "--without-rsvg" if build.without? "librsvg"
if build.head?
system "./autogen.sh", *args
else
system "./configure", *args
end
system "make", "install"
if build.with? "app"
cd "macosx" do
xcodebuild "SDKROOT=#{MacOS.sdk_path}", "-configuration", "Release", "SYMROOT=build", "PREFIX=#{prefix}",
"ONLY_ACTIVE_ARCH=YES", "MACOSX_DEPLOYMENT_TARGET=#{MacOS.version}"
end
prefix.install "macosx/build/Release/Graphviz.app"
end
(bin/"gvmap.sh").unlink
end
test do
(testpath/"sample.dot").write <<~EOS
digraph G {
a -> b
}
EOS
system "#{bin}/dot", "-Tpdf", "-o", "sample.pdf", "sample.dot"
end
end
|
require "formula"
class Grass64 < Formula
homepage "http://grass.osgeo.org/"
stable do
url "http://grass.osgeo.org/grass64/source/grass-6.4.4.tar.gz"
sha1 "0e4dac9fb3320a26e4f640f641485fde0323dd46"
# Patches to keep files from being installed outside of the prefix.
# Remove lines from Makefile that try to install to /Library/Documentation.
# Also, quick patch for compiling with clang (as yet, unreported issue)
patch :DATA
end
keg_only "grass is in main tap and same-name bin utilities are installed"
option "without-gui", "Build without WxPython interface. Command line tools still available."
# TODO: test on 10.6 first. may work with latest wxWidgets 3.0
# depends_on :macos => :lion
# TODO: builds with clang (has same non-fatal errors as gcc), but is it compiled correctly?
# depends_on "gcc" => :build
depends_on "pkg-config" => :build
depends_on "gettext"
depends_on "readline"
depends_on "gdal"
depends_on "libtiff"
depends_on "unixodbc"
depends_on "fftw"
depends_on :python
depends_on "wxpython"
depends_on :postgresql => :optional
depends_on :mysql => :optional
depends_on "cairo"
depends_on :x11 # needs to find at least X11/include/GL/gl.h
def headless?
# The GRASS GUI is based on WxPython.
build.without? "gui"
end
def install
readline = Formula["readline"].opt_prefix
gettext = Formula["gettext"].opt_prefix
#noinspection RubyLiteralArrayInspection
args = [
"--disable-debug", "--disable-dependency-tracking",
"--enable-largefile",
"--enable-shared",
"--with-cxx",
"--without-motif",
"--with-python",
"--with-blas",
"--with-lapack",
"--with-sqlite",
"--with-odbc",
"--with-geos=#{Formula["geos"].opt_bin}/geos-config",
"--with-proj-share=#{Formula["proj"].opt_share}/proj",
"--with-png",
"--with-readline-includes=#{readline}/include",
"--with-readline-libs=#{readline}/lib",
"--with-readline",
"--with-nls-includes=#{gettext}/include",
"--with-nls-libs=#{gettext}/lib",
"--with-nls",
"--with-freetype",
"--without-tcltk", # Disabled due to compatibility issues with OS X Tcl/Tk
"--with-includes=#{gettext}/include"
]
unless MacOS::CLT.installed?
# On Xcode-only systems (without the CLT), we have to help:
args << "--with-macosx-sdk=#{MacOS.sdk_path}"
args << "--with-opengl-includes=#{MacOS.sdk_path}/System/Library/Frameworks/OpenGL.framework/Headers"
end
if headless?
args << "--without-wxwidgets"
else
ENV["PYTHONPATH"] = "#{Formula["wxpython"].opt_prefix}/lib/python2.7/site-packages"
args << "--with-wxwidgets=#{Formula["wxmac"].opt_prefix}/bin/wx-config"
end
args << "--enable-64bit" if MacOS.prefer_64_bit?
args << "--with-macos-archs=#{MacOS.preferred_arch}"
cairo = Formula["cairo"]
args << "--with-cairo-includes=#{cairo.include}/cairo"
args << "--with-cairo-libs=#{cairo.lib}"
args << "--with-cairo"
# Database support
args << "--with-postgres" if build.with? "postgresql"
if build.with? "mysql"
mysql = Formula["mysql"]
args << "--with-mysql-includes=#{mysql.include}/mysql"
args << "--with-mysql-libs=#{mysql.lib}"
args << "--with-mysql"
end
system "./configure", "--prefix=#{prefix}", *args
system "make GDAL_DYNAMIC=" # make and make install must be separate steps.
system "make GDAL_DYNAMIC= install" # GDAL_DYNAMIC set to blank for r.external compatability
end
def post_install
# ensure QGIS's Processing plugin recognizes install
ln_sf "../bin/grass64", prefix/"grass-#{version.to_s}/grass.sh"
# link so settings in external apps don't need updated on grass version bump
# in QGIS Processing options, GRASS folder = HOMEBREW_PREFIX/opt/grass-64/grass-base
ln_sf "grass-#{version.to_s}", prefix/"grass-base"
end
def caveats
if headless?
<<-EOS.undent
This build of GRASS has been compiled without the WxPython GUI.
The command line tools remain fully functional.
EOS
end
end
end
__END__
diff --git a/Makefile b/Makefile
index f1edea6..be404b0 100644
--- a/Makefile
+++ b/Makefile
@@ -304,8 +304,6 @@ ifeq ($(strip $(MINGW)),)
-tar cBf - gem/skeleton | (cd ${INST_DIR}/etc ; tar xBf - ) 2>/dev/null
-${INSTALL} gem/gem$(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR) ${BINDIR} 2>/dev/null
endif
- @# enable OSX Help Viewer
- @if [ "`cat include/Make/Platform.make | grep -i '^ARCH.*darwin'`" ] ; then /bin/ln -sfh "${INST_DIR}/docs/html" /Library/Documentation/Help/GRASS-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR} ; fi
install-strip: FORCE
diff --git a/raster/r.terraflow/direction.cc b/raster/r.terraflow/direction.cc
index 7744518..778c225 100644
--- a/raster/r.terraflow/direction.cc
+++ b/raster/r.terraflow/direction.cc
@@ -53,11 +53,11 @@ encodeDirectionMFD(const genericWindow<elevation_type>& elevwin,
if(!is_nodata(elevwin.get())) {
dir = 0;
- if (elevwin.get(5) < elevwin.get() && !is_void(elevwin.get(5))) dir |= 1;
- if (elevwin.get(3) < elevwin.get() && !is_void(elevwin.get(3))) dir |= 16;
+ if (elevwin.get(5) < elevwin.get() && !is_voided(elevwin.get(5))) dir |= 1;
+ if (elevwin.get(3) < elevwin.get() && !is_voided(elevwin.get(3))) dir |= 16;
for(int i=0; i<3; i++) {
- if(elevwin.get(i) < elevwin.get() && !is_void(elevwin.get(i))) dir |= 32<<i;
- if(elevwin.get(i+6) < elevwin.get() && !is_void(elevwin.get(6+i))) dir |= 8>>i;
+ if(elevwin.get(i) < elevwin.get() && !is_voided(elevwin.get(i))) dir |= 32<<i;
+ if(elevwin.get(i+6) < elevwin.get() && !is_voided(elevwin.get(6+i))) dir |= 8>>i;
}
}
diff --git a/raster/r.terraflow/nodata.cc b/raster/r.terraflow/nodata.cc
index 159c66d..610ca55 100644
--- a/raster/r.terraflow/nodata.cc
+++ b/raster/r.terraflow/nodata.cc
@@ -73,7 +73,7 @@ is_nodata(float x) {
int
-is_void(elevation_type el) {
+is_voided(elevation_type el) {
return (el == nodataType::ELEVATION_NODATA);
}
diff --git a/raster/r.terraflow/nodata.h b/raster/r.terraflow/nodata.h
index 1e843c5..ac56504 100644
--- a/raster/r.terraflow/nodata.h
+++ b/raster/r.terraflow/nodata.h
@@ -37,7 +37,7 @@
int is_nodata(elevation_type el);
int is_nodata(int x);
int is_nodata(float x);
-int is_void(elevation_type el);
+int is_voided(elevation_type el);
class nodataType : public ijBaseType {
grass-64: bump revision
require "formula"
class Grass64 < Formula
homepage "http://grass.osgeo.org/"
stable do
url "http://grass.osgeo.org/grass64/source/grass-6.4.4.tar.gz"
sha1 "0e4dac9fb3320a26e4f640f641485fde0323dd46"
# Patches to keep files from being installed outside of the prefix.
# Remove lines from Makefile that try to install to /Library/Documentation.
# Also, quick patch for compiling with clang (as yet, unreported issue)
patch :DATA
end
revision 1
keg_only "grass is in main tap and same-name bin utilities are installed"
option "without-gui", "Build without WxPython interface. Command line tools still available."
# TODO: test on 10.6 first. may work with latest wxWidgets 3.0
# depends_on :macos => :lion
# TODO: builds with clang (has same non-fatal errors as gcc), but is it compiled correctly?
# depends_on "gcc" => :build
depends_on "pkg-config" => :build
depends_on "gettext"
depends_on "readline"
depends_on "gdal"
depends_on "libtiff"
depends_on "unixodbc"
depends_on "fftw"
depends_on :python
depends_on "wxpython"
depends_on :postgresql => :optional
depends_on :mysql => :optional
depends_on "cairo"
depends_on :x11 # needs to find at least X11/include/GL/gl.h
def headless?
# The GRASS GUI is based on WxPython.
build.without? "gui"
end
def install
readline = Formula["readline"].opt_prefix
gettext = Formula["gettext"].opt_prefix
#noinspection RubyLiteralArrayInspection
args = [
"--disable-debug", "--disable-dependency-tracking",
"--enable-largefile",
"--enable-shared",
"--with-cxx",
"--without-motif",
"--with-python",
"--with-blas",
"--with-lapack",
"--with-sqlite",
"--with-odbc",
"--with-geos=#{Formula["geos"].opt_bin}/geos-config",
"--with-proj-share=#{Formula["proj"].opt_share}/proj",
"--with-png",
"--with-readline-includes=#{readline}/include",
"--with-readline-libs=#{readline}/lib",
"--with-readline",
"--with-nls-includes=#{gettext}/include",
"--with-nls-libs=#{gettext}/lib",
"--with-nls",
"--with-freetype",
"--without-tcltk", # Disabled due to compatibility issues with OS X Tcl/Tk
"--with-includes=#{gettext}/include"
]
unless MacOS::CLT.installed?
# On Xcode-only systems (without the CLT), we have to help:
args << "--with-macosx-sdk=#{MacOS.sdk_path}"
args << "--with-opengl-includes=#{MacOS.sdk_path}/System/Library/Frameworks/OpenGL.framework/Headers"
end
if headless?
args << "--without-wxwidgets"
else
ENV["PYTHONPATH"] = "#{Formula["wxpython"].opt_prefix}/lib/python2.7/site-packages"
args << "--with-wxwidgets=#{Formula["wxmac"].opt_prefix}/bin/wx-config"
end
args << "--enable-64bit" if MacOS.prefer_64_bit?
args << "--with-macos-archs=#{MacOS.preferred_arch}"
cairo = Formula["cairo"]
args << "--with-cairo-includes=#{cairo.include}/cairo"
args << "--with-cairo-libs=#{cairo.lib}"
args << "--with-cairo"
# Database support
args << "--with-postgres" if build.with? "postgresql"
if build.with? "mysql"
mysql = Formula["mysql"]
args << "--with-mysql-includes=#{mysql.include}/mysql"
args << "--with-mysql-libs=#{mysql.lib}"
args << "--with-mysql"
end
system "./configure", "--prefix=#{prefix}", *args
system "make GDAL_DYNAMIC=" # make and make install must be separate steps.
system "make GDAL_DYNAMIC= install" # GDAL_DYNAMIC set to blank for r.external compatability
end
def post_install
# ensure QGIS's Processing plugin recognizes install
ln_sf "../bin/grass64", prefix/"grass-#{version.to_s}/grass.sh"
# link so settings in external apps don't need updated on grass version bump
# in QGIS Processing options, GRASS folder = HOMEBREW_PREFIX/opt/grass-64/grass-base
ln_sf "grass-#{version.to_s}", prefix/"grass-base"
end
def caveats
if headless?
<<-EOS.undent
This build of GRASS has been compiled without the WxPython GUI.
The command line tools remain fully functional.
EOS
end
end
end
__END__
diff --git a/Makefile b/Makefile
index f1edea6..be404b0 100644
--- a/Makefile
+++ b/Makefile
@@ -304,8 +304,6 @@ ifeq ($(strip $(MINGW)),)
-tar cBf - gem/skeleton | (cd ${INST_DIR}/etc ; tar xBf - ) 2>/dev/null
-${INSTALL} gem/gem$(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR) ${BINDIR} 2>/dev/null
endif
- @# enable OSX Help Viewer
- @if [ "`cat include/Make/Platform.make | grep -i '^ARCH.*darwin'`" ] ; then /bin/ln -sfh "${INST_DIR}/docs/html" /Library/Documentation/Help/GRASS-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR} ; fi
install-strip: FORCE
diff --git a/raster/r.terraflow/direction.cc b/raster/r.terraflow/direction.cc
index 7744518..778c225 100644
--- a/raster/r.terraflow/direction.cc
+++ b/raster/r.terraflow/direction.cc
@@ -53,11 +53,11 @@ encodeDirectionMFD(const genericWindow<elevation_type>& elevwin,
if(!is_nodata(elevwin.get())) {
dir = 0;
- if (elevwin.get(5) < elevwin.get() && !is_void(elevwin.get(5))) dir |= 1;
- if (elevwin.get(3) < elevwin.get() && !is_void(elevwin.get(3))) dir |= 16;
+ if (elevwin.get(5) < elevwin.get() && !is_voided(elevwin.get(5))) dir |= 1;
+ if (elevwin.get(3) < elevwin.get() && !is_voided(elevwin.get(3))) dir |= 16;
for(int i=0; i<3; i++) {
- if(elevwin.get(i) < elevwin.get() && !is_void(elevwin.get(i))) dir |= 32<<i;
- if(elevwin.get(i+6) < elevwin.get() && !is_void(elevwin.get(6+i))) dir |= 8>>i;
+ if(elevwin.get(i) < elevwin.get() && !is_voided(elevwin.get(i))) dir |= 32<<i;
+ if(elevwin.get(i+6) < elevwin.get() && !is_voided(elevwin.get(6+i))) dir |= 8>>i;
}
}
diff --git a/raster/r.terraflow/nodata.cc b/raster/r.terraflow/nodata.cc
index 159c66d..610ca55 100644
--- a/raster/r.terraflow/nodata.cc
+++ b/raster/r.terraflow/nodata.cc
@@ -73,7 +73,7 @@ is_nodata(float x) {
int
-is_void(elevation_type el) {
+is_voided(elevation_type el) {
return (el == nodataType::ELEVATION_NODATA);
}
diff --git a/raster/r.terraflow/nodata.h b/raster/r.terraflow/nodata.h
index 1e843c5..ac56504 100644
--- a/raster/r.terraflow/nodata.h
+++ b/raster/r.terraflow/nodata.h
@@ -37,7 +37,7 @@
int is_nodata(elevation_type el);
int is_nodata(int x);
int is_nodata(float x);
-int is_void(elevation_type el);
+int is_voided(elevation_type el);
class nodataType : public ijBaseType {
|
class GribApi < Formula
desc "Encode and decode grib messages (editions 1 and 2)"
homepage "https://software.ecmwf.int/wiki/display/GRIB/Home"
url "https://software.ecmwf.int/wiki/download/attachments/3473437/grib_api-1.15.0-Source.tar.gz"
sha256 "733f48e2882141003b83fa165d1ea12cad3c0c56953bc30be1d5d4aa6a0e5913"
revision 1
bottle do
sha256 "73ba03c7dd6fb0374d9290844bba8ccc872fab0e9d6a863341b45c52da7993e9" => :el_capitan
sha256 "34c8ff3bcca753743676e9a0c96f50edcc7ea72d24765b48b386bc743ff1bddb" => :yosemite
sha256 "8f7350d08fc12db9f6f44174ac12a43666b02f168b1e58188a4fe40b31d68350" => :mavericks
end
option "with-static", "Build static instead of shared library."
depends_on :fortran
depends_on "cmake" => :build
depends_on "jasper" => :recommended
depends_on "openjpeg" => :optional
depends_on "libpng" => :optional
# Fixes build errors in Lion
# https://software.ecmwf.int/wiki/plugins/viewsource/viewpagesrc.action?pageId=12648475
patch :DATA
def install
mkdir "build" do
args = std_cmake_args
args << "-DBUILD_SHARED_LIBS=OFF" if build.with? "static"
args << "-DPNG_PNG_INCLUDE_DIR=#{Formula["libpng"].opt_include}" << "-DENABLE_PNG=ON" if build.with? "libpng"
system "cmake", "..", *args
system "make", "install"
end
end
test do
grib_samples_path = shell_output("#{bin}/grib_info -t").strip
system "#{bin}/grib_ls", "#{grib_samples_path}/GRIB1.tmpl"
system "#{bin}/grib_ls", "#{grib_samples_path}/GRIB2.tmpl"
end
end
__END__
diff --git a/configure b/configure
index 0a88b28..9dafe46 100755
--- a/configure
+++ b/configure
@@ -7006,7 +7006,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic='-fno-common'
+ #lt_prog_compiler_pic='-fno-common'
;;
hpux*)
@@ -12186,7 +12186,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_F77='-fno-common'
+ #lt_prog_compiler_pic_F77='-fno-common'
;;
hpux*)
@@ -15214,7 +15214,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_FC='-fno-common'
+ #lt_prog_compiler_pic_FC='-fno-common'
;;
hpux*)
grib-api: update 1.15.0_1 bottle.
class GribApi < Formula
desc "Encode and decode grib messages (editions 1 and 2)"
homepage "https://software.ecmwf.int/wiki/display/GRIB/Home"
url "https://software.ecmwf.int/wiki/download/attachments/3473437/grib_api-1.15.0-Source.tar.gz"
sha256 "733f48e2882141003b83fa165d1ea12cad3c0c56953bc30be1d5d4aa6a0e5913"
revision 1
bottle do
sha256 "820bcab80df56cc572f5a2ef2e67f95fac724397767b96a72f0c447417604afc" => :el_capitan
sha256 "be750e6afd93dfd9c71406dedeafb9060fffa41cbd79e965c26c27b86b0472d7" => :yosemite
sha256 "64dfeb154b3069163c9a43b8a9743dbc581d26f84f58a1ae121fe86d064d9fb4" => :mavericks
end
option "with-static", "Build static instead of shared library."
depends_on :fortran
depends_on "cmake" => :build
depends_on "jasper" => :recommended
depends_on "openjpeg" => :optional
depends_on "libpng" => :optional
# Fixes build errors in Lion
# https://software.ecmwf.int/wiki/plugins/viewsource/viewpagesrc.action?pageId=12648475
patch :DATA
def install
mkdir "build" do
args = std_cmake_args
args << "-DBUILD_SHARED_LIBS=OFF" if build.with? "static"
args << "-DPNG_PNG_INCLUDE_DIR=#{Formula["libpng"].opt_include}" << "-DENABLE_PNG=ON" if build.with? "libpng"
system "cmake", "..", *args
system "make", "install"
end
end
test do
grib_samples_path = shell_output("#{bin}/grib_info -t").strip
system "#{bin}/grib_ls", "#{grib_samples_path}/GRIB1.tmpl"
system "#{bin}/grib_ls", "#{grib_samples_path}/GRIB2.tmpl"
end
end
__END__
diff --git a/configure b/configure
index 0a88b28..9dafe46 100755
--- a/configure
+++ b/configure
@@ -7006,7 +7006,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic='-fno-common'
+ #lt_prog_compiler_pic='-fno-common'
;;
hpux*)
@@ -12186,7 +12186,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_F77='-fno-common'
+ #lt_prog_compiler_pic_F77='-fno-common'
;;
hpux*)
@@ -15214,7 +15214,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_FC='-fno-common'
+ #lt_prog_compiler_pic_FC='-fno-common'
;;
hpux*)
|
require "language/haskell"
class Hadolint < Formula
include Language::Haskell::Cabal
desc "Smarter Dockerfile linter to validate best practices"
homepage "https://github.com/hadolint/hadolint"
url "https://github.com/hadolint/hadolint/archive/v1.6.1.tar.gz"
sha256 "bf78ec648de0da76f20613eaa587fc81b64911124f460b42ee98ddf1a384aa70"
bottle do
cellar :any_skip_relocation
sha256 "7d676a969ef6182c30fd79f0e564e5559bd24045f080cd3033c07b809f8e9f26" => :high_sierra
sha256 "69e2d59d5073ad21503e754df3f86b8fc71d36a62ea3e2b70d9131a3c3518f97" => :sierra
sha256 "a4f347e363cf7c8a1defd1da449390c4f39888f30ca2806c0ec5ee2ffb56b6c1" => :el_capitan
end
depends_on "cabal-install" => :build
depends_on "ghc@8.2" => :build
def install
cabal_sandbox do
cabal_install "hpack"
system "./.cabal-sandbox/bin/hpack"
end
install_cabal_package
end
test do
df = testpath/"Dockerfile"
df.write <<~EOS
FROM debian
EOS
assert_match "DL3006", shell_output("#{bin}/hadolint #{df}", 1)
end
end
hadolint: update 1.6.1 bottle.
require "language/haskell"
class Hadolint < Formula
include Language::Haskell::Cabal
desc "Smarter Dockerfile linter to validate best practices"
homepage "https://github.com/hadolint/hadolint"
url "https://github.com/hadolint/hadolint/archive/v1.6.1.tar.gz"
sha256 "bf78ec648de0da76f20613eaa587fc81b64911124f460b42ee98ddf1a384aa70"
bottle do
cellar :any_skip_relocation
sha256 "5e8192a179b4974874d46c2bbf621b7559cffb068f237d4f63c851c598d21648" => :high_sierra
sha256 "8d89537863a8e250c76453d34f54351e547f32a82536fec37f7fa760ed185c7c" => :sierra
sha256 "9fb279e76aecfca33d8ae011357d3efa32296c2bc693c6866e318f01a52efe9a" => :el_capitan
end
depends_on "cabal-install" => :build
depends_on "ghc@8.2" => :build
def install
cabal_sandbox do
cabal_install "hpack"
system "./.cabal-sandbox/bin/hpack"
end
install_cabal_package
end
test do
df = testpath/"Dockerfile"
df.write <<~EOS
FROM debian
EOS
assert_match "DL3006", shell_output("#{bin}/hadolint #{df}", 1)
end
end
|
class Harfbuzz < Formula
desc "OpenType text shaping engine"
homepage "https://wiki.freedesktop.org/www/Software/HarfBuzz/"
url "https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-1.5.1.tar.bz2"
sha256 "56838dfdad2729b8866763c82d623354d138a4d99d9ffb710c7d377b5cfc7c51"
bottle do
sha256 "8595f6dd1a1f5e9734f180e901cabd2f8613520a1f41ff44e9bd04376163227b" => :high_sierra
sha256 "65b2821a8af21d348fc4fd3ffd6b94b934b8fafe05e51820addec0d80f8fe9b1" => :sierra
sha256 "99c09484d64116ee66bb70376f566bebb4bf22cfbee9a05a9e225de3f2a06495" => :el_capitan
sha256 "45aa679d9ce6b65a7330444d2ee87bf8808144d38599e35581a80259a7c7a543" => :yosemite
end
head do
url "https://github.com/behdad/harfbuzz.git"
depends_on "ragel" => :build
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
end
option "with-cairo", "Build command-line utilities that depend on Cairo"
depends_on "pkg-config" => :build
depends_on "freetype" => :recommended
depends_on "glib" => :recommended
depends_on "gobject-introspection" => :recommended
depends_on "graphite2" => :recommended
depends_on "icu4c" => :recommended
depends_on "cairo" => :optional
resource "ttf" do
url "https://github.com/behdad/harfbuzz/raw/fc0daafab0336b847ac14682e581a8838f36a0bf/test/shaping/fonts/sha1sum/270b89df543a7e48e206a2d830c0e10e5265c630.ttf"
sha256 "9535d35dab9e002963eef56757c46881f6b3d3b27db24eefcc80929781856c77"
end
def install
args = %W[
--disable-dependency-tracking
--prefix=#{prefix}
--with-coretext=yes
--enable-static
]
if build.with? "cairo"
args << "--with-cairo=yes"
else
args << "--with-cairo=no"
end
if build.with? "freetype"
args << "--with-freetype=yes"
else
args << "--with-freetype=no"
end
if build.with? "glib"
args << "--with-glib=yes"
else
args << "--with-glib=no"
end
if build.with? "gobject-introspection"
args << "--with-gobject=yes" << "--enable-introspection=yes"
else
args << "--with-gobject=no" << "--enable-introspection=no"
end
if build.with? "graphite2"
args << "--with-graphite2=yes"
else
args << "--with-graphite2=no"
end
if build.with? "icu4c"
args << "--with-icu=yes"
else
args << "--with-icu=no"
end
system "./autogen.sh" if build.head?
system "./configure", *args
system "make", "install"
end
test do
resource("ttf").stage do
shape = `echo 'സ്റ്റ്' | #{bin}/hb-shape 270b89df543a7e48e206a2d830c0e10e5265c630.ttf`.chomp
assert_equal "[glyph201=0+1183|U0D4D=0+0]", shape
end
end
end
harfbuzz 1.6.0
Closes #19417.
Signed-off-by: JCount <33ebc4a6b11670639e02eb2b884714d9703346eb@gmail.com>
class Harfbuzz < Formula
desc "OpenType text shaping engine"
homepage "https://wiki.freedesktop.org/www/Software/HarfBuzz/"
url "https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-1.6.0.tar.bz2"
sha256 "5037ac0efc85a02a334965e66c1053d9dc9ed6833eae9739bd85bc33c83167c9"
bottle do
sha256 "8595f6dd1a1f5e9734f180e901cabd2f8613520a1f41ff44e9bd04376163227b" => :high_sierra
sha256 "65b2821a8af21d348fc4fd3ffd6b94b934b8fafe05e51820addec0d80f8fe9b1" => :sierra
sha256 "99c09484d64116ee66bb70376f566bebb4bf22cfbee9a05a9e225de3f2a06495" => :el_capitan
sha256 "45aa679d9ce6b65a7330444d2ee87bf8808144d38599e35581a80259a7c7a543" => :yosemite
end
head do
url "https://github.com/behdad/harfbuzz.git"
depends_on "ragel" => :build
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
end
option "with-cairo", "Build command-line utilities that depend on Cairo"
depends_on "pkg-config" => :build
depends_on "freetype" => :recommended
depends_on "glib" => :recommended
depends_on "gobject-introspection" => :recommended
depends_on "graphite2" => :recommended
depends_on "icu4c" => :recommended
depends_on "cairo" => :optional
resource "ttf" do
url "https://github.com/behdad/harfbuzz/raw/fc0daafab0336b847ac14682e581a8838f36a0bf/test/shaping/fonts/sha1sum/270b89df543a7e48e206a2d830c0e10e5265c630.ttf"
sha256 "9535d35dab9e002963eef56757c46881f6b3d3b27db24eefcc80929781856c77"
end
def install
args = %W[
--disable-dependency-tracking
--prefix=#{prefix}
--with-coretext=yes
--enable-static
]
if build.with? "cairo"
args << "--with-cairo=yes"
else
args << "--with-cairo=no"
end
if build.with? "freetype"
args << "--with-freetype=yes"
else
args << "--with-freetype=no"
end
if build.with? "glib"
args << "--with-glib=yes"
else
args << "--with-glib=no"
end
if build.with? "gobject-introspection"
args << "--with-gobject=yes" << "--enable-introspection=yes"
else
args << "--with-gobject=no" << "--enable-introspection=no"
end
if build.with? "graphite2"
args << "--with-graphite2=yes"
else
args << "--with-graphite2=no"
end
if build.with? "icu4c"
args << "--with-icu=yes"
else
args << "--with-icu=no"
end
system "./autogen.sh" if build.head?
system "./configure", *args
system "make", "install"
end
test do
resource("ttf").stage do
shape = `echo 'സ്റ്റ്' | #{bin}/hb-shape 270b89df543a7e48e206a2d830c0e10e5265c630.ttf`.chomp
assert_equal "[glyph201=0+1183|U0D4D=0+0]", shape
end
end
end
|
class Hcxtools < Formula
desc "Utils for conversion of cap/pcap/pcapng WiFi dump files"
homepage "https://github.com/ZerBea/hcxtools"
url "https://github.com/ZerBea/hcxtools/archive/6.1.1.tar.gz"
sha256 "b9830742cebaadf84679c478e8f9e7534f35f5318c243cba335dfccfddd75886"
license "MIT"
head "https://github.com/ZerBea/hcxtools.git"
bottle do
cellar :any
sha256 "28de57048c75f7989ee928255665312bcc125687a4587b0464cd780b19e4ce44" => :catalina
sha256 "0f2d40f916f84577de2fca9f5f773cc17880e0b11a3b66ae0ea0eff36a019721" => :mojave
sha256 "b8379678a34c6254d33afea1f73d5c3014ab8125cbc4303021bfaf81a08303ad" => :high_sierra
end
depends_on "openssl@1.1"
def install
bin.mkpath
man1.mkpath
system "make", "install", "PREFIX=#{prefix}"
end
test do
# Create file with 22000 hash line
testhash = testpath/"test.22000"
(testpath/"test.22000").write <<~EOS
WPA*01*4d4fe7aac3a2cecab195321ceb99a7d0*fc690c158264*f4747f87f9f4*686173686361742d6573736964***
EOS
# Convert hash to .cap file
testcap = testpath/"test.cap"
system "#{bin}/hcxhash2cap", "--pmkid-eapol=#{testhash}", "-c", testpath/"test.cap"
# Convert .cap file back to hash file
newhash = testpath/"new.22000"
system "#{bin}/hcxpcapngtool", "-o", newhash, testcap
# Diff old and new hash file to check if they are identical
system "diff", newhash, testhash
end
end
hcxtools 6.1.2
Closes #61276.
Signed-off-by: chenrui <5fd29470147430022ff146db88de16ee91dea376@gmail.com>
Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com>
class Hcxtools < Formula
desc "Utils for conversion of cap/pcap/pcapng WiFi dump files"
homepage "https://github.com/ZerBea/hcxtools"
url "https://github.com/ZerBea/hcxtools/archive/6.1.2.tar.gz"
sha256 "d1adec69698fd1cdac30aef7a753513607a3008e64b15a77ac8a1113ae3b4cfa"
license "MIT"
head "https://github.com/ZerBea/hcxtools.git"
bottle do
cellar :any
sha256 "28de57048c75f7989ee928255665312bcc125687a4587b0464cd780b19e4ce44" => :catalina
sha256 "0f2d40f916f84577de2fca9f5f773cc17880e0b11a3b66ae0ea0eff36a019721" => :mojave
sha256 "b8379678a34c6254d33afea1f73d5c3014ab8125cbc4303021bfaf81a08303ad" => :high_sierra
end
depends_on "openssl@1.1"
def install
bin.mkpath
man1.mkpath
system "make", "install", "PREFIX=#{prefix}"
end
test do
# Create file with 22000 hash line
testhash = testpath/"test.22000"
(testpath/"test.22000").write <<~EOS
WPA*01*4d4fe7aac3a2cecab195321ceb99a7d0*fc690c158264*f4747f87f9f4*686173686361742d6573736964***
EOS
# Convert hash to .cap file
testcap = testpath/"test.cap"
system "#{bin}/hcxhash2cap", "--pmkid-eapol=#{testhash}", "-c", testpath/"test.cap"
# Convert .cap file back to hash file
newhash = testpath/"new.22000"
system "#{bin}/hcxpcapngtool", "-o", newhash, testcap
# Diff old and new hash file to check if they are identical
system "diff", newhash, testhash
end
end
|
class Hdf5Mpi < Formula
desc "File format designed to store large amounts of data"
homepage "https://www.hdfgroup.org/HDF5"
url "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/src/hdf5-1.12.0.tar.bz2"
sha256 "97906268640a6e9ce0cde703d5a71c9ac3092eded729591279bf2e3ca9765f61"
revision 1
bottle do
sha256 cellar: :any, arm64_big_sur: "483dd167599e83c428e8dd159fa2bbf44a217edf85c61978e2bfd19bda025a39"
sha256 cellar: :any, big_sur: "2566ec49e96b8bf99b97962f65daaa541256ec59c9ffcf671557bfd7d7348764"
sha256 cellar: :any, catalina: "ba61a9e5993f15c7b339a17afa405422abf89a908f890cd60aead67d2114f310"
sha256 cellar: :any, mojave: "f39b0f908ba1cb1c74aff7a36cb54cf04bc417defd5641752dffb2902866bd0c"
sha256 cellar: :any, high_sierra: "7be5d7e51464129cd531f124efec310affc716d2e810a224d238bba1659aea53"
sha256 cellar: :any, x86_64_linux: "aa123d32e7ac35ecbf4d735c1a97c25576e4b41647e59d917fa1d6453f7a7500"
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "gcc" # for gfortran
depends_on "open-mpi"
depends_on "szip"
uses_from_macos "zlib"
conflicts_with "hdf5", because: "hdf5-mpi is a variant of hdf5, one can only use one or the other"
def install
inreplace %w[c++/src/h5c++.in fortran/src/h5fc.in bin/h5cc.in],
"${libdir}/libhdf5.settings",
"#{pkgshare}/libhdf5.settings"
inreplace "src/Makefile.am",
"settingsdir=$(libdir)",
"settingsdir=#{pkgshare}"
if OS.mac?
system "autoreconf", "-fiv"
else
system "./autogen.sh"
end
args = %W[
--disable-dependency-tracking
--disable-silent-rules
--prefix=#{prefix}
--with-szlib=#{Formula["szip"].opt_prefix}
--enable-build-mode=production
--enable-fortran
--enable-parallel
CC=mpicc
CXX=mpic++
FC=mpifort
F77=mpif77
F90=mpif90
]
args << "--with-zlib=#{Formula["zlib"].opt_prefix}" unless OS.mac?
system "./configure", *args
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <stdio.h>
#include "hdf5.h"
int main()
{
printf("%d.%d.%d\\n", H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE);
return 0;
}
EOS
system "#{bin}/h5pcc", "test.c"
assert_equal version.to_s, shell_output("./a.out").chomp
(testpath/"test.f90").write <<~EOS
use hdf5
integer(hid_t) :: f, dspace, dset
integer(hsize_t), dimension(2) :: dims = [2, 2]
integer :: error = 0, major, minor, rel
call h5open_f (error)
if (error /= 0) call abort
call h5fcreate_f ("test.h5", H5F_ACC_TRUNC_F, f, error)
if (error /= 0) call abort
call h5screate_simple_f (2, dims, dspace, error)
if (error /= 0) call abort
call h5dcreate_f (f, "data", H5T_NATIVE_INTEGER, dspace, dset, error)
if (error /= 0) call abort
call h5dclose_f (dset, error)
if (error /= 0) call abort
call h5sclose_f (dspace, error)
if (error /= 0) call abort
call h5fclose_f (f, error)
if (error /= 0) call abort
call h5close_f (error)
if (error /= 0) call abort
CALL h5get_libversion_f (major, minor, rel, error)
if (error /= 0) call abort
write (*,"(I0,'.',I0,'.',I0)") major, minor, rel
end
EOS
system "#{bin}/h5pfc", "test.f90"
assert_equal version.to_s, shell_output("./a.out").chomp
end
end
hdf5-mpi: revision for gcc
class Hdf5Mpi < Formula
desc "File format designed to store large amounts of data"
homepage "https://www.hdfgroup.org/HDF5"
url "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/src/hdf5-1.12.0.tar.bz2"
sha256 "97906268640a6e9ce0cde703d5a71c9ac3092eded729591279bf2e3ca9765f61"
revision OS.mac? ? 1 : 2
bottle do
sha256 cellar: :any, arm64_big_sur: "483dd167599e83c428e8dd159fa2bbf44a217edf85c61978e2bfd19bda025a39"
sha256 cellar: :any, big_sur: "2566ec49e96b8bf99b97962f65daaa541256ec59c9ffcf671557bfd7d7348764"
sha256 cellar: :any, catalina: "ba61a9e5993f15c7b339a17afa405422abf89a908f890cd60aead67d2114f310"
sha256 cellar: :any, mojave: "f39b0f908ba1cb1c74aff7a36cb54cf04bc417defd5641752dffb2902866bd0c"
sha256 cellar: :any, high_sierra: "7be5d7e51464129cd531f124efec310affc716d2e810a224d238bba1659aea53"
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "gcc" # for gfortran
depends_on "open-mpi"
depends_on "szip"
uses_from_macos "zlib"
conflicts_with "hdf5", because: "hdf5-mpi is a variant of hdf5, one can only use one or the other"
def install
inreplace %w[c++/src/h5c++.in fortran/src/h5fc.in bin/h5cc.in],
"${libdir}/libhdf5.settings",
"#{pkgshare}/libhdf5.settings"
inreplace "src/Makefile.am",
"settingsdir=$(libdir)",
"settingsdir=#{pkgshare}"
if OS.mac?
system "autoreconf", "-fiv"
else
system "./autogen.sh"
end
args = %W[
--disable-dependency-tracking
--disable-silent-rules
--prefix=#{prefix}
--with-szlib=#{Formula["szip"].opt_prefix}
--enable-build-mode=production
--enable-fortran
--enable-parallel
CC=mpicc
CXX=mpic++
FC=mpifort
F77=mpif77
F90=mpif90
]
args << "--with-zlib=#{Formula["zlib"].opt_prefix}" unless OS.mac?
system "./configure", *args
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <stdio.h>
#include "hdf5.h"
int main()
{
printf("%d.%d.%d\\n", H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE);
return 0;
}
EOS
system "#{bin}/h5pcc", "test.c"
assert_equal version.to_s, shell_output("./a.out").chomp
(testpath/"test.f90").write <<~EOS
use hdf5
integer(hid_t) :: f, dspace, dset
integer(hsize_t), dimension(2) :: dims = [2, 2]
integer :: error = 0, major, minor, rel
call h5open_f (error)
if (error /= 0) call abort
call h5fcreate_f ("test.h5", H5F_ACC_TRUNC_F, f, error)
if (error /= 0) call abort
call h5screate_simple_f (2, dims, dspace, error)
if (error /= 0) call abort
call h5dcreate_f (f, "data", H5T_NATIVE_INTEGER, dspace, dset, error)
if (error /= 0) call abort
call h5dclose_f (dset, error)
if (error /= 0) call abort
call h5sclose_f (dspace, error)
if (error /= 0) call abort
call h5fclose_f (f, error)
if (error /= 0) call abort
call h5close_f (error)
if (error /= 0) call abort
CALL h5get_libversion_f (major, minor, rel, error)
if (error /= 0) call abort
write (*,"(I0,'.',I0,'.',I0)") major, minor, rel
end
EOS
system "#{bin}/h5pfc", "test.f90"
assert_equal version.to_s, shell_output("./a.out").chomp
end
end
|
class Helmfile < Formula
desc "Deploy Kubernetes Helm Charts"
homepage "https://github.com/roboll/helmfile"
url "https://github.com/roboll/helmfile/archive/v0.139.0.tar.gz"
sha256 "23baff955a189e2642948d1e33f91b87b6ac4ebc36f96d2ac913b3841436e911"
license "MIT"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "f354a0a85c65f4c50f1a9fc16cb4d2c53f36420fa25320f82637beedd153bc8b"
sha256 cellar: :any_skip_relocation, big_sur: "460d9944786fc927461955a3aead9c80523528e1a9ab464d2213416f65605289"
sha256 cellar: :any_skip_relocation, catalina: "200837ce43d034712ea69c4c37b980b77a8ee29b60f839086262dd213f4d6a5d"
sha256 cellar: :any_skip_relocation, mojave: "a6a670916bd4cccd57dfc9f405c8956a5bcb3e0e8614570f4f869d0bb7ce9fe3"
end
depends_on "go" => :build
depends_on "helm"
def install
system "go", "build", "-ldflags", "-X github.com/roboll/helmfile/pkg/app/version.Version=v#{version}",
"-o", bin/"helmfile", "-v", "github.com/roboll/helmfile"
end
test do
(testpath/"helmfile.yaml").write <<-EOS
repositories:
- name: stable
url: https://charts.helm.sh/stable
releases:
- name: vault # name of this release
namespace: vault # target namespace
createNamespace: true # helm 3.2+ automatically create release namespace (default true)
labels: # Arbitrary key value pairs for filtering releases
foo: bar
chart: stable/vault # the chart being installed to create this release, referenced by `repository/chart` syntax
version: ~1.24.1 # the semver of the chart. range constraint is supported
EOS
system Formula["helm"].opt_bin/"helm", "create", "foo"
output = "Adding repo stable https://charts.helm.sh/stable"
assert_match output, shell_output("#{bin}/helmfile -f helmfile.yaml repos 2>&1")
assert_match version.to_s, shell_output("#{bin}/helmfile -v")
end
end
helmfile: update 0.139.0 bottle.
class Helmfile < Formula
desc "Deploy Kubernetes Helm Charts"
homepage "https://github.com/roboll/helmfile"
url "https://github.com/roboll/helmfile/archive/v0.139.0.tar.gz"
sha256 "23baff955a189e2642948d1e33f91b87b6ac4ebc36f96d2ac913b3841436e911"
license "MIT"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "3a9f5f6f5cde95bb345870d61f0d6537a1359ba88af8b429a5a08b60c34f55f0"
sha256 cellar: :any_skip_relocation, big_sur: "7292c11a559caa8f8d68d5b7f7975e056f4eac9923b6f6aecaa86c7478c4dff5"
sha256 cellar: :any_skip_relocation, catalina: "36bd7e563dd68c48dcb9b72a09b18cccf2056a25043c5c363599bfd034700b8f"
sha256 cellar: :any_skip_relocation, mojave: "31e47afcfe4787fc1c46f204d8a82a2416128e4add520b559a5c6bed25d8aa37"
end
depends_on "go" => :build
depends_on "helm"
def install
system "go", "build", "-ldflags", "-X github.com/roboll/helmfile/pkg/app/version.Version=v#{version}",
"-o", bin/"helmfile", "-v", "github.com/roboll/helmfile"
end
test do
(testpath/"helmfile.yaml").write <<-EOS
repositories:
- name: stable
url: https://charts.helm.sh/stable
releases:
- name: vault # name of this release
namespace: vault # target namespace
createNamespace: true # helm 3.2+ automatically create release namespace (default true)
labels: # Arbitrary key value pairs for filtering releases
foo: bar
chart: stable/vault # the chart being installed to create this release, referenced by `repository/chart` syntax
version: ~1.24.1 # the semver of the chart. range constraint is supported
EOS
system Formula["helm"].opt_bin/"helm", "create", "foo"
output = "Adding repo stable https://charts.helm.sh/stable"
assert_match output, shell_output("#{bin}/helmfile -f helmfile.yaml repos 2>&1")
assert_match version.to_s, shell_output("#{bin}/helmfile -v")
end
end
|
class Helmfile < Formula
desc "Deploy Kubernetes Helm Charts"
homepage "https://github.com/roboll/helmfile"
url "https://github.com/roboll/helmfile/archive/v0.98.3.tar.gz"
sha256 "0846b76fe4d14e173aefd7f446bbcaf46a4fbcfd54328eaf110a723af6a28874"
bottle do
cellar :any_skip_relocation
sha256 "1933a26433da94dd7edc2853730fcc7a274d0d7c893150adc2829d76cbc29c22" => :catalina
sha256 "7a7225b2d255a66bb37175e38434c703ca83297c6f8fb654fb936276bd15f334" => :mojave
sha256 "cab7b82736773ef7dd39857c50934a0762b9bb15f10c276afaa48fe5c93c0669" => :high_sierra
end
depends_on "go" => :build
depends_on "helm"
def install
system "go", "build", "-ldflags", "-X github.com/roboll/helmfile/pkg/app/version.Version=v#{version}",
"-o", bin/"helmfile", "-v", "github.com/roboll/helmfile"
end
test do
(testpath/"helmfile.yaml").write <<-EOS
repositories:
- name: stable
url: https://kubernetes-charts.storage.googleapis.com/
releases:
- name: test
EOS
system Formula["helm"].opt_bin/"helm", "create", "foo"
output = "Adding repo stable https://kubernetes-charts.storage.googleapis.com"
assert_match output, shell_output("#{bin}/helmfile -f helmfile.yaml repos 2>&1")
assert_match version.to_s, shell_output("#{bin}/helmfile -v")
end
end
helmfile: update 0.98.3 bottle.
Co-authored-by: Michka Popoff <7b0496f66f66ee22a38826c310c38b415671b832@gmail.com>
class Helmfile < Formula
desc "Deploy Kubernetes Helm Charts"
homepage "https://github.com/roboll/helmfile"
url "https://github.com/roboll/helmfile/archive/v0.98.3.tar.gz"
sha256 "0846b76fe4d14e173aefd7f446bbcaf46a4fbcfd54328eaf110a723af6a28874"
bottle do
cellar :any_skip_relocation
sha256 "1933a26433da94dd7edc2853730fcc7a274d0d7c893150adc2829d76cbc29c22" => :catalina
sha256 "7a7225b2d255a66bb37175e38434c703ca83297c6f8fb654fb936276bd15f334" => :mojave
sha256 "cab7b82736773ef7dd39857c50934a0762b9bb15f10c276afaa48fe5c93c0669" => :high_sierra
sha256 "cd0ae5e7db93bd62b2c604f6a3ff6829fef59979f6d3b510312d890ac59e0dfb" => :x86_64_linux
end
depends_on "go" => :build
depends_on "helm"
def install
system "go", "build", "-ldflags", "-X github.com/roboll/helmfile/pkg/app/version.Version=v#{version}",
"-o", bin/"helmfile", "-v", "github.com/roboll/helmfile"
end
test do
(testpath/"helmfile.yaml").write <<-EOS
repositories:
- name: stable
url: https://kubernetes-charts.storage.googleapis.com/
releases:
- name: test
EOS
system Formula["helm"].opt_bin/"helm", "create", "foo"
output = "Adding repo stable https://kubernetes-charts.storage.googleapis.com"
assert_match output, shell_output("#{bin}/helmfile -f helmfile.yaml repos 2>&1")
assert_match version.to_s, shell_output("#{bin}/helmfile -v")
end
end
|
class Helmfile < Formula
desc "Deploy Kubernetes Helm Charts"
homepage "https://github.com/roboll/helmfile"
url "https://github.com/roboll/helmfile/archive/v0.121.1.tar.gz"
sha256 "e2ff3e466302e39f3593d85cf50d6d71652ede2a2d7421f11f142bf3436b01f1"
license "MIT"
bottle do
cellar :any_skip_relocation
sha256 "c811d5781e4dbeb50f36245d2315626c2893b44877c53bcaf573fcd0062204fe" => :catalina
sha256 "e79e547a3df588dc261f77f21ea3063145e304b222528877a5b5b8b62b4f1a59" => :mojave
sha256 "b5a78bc224fd2276b85648cc6fa35a4dcfc9fe7eb4676ddac405f06be866eb8e" => :high_sierra
end
depends_on "go" => :build
depends_on "helm"
def install
system "go", "build", "-ldflags", "-X github.com/roboll/helmfile/pkg/app/version.Version=v#{version}",
"-o", bin/"helmfile", "-v", "github.com/roboll/helmfile"
end
test do
(testpath/"helmfile.yaml").write <<-EOS
repositories:
- name: stable
url: https://kubernetes-charts.storage.googleapis.com/
releases:
- name: vault # name of this release
namespace: vault # target namespace
labels: # Arbitrary key value pairs for filtering releases
foo: bar
chart: roboll/vault-secret-manager # the chart being installed to create this release, referenced by `repository/chart` syntax
version: ~1.24.1 # the semver of the chart. range constraint is supported
EOS
system Formula["helm"].opt_bin/"helm", "create", "foo"
output = "Adding repo stable https://kubernetes-charts.storage.googleapis.com"
assert_match output, shell_output("#{bin}/helmfile -f helmfile.yaml repos 2>&1")
assert_match version.to_s, shell_output("#{bin}/helmfile -v")
end
end
helmfile 0.122.0
Closes #58195.
Signed-off-by: Seeker <bca9b36fa03ba2a07bcb35f619ad7605877f3386@protonmail.com>
Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com>
class Helmfile < Formula
desc "Deploy Kubernetes Helm Charts"
homepage "https://github.com/roboll/helmfile"
url "https://github.com/roboll/helmfile/archive/v0.122.0.tar.gz"
sha256 "091ce326f7c6186559c86231a01539c8ac20a14ceb73fd0527140b8b84ad94c5"
license "MIT"
bottle do
cellar :any_skip_relocation
sha256 "c811d5781e4dbeb50f36245d2315626c2893b44877c53bcaf573fcd0062204fe" => :catalina
sha256 "e79e547a3df588dc261f77f21ea3063145e304b222528877a5b5b8b62b4f1a59" => :mojave
sha256 "b5a78bc224fd2276b85648cc6fa35a4dcfc9fe7eb4676ddac405f06be866eb8e" => :high_sierra
end
depends_on "go" => :build
depends_on "helm"
def install
system "go", "build", "-ldflags", "-X github.com/roboll/helmfile/pkg/app/version.Version=v#{version}",
"-o", bin/"helmfile", "-v", "github.com/roboll/helmfile"
end
test do
(testpath/"helmfile.yaml").write <<-EOS
repositories:
- name: stable
url: https://kubernetes-charts.storage.googleapis.com/
releases:
- name: vault # name of this release
namespace: vault # target namespace
labels: # Arbitrary key value pairs for filtering releases
foo: bar
chart: roboll/vault-secret-manager # the chart being installed to create this release, referenced by `repository/chart` syntax
version: ~1.24.1 # the semver of the chart. range constraint is supported
EOS
system Formula["helm"].opt_bin/"helm", "create", "foo"
output = "Adding repo stable https://kubernetes-charts.storage.googleapis.com"
assert_match output, shell_output("#{bin}/helmfile -f helmfile.yaml repos 2>&1")
assert_match version.to_s, shell_output("#{bin}/helmfile -v")
end
end
|
class Help2man < Formula
desc "Automatically generate simple man pages"
homepage "https://www.gnu.org/software/help2man/"
url "https://ftp.gnu.org/gnu/help2man/help2man-1.48.5.tar.xz"
mirror "https://ftpmirror.gnu.org/help2man/help2man-1.48.5.tar.xz"
sha256 "6739e4caa42e6aed3399be4387ca79399640967334e91728863b8eaa922582be"
license "GPL-3.0-or-later"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "5f0773ffb77e0e13dce87ce7726fe3f29184f431c345840c7dc869a3b6cf276d"
sha256 cellar: :any, big_sur: "49eb6e847eeb7e51779289d351a337ef0c6cba97ac079806066747456036d8e6"
sha256 cellar: :any, catalina: "4abfd6faab1e8286a08da1874e46ebf8a32812f84953740b08ddf2b17be6eb3c"
sha256 cellar: :any, mojave: "8586eeac3d452b94b08a519bc01a4887e534832e7be01aa1c0c5bfefeda5b6a4"
sha256 cellar: :any_skip_relocation, x86_64_linux: "f1316c8afe193ef525f86ba791f23557ac403d68b14677e6e29ba536df59a0be"
end
depends_on "gettext" if Hardware::CPU.intel?
uses_from_macos "perl"
resource "Locale::gettext" do
url "https://cpan.metacpan.org/authors/id/P/PV/PVANDRY/gettext-1.07.tar.gz"
sha256 "909d47954697e7c04218f972915b787bd1244d75e3bd01620bc167d5bbc49c15"
end
def install
ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5"
if Hardware::CPU.intel?
resource("Locale::gettext").stage do
system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}"
system "make", "install"
end
end
# install is not parallel safe
# see https://github.com/Homebrew/homebrew/issues/12609
ENV.deparallelize
args = []
args << "--enable-nls" if Hardware::CPU.intel?
system "./configure", "--prefix=#{prefix}", *args
system "make", "install"
(libexec/"bin").install "#{bin}/help2man"
(bin/"help2man").write_env_script("#{libexec}/bin/help2man", PERL5LIB: ENV["PERL5LIB"])
end
test do
out = if Hardware::CPU.intel?
shell_output("#{bin}/help2man --locale=en_US.UTF-8 #{bin}/help2man")
else
shell_output("#{bin}/help2man #{bin}/help2man")
end
assert_match "help2man #{version}", out
end
end
help2man: update 1.48.5 bottle.
class Help2man < Formula
desc "Automatically generate simple man pages"
homepage "https://www.gnu.org/software/help2man/"
url "https://ftp.gnu.org/gnu/help2man/help2man-1.48.5.tar.xz"
mirror "https://ftpmirror.gnu.org/help2man/help2man-1.48.5.tar.xz"
sha256 "6739e4caa42e6aed3399be4387ca79399640967334e91728863b8eaa922582be"
license "GPL-3.0-or-later"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "5f0773ffb77e0e13dce87ce7726fe3f29184f431c345840c7dc869a3b6cf276d"
sha256 cellar: :any, monterey: "49e2e969ec8ed1c4f7954d0236fd64719e102a128c42af685767bfc5f213ac07"
sha256 cellar: :any, big_sur: "49eb6e847eeb7e51779289d351a337ef0c6cba97ac079806066747456036d8e6"
sha256 cellar: :any, catalina: "4abfd6faab1e8286a08da1874e46ebf8a32812f84953740b08ddf2b17be6eb3c"
sha256 cellar: :any, mojave: "8586eeac3d452b94b08a519bc01a4887e534832e7be01aa1c0c5bfefeda5b6a4"
sha256 cellar: :any_skip_relocation, x86_64_linux: "f1316c8afe193ef525f86ba791f23557ac403d68b14677e6e29ba536df59a0be"
end
depends_on "gettext" if Hardware::CPU.intel?
uses_from_macos "perl"
resource "Locale::gettext" do
url "https://cpan.metacpan.org/authors/id/P/PV/PVANDRY/gettext-1.07.tar.gz"
sha256 "909d47954697e7c04218f972915b787bd1244d75e3bd01620bc167d5bbc49c15"
end
def install
ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5"
if Hardware::CPU.intel?
resource("Locale::gettext").stage do
system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}"
system "make", "install"
end
end
# install is not parallel safe
# see https://github.com/Homebrew/homebrew/issues/12609
ENV.deparallelize
args = []
args << "--enable-nls" if Hardware::CPU.intel?
system "./configure", "--prefix=#{prefix}", *args
system "make", "install"
(libexec/"bin").install "#{bin}/help2man"
(bin/"help2man").write_env_script("#{libexec}/bin/help2man", PERL5LIB: ENV["PERL5LIB"])
end
test do
out = if Hardware::CPU.intel?
shell_output("#{bin}/help2man --locale=en_US.UTF-8 #{bin}/help2man")
else
shell_output("#{bin}/help2man #{bin}/help2man")
end
assert_match "help2man #{version}", out
end
end
|
class Homebank < Formula
desc "Manage your personal accounts at home"
homepage "http://homebank.free.fr"
url "http://homebank.free.fr/public/homebank-5.0.4.tar.gz"
sha256 "d78ccbef2ac52bf30e0ded093ca7b5162405f0ada7e5853c63d2b025e098c978"
bottle do
sha256 "9211fea3f0282cbf278d4a36763847b58e17e42b202b10762914dd19e79171bc" => :yosemite
sha256 "7fef17d4bab46280e3546bdd1707a50a950621ff746f8bab7b82127eb27baed2" => :mavericks
sha256 "f19878c6d82dd385e38cfe24f757e5364893a03f3eb1fbbc3a4582377155070e" => :mountain_lion
end
depends_on "pkg-config" => :build
depends_on "intltool" => :build
depends_on "gettext"
depends_on "gtk+3"
depends_on "gnome-icon-theme"
depends_on "hicolor-icon-theme"
depends_on "freetype"
depends_on "fontconfig"
depends_on "libofx" => :optional
def install
args = ["--disable-dependency-tracking",
"--prefix=#{prefix}"]
args << "--with-ofx" if build.with? "libofx"
system "./configure", *args
chmod 0755, "./install-sh"
system "make", "install"
end
test do
system "#{bin}/homebank", "--version"
end
end
homebank 5.0.5
Homebank 5.0.5
Closes Homebrew/homebrew#44214.
Signed-off-by: Dominyk Tiller <53e438f55903875d07efdd98a8aaf887e7208dd3@gmail.com>
class Homebank < Formula
desc "Manage your personal accounts at home"
homepage "http://homebank.free.fr"
url "http://homebank.free.fr/public/homebank-5.0.5.tar.gz"
sha256 "67c47709517d325fc8d601bb8552e3c8a1ad3b820a2c0a403ed20f00c795903c"
bottle do
sha256 "9211fea3f0282cbf278d4a36763847b58e17e42b202b10762914dd19e79171bc" => :yosemite
sha256 "7fef17d4bab46280e3546bdd1707a50a950621ff746f8bab7b82127eb27baed2" => :mavericks
sha256 "f19878c6d82dd385e38cfe24f757e5364893a03f3eb1fbbc3a4582377155070e" => :mountain_lion
end
depends_on "pkg-config" => :build
depends_on "intltool" => :build
depends_on "gettext"
depends_on "gtk+3"
depends_on "gnome-icon-theme"
depends_on "hicolor-icon-theme"
depends_on "freetype"
depends_on "fontconfig"
depends_on "libofx" => :optional
def install
args = ["--disable-dependency-tracking",
"--prefix=#{prefix}"]
args << "--with-ofx" if build.with? "libofx"
system "./configure", *args
chmod 0755, "./install-sh"
system "make", "install"
end
test do
system "#{bin}/homebank", "--version"
end
end
|
require 'formula'
class Icoutils < Formula
homepage 'http://www.nongnu.org/icoutils/'
url 'http://savannah.nongnu.org/download/icoutils/icoutils-0.31.0.tar.bz2'
sha1 '2712acd33c611588793562310077efd2ff35dca5'
revision 1
depends_on 'libpng'
def install
system "./configure", "--disable-dependency-tracking",
"--disable-rpath",
"--prefix=#{prefix}"
system "make install"
end
end
icoutils: add test
Closes Homebrew/homebrew#35453.
Signed-off-by: Jack Nagel <43386ce32af96f5c56f2a88e458cb94cebee3751@gmail.com>
class Icoutils < Formula
homepage "http://www.nongnu.org/icoutils/"
url "http://savannah.nongnu.org/download/icoutils/icoutils-0.31.0.tar.bz2"
sha1 "2712acd33c611588793562310077efd2ff35dca5"
revision 1
depends_on "libpng"
def install
system "./configure", "--disable-dependency-tracking",
"--disable-rpath",
"--prefix=#{prefix}"
system "make", "install"
end
test do
system "#{bin}/icotool", "-l", test_fixtures("test.ico")
end
end
|
class Imapsync < Formula
desc "Migrate or backup IMAP mail accounts"
homepage "https://imapsync.lamiral.info/"
url "https://imapsync.lamiral.info/dist2/imapsync-2.200.tgz"
# NOTE: The mirror will return 404 until the version becomes outdated.
sha256 "115f3e3be2ec5fd5235501240292c5f15bd289d47e39f7581da861b92bca5be5"
license "NLPL"
head "https://github.com/imapsync/imapsync.git", branch: "master"
livecheck do
url "https://imapsync.lamiral.info/dist2/"
regex(/href=.*?imapsync[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "d13a9bda6f684909de20e10c65430836bac345c6bed1ea1d0d37a0f655eb258d"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "583aef334a783f9efed892bb52fc8916ba4b219843dd359557984fddcecc9bf8"
sha256 cellar: :any_skip_relocation, monterey: "eeb5fb8230ad6f55a2fc61e76fc35cefc510a6bdc5d46f6c1f542c45c6a29778"
sha256 cellar: :any_skip_relocation, big_sur: "c0d4e602efe6f502e4138f718a951af32c56676a6c304bbd0b2cbb55feff8c55"
sha256 cellar: :any_skip_relocation, catalina: "54546bcbf94e9bb504cb330c816d59ca087f9e8ed2825ff022574c6d5a9f0edb"
sha256 cellar: :any_skip_relocation, x86_64_linux: "f9f9b3065ad3cf7a8e4eb4000403ef859d65999cc97160c82259d130a0ae9f8d"
end
depends_on "pod2man" => :build
uses_from_macos "perl"
on_linux do
resource "Digest::HMAC_SHA1" do
url "https://cpan.metacpan.org/authors/id/G/GA/GAAS/Digest-HMAC-1.03.tar.gz"
sha256 "3bc72c6d3ff144d73aefb90e9a78d33612d58cf1cd1631ecfb8985ba96da4a59"
end
resource "IO::Socket::INET6" do
url "https://cpan.metacpan.org/authors/id/S/SH/SHLOMIF/IO-Socket-INET6-2.72.tar.gz"
sha256 "85e020fa179284125fc1d08e60a9022af3ec1271077fe14b133c1785cdbf1ebb"
end
resource "Socket6" do
url "https://cpan.metacpan.org/authors/id/U/UM/UMEMOTO/Socket6-0.29.tar.gz"
sha256 "468915fa3a04dcf6574fc957eff495915e24569434970c91ee8e4e1459fc9114"
end
resource "IO::Socket::SSL" do
url "https://cpan.metacpan.org/authors/id/S/SU/SULLR/IO-Socket-SSL-2.066.tar.gz"
sha256 "0d47064781a545304d5dcea5dfcee3acc2e95a32e1b4884d80505cde8ee6ebcd"
end
resource "Net::SSLeay" do
url "https://cpan.metacpan.org/authors/id/C/CH/CHRISN/Net-SSLeay-1.88.tar.gz"
sha256 "2000da483c8471a0b61e06959e92a6fca7b9e40586d5c828de977d3d2081cfdd"
end
resource "Term::ReadKey" do
url "https://cpan.metacpan.org/authors/id/J/JS/JSTOWE/TermReadKey-2.38.tar.gz"
sha256 "5a645878dc570ac33661581fbb090ff24ebce17d43ea53fd22e105a856a47290"
end
resource "Regexp::Common" do
url "https://cpan.metacpan.org/authors/id/A/AB/ABIGAIL/Regexp-Common-2017060201.tar.gz"
sha256 "ee07853aee06f310e040b6bf1a0199a18d81896d3219b9b35c9630d0eb69089b"
end
resource "ExtUtils::Config" do
url "https://cpan.metacpan.org/authors/id/L/LE/LEONT/ExtUtils-Config-0.008.tar.gz"
sha256 "ae5104f634650dce8a79b7ed13fb59d67a39c213a6776cfdaa3ee749e62f1a8c"
end
resource "ExtUtils::Helpers" do
url "https://cpan.metacpan.org/authors/id/L/LE/LEONT/ExtUtils-Helpers-0.026.tar.gz"
sha256 "de901b6790a4557cf4ec908149e035783b125bf115eb9640feb1bc1c24c33416"
end
resource "ExtUtils::InstallPaths" do
url "https://cpan.metacpan.org/authors/id/L/LE/LEONT/ExtUtils-InstallPaths-0.012.tar.gz"
sha256 "84735e3037bab1fdffa3c2508567ad412a785c91599db3c12593a50a1dd434ed"
end
end
resource "Encode::IMAPUTF7" do
url "https://cpan.metacpan.org/authors/id/P/PM/PMAKHOLM/Encode-IMAPUTF7-1.05.tar.gz"
sha256 "470305ddc37483cfe8d3c16d13770a28011f600bf557acb8c3e07739997c37e1"
end
resource "Unicode::String" do
url "https://cpan.metacpan.org/authors/id/G/GA/GAAS/GAAS/Unicode-String-2.10.tar.gz"
sha256 "894a110ece479546af8afec0972eec7320c86c4dea4e6b354dff3c7526ba9b68"
end
resource "File::Copy::Recursive" do
url "https://cpan.metacpan.org/authors/id/D/DM/DMUEY/File-Copy-Recursive-0.45.tar.gz"
sha256 "d3971cf78a8345e38042b208bb7b39cb695080386af629f4a04ffd6549df1157"
end
resource "Authen::NTLM" do
url "https://cpan.metacpan.org/authors/id/N/NB/NBEBOUT/NTLM-1.09.tar.gz"
sha256 "c823e30cda76bc15636e584302c960e2b5eeef9517c2448f7454498893151f85"
end
resource "Mail::IMAPClient" do
url "https://cpan.metacpan.org/authors/id/P/PL/PLOBBES/Mail-IMAPClient-3.43.tar.gz"
sha256 "093c97fac15b47a8fe4d2936ef2df377abf77cc8ab74092d2128bb945d1fb46f"
end
resource "IO::Tee" do
url "https://cpan.metacpan.org/authors/id/N/NE/NEILB/IO-Tee-0.66.tar.gz"
sha256 "2d9ce7206516f9c30863a367aa1c2b9b35702e369b0abaa15f99fb2cc08552e0"
end
resource "Data::Uniqid" do
url "https://cpan.metacpan.org/authors/id/M/MW/MWX/Data-Uniqid-0.12.tar.gz"
sha256 "b6919ba49b9fe98bfdf3e8accae7b9b7f78dc9e71ebbd0b7fef7a45d99324ccb"
end
resource "JSON" do
url "https://cpan.metacpan.org/authors/id/I/IS/ISHIGAKI/JSON-4.03.tar.gz"
sha256 "e41f8761a5e7b9b27af26fe5780d44550d7a6a66bf3078e337d676d07a699941"
end
resource "Test::MockObject" do
url "https://cpan.metacpan.org/authors/id/C/CH/CHROMATIC/Test-MockObject-1.20200122.tar.gz"
sha256 "2b7f80da87f5a6fe0360d9ee521051053017442c3a26e85db68dfac9f8307623"
end
if MacOS.version <= :catalina
resource "Module::Build" do
url "https://cpan.metacpan.org/authors/id/L/LE/LEONT/Module-Build-0.4231.tar.gz"
sha256 "7e0f4c692c1740c1ac84ea14d7ea3d8bc798b2fb26c09877229e04f430b2b717"
end
end
resource "JSON::WebToken" do
url "https://cpan.metacpan.org/authors/id/X/XA/XAICRON/JSON-WebToken-0.10.tar.gz"
sha256 "77c182a98528f1714d82afc548d5b3b4dc93e67069128bb9b9413f24cf07248b"
end
resource "Module::Build::Tiny" do
url "https://cpan.metacpan.org/authors/id/L/LE/LEONT/Module-Build-Tiny-0.039.tar.gz"
sha256 "7d580ff6ace0cbe555bf36b86dc8ea232581530cbeaaea09bccb57b55797f11c"
end
resource "Readonly" do
url "https://cpan.metacpan.org/authors/id/S/SA/SANKO/Readonly-2.05.tar.gz"
sha256 "4b23542491af010d44a5c7c861244738acc74ababae6b8838d354dfb19462b5e"
end
resource "Sys::MemInfo" do
url "https://cpan.metacpan.org/authors/id/S/SC/SCRESTO/Sys-MemInfo-0.99.tar.gz"
sha256 "0786319d3a3a8bae5d727939244bf17e140b714f52734d5e9f627203e4cf3e3b"
end
resource "File::Tail" do
url "https://cpan.metacpan.org/authors/id/M/MG/MGRABNAR/File-Tail-1.3.tar.gz"
sha256 "26d09f81836e43eae40028d5283fe5620fe6fe6278bf3eb8eb600c48ec34afc7"
end
resource "IO::Socket::IP" do
url "https://cpan.metacpan.org/authors/id/P/PE/PEVANS/IO-Socket-IP-0.41.tar.gz"
sha256 "849a45a238f8392588b97722c850382c4e6d157cd08a822ddcb9073c73bf1446"
end
def install
ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5"
build_pl = ["Module::Build", "JSON::WebToken", "Module::Build::Tiny", "Readonly", "IO::Socket::IP"]
resources.each do |r|
r.stage do
next if build_pl.include? r.name
system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}"
system "make"
system "make", "install"
end
end
# Big Sur has a sufficiently new Module::Build
build_pl.shift if MacOS.version >= :big_sur
build_pl.each do |name|
resource(name).stage do
system "perl", "Build.PL", "--install_base", libexec
system "./Build"
system "./Build", "install"
end
end
system "perl", "-c", "imapsync"
system "#{Formula["pod2man"].opt_bin}/pod2man", "imapsync", "imapsync.1"
bin.install "imapsync"
man1.install "imapsync.1"
bin.env_script_all_files(libexec/"bin", PERL5LIB: ENV["PERL5LIB"])
end
test do
assert_match version.to_s, pipe_output("#{bin}/imapsync --dry")
shell_output("#{bin}/imapsync --dry \
--host1 test1.lamiral.info --user1 test1 --password1 secret1 \
--host2 test2.lamiral.info --user2 test2 --password2 secret2")
end
end
imapsync: use `on_{system}` blocks
Generated using `brew style --fix` and then updated manually if needed
class Imapsync < Formula
desc "Migrate or backup IMAP mail accounts"
homepage "https://imapsync.lamiral.info/"
url "https://imapsync.lamiral.info/dist2/imapsync-2.200.tgz"
# NOTE: The mirror will return 404 until the version becomes outdated.
sha256 "115f3e3be2ec5fd5235501240292c5f15bd289d47e39f7581da861b92bca5be5"
license "NLPL"
head "https://github.com/imapsync/imapsync.git", branch: "master"
livecheck do
url "https://imapsync.lamiral.info/dist2/"
regex(/href=.*?imapsync[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "d13a9bda6f684909de20e10c65430836bac345c6bed1ea1d0d37a0f655eb258d"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "583aef334a783f9efed892bb52fc8916ba4b219843dd359557984fddcecc9bf8"
sha256 cellar: :any_skip_relocation, monterey: "eeb5fb8230ad6f55a2fc61e76fc35cefc510a6bdc5d46f6c1f542c45c6a29778"
sha256 cellar: :any_skip_relocation, big_sur: "c0d4e602efe6f502e4138f718a951af32c56676a6c304bbd0b2cbb55feff8c55"
sha256 cellar: :any_skip_relocation, catalina: "54546bcbf94e9bb504cb330c816d59ca087f9e8ed2825ff022574c6d5a9f0edb"
sha256 cellar: :any_skip_relocation, x86_64_linux: "f9f9b3065ad3cf7a8e4eb4000403ef859d65999cc97160c82259d130a0ae9f8d"
end
depends_on "pod2man" => :build
uses_from_macos "perl"
on_linux do
resource "Digest::HMAC_SHA1" do
url "https://cpan.metacpan.org/authors/id/G/GA/GAAS/Digest-HMAC-1.03.tar.gz"
sha256 "3bc72c6d3ff144d73aefb90e9a78d33612d58cf1cd1631ecfb8985ba96da4a59"
end
resource "IO::Socket::INET6" do
url "https://cpan.metacpan.org/authors/id/S/SH/SHLOMIF/IO-Socket-INET6-2.72.tar.gz"
sha256 "85e020fa179284125fc1d08e60a9022af3ec1271077fe14b133c1785cdbf1ebb"
end
resource "Socket6" do
url "https://cpan.metacpan.org/authors/id/U/UM/UMEMOTO/Socket6-0.29.tar.gz"
sha256 "468915fa3a04dcf6574fc957eff495915e24569434970c91ee8e4e1459fc9114"
end
resource "IO::Socket::SSL" do
url "https://cpan.metacpan.org/authors/id/S/SU/SULLR/IO-Socket-SSL-2.066.tar.gz"
sha256 "0d47064781a545304d5dcea5dfcee3acc2e95a32e1b4884d80505cde8ee6ebcd"
end
resource "Net::SSLeay" do
url "https://cpan.metacpan.org/authors/id/C/CH/CHRISN/Net-SSLeay-1.88.tar.gz"
sha256 "2000da483c8471a0b61e06959e92a6fca7b9e40586d5c828de977d3d2081cfdd"
end
resource "Term::ReadKey" do
url "https://cpan.metacpan.org/authors/id/J/JS/JSTOWE/TermReadKey-2.38.tar.gz"
sha256 "5a645878dc570ac33661581fbb090ff24ebce17d43ea53fd22e105a856a47290"
end
resource "Regexp::Common" do
url "https://cpan.metacpan.org/authors/id/A/AB/ABIGAIL/Regexp-Common-2017060201.tar.gz"
sha256 "ee07853aee06f310e040b6bf1a0199a18d81896d3219b9b35c9630d0eb69089b"
end
resource "ExtUtils::Config" do
url "https://cpan.metacpan.org/authors/id/L/LE/LEONT/ExtUtils-Config-0.008.tar.gz"
sha256 "ae5104f634650dce8a79b7ed13fb59d67a39c213a6776cfdaa3ee749e62f1a8c"
end
resource "ExtUtils::Helpers" do
url "https://cpan.metacpan.org/authors/id/L/LE/LEONT/ExtUtils-Helpers-0.026.tar.gz"
sha256 "de901b6790a4557cf4ec908149e035783b125bf115eb9640feb1bc1c24c33416"
end
resource "ExtUtils::InstallPaths" do
url "https://cpan.metacpan.org/authors/id/L/LE/LEONT/ExtUtils-InstallPaths-0.012.tar.gz"
sha256 "84735e3037bab1fdffa3c2508567ad412a785c91599db3c12593a50a1dd434ed"
end
end
resource "Encode::IMAPUTF7" do
url "https://cpan.metacpan.org/authors/id/P/PM/PMAKHOLM/Encode-IMAPUTF7-1.05.tar.gz"
sha256 "470305ddc37483cfe8d3c16d13770a28011f600bf557acb8c3e07739997c37e1"
end
resource "Unicode::String" do
url "https://cpan.metacpan.org/authors/id/G/GA/GAAS/GAAS/Unicode-String-2.10.tar.gz"
sha256 "894a110ece479546af8afec0972eec7320c86c4dea4e6b354dff3c7526ba9b68"
end
resource "File::Copy::Recursive" do
url "https://cpan.metacpan.org/authors/id/D/DM/DMUEY/File-Copy-Recursive-0.45.tar.gz"
sha256 "d3971cf78a8345e38042b208bb7b39cb695080386af629f4a04ffd6549df1157"
end
resource "Authen::NTLM" do
url "https://cpan.metacpan.org/authors/id/N/NB/NBEBOUT/NTLM-1.09.tar.gz"
sha256 "c823e30cda76bc15636e584302c960e2b5eeef9517c2448f7454498893151f85"
end
resource "Mail::IMAPClient" do
url "https://cpan.metacpan.org/authors/id/P/PL/PLOBBES/Mail-IMAPClient-3.43.tar.gz"
sha256 "093c97fac15b47a8fe4d2936ef2df377abf77cc8ab74092d2128bb945d1fb46f"
end
resource "IO::Tee" do
url "https://cpan.metacpan.org/authors/id/N/NE/NEILB/IO-Tee-0.66.tar.gz"
sha256 "2d9ce7206516f9c30863a367aa1c2b9b35702e369b0abaa15f99fb2cc08552e0"
end
resource "Data::Uniqid" do
url "https://cpan.metacpan.org/authors/id/M/MW/MWX/Data-Uniqid-0.12.tar.gz"
sha256 "b6919ba49b9fe98bfdf3e8accae7b9b7f78dc9e71ebbd0b7fef7a45d99324ccb"
end
resource "JSON" do
url "https://cpan.metacpan.org/authors/id/I/IS/ISHIGAKI/JSON-4.03.tar.gz"
sha256 "e41f8761a5e7b9b27af26fe5780d44550d7a6a66bf3078e337d676d07a699941"
end
resource "Test::MockObject" do
url "https://cpan.metacpan.org/authors/id/C/CH/CHROMATIC/Test-MockObject-1.20200122.tar.gz"
sha256 "2b7f80da87f5a6fe0360d9ee521051053017442c3a26e85db68dfac9f8307623"
end
resource "Module::Build" do
on_system :linux, macos: :catalina_or_older do
url "https://cpan.metacpan.org/authors/id/L/LE/LEONT/Module-Build-0.4231.tar.gz"
sha256 "7e0f4c692c1740c1ac84ea14d7ea3d8bc798b2fb26c09877229e04f430b2b717"
end
end
resource "JSON::WebToken" do
url "https://cpan.metacpan.org/authors/id/X/XA/XAICRON/JSON-WebToken-0.10.tar.gz"
sha256 "77c182a98528f1714d82afc548d5b3b4dc93e67069128bb9b9413f24cf07248b"
end
resource "Module::Build::Tiny" do
url "https://cpan.metacpan.org/authors/id/L/LE/LEONT/Module-Build-Tiny-0.039.tar.gz"
sha256 "7d580ff6ace0cbe555bf36b86dc8ea232581530cbeaaea09bccb57b55797f11c"
end
resource "Readonly" do
url "https://cpan.metacpan.org/authors/id/S/SA/SANKO/Readonly-2.05.tar.gz"
sha256 "4b23542491af010d44a5c7c861244738acc74ababae6b8838d354dfb19462b5e"
end
resource "Sys::MemInfo" do
url "https://cpan.metacpan.org/authors/id/S/SC/SCRESTO/Sys-MemInfo-0.99.tar.gz"
sha256 "0786319d3a3a8bae5d727939244bf17e140b714f52734d5e9f627203e4cf3e3b"
end
resource "File::Tail" do
url "https://cpan.metacpan.org/authors/id/M/MG/MGRABNAR/File-Tail-1.3.tar.gz"
sha256 "26d09f81836e43eae40028d5283fe5620fe6fe6278bf3eb8eb600c48ec34afc7"
end
resource "IO::Socket::IP" do
url "https://cpan.metacpan.org/authors/id/P/PE/PEVANS/IO-Socket-IP-0.41.tar.gz"
sha256 "849a45a238f8392588b97722c850382c4e6d157cd08a822ddcb9073c73bf1446"
end
def install
ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5"
build_pl = ["Module::Build", "JSON::WebToken", "Module::Build::Tiny", "Readonly", "IO::Socket::IP"]
resources.each do |r|
r.stage do
next if build_pl.include? r.name
system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}"
system "make"
system "make", "install"
end
end
# Big Sur has a sufficiently new Module::Build
build_pl.shift if MacOS.version >= :big_sur
build_pl.each do |name|
resource(name).stage do
system "perl", "Build.PL", "--install_base", libexec
system "./Build"
system "./Build", "install"
end
end
system "perl", "-c", "imapsync"
system "#{Formula["pod2man"].opt_bin}/pod2man", "imapsync", "imapsync.1"
bin.install "imapsync"
man1.install "imapsync.1"
bin.env_script_all_files(libexec/"bin", PERL5LIB: ENV["PERL5LIB"])
end
test do
assert_match version.to_s, pipe_output("#{bin}/imapsync --dry")
shell_output("#{bin}/imapsync --dry \
--host1 test1.lamiral.info --user1 test1 --password1 secret1 \
--host2 test2.lamiral.info --user2 test2 --password2 secret2")
end
end
|
class Imgproxy < Formula
desc "Fast and secure server for resizing and converting remote images"
homepage "https://imgproxy.net"
url "https://github.com/imgproxy/imgproxy/archive/v2.8.1.tar.gz"
sha256 "807b1f50338f2d39272deb231ed141105bee111d589d6dc2a1d253b658b453be"
head "https://github.com/imgproxy/imgproxy.git"
bottle do
cellar :any
sha256 "8907a8c19dfe60bd2fe68b49e2ab7fcddea60f00403196cb006a597afc9cd67a" => :catalina
sha256 "ee13514b1c297ba7d9adfe22ca702ed166638cc9f6f203875f5a127bfc1b401d" => :mojave
sha256 "04eef493086bc7dec61f8d27f1477e16dea730659f2375fd2f101ad5b505e9db" => :high_sierra
end
depends_on "go" => :build
depends_on "pkg-config" => :build
depends_on "vips"
def install
ENV["CGO_LDFLAGS_ALLOW"]="-s|-w"
ENV["CGO_CFLAGS_ALLOW"]="-Xpreprocessor"
system "go", "build", "-o", "#{bin}/#{name}"
end
test do
require "socket"
server = TCPServer.new(0)
port = server.addr[1]
server.close
cp(test_fixtures("test.jpg"), testpath/"test.jpg")
ENV["IMGPROXY_BIND"] = "127.0.0.1:#{port}"
ENV["IMGPROXY_LOCAL_FILESYSTEM_ROOT"] = testpath
pid = fork do
exec bin/"imgproxy"
end
sleep 3
output = testpath/"test-converted.png"
system("curl", "-s", "-o", output, "http://127.0.0.1:#{port}/insecure/fit/100/100/no/0/plain/local:///test.jpg@png")
assert_equal 0, $CHILD_STATUS
assert_predicate output, :exist?
file_output = shell_output("file #{output}")
assert_match "PNG image data", file_output
assert_match "1 x 1", file_output
ensure
Process.kill("TERM", pid)
Process.wait(pid)
end
end
imgproxy: update 2.8.1 bottle.
Closes #18818.
Signed-off-by: Dawid Dziurla <c4a7db180859322ef5630a1dfc2805b5bc97fc25@gmail.com>
class Imgproxy < Formula
desc "Fast and secure server for resizing and converting remote images"
homepage "https://imgproxy.net"
url "https://github.com/imgproxy/imgproxy/archive/v2.8.1.tar.gz"
sha256 "807b1f50338f2d39272deb231ed141105bee111d589d6dc2a1d253b658b453be"
head "https://github.com/imgproxy/imgproxy.git"
bottle do
cellar :any
sha256 "8907a8c19dfe60bd2fe68b49e2ab7fcddea60f00403196cb006a597afc9cd67a" => :catalina
sha256 "ee13514b1c297ba7d9adfe22ca702ed166638cc9f6f203875f5a127bfc1b401d" => :mojave
sha256 "04eef493086bc7dec61f8d27f1477e16dea730659f2375fd2f101ad5b505e9db" => :high_sierra
sha256 "6f20ba5f5ade1f9f2a7a71ae45d0062d2234bdc2bfe56f016389f5c367095668" => :x86_64_linux
end
depends_on "go" => :build
depends_on "pkg-config" => :build
depends_on "vips"
def install
ENV["CGO_LDFLAGS_ALLOW"]="-s|-w"
ENV["CGO_CFLAGS_ALLOW"]="-Xpreprocessor"
system "go", "build", "-o", "#{bin}/#{name}"
end
test do
require "socket"
server = TCPServer.new(0)
port = server.addr[1]
server.close
cp(test_fixtures("test.jpg"), testpath/"test.jpg")
ENV["IMGPROXY_BIND"] = "127.0.0.1:#{port}"
ENV["IMGPROXY_LOCAL_FILESYSTEM_ROOT"] = testpath
pid = fork do
exec bin/"imgproxy"
end
sleep 3
output = testpath/"test-converted.png"
system("curl", "-s", "-o", output, "http://127.0.0.1:#{port}/insecure/fit/100/100/no/0/plain/local:///test.jpg@png")
assert_equal 0, $CHILD_STATUS
assert_predicate output, :exist?
file_output = shell_output("file #{output}")
assert_match "PNG image data", file_output
assert_match "1 x 1", file_output
ensure
Process.kill("TERM", pid)
Process.wait(pid)
end
end
|
require 'formula'
class Inspircd < Formula
homepage 'http://www.inspircd.org'
url 'https://github.com/inspircd/inspircd/archive/v2.0.16.tar.gz'
sha1 '6206e5dd61717a24f499e58996d2c7f4c8e4512d'
head 'https://github.com/inspircd/inspircd.git'
skip_clean 'data'
skip_clean 'logs'
depends_on 'pkg-config' => :build
depends_on 'geoip' => :optional
depends_on 'gnutls' => :optional
depends_on 'libgcrypt' if build.with? 'gnutls'
depends_on :mysql => :optional
depends_on 'pcre' => :optional
depends_on 'postgresql' => :optional
depends_on 'sqlite' => :optional
depends_on 'tre' => :optional
option 'without-ldap', 'Build without ldap support'
option 'without-openssl', 'Build without openssl support'
def install
modules = []
modules << 'm_geoip.cpp' if build.with? 'geoip'
modules << 'm_ssl_gnutls.cpp' if build.with? 'gnutls'
modules << 'm_mysql.cpp' if build.with? 'mysql'
modules << 'm_ssl_openssl.cpp' if build.with? 'openssl'
modules << 'm_ldapauth.cpp' if build.with? 'ldap'
modules << 'm_ldapoper.cpp' if build.with? 'ldap'
modules << 'm_regex_pcre.cpp' if build.with? 'pcre'
modules << 'm_pgsql.cpp' if build.with? 'postgresql'
modules << 'm_sqlite3.cpp' if build.with? 'sqlite'
modules << 'm_regex_tre.cpp' if build.with? 'tre'
system './configure', "--enable-extras=#{modules.join(',')}" unless modules.empty?
system './configure', "--prefix=#{prefix}", "--with-cc=#{ENV.cc}"
system 'make install'
inreplace "#{prefix}/org.inspircd.plist", 'ircdaemon', ENV['USER']
end
end
InspIRCd: fix SHA1 and add a patch for an issue on LLVM 3.4.
Closes Homebrew/homebrew#28708.
Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
require 'formula'
class Inspircd < Formula
homepage 'http://www.inspircd.org'
url 'https://github.com/inspircd/inspircd/archive/v2.0.16.tar.gz'
sha1 '5ea8e81124dc933ba289a4eb5782a66874e5d7e4'
revision 1
head 'https://github.com/inspircd/inspircd.git'
skip_clean 'data'
skip_clean 'logs'
depends_on 'pkg-config' => :build
depends_on 'geoip' => :optional
depends_on 'gnutls' => :optional
depends_on 'libgcrypt' if build.with? 'gnutls'
depends_on :mysql => :optional
depends_on 'pcre' => :optional
depends_on 'postgresql' => :optional
depends_on 'sqlite' => :optional
depends_on 'tre' => :optional
option 'without-ldap', 'Build without ldap support'
option 'without-openssl', 'Build without openssl support'
# Fix for runtime linker errors when loading modules compiled with LLVM 3.4
patch :p1 do
url 'https://github.com/inspircd/inspircd/commit/b65fb065b5a77aeea056f88e1b8d96ec8fbea47c.diff'
sha1 '13005aa29dd6ee37a30aca805d99789220884c9c'
end
def install
modules = []
modules << 'm_geoip.cpp' if build.with? 'geoip'
modules << 'm_ssl_gnutls.cpp' if build.with? 'gnutls'
modules << 'm_mysql.cpp' if build.with? 'mysql'
modules << 'm_ssl_openssl.cpp' if build.with? 'openssl'
modules << 'm_ldapauth.cpp' if build.with? 'ldap'
modules << 'm_ldapoper.cpp' if build.with? 'ldap'
modules << 'm_regex_pcre.cpp' if build.with? 'pcre'
modules << 'm_pgsql.cpp' if build.with? 'postgresql'
modules << 'm_sqlite3.cpp' if build.with? 'sqlite'
modules << 'm_regex_tre.cpp' if build.with? 'tre'
system './configure', "--enable-extras=#{modules.join(',')}" unless modules.empty?
system './configure', "--prefix=#{prefix}", "--with-cc=#{ENV.cc}"
system 'make install'
inreplace "#{prefix}/org.inspircd.plist", 'ircdaemon', ENV['USER']
end
end
|
class Ipmiutil < Formula
desc "IPMI server management utility"
homepage "https://ipmiutil.sourceforge.io/"
url "https://downloads.sourceforge.net/project/ipmiutil/ipmiutil-3.1.7.tar.gz"
sha256 "911fd6f8b33651b98863d57e678d2fc593bc43fcd2a21f5dc7d5db8f92128a9a"
livecheck do
url :stable
end
bottle do
cellar :any_skip_relocation
sha256 "ad8fc089b714a2286884168e7ce78e4cfb9a2c045e7daf9ee77eae3524bb0f8f" => :catalina
sha256 "af41d4e3592cea0b3151276cff34bfabc810b47af165dc16436e8af30877e52e" => :mojave
sha256 "502b711bfa0411d970ac6fc5dabd65e04a0a80b0bf0adead2fa1e965f2079050" => :high_sierra
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "openssl@1.1"
conflicts_with "renameutils", because: "both install `icmd` binaries"
def install
# Darwin does not exist only on PowerPC
inreplace "configure.ac", "test \"$archp\" = \"powerpc\"", "true"
system "autoreconf", "-fiv"
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--enable-sha256",
"--enable-gpl"
system "make", "TMPDIR=#{ENV["TMPDIR"]}"
# DESTDIR is needed to make everything go where we want it.
system "make", "prefix=/",
"DESTDIR=#{prefix}",
"varto=#{var}/lib/#{name}",
"initto=#{etc}/init.d",
"sysdto=#{prefix}/#{name}",
"install"
end
test do
system "#{bin}/ipmiutil", "delloem", "help"
end
end
ipmiutil: update 3.1.7 bottle.
class Ipmiutil < Formula
desc "IPMI server management utility"
homepage "https://ipmiutil.sourceforge.io/"
url "https://downloads.sourceforge.net/project/ipmiutil/ipmiutil-3.1.7.tar.gz"
sha256 "911fd6f8b33651b98863d57e678d2fc593bc43fcd2a21f5dc7d5db8f92128a9a"
livecheck do
url :stable
end
bottle do
cellar :any_skip_relocation
sha256 "3cb5c77d4305480078d8a4cfbab0118a5e8304a13eff06ac95ba9575f9ec06d1" => :big_sur
sha256 "ad8fc089b714a2286884168e7ce78e4cfb9a2c045e7daf9ee77eae3524bb0f8f" => :catalina
sha256 "af41d4e3592cea0b3151276cff34bfabc810b47af165dc16436e8af30877e52e" => :mojave
sha256 "502b711bfa0411d970ac6fc5dabd65e04a0a80b0bf0adead2fa1e965f2079050" => :high_sierra
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "openssl@1.1"
conflicts_with "renameutils", because: "both install `icmd` binaries"
def install
# Darwin does not exist only on PowerPC
inreplace "configure.ac", "test \"$archp\" = \"powerpc\"", "true"
system "autoreconf", "-fiv"
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--enable-sha256",
"--enable-gpl"
system "make", "TMPDIR=#{ENV["TMPDIR"]}"
# DESTDIR is needed to make everything go where we want it.
system "make", "prefix=/",
"DESTDIR=#{prefix}",
"varto=#{var}/lib/#{name}",
"initto=#{etc}/init.d",
"sysdto=#{prefix}/#{name}",
"install"
end
test do
system "#{bin}/ipmiutil", "delloem", "help"
end
end
|
class Irrlicht < Formula
desc "Realtime 3D engine"
homepage "https://irrlicht.sourceforge.io/"
url "https://downloads.sourceforge.net/project/irrlicht/Irrlicht%20SDK/1.8/1.8.4/irrlicht-1.8.4.zip"
sha256 "f42b280bc608e545b820206fe2a999c55f290de5c7509a02bdbeeccc1bf9e433"
head "https://svn.code.sf.net/p/irrlicht/code/trunk"
livecheck do
url :stable
regex(%r{url=.*?/irrlicht[._-]v?(\d+(?:\.\d+)+)\.(?:t|zip)}i)
end
bottle do
rebuild 1
sha256 cellar: :any_skip_relocation, big_sur: "611abae20f145f6026ddb16b24564fd11599f7ca7e4f59b0971b3b2304fad466"
sha256 cellar: :any_skip_relocation, catalina: "665031602d338528055bfb7dba5c1a4c94c0deaea6c3db8d4d4cddb061a54e7d"
sha256 cellar: :any_skip_relocation, mojave: "e5b9b3d8b58f26c138b9dcd421fad9769e6ab7833bbf668cdeac909fd204a601"
sha256 cellar: :any_skip_relocation, high_sierra: "508d300a52f1f1d5b1d5193f07559ca3da5aa3286181ae88b415bf5468c521bc"
sha256 cellar: :any_skip_relocation, sierra: "d2236f351b11847d960909fa0e96d83ab0448228de30cd21014fea47a2c636a5"
end
depends_on xcode: :build
def install
# Fix "error: cannot initialize a parameter of type
# 'id<NSApplicationDelegate> _Nullable' with an rvalue of type
# 'id<NSFileManagerDelegate>'"
# Reported 5 Oct 2016 https://irrlicht.sourceforge.io/forum/viewtopic.php?f=7&t=51562
inreplace "source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm",
"[NSApp setDelegate:(id<NSFileManagerDelegate>)",
"[NSApp setDelegate:(id<NSApplicationDelegate>)"
# Fix "error: ZLIB_VERNUM != PNG_ZLIB_VERNUM" on Mojave (picking up system zlib)
# Reported 21 Oct 2018 https://sourceforge.net/p/irrlicht/bugs/442/
inreplace "source/Irrlicht/libpng/pngpriv.h",
"# error ZLIB_VERNUM != PNG_ZLIB_VERNUM \\",
"# warning ZLIB_VERNUM != PNG_ZLIB_VERNUM \\"
xcodebuild "-project", "source/Irrlicht/MacOSX/MacOSX.xcodeproj",
"-configuration", "Release",
"-target", "libIrrlicht.a",
"SYMROOT=build"
lib.install "source/Irrlicht/MacOSX/build/Release/libIrrlicht.a"
include.install "include" => "irrlicht"
end
test do
assert_match "x86_64", shell_output("lipo -info #{lib}/libIrrlicht.a")
end
end
irrlicht: build on Linux
Closes #22421.
Signed-off-by: Michka Popoff <5d406f95fb0e0230f83654e4a22d0115cc205d59@users.noreply.github.com>
class Irrlicht < Formula
desc "Realtime 3D engine"
homepage "https://irrlicht.sourceforge.io/"
url "https://downloads.sourceforge.net/project/irrlicht/Irrlicht%20SDK/1.8/1.8.4/irrlicht-1.8.4.zip"
sha256 "f42b280bc608e545b820206fe2a999c55f290de5c7509a02bdbeeccc1bf9e433"
head "https://svn.code.sf.net/p/irrlicht/code/trunk"
livecheck do
url :stable
regex(%r{url=.*?/irrlicht[._-]v?(\d+(?:\.\d+)+)\.(?:t|zip)}i)
end
bottle do
rebuild 1
sha256 cellar: :any_skip_relocation, big_sur: "611abae20f145f6026ddb16b24564fd11599f7ca7e4f59b0971b3b2304fad466"
sha256 cellar: :any_skip_relocation, catalina: "665031602d338528055bfb7dba5c1a4c94c0deaea6c3db8d4d4cddb061a54e7d"
sha256 cellar: :any_skip_relocation, mojave: "e5b9b3d8b58f26c138b9dcd421fad9769e6ab7833bbf668cdeac909fd204a601"
sha256 cellar: :any_skip_relocation, high_sierra: "508d300a52f1f1d5b1d5193f07559ca3da5aa3286181ae88b415bf5468c521bc"
sha256 cellar: :any_skip_relocation, sierra: "d2236f351b11847d960909fa0e96d83ab0448228de30cd21014fea47a2c636a5"
end
depends_on xcode: :build
on_linux do
depends_on "libx11"
depends_on "libxxf86vm"
depends_on "mesa"
end
def install
on_macos do
# Fix "error: cannot initialize a parameter of type
# 'id<NSApplicationDelegate> _Nullable' with an rvalue of type
# 'id<NSFileManagerDelegate>'"
# Reported 5 Oct 2016 https://irrlicht.sourceforge.io/forum/viewtopic.php?f=7&t=51562
inreplace "source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm",
"[NSApp setDelegate:(id<NSFileManagerDelegate>)",
"[NSApp setDelegate:(id<NSApplicationDelegate>)"
# Fix "error: ZLIB_VERNUM != PNG_ZLIB_VERNUM" on Mojave (picking up system zlib)
# Reported 21 Oct 2018 https://sourceforge.net/p/irrlicht/bugs/442/
inreplace "source/Irrlicht/libpng/pngpriv.h",
"# error ZLIB_VERNUM != PNG_ZLIB_VERNUM \\",
"# warning ZLIB_VERNUM != PNG_ZLIB_VERNUM \\"
xcodebuild "-project", "source/Irrlicht/MacOSX/MacOSX.xcodeproj",
"-configuration", "Release",
"-target", "libIrrlicht.a",
"SYMROOT=build"
lib.install "source/Irrlicht/MacOSX/build/Release/libIrrlicht.a"
include.install "include" => "irrlicht"
end
on_linux do
cd "source/Irrlicht" do
inreplace "Makefile" do |s|
s.gsub! "/usr/X11R6/lib$(LIBSELECT)", Formula["libx11"].opt_lib
s.gsub! "/usr/X11R6/include", Formula["libx11"].opt_include
end
ENV.append "LDFLAGS", "-L#{Formula["mesa"].opt_lib}"
ENV.append "LDFLAGS", "-L#{Formula["libxxf86vm"].opt_lib}"
ENV.append "CXXFLAGS", "-I#{Formula["libxxf86vm"].opt_include}"
system "make", "sharedlib", "NDEBUG=1"
system "make", "install", "INSTALL_DIR=#{lib}"
system "make", "clean"
system "make", "staticlib", "NDEBUG=1"
end
lib.install "lib/Linux/libIrrlicht.a"
end
(pkgshare/"examples").install "examples/01.HelloWorld"
end
test do
on_macos do
assert_match "x86_64", shell_output("lipo -info #{lib}/libIrrlicht.a")
end
cp_r Dir["#{pkgshare}/examples/01.HelloWorld/*"], testpath
system ENV.cxx, "-I#{include}/irrlicht", "-L#{lib}", "-lIrrlicht", "main.cpp", "-o", "hello"
end
end
|
class IslAT011 < Formula
desc "Integer Set Library for the polyhedral model"
homepage "http://freecode.com/projects/isl"
# Track gcc infrastructure releases.
url "http://isl.gforge.inria.fr/isl-0.11.1.tar.bz2"
mirror "ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.11.1.tar.bz2"
sha256 "095f4b54c88ca13a80d2b025d9c551f89ea7ba6f6201d701960bfe5c1466a98d"
bottle do
cellar :any
rebuild 1
sha256 "2b09179f027f7e66086f7fc2f6b906a670b51b83e45434ec91477b5b14e2a410" => :high_sierra
sha256 "88be318c19e233dd4bb62760d22d42f03b9d92edc9a3f058b6ec745ad0f162eb" => :sierra
sha256 "185efaee527e73a30355ad88cad43e407dc26b169df01531559d377e33eff971" => :el_capitan
sha256 "beb1434e8feb9a8b1df64b9d5b6cd7b66fdd170fe22b0f5078382377162ee2ee" => :yosemite
end
keg_only :versioned_formula
depends_on "gmp@4"
def install
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
"--with-gmp=system",
"--with-gmp-prefix=#{Formula["gmp@4"].opt_prefix}"
system "make", "install"
(share/"gdb/auto-load").install Dir["#{lib}/*-gdb.py"]
end
test do
(testpath/"test.c").write <<-EOS.undent
#include <isl/ctx.h>
int main()
{
isl_ctx* ctx = isl_ctx_alloc();
isl_ctx_free(ctx);
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-lisl",
"-I#{include}", "-I#{Formula["gmp@4"].include}", "-o", "test"
system "./test"
end
end
isl@0.11: secure url(s)
class IslAT011 < Formula
desc "Integer Set Library for the polyhedral model"
homepage "http://freecode.com/projects/isl"
# Track gcc infrastructure releases.
url "https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.11.1.tar.bz2"
mirror "http://isl.gforge.inria.fr/isl-0.11.1.tar.bz2"
sha256 "095f4b54c88ca13a80d2b025d9c551f89ea7ba6f6201d701960bfe5c1466a98d"
bottle do
cellar :any
rebuild 1
sha256 "2b09179f027f7e66086f7fc2f6b906a670b51b83e45434ec91477b5b14e2a410" => :high_sierra
sha256 "88be318c19e233dd4bb62760d22d42f03b9d92edc9a3f058b6ec745ad0f162eb" => :sierra
sha256 "185efaee527e73a30355ad88cad43e407dc26b169df01531559d377e33eff971" => :el_capitan
sha256 "beb1434e8feb9a8b1df64b9d5b6cd7b66fdd170fe22b0f5078382377162ee2ee" => :yosemite
end
keg_only :versioned_formula
depends_on "gmp@4"
def install
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
"--with-gmp=system",
"--with-gmp-prefix=#{Formula["gmp@4"].opt_prefix}"
system "make", "install"
(share/"gdb/auto-load").install Dir["#{lib}/*-gdb.py"]
end
test do
(testpath/"test.c").write <<-EOS.undent
#include <isl/ctx.h>
int main()
{
isl_ctx* ctx = isl_ctx_alloc();
isl_ctx_free(ctx);
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-lisl",
"-I#{include}", "-I#{Formula["gmp@4"].include}", "-o", "test"
system "./test"
end
end
|
class Istioctl < Formula
desc "Istio configuration command-line utility"
homepage "https://istio.io/"
url "https://github.com/istio/istio.git",
tag: "1.14.1",
revision: "f59ce19ec6b63bbb70a65c43ac423845f1129464"
license "Apache-2.0"
head "https://github.com/istio/istio.git", branch: "master"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "b4aba25f4c2d3ab04306a63b33d6eff16d5db0d62426f837e82d9cdaf5f5ced7"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "b4aba25f4c2d3ab04306a63b33d6eff16d5db0d62426f837e82d9cdaf5f5ced7"
sha256 cellar: :any_skip_relocation, monterey: "94a5ae68196a87bac80928d2e816bd89038a6a9bb3485ca7419292373820bc9f"
sha256 cellar: :any_skip_relocation, big_sur: "94a5ae68196a87bac80928d2e816bd89038a6a9bb3485ca7419292373820bc9f"
sha256 cellar: :any_skip_relocation, catalina: "94a5ae68196a87bac80928d2e816bd89038a6a9bb3485ca7419292373820bc9f"
sha256 cellar: :any_skip_relocation, x86_64_linux: "dbdf0bdeb95cca91b24ecb2be448e7b6564b556bbfb8db6515e8e93aae0be5c4"
end
depends_on "go" => :build
depends_on "go-bindata" => :build
uses_from_macos "curl" => :build
def install
ENV["VERSION"] = version.to_s
ENV["TAG"] = version.to_s
ENV["ISTIO_VERSION"] = version.to_s
ENV["HUB"] = "docker.io/istio"
ENV["BUILD_WITH_CONTAINER"] = "0"
os = OS.kernel_name.downcase
arch = Hardware::CPU.intel? ? "amd64" : Hardware::CPU.arch.to_s
system "make", "istioctl"
bin.install "out/#{os}_#{arch}/istioctl"
# Install bash completion
output = Utils.safe_popen_read(bin/"istioctl", "completion", "bash")
(bash_completion/"istioctl").write output
# Install zsh completion
output = Utils.safe_popen_read(bin/"istioctl", "completion", "zsh")
(zsh_completion/"_istioctl").write output
# Install fish completion
output = Utils.safe_popen_read(bin/"istioctl", "completion", "fish")
(fish_completion/"istioctl.fish").write output
end
test do
assert_equal version.to_s, shell_output("#{bin}/istioctl version --remote=false").strip
end
end
istioctl: update 1.14.1 bottle.
class Istioctl < Formula
desc "Istio configuration command-line utility"
homepage "https://istio.io/"
url "https://github.com/istio/istio.git",
tag: "1.14.1",
revision: "f59ce19ec6b63bbb70a65c43ac423845f1129464"
license "Apache-2.0"
head "https://github.com/istio/istio.git", branch: "master"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "bd6ad6cff5b01db19f2190995e1e2b34167b23908de2c1380107702d2a524e11"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "bd6ad6cff5b01db19f2190995e1e2b34167b23908de2c1380107702d2a524e11"
sha256 cellar: :any_skip_relocation, monterey: "ac46c14577dbcce6c0b378f78e8a8813ba0ac7ffcc01e1bb1c90e7c5fe0442ed"
sha256 cellar: :any_skip_relocation, big_sur: "ac46c14577dbcce6c0b378f78e8a8813ba0ac7ffcc01e1bb1c90e7c5fe0442ed"
sha256 cellar: :any_skip_relocation, catalina: "ac46c14577dbcce6c0b378f78e8a8813ba0ac7ffcc01e1bb1c90e7c5fe0442ed"
sha256 cellar: :any_skip_relocation, x86_64_linux: "f1c40fb94cdb8b8076d8f1c54a4db0be6c3d0a7f5a6d30601e699178d2bc79a5"
end
depends_on "go" => :build
depends_on "go-bindata" => :build
uses_from_macos "curl" => :build
def install
ENV["VERSION"] = version.to_s
ENV["TAG"] = version.to_s
ENV["ISTIO_VERSION"] = version.to_s
ENV["HUB"] = "docker.io/istio"
ENV["BUILD_WITH_CONTAINER"] = "0"
os = OS.kernel_name.downcase
arch = Hardware::CPU.intel? ? "amd64" : Hardware::CPU.arch.to_s
system "make", "istioctl"
bin.install "out/#{os}_#{arch}/istioctl"
# Install bash completion
output = Utils.safe_popen_read(bin/"istioctl", "completion", "bash")
(bash_completion/"istioctl").write output
# Install zsh completion
output = Utils.safe_popen_read(bin/"istioctl", "completion", "zsh")
(zsh_completion/"_istioctl").write output
# Install fish completion
output = Utils.safe_popen_read(bin/"istioctl", "completion", "fish")
(fish_completion/"istioctl.fish").write output
end
test do
assert_equal version.to_s, shell_output("#{bin}/istioctl version --remote=false").strip
end
end
|
class Jbig2dec < Formula
desc "JBIG2 decoder and library (for monochrome documents)"
homepage "http://ghostscript.com/jbig2dec.html"
url "http://downloads.ghostscript.com/public/jbig2dec/jbig2dec-0.12.tar.gz"
sha256 "bcc5f2cc75ee46e9a2c3c68d4a1b740280c772062579a5d0ceda24bee2e5ebf0"
bottle do
cellar :any
rebuild 1
sha256 "a46edad05083874510463f4638100765a4f2fb451fad2cfad4b5276cdcb632f7" => :sierra
sha256 "38ad008992a9c273162238783b31bbcc4be8558d82c0a87b947ef0be699c437c" => :el_capitan
sha256 "d1de5bcbceaca8669c847ec754e7d44b844ad08abdef377efdd704e768d13c86" => :yosemite
sha256 "e42e117812549edeae1f60e1900b0692994c75ebae186f611e16528fe0521c89" => :mavericks
sha256 "42039ee0b62ad6b4a153c5a5e93609ac1b668626b044a23a450a58d4d71338a5" => :mountain_lion
end
depends_on "automake" => :build
depends_on "autoconf" => :build
depends_on "libtool" => :build
depends_on "libpng" => :optional
# http://bugs.ghostscript.com/show_bug.cgi?id=695890
# Remove on next release.
patch do
# Original URL: http://git.ghostscript.com/?p=jbig2dec.git;a=commitdiff_plain;h=70c7f1967f43a94f9f0d6808d6ab5700a120d2fc
url "https://raw.githubusercontent.com/Homebrew/formula-patches/7dc28b82/jbig2dec/bug-695890.patch"
sha256 "5239e4eb991f198d2ba30d08011c2887599b5cead9db8b1d3eacec4b8912c2d0"
end
def install
args = %W[
--disable-dependency-tracking
--prefix=#{prefix}
--disable-silent-rules
]
args << "--without-libpng" if build.without? "libpng"
system "autoreconf", "-fvi" # error: cannot find install-sh
system "./configure", *args
system "make", "install"
end
test do
(testpath/"test.c").write <<-EOS.undent
#include <stdint.h>
#include <stdlib.h>
#include <jbig2.h>
int main()
{
Jbig2Ctx *ctx;
Jbig2Image *image;
ctx = jbig2_ctx_new(NULL, 0, NULL, NULL, NULL);
image = jbig2_image_new(ctx, 10, 10);
jbig2_image_release(ctx, image);
jbig2_ctx_free(ctx);
return 0;
}
EOS
system ENV.cc, "test.c", "-DJBIG_NO_MEMENTO", "-L#{lib}", "-ljbig2dec", "-o", "test"
system "./test"
end
end
jbig2dec: use https for homepage
class Jbig2dec < Formula
desc "JBIG2 decoder and library (for monochrome documents)"
homepage "https://ghostscript.com/jbig2dec.html"
url "http://downloads.ghostscript.com/public/jbig2dec/jbig2dec-0.12.tar.gz"
sha256 "bcc5f2cc75ee46e9a2c3c68d4a1b740280c772062579a5d0ceda24bee2e5ebf0"
bottle do
cellar :any
rebuild 1
sha256 "a46edad05083874510463f4638100765a4f2fb451fad2cfad4b5276cdcb632f7" => :sierra
sha256 "38ad008992a9c273162238783b31bbcc4be8558d82c0a87b947ef0be699c437c" => :el_capitan
sha256 "d1de5bcbceaca8669c847ec754e7d44b844ad08abdef377efdd704e768d13c86" => :yosemite
sha256 "e42e117812549edeae1f60e1900b0692994c75ebae186f611e16528fe0521c89" => :mavericks
sha256 "42039ee0b62ad6b4a153c5a5e93609ac1b668626b044a23a450a58d4d71338a5" => :mountain_lion
end
depends_on "automake" => :build
depends_on "autoconf" => :build
depends_on "libtool" => :build
depends_on "libpng" => :optional
# http://bugs.ghostscript.com/show_bug.cgi?id=695890
# Remove on next release.
patch do
# Original URL: http://git.ghostscript.com/?p=jbig2dec.git;a=commitdiff_plain;h=70c7f1967f43a94f9f0d6808d6ab5700a120d2fc
url "https://raw.githubusercontent.com/Homebrew/formula-patches/7dc28b82/jbig2dec/bug-695890.patch"
sha256 "5239e4eb991f198d2ba30d08011c2887599b5cead9db8b1d3eacec4b8912c2d0"
end
def install
args = %W[
--disable-dependency-tracking
--prefix=#{prefix}
--disable-silent-rules
]
args << "--without-libpng" if build.without? "libpng"
system "autoreconf", "-fvi" # error: cannot find install-sh
system "./configure", *args
system "make", "install"
end
test do
(testpath/"test.c").write <<-EOS.undent
#include <stdint.h>
#include <stdlib.h>
#include <jbig2.h>
int main()
{
Jbig2Ctx *ctx;
Jbig2Image *image;
ctx = jbig2_ctx_new(NULL, 0, NULL, NULL, NULL);
image = jbig2_image_new(ctx, 10, 10);
jbig2_image_release(ctx, image);
jbig2_ctx_free(ctx);
return 0;
}
EOS
system ENV.cc, "test.c", "-DJBIG_NO_MEMENTO", "-L#{lib}", "-ljbig2dec", "-o", "test"
system "./test"
end
end
|
require "language/node"
class Jhipster < Formula
desc "Generate, develop and deploy Spring Boot + Angular/React applications"
homepage "https://www.jhipster.tech/"
url "https://registry.npmjs.org/generator-jhipster/-/generator-jhipster-5.6.0.tgz"
sha256 "7f339523c41b01171303fe1488af49dc72dfdee18011440e866b1030969d2728"
bottle do
cellar :any_skip_relocation
sha256 "459c74f3c4e3ec24866b6e3e12e7fa23546c66b75f8921a2e5ac714739274fd7" => :mojave
sha256 "0b7bdfcd8c2d6a15e951d05b6812e09153005d9e046155d9c12e311466bc5fc6" => :high_sierra
sha256 "ad6263b22be9da7d869716be21b0be5f5cdbb69cd38c0f53a416dd39c17acbab" => :sierra
end
depends_on :java => "1.8+"
depends_on "node"
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
end
test do
assert_match "execution is complete", shell_output("#{bin}/jhipster info")
end
end
jhipster: update 5.6.0 bottle.
require "language/node"
class Jhipster < Formula
desc "Generate, develop and deploy Spring Boot + Angular/React applications"
homepage "https://www.jhipster.tech/"
url "https://registry.npmjs.org/generator-jhipster/-/generator-jhipster-5.6.0.tgz"
sha256 "7f339523c41b01171303fe1488af49dc72dfdee18011440e866b1030969d2728"
bottle do
cellar :any_skip_relocation
sha256 "d58ea9dde588b2bafb9cca507ba1887b3aeb085e0e655c5d091ff5f2ab6869e5" => :mojave
sha256 "ae5407096655876d28f8d72ab3ef205644c393d78efcdd47bc0d55bbc1b7733e" => :high_sierra
sha256 "1d9839279a6a161ab9e9f6e76d84ee9eda87a48163c0fe512047268b88da0093" => :sierra
end
depends_on :java => "1.8+"
depends_on "node"
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
end
test do
assert_match "execution is complete", shell_output("#{bin}/jhipster info")
end
end
|
require "language/node"
class Jhipster < Formula
desc "Generate, develop and deploy Spring Boot + Angular/React applications"
homepage "https://www.jhipster.tech/"
url "https://registry.npmjs.org/generator-jhipster/-/generator-jhipster-5.3.1.tgz"
sha256 "04c94ba781faaac2d60d06dfe869c870e325ba6b28084e3bacaa271beba74369"
bottle do
cellar :any_skip_relocation
sha256 "1396b26c965566b6ffbcc15e9ba1b4ef87d6adcce20368e179ebe5d68f35d339" => :mojave
sha256 "481d40b1e94bad8a808c32a910cd4207667448387c04878c6e37df18d3c1055e" => :high_sierra
sha256 "ab1c7cbd32901ef3af41f77980f0e57584176e6f0eeb74d4e7b02150905a93ea" => :sierra
sha256 "bf2cd3efff3eee72713582f5cf72de69b8e574f1a98827b9e8370486005b8831" => :el_capitan
end
depends_on "node"
depends_on :java => "1.8+"
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
end
test do
assert_match "execution is complete", shell_output("#{bin}/jhipster info")
end
end
jhipster: fix dependency order
require "language/node"
class Jhipster < Formula
desc "Generate, develop and deploy Spring Boot + Angular/React applications"
homepage "https://www.jhipster.tech/"
url "https://registry.npmjs.org/generator-jhipster/-/generator-jhipster-5.3.1.tgz"
sha256 "04c94ba781faaac2d60d06dfe869c870e325ba6b28084e3bacaa271beba74369"
bottle do
cellar :any_skip_relocation
sha256 "1396b26c965566b6ffbcc15e9ba1b4ef87d6adcce20368e179ebe5d68f35d339" => :mojave
sha256 "481d40b1e94bad8a808c32a910cd4207667448387c04878c6e37df18d3c1055e" => :high_sierra
sha256 "ab1c7cbd32901ef3af41f77980f0e57584176e6f0eeb74d4e7b02150905a93ea" => :sierra
sha256 "bf2cd3efff3eee72713582f5cf72de69b8e574f1a98827b9e8370486005b8831" => :el_capitan
end
depends_on :java => "1.8+"
depends_on "node"
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
end
test do
assert_match "execution is complete", shell_output("#{bin}/jhipster info")
end
end
|
require 'formula'
class Jjdeploy < Formula
homepage 'https://github.com/buscarini/jjdeploy'
url 'https://github.com/buscarini/jjdeploy/archive/0.0.5.tar.gz'
sha1 'c87cda5ae460e531fad78427c61e8bd964983814'
depends_on 'Xcode' => :recommended
def install
prefix.install 'jjdeploy_resources','jjdeploy.config'
bin.install 'jjdeploy'
end
test do
system "#{bin}/jjdeploy", '--version'
end
end
Fixed sha
require 'formula'
class Jjdeploy < Formula
homepage 'https://github.com/buscarini/jjdeploy'
url 'https://github.com/buscarini/jjdeploy/archive/0.0.5.tar.gz'
sha1 'd529f7dbe9db4cd8dfa4d99156316055a344c11f'
depends_on 'Xcode' => :recommended
def install
prefix.install 'jjdeploy_resources','jjdeploy.config'
bin.install 'jjdeploy'
end
test do
system "#{bin}/jjdeploy", '--version'
end
end |
require 'formula'
class Jjdeploy < Formula
homepage 'https://github.com/buscarini/jjdeploy'
url 'https://github.com/buscarini/jjdeploy/archive/0.5.5.tar.gz'
sha1 '9df15701fe6dfa6729e05298765478313c56a9bc'
def install
prefix.install 'jjdeploy_resources','jjdeploy.config'
bin.install 'jjdeploy'
end
test do
system "#{bin}/jjdeploy", '--version'
end
end
jjdeploy 0.5.6
require 'formula'
class Jjdeploy < Formula
homepage 'https://github.com/buscarini/jjdeploy'
url 'https://github.com/buscarini/jjdeploy/archive/0.5.6.tar.gz'
sha1 '14d49c95a3174627ca7ac1f83364f83cdae6b65d'
def install
prefix.install 'jjdeploy_resources','jjdeploy.config'
bin.install 'jjdeploy'
end
test do
system "#{bin}/jjdeploy", '--version'
end
end |
class Jpeginfo < Formula
desc "Prints information and tests integrity of JPEG/JFIF files"
homepage "https://www.kokkonen.net/tjko/projects.html"
url "https://www.kokkonen.net/tjko/src/jpeginfo-1.6.1.tar.gz"
sha256 "629e31cf1da0fa1efe4a7cc54c67123a68f5024f3d8e864a30457aeaed1d7653"
license "GPL-2.0-or-later"
revision 1
head "https://github.com/tjko/jpeginfo.git", branch: "master"
livecheck do
url :homepage
regex(/href=.*?jpeginfo[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
rebuild 1
sha256 cellar: :any, arm64_monterey: "b223bfedf94aca1532a772bb7fcde2a9613dd28d27a79dce36d956727a30b829"
sha256 cellar: :any, arm64_big_sur: "883d13008806a89bd05f612ffd27940a5985f47ad9c950af76f719b6a781bb1e"
sha256 cellar: :any, monterey: "4b3617a321a243d012107f4f62c650e4e980712ca0e0402c592f37a9db95e2ea"
sha256 cellar: :any, big_sur: "27bb3588438853fb065ef36885dfea66a2e066dddc7025ea8fd6295682ff8b83"
sha256 cellar: :any, catalina: "0f0cc493a38a1a701a51f6aa2cada9b8f248c228a72ce30c451d5cab2906e8c5"
sha256 cellar: :any, mojave: "71cbeda00d00f513847a88930a6851b00ab9811fb6ed37d0617eaee5e86decf3"
sha256 cellar: :any_skip_relocation, x86_64_linux: "a3e4419c51af044e57adaf7d6d360bd99ad1bc16d4d837d060df84fe308bb4d2"
end
depends_on "autoconf" => :build
depends_on "jpeg"
def install
ENV.deparallelize
# The ./configure file inside the tarball is too old to work with Xcode 12, regenerate:
system "autoconf", "--force"
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make", "install"
end
test do
system "#{bin}/jpeginfo", "--help"
end
end
jpeginfo: migrate `jpeg` to `jpeg-turbo`
Closes #103478.
Signed-off-by: Carlo Cabrera <3ffc397d0e4bded29cb84b56167de54c01e3a55b@users.noreply.github.com>
Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com>
class Jpeginfo < Formula
desc "Prints information and tests integrity of JPEG/JFIF files"
homepage "https://www.kokkonen.net/tjko/projects.html"
url "https://www.kokkonen.net/tjko/src/jpeginfo-1.6.1.tar.gz"
sha256 "629e31cf1da0fa1efe4a7cc54c67123a68f5024f3d8e864a30457aeaed1d7653"
license "GPL-2.0-or-later"
revision 2
head "https://github.com/tjko/jpeginfo.git", branch: "master"
livecheck do
url :homepage
regex(/href=.*?jpeginfo[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
rebuild 1
sha256 cellar: :any, arm64_monterey: "b223bfedf94aca1532a772bb7fcde2a9613dd28d27a79dce36d956727a30b829"
sha256 cellar: :any, arm64_big_sur: "883d13008806a89bd05f612ffd27940a5985f47ad9c950af76f719b6a781bb1e"
sha256 cellar: :any, monterey: "4b3617a321a243d012107f4f62c650e4e980712ca0e0402c592f37a9db95e2ea"
sha256 cellar: :any, big_sur: "27bb3588438853fb065ef36885dfea66a2e066dddc7025ea8fd6295682ff8b83"
sha256 cellar: :any, catalina: "0f0cc493a38a1a701a51f6aa2cada9b8f248c228a72ce30c451d5cab2906e8c5"
sha256 cellar: :any, mojave: "71cbeda00d00f513847a88930a6851b00ab9811fb6ed37d0617eaee5e86decf3"
sha256 cellar: :any_skip_relocation, x86_64_linux: "a3e4419c51af044e57adaf7d6d360bd99ad1bc16d4d837d060df84fe308bb4d2"
end
depends_on "autoconf" => :build
depends_on "jpeg-turbo"
def install
ENV.deparallelize
# The ./configure file inside the tarball is too old to work with Xcode 12, regenerate:
system "autoconf", "--force"
system "./configure", *std_configure_args
system "make", "install"
end
test do
system "#{bin}/jpeginfo", "--help"
end
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.