Skip to content

Commit 5400820

Browse files
committed
Support frozen strings
1 parent 5ed6181 commit 5400820

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ jobs:
2121
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
2222
- name: Run Tests
2323
run: bundle exec rake test
24+
env:
25+
RUBYOPT: ${{ startsWith(matrix.ruby, 'ruby-head') && '--enable=frozen-string-literal' || '' }}

lib/net/scp.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,12 @@ def download!(remote, local=nil, options={}, &progress)
329329
# (:verbose, :recursive, :preserve). Returns the command-line as a
330330
# string, ready to execute.
331331
def scp_command(mode, options)
332-
command = "scp "
332+
command =
333+
if RUBY_VERSION < "2.3"
334+
"scp "
335+
else
336+
+"scp "
337+
end
333338
command << (mode == :upload ? "-t" : "-f")
334339
command << " -v" if options[:verbose]
335340
command << " -r" if options[:recursive]

net-scp.gemspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ Gem::Specification.new do |spec|
3535
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
3636
spec.add_runtime_dependency(%q<net-ssh>, [">= 2.6.5", "< 8.0.0"])
3737
spec.add_development_dependency(%q<test-unit>, [">= 0"])
38-
spec.add_development_dependency(%q<mocha>, [">= 0"])
38+
spec.add_dependency(%q<mocha>, [">= 0", "<2.1"])
3939
else
4040
spec.add_dependency(%q<net-ssh>, [">= 2.6.5", "< 8.0.0"])
4141
spec.add_dependency(%q<test-unit>, [">= 0"])
42-
spec.add_dependency(%q<mocha>, [">= 0"])
42+
spec.add_dependency(%q<mocha>, [">= 0", "<2.1"])
4343
end
4444
else
4545
spec.add_dependency(%q<net-ssh>, [">= 2.6.5", "< 8.0.0"])
4646
spec.add_dependency(%q<test-unit>, [">= 0"])
47-
spec.add_dependency(%q<mocha>, [">= 0"])
47+
spec.add_dependency(%q<mocha>, [">= 0", "<2.1"])
4848
end
4949
end

0 commit comments

Comments
 (0)