sym 3.0.1 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/ruby_warnings.rb CHANGED
@@ -1,4 +1,4 @@
1
- ruby_version = RbConfig::CONFIG['MAJOR'].to_i * 10 + RbConfig::CONFIG['MINOR'].to_i
1
+ ruby_version = (RbConfig::CONFIG['MAJOR'].to_i * 10) + RbConfig::CONFIG['MINOR'].to_i
2
2
  if ruby_version >= 27
3
3
  Warning[:deprecated] = false
4
4
  ENV['RUBYOPT'] = '-W:no-deprecated'
@@ -62,12 +62,12 @@ module Sym
62
62
 
63
63
  diff = compute_diff
64
64
 
65
- File.open(opts[:file], 'w') { |f| f.write(encr(content_edited, key)) }
65
+ File.write(opts[:file], encr(content_edited, key))
66
66
 
67
67
  out = ''
68
68
  if opts[:verbose]
69
- out << "Saved encrypted/compressed content to #{opts[:file].bold.blue}" +
70
- " (#{File.size(opts[:file]) / 1024}Kb), unencrypted size #{content.length / 1024}Kb."
69
+ out << ("Saved encrypted/compressed content to #{opts[:file].bold.blue}" +
70
+ " (#{File.size(opts[:file]) / 1024}Kb), unencrypted size #{content.length / 1024}Kb.")
71
71
  out << (opts[:backup] ? ",\nbacked up the last version to #{backup_file.bold.blue}." : '.')
72
72
  end
73
73
  out << "\n\nDiff:\n#{diff}"
@@ -76,7 +76,7 @@ Diff:
76
76
  out << command if command
77
77
  out << echo if echo
78
78
  out << result if result
79
- out << '—'*80
79
+ out << ('—'*80)
80
80
  end
81
81
  end
82
82
  end
@@ -29,7 +29,7 @@ module Sym
29
29
 
30
30
  configure do
31
31
  self.kind = 'sym'
32
- self.user = ENV['USER']
32
+ self.user = ENV.fetch('USER', nil)
33
33
  self.sub_section = 'generic-password'
34
34
  end
35
35
 
@@ -9,7 +9,7 @@ module Sym
9
9
  def output_proc
10
10
  Sym::App.log :info, "writing to a file #{opts[:output]}"
11
11
  ->(data) {
12
- ::File.open(opts[:output], 'w') { |f| f.write(data) }
12
+ ::File.write(opts[:output], data)
13
13
  }
14
14
  end
15
15
  end
@@ -69,7 +69,7 @@ module Sym
69
69
 
70
70
  KeySourceCheck.new(
71
71
  name: :env,
72
- output: ->(*, value) { ENV[value] if value =~ /^[a-zA-Z0-9_]+$/ }
72
+ output: ->(*, value) { value =~ /^[a-zA-Z0-9_]+$/ ? ENV[value] : nil }
73
73
  ),
74
74
 
75
75
  KeySourceCheck.new(
data/lib/sym/app.rb CHANGED
@@ -49,8 +49,8 @@ module Sym
49
49
  operation = command ? "to #{command.class.short_name.to_s.humanize.downcase}" : ''
50
50
  reason = exception.message if exception
51
51
 
52
- if exception && (config && config[:trace] || reason == 'Unknown Error')
53
- lines << "#{error_type.bold.red}:\n#{error_details.red.italic}\n" + ''.normal
52
+ if exception && ((config && config[:trace]) || reason == 'Unknown Error')
53
+ lines << ("#{error_type.bold.red}:\n#{error_details.red.italic}\n" + ''.normal)
54
54
  lines << exception.backtrace.join("\n").red.bold if config[:trace]
55
55
  lines << "\n"
56
56
  else
@@ -141,7 +141,7 @@ module Sym
141
141
 
142
142
  def editors_to_try
143
143
  [
144
- ENV['EDITOR'],
144
+ ENV.fetch('EDITOR', nil),
145
145
  '/usr/bin/vim',
146
146
  '/usr/local/bin/vim',
147
147
  '/bin/vim',
data/lib/sym/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Sym
2
- VERSION = '3.0.1'
2
+ VERSION = '3.0.2'
3
3
  DESCRIPTION = <<~eof
4
4
 
5
5
  Sym is a ruby library (gem) that offers both the command line interface
data/sym.gemspec CHANGED
@@ -66,4 +66,5 @@ Gem::Specification.new do |spec|
66
66
  spec.add_development_dependency 'simplecov'
67
67
  spec.add_development_dependency 'codecov'
68
68
  spec.add_development_dependency 'yard'
69
+ spec.metadata['rubygems_mfa_required'] = 'true'
69
70
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sym
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Gredeskoul
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-12 00:00:00.000000000 Z
11
+ date: 2022-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored2
@@ -316,9 +316,10 @@ executables:
316
316
  extensions: []
317
317
  extra_rdoc_files: []
318
318
  files:
319
- - ".circleci/config.yml"
320
319
  - ".document"
321
320
  - ".envrc"
321
+ - ".github/workflows/rubocop.yml"
322
+ - ".github/workflows/ruby.yml"
322
323
  - ".gitignore"
323
324
  - ".rspec"
324
325
  - ".rubocop.yml"
@@ -403,7 +404,8 @@ files:
403
404
  - sym.gemspec
404
405
  homepage: https://github.com/kigster/sym
405
406
  licenses: []
406
- metadata: {}
407
+ metadata:
408
+ rubygems_mfa_required: 'true'
407
409
  post_install_message: "\nThank you for installing Sym! \n\nBLOG POST\n=========\nhttp://kig.re/2017/03/10/dead-simple-encryption-with-sym.html\n\nBASH
408
410
  COMPLETION\n===============\nTo enable bash command line completion and install
409
411
  highly useful\ncommand line BASH wrapper 'symit', please run the following \ncommand
@@ -425,7 +427,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
425
427
  - !ruby/object:Gem::Version
426
428
  version: '0'
427
429
  requirements: []
428
- rubygems_version: 3.2.8
430
+ rubygems_version: 3.3.15
429
431
  signing_key:
430
432
  specification_version: 4
431
433
  summary: Dead-simple and easy to use encryption library on top of OpenSSL, offering
data/.circleci/config.yml DELETED
@@ -1,60 +0,0 @@
1
- # Ruby CircleCI 2.0 configuration file
2
- #
3
- # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
- #
5
- version: 2
6
- jobs:
7
- build:
8
- docker:
9
- # specify the version you desire here
10
- - image: circleci/ruby:2.6.2-node-browsers-legacy
11
- environment:
12
- TEST_DRB: false
13
-
14
- - image: memcached:latest
15
-
16
- working_directory: ~/repo
17
-
18
- steps:
19
- - checkout
20
- - restore_cache:
21
- keys:
22
- - v1-dependencies-{{ checksum "Gemfile" }}
23
-
24
- - run:
25
- name: install dependencies
26
- command: |
27
- bundle install --jobs=4 --retry=3 --path vendor/bundle
28
-
29
- - save_cache:
30
- paths:
31
- - ./vendor/bundle
32
- key: v1-dependencies-{{ checksum "Gemfile" }}
33
-
34
- - run:
35
- name: install dockerize
36
- command: wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
37
- environment:
38
- DOCKERIZE_VERSION: v0.3.0
39
-
40
- - run:
41
- name: Wait for the memcached
42
- command: dockerize -wait tcp://localhost:11211 -timeout 1m
43
-
44
- - run:
45
- name: RSpecs
46
- command: |
47
- export PATH=".:$PATH"
48
- bundle exec rspec --version
49
- bundle exec exe/sym --version
50
- # flush memcached
51
- printf "flush_all\r\nquit\r\n" | timeout -k 2 -s HUP 10 nc -G 4 127.0.0.1 11211 || true
52
- timeout -k 2 -s HUP 30 bundle exec rspec --order random --backtrace
53
-
54
- - run:
55
- name: Rubocop
56
- command: |
57
- bundle exec rubocop --version
58
- bundle exec rubocop
59
-
60
-