Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundler hack to handle conflict with OpenStudio #199

Merged
merged 4 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
# See also https://openstudio.net/license
# *******************************************************************************

require 'bundler/gem_tasks'
if !defined?(Bundler)
require 'bundler/gem_tasks'
end
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)

require 'openstudio/extension/rake_task'
require 'openstudio/extension'
rake_task = OpenStudio::Extension::RakeTask.new
rake_task.set_extension_class(OpenStudio::Extension::Extension, 'nrel/openstudio-extension-gem')
# Only load extension tasks if we're not installing
unless ARGV.include?('install')
require 'openstudio/extension/rake_task'
require 'openstudio/extension'
rake_task = OpenStudio::Extension::RakeTask.new
rake_task.set_extension_class(OpenStudio::Extension::Extension, 'nrel/openstudio-extension-gem')
end

require 'rubocop/rake_task'
RuboCop::RakeTask.new
Expand Down
4 changes: 3 additions & 1 deletion bin/console
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env ruby

require 'bundler/setup'
if !defined?(Bundler)
require 'bundler/setup'
end
require 'openstudio/extension'

# You can add fixtures and/or initialization code here to make experimenting
Expand Down
4 changes: 3 additions & 1 deletion init_templates/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# See also https://openstudio.net/license
# *******************************************************************************

require 'bundler/setup'
if !defined?(Bundler)
require 'bundler/setup'
end
require 'openstudio/GEM_NAME_UNDERSCORES'

RSpec.configure do |config|
Expand Down
5 changes: 4 additions & 1 deletion lib/openstudio/extension/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
# See also https://openstudio.net/license
# *******************************************************************************

require 'bundler'
# Check if Bundler is already loaded
if !defined?(Bundler)
require 'bundler'
end
require 'fileutils'
require 'json'
require 'open3'
Expand Down
5 changes: 4 additions & 1 deletion lib/openstudio/extension/runner_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
# See also https://openstudio.net/license
# *******************************************************************************

require 'bundler'
# Check if Bundler is already loaded
if !defined?(Bundler)
require 'bundler'
end
require 'fileutils'
require 'json'
require 'parallel'
Expand Down
2 changes: 2 additions & 0 deletions openstudio-extension.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ Gem::Specification.new do |spec|
spec.add_dependency 'octokit', '~> 4.18.0' # for change logs
spec.add_dependency 'openstudio_measure_tester', '~> 0.4.0'
spec.add_dependency 'openstudio-workflow', '~> 2.4.0'
# parallel, regexp_parser, and addressable versions are pinned to avoid test_with_openstudio errors
spec.add_dependency 'parallel', '~> 1.19.1'
spec.add_dependency 'regexp_parser', '2.9.0'
spec.add_dependency 'addressable', '2.8.1'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rspec', '~> 3.9'
end
4 changes: 3 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# See also https://openstudio.net/license
# *******************************************************************************

require 'bundler/setup'
if !defined?(Bundler)
require 'bundler/setup'
end
require 'openstudio/extension'

RSpec.configure do |config|
Expand Down