Skip to content

Commit dfa834f

Browse files
committed
Be more careful about ruby version and syntax
1 parent ba7e6e8 commit dfa834f

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

.rubocop.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AllCops:
2-
TargetRubyVersion: 2.6
2+
TargetRubyVersion: 2.5
33
NewCops: enable
44
SuggestExtensions: false
55
Exclude:
@@ -65,15 +65,15 @@ Layout/LineLength:
6565
# Configuration parameters: CountComments.
6666
Metrics/ClassLength:
6767
Enabled: false
68-
Max: 400
6968

7069
Metrics/AbcSize:
7170
Enabled: false
72-
Max: 50
7371

7472
Metrics/MethodLength:
7573
Enabled: false
76-
Max: 50
74+
75+
Metrics/BlockLength:
76+
Enabled: false
7777

7878
# Configuration parameters: CountKeywordArgs.
7979
Metrics/ParameterLists:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1111
- Environment variable to run from a subdirectory during CI testing: `USE_SUBDIR`
1212

1313
### Changed
14+
- Rubocop expected syntax downgraded from ruby 2.6 to 2.5
1415

1516
### Deprecated
1617

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Add a file called `Gemfile` (no extension) to your Arduino project:
5353

5454
```ruby
5555
source 'https://rubygems.org'
56-
gem 'arduino_ci'
56+
gem 'arduino_ci' '~> 1.1'
5757
```
5858

5959
It would also make sense to add the following to your `.gitignore`, or copy [the `.gitignore` used by this project](.gitignore):

exe/arduino_ci.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,21 +419,20 @@ def perform_example_compilation_tests(cpp_library, config)
419419

420420
# initialize command and config
421421
config = ArduinoCI::CIConfig.default.from_project_library
422-
423422
@backend = ArduinoCI::ArduinoInstallation.autolocate!
424423
inform("Located arduino-cli binary") { @backend.binary_path.to_s }
425424

426425
# run any library init scripts from the library itself.
427426
perform_custom_initialization(config)
428427

429-
430428
# initialize library under test
431429
inform("Environment variable #{VAR_USE_SUBDIR}") { "'#{ENV[VAR_USE_SUBDIR]}'" }
432430
cpp_library_path = Pathname.new(ENV[VAR_USE_SUBDIR].nil? ? "." : ENV[VAR_USE_SUBDIR])
433431
cpp_library = assure("Installing library under test") do
434432
@backend.install_local_library(cpp_library_path)
435433
end
436434

435+
# Warn if the library name isn't obvious
437436
assumed_name = @backend.name_of_library(cpp_library_path)
438437
ondisk_name = cpp_library_path.realpath.basename.to_s
439438
if assumed_name != ondisk_name

lib/arduino_ci/arduino_backend.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def _wrap_run(work_fn, *args, **kwargs)
5252
# do some work to extract & merge environment variables if they exist
5353
has_env = !args.empty? && args[0].instance_of?(Hash)
5454
env_vars = has_env ? args[0] : {}
55-
actual_args = has_env ? args[1..] : args # need to shift over if we extracted args
55+
actual_args = has_env ? args[1..-1] : args # need to shift over if we extracted args
5656
custom_config = @config_dir.nil? ? [] : ["--config-file", @config_dir.to_s]
5757
full_args = [binary_path.to_s, "--format", "json"] + custom_config + actual_args
5858
full_cmd = env_vars.empty? ? full_args : [env_vars] + full_args

0 commit comments

Comments
 (0)