repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/validator_spec.rb
spec/units/validator_spec.rb
require 'spec_helper' class NotNilInteractor include Interactor include Pulsar::Validator validate_context_for! :not_nil_property end RSpec.describe Pulsar::Validator do let(:described_instance) { NotNilInteractor.new } it { expect(described_instance).to respond_to :validate_context! } describe '#valid...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/constants_spec.rb
spec/units/constants_spec.rb
require 'spec_helper' RSpec.describe 'Pulsar Constants' do context Pulsar::PULSAR_HOME do subject { Pulsar::PULSAR_HOME } it { is_expected.to eql File.expand_path('~/.pulsar') } end context Pulsar::PULSAR_TMP do subject { Pulsar::PULSAR_TMP } it { is_expected.to eql "#{Pulsar::PULSAR_HOME}/tmp...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/interactors/create_run_dirs_spec.rb
spec/units/interactors/create_run_dirs_spec.rb
require 'spec_helper' RSpec.describe Pulsar::CreateRunDirs do subject { described_class.new } it { is_expected.to be_kind_of(Interactor) } describe '.success' do around do |example| Timecop.freeze { example.run } end context 'uses a timestamp' do subject { described_class.call.timestam...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/interactors/run_capistrano_spec.rb
spec/units/interactors/run_capistrano_spec.rb
require 'spec_helper' RSpec.describe Pulsar::RunCapistrano do subject { described_class.new } it { is_expected.to be_kind_of(Interactor) } describe '.success' do subject { described_class.new context_params } let(:context_params) do { cap_path: RSpec.configuration.pulsar_conf_path, config...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/interactors/clone_initial_repository_spec.rb
spec/units/interactors/clone_initial_repository_spec.rb
require 'spec_helper' RSpec.describe Pulsar::CopyInitialRepository do subject { described_class.new } it { is_expected.to be_kind_of(Interactor) } describe '.call' do subject { described_class.call(directory: './pulsar-conf') } let(:initial_repo) { './../../../lib/pulsar/generators/initial_repo/' } ...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/interactors/identify_repository_location_spec.rb
spec/units/interactors/identify_repository_location_spec.rb
require 'spec_helper' RSpec.describe Pulsar::IdentifyRepositoryLocation do subject { described_class.new } it { is_expected.to be_kind_of(Interactor) } describe '.call' do subject { described_class.call(repository: repo) } let(:repo) { './my-conf' } context 'success' do before { allow(File)...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/interactors/add_applications_spec.rb
spec/units/interactors/add_applications_spec.rb
require 'spec_helper' RSpec.describe Pulsar::AddApplications do subject { described_class.new } it { is_expected.to be_kind_of(Interactor) } describe '.call' do subject { described_class.call(config_path: './my-conf') } before do allow(Dir).to receive(:[]) .and_return(%w(./blog/), %w(Cap...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/interactors/copy_environment_file_spec.rb
spec/units/interactors/copy_environment_file_spec.rb
require 'spec_helper' RSpec.describe Pulsar::CopyEnvironmentFile do subject { described_class.new } it { is_expected.to be_kind_of(Interactor) } describe '.call' do subject { command } let(:command) { described_class.call(args) } let(:cap_path) { "#{Pulsar::PULSAR_TMP}/cap-path" } let(:args) d...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/interactors/clone_repository_spec.rb
spec/units/interactors/clone_repository_spec.rb
require 'spec_helper' RSpec.describe Pulsar::CloneRepository do subject { described_class.new } it { is_expected.to be_kind_of(Interactor) } describe '.call' do subject do described_class.call( config_path: run_path, repository: repo, repository_type: type ) end ...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/interactors/create_deploy_file_spec.rb
spec/units/interactors/create_deploy_file_spec.rb
require 'spec_helper' RSpec.describe Pulsar::CreateDeployFile do subject { described_class.new } it { is_expected.to be_kind_of(Interactor) } describe '.call' do subject { command } let(:command) { described_class.call(args) } let(:cap_path) { "#{Pulsar::PULSAR_TMP}/cap-path" } let(:args) do ...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/interactors/create_capfile_spec.rb
spec/units/interactors/create_capfile_spec.rb
require 'spec_helper' RSpec.describe Pulsar::CreateCapfile do subject { described_class.new } it { is_expected.to be_kind_of(Interactor) } describe '.call' do subject { command } let(:command) { described_class.call(args) } let(:cap_path) { "#{Pulsar::PULSAR_TMP}/cap-path" } let(:args) do ...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/interactors/cleanup_spec.rb
spec/units/interactors/cleanup_spec.rb
require 'spec_helper' RSpec.describe Pulsar::Cleanup do subject { described_class.new } it { is_expected.to be_kind_of(Interactor) } describe '.call' do subject { FileUtils } let(:run_path) { './some-path' } before do allow(subject).to receive(:rm_rf) described_class.call(run_path: r...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/interactors/run_bundle_install_spec.rb
spec/units/interactors/run_bundle_install_spec.rb
require 'spec_helper' RSpec.describe Pulsar::RunBundleInstall do subject { described_class.new } it { is_expected.to be_kind_of(Interactor) } describe '.success' do subject do described_class.new(config_path: './config-path', bundle_path: './bundle-path') end let(:bundle_env) do 'BUNDL...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/interactors/identify_repository_type_spec.rb
spec/units/interactors/identify_repository_type_spec.rb
require 'spec_helper' RSpec.describe Pulsar::IdentifyRepositoryType do subject { described_class.new } it { is_expected.to be_kind_of(Interactor) } describe '.call' do subject { described_class.call(args) } let(:repo) { './my-conf' } let(:location) { :local } let(:args) { { repository:...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/organizers/install_spec.rb
spec/units/organizers/install_spec.rb
require 'spec_helper' RSpec.describe Pulsar::Install do subject { described_class.new } it { is_expected.to be_kind_of(Interactor::Organizer) } context 'organizes interactors' do subject { described_class.organized } it { is_expected.to eql [Pulsar::CopyInitialRepository] } end end
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/organizers/list_spec.rb
spec/units/organizers/list_spec.rb
require 'spec_helper' RSpec.describe Pulsar::List do subject { described_class.new } it { is_expected.to be_kind_of(Interactor::Organizer) } context 'organizes interactors' do subject { described_class.organized } let(:interactors) do [ Pulsar::IdentifyRepositoryLocation, Pulsar:...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/organizers/task_spec.rb
spec/units/organizers/task_spec.rb
require 'spec_helper' RSpec.describe Pulsar::Task do subject { described_class.new } it { is_expected.to be_kind_of(Interactor::Organizer) } context 'organizes interactors' do subject { described_class.organized } let(:interactors) do [ Pulsar::IdentifyRepositoryLocation, Pulsar:...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/cli/version_spec.rb
spec/units/cli/version_spec.rb
require 'spec_helper' RSpec.describe Pulsar::CLI do subject { Pulsar::Version } let(:described_instance) { described_class.new } context '#__print_version' do subject { -> { described_instance.__print_version } } it { is_expected.to output(/#{Pulsar::VERSION}/).to_stdout } end end
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/cli/install_spec.rb
spec/units/cli/install_spec.rb
require 'spec_helper' RSpec.describe Pulsar::CLI do subject { Pulsar::Install } let(:described_instance) { described_class.new } context '#install' do let(:result) { spy } before do allow(Pulsar::Install).to receive(:call).and_return(result) allow($stdout).to receive(:puts) end co...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/cli/deploy_spec.rb
spec/units/cli/deploy_spec.rb
require 'spec_helper' RSpec.describe Pulsar::CLI do subject { Pulsar::Task } let(:described_instance) { described_class.new } let(:fail_text) { /Failed to deploy blog on production./ } context '#deploy' do let(:result) { spy } let(:repo) { './conf_repo' } before do allow($stdout).to rece...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/cli/list_spec.rb
spec/units/cli/list_spec.rb
require 'spec_helper' RSpec.describe Pulsar::CLI do subject { Pulsar::List } let(:described_instance) { described_class.new } let(:fail_text) { /Failed to list application and environments./ } context '#list' do let(:result) { spy } let(:repo) { './conf_repo' } before do allow($stdout).t...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/units/cli/task_spec.rb
spec/units/cli/task_spec.rb
require 'spec_helper' RSpec.describe Pulsar::CLI do subject { Pulsar::Task } let(:described_instance) { described_class.new } let(:fail_text) { /Failed to execute task deploy:check for blog on production./ } context '#task' do let(:result) { spy } let(:repo) { './conf_repo' } before do a...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/features/version_spec.rb
spec/features/version_spec.rb
require 'spec_helper' RSpec.describe 'Version' do subject { command } let(:command) do `#{RSpec.configuration.pulsar_command} #{arguments}` end let(:arguments) { "--version" } context 'via a --version flag' do let(:version) { "#{Pulsar::VERSION}\n" } it { is_expected.to eql version } end en...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/features/install_spec.rb
spec/features/install_spec.rb
require 'spec_helper' RSpec.describe 'Install' do subject { command } let(:command) do `#{RSpec.configuration.pulsar_command} install #{arguments}` end let(:arguments) { nil } context 'via a subcommand named install' do subject { -> { command } } let(:error) { /Could not find command/ } ...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/features/deploy_spec.rb
spec/features/deploy_spec.rb
require 'spec_helper' RSpec.describe 'Deploy' do subject { -> { command } } let(:command) do `DRY_RUN=true #{RSpec.configuration.pulsar_command} deploy #{options} #{arguments}` end let(:repo) { RSpec.configuration.pulsar_conf_path } let(:options) { "--conf-repo #{repo}" } let(:app) ...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/features/list_spec.rb
spec/features/list_spec.rb
require 'spec_helper' RSpec.describe 'List' do subject { -> { command } } let(:command) do `#{RSpec.configuration.pulsar_command} list #{arguments}` end let(:repo) { RSpec.configuration.pulsar_conf_path } let(:arguments) { "--conf-repo #{repo}" } context 'via a subcommand named list' do let...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/spec/features/task_spec.rb
spec/features/task_spec.rb
require 'spec_helper' RSpec.describe 'Task' do subject { -> { command } } let(:command) do `DRY_RUN=true #{RSpec.configuration.pulsar_command} task #{options} #{arguments} #{task}` end let(:repo) { RSpec.configuration.pulsar_conf_path } let(:task) { 'deploy:check' } let(:options) { ...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar.rb
lib/pulsar.rb
require 'pulsar/version' module Pulsar require 'bundler' require 'thor' require 'rake' require 'dotenv' require 'interactor' require 'fileutils' require 'pulsar/context_error' require 'pulsar/validator' require 'pulsar/interactors/cleanup' require 'pulsar/interactors/create_run_dirs' require 'pu...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/version.rb
lib/pulsar/version.rb
module Pulsar VERSION = '1.1.0'.freeze end
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/constants.rb
lib/pulsar/constants.rb
module Pulsar PULSAR_HOME = File.expand_path('~/.pulsar') PULSAR_TMP = "#{PULSAR_HOME}/tmp".freeze PULSAR_CONF = "#{PULSAR_HOME}/config".freeze end
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/validator.rb
lib/pulsar/validator.rb
module Pulsar module Validator def self.included(klass) klass.extend ClassMethods klass.before :validate_context! end def validate_context! validable_properties.each do |property| result = context.send property.to_sym context_fail! "Invalid context for #{property} [#{res...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/cli.rb
lib/pulsar/cli.rb
if ENV['COVERAGE'] ENV['FEATURE_TESTS'] = 'true' require_relative '../../spec/support/coverage_setup' end module Pulsar class CLI < Thor map %w[--version -v] => :__print_version desc 'install [DIRECTORY]', 'Install initial repository in DIRECTORY' long_desc <<-LONGDESC `pulsar install` will in...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/context_error.rb
lib/pulsar/context_error.rb
module Pulsar class ContextError < StandardError def to_s backtrace ? backtrace.unshift(super).join("\n") : super end end end
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/interactors/identify_repository_location.rb
lib/pulsar/interactors/identify_repository_location.rb
module Pulsar class IdentifyRepositoryLocation include Interactor include Pulsar::Validator def call context.repository_location = if File.exist?(context.repository) :local else :remote ...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/interactors/create_capfile.rb
lib/pulsar/interactors/create_capfile.rb
module Pulsar class CreateCapfile include Interactor include Pulsar::Validator validate_context_for! :config_path, :cap_path, :application, :applications before :validate_application!, :prepare_context def call default_capfile = "#{context.config_path}/apps/Capfile" app_capfile =...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/interactors/run_bundle_install.rb
lib/pulsar/interactors/run_bundle_install.rb
module Pulsar class RunBundleInstall include Interactor include Pulsar::Validator validate_context_for! :config_path, :bundle_path def call gemfile_env = "BUNDLE_GEMFILE=#{context.config_path}/Gemfile" bundle_env = "BUNDLE_PATH=#{context.bundle_path}" cmd_env = "#{gemfile_env}...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/interactors/cleanup.rb
lib/pulsar/interactors/cleanup.rb
module Pulsar class Cleanup include Interactor include Pulsar::Validator def call FileUtils.rm_rf(context.run_path) end end end
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/interactors/run_capistrano.rb
lib/pulsar/interactors/run_capistrano.rb
module Pulsar class RunCapistrano include Interactor include Pulsar::Validator validate_context_for! :cap_path, :config_path, :bundle_path, :environment def call Dir.chdir(context.cap_path) do gemfile_env = "BUNDLE_GEMFILE=#{context.config_path}/Gemfile" bundle_env = "BUNDLE_P...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/interactors/copy_environment_file.rb
lib/pulsar/interactors/copy_environment_file.rb
module Pulsar class CopyEnvironmentFile include Interactor include Pulsar::Validator validate_context_for! :config_path, :cap_path, :application, :applications before :validate_environment! before :prepare_context def call env_file = "#{context.config_path}/apps/#{context.application}/...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/interactors/copy_initial_repository.rb
lib/pulsar/interactors/copy_initial_repository.rb
module Pulsar class CopyInitialRepository include Interactor include Pulsar::Validator def call current_path = File.dirname(__FILE__) initial_repo = "#{current_path}/../generators/initial_repo" FileUtils.cp_r(File.expand_path(initial_repo), context.directory) rescue context_f...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/interactors/create_deploy_file.rb
lib/pulsar/interactors/create_deploy_file.rb
module Pulsar class CreateDeployFile include Interactor include Pulsar::Validator before :prepare_context def call default_deploy = "#{context.config_path}/apps/deploy.rb" app_deploy = "#{context.config_path}/apps/#{context.application}/deploy.rb" FileUtils.mkdir_p(context.cap...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/interactors/create_run_dirs.rb
lib/pulsar/interactors/create_run_dirs.rb
module Pulsar class CreateRunDirs include Interactor include Pulsar::Validator def call context.timestamp = Time.now.to_f context.bundle_path = "#{PULSAR_HOME}/bundle" context.run_path = "#{PULSAR_TMP}/run-#{context.timestamp}" context.config_path = "#{context.run_path}/conf"...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/interactors/add_applications.rb
lib/pulsar/interactors/add_applications.rb
module Pulsar class AddApplications include Interactor include Pulsar::Validator validate_context_for! :config_path before :prepare_context after :validate_output! def call each_application_path do |app| context.applications[File.basename(app)] = stages_for(app) end r...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/interactors/identify_repository_type.rb
lib/pulsar/interactors/identify_repository_type.rb
module Pulsar class IdentifyRepositoryType include Interactor include Pulsar::Validator validate_context_for! :repository, :repository_location def call case context.repository_location when :local context.repository_type = :folder when :remote context.repository_ty...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/interactors/clone_repository.rb
lib/pulsar/interactors/clone_repository.rb
module Pulsar class CloneRepository include Interactor include Pulsar::Validator validate_context_for! :config_path, :repository, :repository_type def call case context.repository_type when :git then clone_git_repository when :github then clone_github_repository when :fold...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/generators/initial_repo/apps/deploy.rb
lib/pulsar/generators/initial_repo/apps/deploy.rb
# deploy.rb file shared between all the apps # config valid only for current version of Capistrano lock '3.8.0' # Default branch is :master # ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp # Default deploy_to directory is /var/www/my_app_name # set :deploy_to, '/var/www/my_app_name' # Default value for :scm i...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/generators/initial_repo/apps/your_app/staging.rb
lib/pulsar/generators/initial_repo/apps/your_app/staging.rb
server 'staging.your_app.com', user: 'deploy', roles: %w{web app db}, primary: true set :stage, :staging
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/generators/initial_repo/apps/your_app/production.rb
lib/pulsar/generators/initial_repo/apps/your_app/production.rb
server 'your_app.com', user: 'deploy', roles: %w{web app db}, primary: true set :stage, :production
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/generators/initial_repo/apps/your_app/deploy.rb
lib/pulsar/generators/initial_repo/apps/your_app/deploy.rb
# deploy.rb file shared between all the stages of a certain app set :application, 'my_app_name' set :repo_url, 'git@example.com:me/my_repo.git'
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/organizers/task.rb
lib/pulsar/organizers/task.rb
module Pulsar class Task include Interactor::Organizer organize IdentifyRepositoryLocation, IdentifyRepositoryType, CreateRunDirs, CloneRepository, AddApplications, CreateCapfile, CreateDeployFile, CopyEnvironmentFile,...
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/organizers/list.rb
lib/pulsar/organizers/list.rb
module Pulsar class List include Interactor::Organizer organize IdentifyRepositoryLocation, IdentifyRepositoryType, CreateRunDirs, CloneRepository, AddApplications, Cleanup end end
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
nebulab/pulsar
https://github.com/nebulab/pulsar/blob/fd8d081653f70517e0d40e71611aede8814ab1d8/lib/pulsar/organizers/install.rb
lib/pulsar/organizers/install.rb
module Pulsar class Install include Interactor::Organizer organize CopyInitialRepository end end
ruby
MIT
fd8d081653f70517e0d40e71611aede8814ab1d8
2026-01-04T17:51:14.324688Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/sft_segment_spec.rb
spec/sft_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::SFT do context "general" do before :all do @base_sft = "SFT|Level Seven Healthcare Software, Inc.^L^^^^&2.16.840.1.113883.19.4.6^ISO^XX^^^1234|1.2|An Lab System|56734||20080817" end it "creates an SFT segment" do ...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/dynamic_segment_def_spec.rb
spec/dynamic_segment_def_spec.rb
# frozen_string_literal: true require "spec_helper" describe "dynamic segment definition" do context "general" do it "accepts a block with a parameter" do seg = HL7::Message::Segment.new do |s| s.e0 = "MSK" s.e1 = "1234" s.e2 = "5678" end expect(seg.to_s).to eq "MSK|12...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/segment_spec.rb
spec/segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment do describe "length" do it "returns the length of the elements" do segment = HL7::Message::Segment.new "MSA|AR|ZZ9380 ERR" expect(segment.length).to eq 3 end end describe "enumerable" do it "enumerates ov...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/batch_parsing_spec.rb
spec/batch_parsing_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message do context "batch parsing" do it "has a class method HL7::Message.parse_batch" do expect(HL7::Message).to respond_to(:parse_batch) end it "raises an exception when parsing an empty batch" do # :empty_batch message con...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/rol_segment_spec.rb
spec/rol_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::ROL do describe "segment parsing" do let(:segment_string) do "ROL|1|AD|Role|Role person|20240611|20240711|Duration|Role action reason|Provider type|Organization unit type|Office home address birthplace|Phone number|Person ...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/msh_segment_spec.rb
spec/msh_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::MSH do context "general" do before :all do @base = "MSH|^~\\&||ABCHS||AUSDHSV|20070101112951||ADT^A04^ADT_A01|12334456778890|P|2.5|||NE|NE|AU|ASCII|ENGLISH|||AN ORG|||RECNET.ORG" end it "allows access to an MSH se...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/pv1_segment_spec.rb
spec/pv1_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::PV1 do context "general" do before :all do @base = "PV1||R|||||||||||||||A|||V02^19900607~H02^19900607" end it "allows access to an PV1 segment" do pv1 = HL7::Message::Segment::PV1.new @base expect(pv1...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/message_spec.rb
spec/message_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message do describe "#correction?" do subject { hl7.correction? } let(:hl7) { HL7::Message.new data } context "when is a correction" do let(:data) do [ "OBR|1|A241Z^LAB||123456^A TEST^L|||201508181431||1234||||No...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/evn_segment_spec.rb
spec/evn_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::EVN do context "general" do before :all do @base = "EVN|A04|20060705000000" end it "allows access to an EVN segment" do evn = HL7::Message::Segment::EVN.new @base expect(evn.type_code).to eq "A04" ...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/obr_segment_spec.rb
spec/obr_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::OBR do context "general" do before :all do @base = "OBR|2|^USSSA|0000000567^USSSA|37956^CT ABDOMEN^LN|||199405021550|||||||||||||0000763||||NMR|P||||||R/O TUMOR|202300&BAKER&MARK&E|||01&LOCHLEAR&JUDY|||||||||||||||123" ...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/nk1_segment_spec.rb
spec/nk1_segment_spec.rb
# frozen_string_literal: true require "spec_helper" # rubocop:disable RSpec/MultipleExpectations, RSpec/ExampleLength # reason: we need to assert every segment field to be exhaustive describe HL7::Message::Segment::NK1 do let(:segment_string) do "NK1|1|Mum^Martha^M^^^^L|MTH^Mother^HL70063^^^^2.5.1|444 Home Stre...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/aip_segment_spec.rb
spec/aip_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::AIP do context "general" do before :all do @base_aip = "AIP|1|U|JSB^ISON^Kathy^S|D^Doctor||20020108150000|||10|m^Minutes" end it "creates an AIP segment" do expect do aip = HL7::Message::Segment::AIP...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/dg1_spec.rb
spec/dg1_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::DG1 do context "reading" do let(:base_string) do "DG1|1|I9|71596^OSTEOARTHROS NOS-L/LEG ^I9|OSTEOARTHROS NOS-L/LEG |20170615140551-0800||A|" end let(:segment) { HL7::Message::Segment::DG1.new(base_string) } it...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/basic_parsing_spec.rb
spec/basic_parsing_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message do context "basic parsing" do before :all do @simple_msh_txt = open("./test_data/test.hl7").readlines.first @empty_txt = open("./test_data/empty.hl7").readlines.first @empty_segments_txt = open("./test_data/empty_segment...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/err_segment_spec.rb
spec/err_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::ERR do context "general" do before :all do @base_err = "ERR||OBR^1|100^Segment sequence error^HL70357|E|||Missing required OBR segment|Email help desk for further information on this error||||^NET^Internet^helpdesk@hl7.org...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/mfe_segment_spec.rb
spec/mfe_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::MFE do context "general" do before :all do @base_sft = "MFE|MAD|6772331|200106290500|BUD^Buddhist^HL70006|CE" end it "creates an MFE segment" do expect do sft = HL7::Message::Segment::MFE.new(@base_s...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/pid_segment_spec.rb
spec/pid_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::PID do let(:segment) do "PID|1||333||LastName^FirstName^MiddleInitial^SR^NickName||19760228|F||2106-3^White^HL70005^CAUC^Caucasian^L||AA||||||555.55|012345678||||||||||201011110924-0700|Y||UA|||||||" end let(:filled_pid) { H...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/rf1_segment_spec.rb
spec/rf1_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::RF1 do context "general" do before :all do @base = "RF1|P^Pending^HL70283|R^Routine^HL70280|GRF^General referral^HL70281|AM^Assume management^HL70282||8094|20060705||20060705||42" end it "allows access to an RF1 s...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/in1_segment_spec.rb
spec/in1_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::IN1 do context "general" do before :all do @base_in1 = "IN1|1||752|ACORDIA NATIONAL||||A|GRP|||||||SMITH^JOHN|19|19700102||||||||||||||||||WC23732763278A|||||||||||||||||X" end it "creates an IN1 segment" do ...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/prt_segment_spec.rb
spec/prt_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::PRT do describe "segment parsing" do let(:segment_string) do "PRT|1^N01^1^UUID|AD|Reason|AP|1^Author|Provider type|1|" \ "ORG^A||2^N01^2^UUID|20240611|20240711|Duration|" \ "2070 Test Park^^Los Angeles^CA^9...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/ft1_segment_spec.rb
spec/ft1_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::FT1 do context "general" do before :all do @base_ft1 = "FT1|1|||20180705|20180705|||Description||1||||||123456^The Location|||R45.82^Worries~H18.892^Other specified disorders of cornea|1043312457^Provider^Testing^^^^|10433...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/msa_segment_spec.rb
spec/msa_segment_spec.rb
# frozen_string_literal: true $: << "../lib" require "ruby-hl7" describe HL7::Message::Segment::MSA do context "general" do before :all do @base_msa = "MSA|AR|ZZ9380 ERR" end it "creates an MSA segment" do expect do msa = HL7::Message::Segment::MSA.new(@base_msa) expect(msa)...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/fts_segment_spec.rb
spec/fts_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::FTS do context "general" do before :all do base_string = "FTS||End of File" @fts = HL7::Message::Segment::FTS.new(base_string) end it "creates an FTS segment" do expect(@fts).not_to be_nil end ...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/txa_segment_spec.rb
spec/txa_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::TXA do let(:segment) do "TXA|1|AR|AP|20220611113300|1^Name|20220611|2022061110||1^Creator|" \ "1^Author|1^Typer|A^V02^UID^TC|A^V01^UID^TC|01|02|file.txt|C|P|AV|ST||" \ "2022061110|DC|AR|FileName|202206111011" end ...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/mfi_segment_spec.rb
spec/mfi_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::MFI do context "general" do before :all do @base_sft = "MFI|HL70006^RELIGION^HL70175|TEST|UPD|||AL" end it "creates an MFI segment" do expect do sft = described_class.new(@base_sft) expect(sf...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/messages_spec.rb
spec/messages_spec.rb
# frozen_string_literal: true require "spec_helper" describe "HL7 Messages" do it "processes multiple known messages without failing" do expect do HL7MESSAGES.each_pair do |_key, hl7| HL7::Message.new(hl7) end end.not_to raise_exception end describe "MFN M13 Messages" do it "ext...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/obx_segment_spec.rb
spec/obx_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::OBX do context "general" do before :all do @base = "OBX|1|NM|30341-2^Erythrocyte sedimentation rate^LN^815117^ESR^99USI^^^Erythrocyte sedimentation rate||10|mm/h^millimeter per hour^UCUM|0 to 17|N|0.1||F|||20110331140551-0...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/segment_list_storage_spec.rb
spec/segment_list_storage_spec.rb
# frozen_string_literal: true require "spec_helper" class SegmentNoChildren < HL7::Message::Segment end class SegmentWithChildren < HL7::Message::Segment has_children %i[NTE ORC SPM] end describe HL7::Message::SegmentListStorage do describe "self#add_child_type" do it "allows to add a new segment type as ch...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/gt1_segment_spec.rb
spec/gt1_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::GT1 do context "general" do before :all do @base_gt1 = "GT1||440|Crusher^Beverly||1003 Elm Street^^Enterprise^MD^29433|(330)644-1234^^^bcrusher@ufp.net^^330^6441234| |19600411000000|F||18|339-33-6657||||||||F||||||||||M" ...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/prd_segment_spec.rb
spec/prd_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::PRD do context "general" do let(:base) do "PRD|RP|LastName^FirstName^MiddleInitial^SR^NickName|444 Home Street^Apt B^Ann Arbor^MI^99999^USA|^^^A Wonderful Clinic|^WPN^PH^^^07^5555555|PH|4796^AUSHICPR|20130109163307+1000|20...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/segment_field_spec.rb
spec/segment_field_spec.rb
# frozen_string_literal: true require "spec_helper" class MockSegment < HL7::Message::Segment weight 1 add_field :no_block alias_field :no_block_alias, :no_block add_field :validating do |value| value == "bad" ? nil : value end add_field :converting do |value| "X#{value}" end end describe HL7::...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/ail_segment_spec.rb
spec/ail_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::AIL do context "general" do before :all do @base_ail = "AIL|1|A|OFFICE^^^OFFICE|^OFFICE^A4" end it "creates an AIL segment" do expect do ail = HL7::Message::Segment::AIL.new(@base_ail) expect...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/speed_parsing_spec.rb
spec/speed_parsing_spec.rb
# frozen_string_literal: true require "spec_helper" require "time" describe HL7::Message do context "speed parsing" do before :all do @msg = open("./test_data/lotsunknowns.hl7").readlines end it "parses large, unknown segments rapidly" do start = Time.now doc = HL7::Message.new @msg ...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/sch_segment_spec.rb
spec/sch_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::SCH do context "general" do before :all do @base_sch = "SCH|||||681|S^SCHEDULED|^BONE DENSITY PB,cf/RH |30^30 MINUTE APPOINTMENT|45|m|^^45^200905260930^200905261015|||||||||polly^^POLLY BRESCOCK|^^^^^^ ||||SCHEDULED" e...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/default_segment_spec.rb
spec/default_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::Default do context "general" do before :all do @base_msa = "MSA|AR|ZZ9380 ERR" end it "stores an existing segment" do seg = HL7::Message::Segment::Default.new(@base_msa) expect(seg.to_s).to eq @base_ms...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/spec_helper.rb
spec/spec_helper.rb
# frozen_string_literal: true require "simplecov" if ENV["COVERAGE"] SimpleCov.start do add_filter "/test/" add_filter "/spec/" end end # ruby-hl7 loads the rest of the files in lib require File.expand_path("../lib/ruby-hl7", __dir__) require File.expand_path("../lib/test/hl7_messages", __dir__) RSpec.c...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/pv2_segment_spec.rb
spec/pv2_segment_spec.rb
# frozen_string_literal: true require "spec_helper" # rubocop:disable RSpec/MultipleExpectations, RSpec/ExampleLength # reason: we need to assert every segment field to be exhaustive describe HL7::Message::Segment::PV2 do let(:filled_pv2) { HL7::Message::Segment::PV2.new(segment_string) } let(:segment_string) do...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/segment_generator_spec.rb
spec/segment_generator_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::SegmentGenerator do describe "valid_segments_parts?" do let(:element) { "MSH|1|2|3" } let(:delimiter) { HL7::Message::Delimiter.new("|", "^", '\r') } let(:segment_generator) do HL7::Message::SegmentGenerator.new(element, ni...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/spm_segment_spec.rb
spec/spm_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message::Segment::SPM do context "general" do before :all do @base_spm = "SPM|1|23456&EHR&2.16.840.1.113883.19.3.2.3&ISO^9700122&Lab&2.16.840.1.113883.19.3.1.6&ISO||122554006^Capillary blood specimen^SCT^BLDC^Blood capillary^HL70070^2008013...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/orc_segment_spec.rb
spec/orc_segment_spec.rb
# frozen_string_literal: true $: << "../lib" require "ruby-hl7" describe HL7::Message::Segment::ORC do context "general" do before :all do @base_orc = "ORC|RE|23456^EHR^2.16.840.1.113883.19.3.2.3^ISO|9700123^Lab^2.16.840.1.113883.19.3.1.6^ISO|||||||||1234^Admit^Alan^A^III^Dr^^^&2.16.840.1.113883.19.4.6^IS...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/child_segment_spec.rb
spec/child_segment_spec.rb
# frozen_string_literal: true require "spec_helper" describe HL7::Message do context "child segments" do before :all do @base = open("./test_data/obxobr.hl7").readlines end it "allows access to child segments" do msg = HL7::Message.new @base expect(msg).not_to be_nil expect(msg[...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/helpers/time_formatter_helper_spec.rb
spec/helpers/time_formatter_helper_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe TimeFormatterHelper, :type => :helper do describe "#hl7_formatted_timestamp" do subject(:formatted_date) { hl7_formatted_timestamp(value, fraction_digits) } let(:fraction_digits) { 0 } context "when value is not a Time nor a DateTime" ...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/spec/core_ext/date_time_spec.rb
spec/core_ext/date_time_spec.rb
# frozen_string_literal: true require "spec_helper" describe Date do subject { Date.parse("2013-12-02").to_hl7 } it "responds to the HL7 timestamp" do expect(subject).to eq "20131202" end end describe "to_hl7 for time related classes" do let(:formated_time) { time_now.strftime("%Y%m%d%H%M%S") } let(:f...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/examples/proxy_server.rb
examples/proxy_server.rb
# frozen_string_literal: true # $Id$ # Ruby-HL7 Proxy Server Example require "rubygems" require "ruby-hl7" require "socket" PORT = 2402 target_ip = "127.0.0.1" target_port = 5900 srv = TCPServer.new(PORT) puts format("proxy_server listening on port: %i", PORT) puts format("proxying for: %s:%i", target_ip, target_por...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/lib/version.rb
lib/version.rb
# frozen_string_literal: true module RubyHl7 VERSION = "1.4.0" end
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/lib/segment_list_storage.rb
lib/segment_list_storage.rb
# frozen_string_literal: true # This module includes methods for storing segments inside segments. # has_children(child_types) defines three methods dynamically. module HL7::Message::SegmentListStorage attr_reader :child_types def add_child_type(child_type) if defined?(@child_types) @child_types << chi...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/lib/message_parser.rb
lib/message_parser.rb
# frozen_string_literal: true module HL7::MessageBatchParser def parse_batch(batch) # :yields: message raise HL7::ParseError, "badly_formed_batch_message" unless batch.hl7_batch? batch = clean_batch_for_jruby batch raise HL7::ParseError, "empty_batch_message" unless match = /\rMSH/.match(ba...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false
ruby-hl7/ruby-hl7
https://github.com/ruby-hl7/ruby-hl7/blob/d5c8ee0288d225591c611a8474da5c520e5415f6/lib/segment_fields.rb
lib/segment_fields.rb
# frozen_string_literal: true # SegmentFields # class HL7::Message::Segment::NK1 < HL7::Message::Segment # weight 100 # segments are sorted ascendingly # add_field :something_you_want # assumes :idx=>1 # add_field :something_else, :idx=>6 # :idx=>6 and field count=6 module HL7::Message::SegmentFields...
ruby
MIT
d5c8ee0288d225591c611a8474da5c520e5415f6
2026-01-04T17:51:14.403379Z
false