Skip to content

Commit

Permalink
v1.1.2
Browse files Browse the repository at this point in the history
- update bundle
- rubocop fixes
  • Loading branch information
embold-tyler committed Mar 12, 2024
1 parent 665b668 commit 36c43fa
Show file tree
Hide file tree
Showing 21 changed files with 52 additions and 46 deletions.
9 changes: 6 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ Style/StringLiterals:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylestringliterals

Style/TrailingCommaInLiteral:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styletrailingcommainliteral
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: consistent_comma
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainliteral

Style/WhileUntilModifier:
Enabled: false
Expand Down Expand Up @@ -153,3 +153,6 @@ Metrics/ParameterLists:

Metrics/PerceivedComplexity:
Enabled: false

AllCops:
TargetRubyVersion: 2.6.3
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.0
3.0.6
2 changes: 1 addition & 1 deletion lib/pulsar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ module Pulsar
require 'pulsar/cli'

# Silence Rake output
Rake::FileUtilsExt.verbose_flag = false
Rake::FileUtilsExt.verbose_flag = true
end
4 changes: 2 additions & 2 deletions lib/pulsar/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def deploy(application, environment)
result = Pulsar::Task.call(
repository: load_option_or_env!(:conf_repo),
application: application, environment: environment,
task: 'deploy'
task: 'deploy',
)

if result.success?
Expand All @@ -76,7 +76,7 @@ def task(application, environment, task)
result = Pulsar::Task.call(
repository: load_option_or_env!(:conf_repo),
application: application, environment: environment,
task: task
task: task,
)

if result.success?
Expand Down
2 changes: 1 addition & 1 deletion lib/pulsar/interactors/add_applications.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def call
each_application_path do |app|
context.applications[File.basename(app)] = stages_for(app)
end
rescue
rescue StandardError
context_fail! $!.message
end

Expand Down
7 changes: 4 additions & 3 deletions lib/pulsar/interactors/clone_repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def call
when :github then clone_github_repository
when :folder then copy_local_folder
end
rescue
rescue StandardError
context_fail! $!.message
end

Expand All @@ -23,7 +23,7 @@ def clone_git_repository
quiet = '>/dev/null 2>&1'

Rake.sh(
"#{cmd} #{opts} #{context.repository} #{context.config_path} #{quiet}"
"#{cmd} #{opts} #{context.repository} #{context.config_path} #{quiet}",
)
end

Expand All @@ -34,12 +34,13 @@ def clone_github_repository
repo = "[email protected]:#{context.repository}.git"

Rake.sh(
"#{cmd} #{opts} #{repo} #{context.config_path} #{quiet}"
"#{cmd} #{opts} #{repo} #{context.config_path} #{quiet}",
)
end

def copy_local_folder
raise "No repository found at #{context.repository}" unless File.exist? context.repository

FileUtils.cp_r("#{context.repository}/.", context.config_path)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/pulsar/interactors/copy_environment_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def call

FileUtils.mkdir_p(context.cap_deploy_path)
FileUtils.cp(env_file, context.environment_file_path)
rescue
rescue StandardError
context_fail! $!.message
end

Expand Down
2 changes: 1 addition & 1 deletion lib/pulsar/interactors/copy_initial_repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def call
initial_repo = "#{current_path}/../generators/initial_repo"

FileUtils.cp_r(File.expand_path(initial_repo), context.directory)
rescue
rescue StandardError
context_fail! $!.message
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/pulsar/interactors/create_capfile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def call
Rake.sh("cat #{default_capfile} >> #{context.capfile_path}") if File.exist?(default_capfile)
Rake.sh("cat #{app_capfile} >> #{context.capfile_path}") if File.exist?(app_capfile)
Rake.sh("echo '#{import_tasks}' >> #{context.capfile_path}")
rescue
rescue StandardError
context_fail! $!.message
end

Expand Down
4 changes: 2 additions & 2 deletions lib/pulsar/interactors/create_deploy_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def call
FileUtils.touch(context.deploy_file_path)
Rake.sh("cat #{default_deploy} >> #{context.deploy_file_path}") if File.exist?(default_deploy)
Rake.sh("cat #{app_deploy} >> #{context.deploy_file_path}") if File.exist?(app_deploy)
rescue
context_fail!$!.message
rescue StandardError
context_fail! $!.message
end

private
Expand Down
2 changes: 1 addition & 1 deletion lib/pulsar/interactors/identify_repository_location.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def call
else
:remote
end
rescue
rescue StandardError
context_fail! $!.message
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/pulsar/interactors/identify_repository_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def call
private

def github_repository?
context.repository =~ %r{^[\w-]+\/[\w-]+$}
context.repository =~ %r{^[\w-]+/[\w-]+$}
end
end
end
2 changes: 1 addition & 1 deletion lib/pulsar/interactors/run_bundle_install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def call
Bundler.with_unbundled_env do
Rake.sh("#{bundle_cmd}#{out_redir}")
end
rescue
rescue StandardError
context_fail! $!.message
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/pulsar/interactors/run_capistrano.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def call

Rake.sh("#{gemfile_env} #{bundle_env} #{cap_cmd}#{out_redir}")
end
rescue
rescue StandardError
context_fail! $!.message
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/pulsar/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Pulsar
VERSION = '1.1.1'.freeze
VERSION = '1.1.2'.freeze
end
30 changes: 15 additions & 15 deletions pulsar.gemspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
lib = File.expand_path('../lib', __FILE__)
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'pulsar/version'

Gem::Specification.new do |gem|
gem.name = 'pulsar'
gem.version = Pulsar::VERSION
gem.licenses = ['MIT']
gem.licenses = ['MIT']
gem.authors = ['Matteo Latini']
gem.email = ['[email protected]']
gem.homepage = 'http://pulsar.nebulab.it'
Expand All @@ -15,22 +15,22 @@ Gem::Specification.new do |gem|
to store all your precious configurations and recipes to build Capistrano
deploys on it.
'

gem.required_ruby_version = '>= 2.6.3'
gem.files = `git ls-files`.split($/)
gem.bindir = 'exe'
gem.executables = gem.files.grep(%r{^exe\/}).map { |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)\/})
gem.executables = gem.files.grep(%r{^exe/}).map { |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ['lib']

gem.add_dependency 'bundler', '~> 2'
gem.add_dependency 'thor', '~> 0.19'
gem.add_dependency 'interactor', '~> 3.1'
gem.add_dependency 'dotenv', '~> 2.0'
gem.add_dependency 'bundler', '> 2'
gem.add_dependency 'dotenv', '> 2.0'
gem.add_dependency 'interactor', '> 3.1'
gem.add_dependency 'thor', '> 0.19'

gem.add_development_dependency 'rake', '~> 10.4'
gem.add_development_dependency 'rspec', '~> 3.2'
gem.add_development_dependency 'rubocop', '~> 0.47'
gem.add_development_dependency 'timecop', '~> 0.8'
gem.add_development_dependency 'simplecov', '~> 0.14.0'
gem.add_development_dependency 'coveralls', '~> 0.8.20'
gem.add_development_dependency 'coveralls', '> 0.8.20'
gem.add_development_dependency 'rake', '> 10.4'
gem.add_development_dependency 'rspec', '> 3.2'
gem.add_development_dependency 'rubocop', '> 0.47'
gem.add_development_dependency 'simplecov', '> 0.14.0'
gem.add_development_dependency 'timecop', '> 0.8'
end
1 change: 1 addition & 0 deletions spec/support/dummies/conf/dir/apps/ecommerce/staging.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# staging
1 change: 1 addition & 0 deletions spec/support/dummies/conf/wrong_cap/apps/Capfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Capfile
2 changes: 1 addition & 1 deletion spec/units/interactors/clone_repository_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
described_class.call(
config_path: run_path,
repository: repo,
repository_type: type
repository_type: type,
)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/units/interactors/copy_environment_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
context 'when no environment context is passed' do
subject do
described_class.call(
cap_path: './some-path', config_path: './my-conf', application: 'blog'
cap_path: './some-path', config_path: './my-conf', application: 'blog',
)
end

Expand Down
16 changes: 8 additions & 8 deletions spec/units/interactors/run_capistrano_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
subject do
described_class.call(
config_path: './config-path', bundle_path: './bundle-path',
environment: 'production', task: 'deploy:check'
environment: 'production', task: 'deploy:check',
)
end

Expand All @@ -75,7 +75,7 @@
subject do
described_class.call(
cap_path: './cap-path', config_path: './config-path',
bundle_path: './bundle-path', task: 'deploy:check'
bundle_path: './bundle-path', task: 'deploy:check',
)
end

Expand All @@ -86,7 +86,7 @@
subject do
described_class.call(
cap_path: './cap-path', config_path: './config-path',
environment: 'production', task: 'deploy:check'
environment: 'production', task: 'deploy:check',
)
end

Expand All @@ -97,7 +97,7 @@
subject do
described_class.call(
cap_path: './cap-path', environment: 'production',
bundle_path: './bundle-path', task: 'deploy:check'
bundle_path: './bundle-path', task: 'deploy:check',
)
end

Expand All @@ -108,7 +108,7 @@
subject do
described_class.call(
cap_path: './cap-path', config_path: './config-path',
bundle_path: './bundle-path', environment: 'production'
bundle_path: './bundle-path', environment: 'production',
)
end

Expand All @@ -120,7 +120,7 @@
described_class.call(
cap_path: './cap-path', config_path: './config-path',
bundle_path: './bundle-path', environment: 'production',
task: 'unexistent:task'
task: 'unexistent:task',
)
end
it { is_expected.to be_a_failure }
Expand All @@ -131,7 +131,7 @@
described_class.call(
cap_path: './cap-path', config_path: './config-path',
bundle_path: './bundle-path', environment: 'production',
task: 'unexistent:task[param1,pa'
task: 'unexistent:task[param1,pa',
)
end
it { is_expected.to be_a_failure }
Expand All @@ -141,7 +141,7 @@
described_class.call(
cap_path: './cap-path', config_path: './config-path',
bundle_path: './bundle-path', environment: 'production',
task: 'deploy:check'
task: 'deploy:check',
)
end
before { allow(Dir).to receive(:chdir).and_raise(RuntimeError) }
Expand Down

0 comments on commit 36c43fa

Please sign in to comment.