consenter 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1e774a27b5714f9f501f3d161e025a4cfe2f2b6ab597e42970c20c9bb99dee8
4
- data.tar.gz: ea9d3733464f0cffdb4f0b5823b61f767241faf9da1e293aae835aaf64fadb76
3
+ metadata.gz: 5cb3b2767ec661ecf84d1179ad9469a981ecbd61e7a36e9fc77481c3962e9f04
4
+ data.tar.gz: 6de44fa228f445a7557d75f60fff0e23de5d37094aadcf6e612521f3fee423fc
5
5
  SHA512:
6
- metadata.gz: 7934059a90cfdd20eb51f5c7ebddf7f0b6247387c9a40a267db0bbbf79e0f38338684f3a336034a6f212c456dee49608d0b663477233ee06c6e0f4fb0ec0d6d2
7
- data.tar.gz: 29d1811a04687390a8ba1ed0c6be170db7b516be102a6dad002bc0d0ddf1bbffe95529529231ef1fc3489e49ee05f84fbf81c1de0ebabe42f615127066197dcb
6
+ metadata.gz: 4149d2f81d9bacbd7da07f044e3cee099c637322cd131aea6873cc52a0cadb44a2632aeb356c8d6f03674e33292f0a9386310fab2bd4a94fa3387c1f565bb3c1
7
+ data.tar.gz: 7c5e4569486c30ae91ae3c536bd651a346f8783697a511cad808f2892c6c8cd76f1dcf81b2710ad27f17cbb9881b88961eb07e2c9d0291f9cd4946e5e7e58047
@@ -1,2 +1,4 @@
1
1
  Style/Documentation:
2
2
  Enabled: false
3
+ Style/FrozenStringLiteralComment:
4
+ Enabled: false
data/Rakefile CHANGED
@@ -1,4 +1,20 @@
1
+ # rubocop:disable Style/SymbolArray
2
+ # rubocop:disable Style/HashSyntax
3
+
1
4
  require 'bundler/gem_tasks'
5
+
6
+ task :validate_gemspec do
7
+ Bundler.load_gemspec('consenter.gemspec').validate
8
+ end
9
+
10
+ task :version => :validate_gemspec do
11
+ puts Consenter::VERSION
12
+ end
13
+
14
+ require 'rubocop/rake_task'
15
+
16
+ RuboCop::RakeTask.new(:rubocop)
17
+
2
18
  require 'rake/testtask'
3
19
 
4
20
  Rake::TestTask.new(:test) do |t|
@@ -7,16 +23,11 @@ Rake::TestTask.new(:test) do |t|
7
23
  t.test_files = FileList['test/**/*_test.rb']
8
24
  end
9
25
 
10
- # rubocop:disable Style/HashSyntax
11
-
12
- task :validate_gemspec do
13
- Bundler.load_gemspec('consenter.gemspec').validate
14
- end
26
+ task :default => [:rubocop, :test]
15
27
 
16
- task :version => :validate_gemspec do
17
- puts Consenter::VERSION
18
- end
28
+ task :documentation
19
29
 
20
- task :default => :test
30
+ Rake::Task['build'].enhance([:default, :documentation])
21
31
 
22
32
  # rubocop:enable Style/HashSyntax
33
+ # rubocop:enable Style/SymbolArray
data/bin/setup CHANGED
@@ -3,9 +3,10 @@ set -euo pipefail
3
3
  IFS=$'\n\t'
4
4
  set -vx
5
5
 
6
- rbenv install -s
6
+ [ -f Brewfile ] && brew bundle
7
+ [ -f .ruby-version ] && rbenv install -s
7
8
  gem install --conservative bundler
8
- bundle install
9
+ [ -f Gemfile ] && bundle install
9
10
 
10
11
  set +vxeu
11
12
  echo
@@ -1,10 +1,9 @@
1
-
2
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'consenter/version'
5
4
 
6
5
  Gem::Specification.new do |spec|
7
- spec.name = 'consenter'
6
+ spec.name = Consenter::NAME
8
7
  spec.version = Consenter::VERSION
9
8
  spec.authors = ['Peter Vandenberk']
10
9
  spec.email = ['pvandenberk@mac.com']
@@ -12,8 +11,9 @@ Gem::Specification.new do |spec|
12
11
  spec.summary = 'Idiomatic Enumerable extension to filter by consent'
13
12
  spec.description = 'Ask for consent for each element in an Enumerable'
14
13
  spec.homepage = 'https://github.com/pvdb/consenter'
14
+ spec.license = 'MIT'
15
15
 
16
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
16
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
17
17
  `git ls-files -z`
18
18
  .split("\x0")
19
19
  .reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -22,8 +22,8 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
24
 
25
- spec.add_development_dependency 'bundler', '~> 1.16'
26
- spec.add_development_dependency 'minitest', '~> 5.0'
27
- spec.add_development_dependency 'pry', '~> 0.11'
28
- spec.add_development_dependency 'rake', '~> 10.0'
25
+ spec.add_development_dependency 'bundler'
26
+ spec.add_development_dependency 'pry'
27
+ spec.add_development_dependency 'rake'
28
+ spec.add_development_dependency 'rubocop'
29
29
  end
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ #
4
+ # this script is inspired by the various incarnations of
5
+ # a similar `pick` utility developed by Kernighan & Pike
6
+ # in their seminal "The UNIX Programming Environment"...
7
+ #
8
+
9
+ lib = File.expand_path('../lib', __dir__)
10
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
11
+ require 'consenter'
12
+
13
+ nul = ARGV.delete('-0') || ARGV.delete('-print0')
14
+
15
+ consented = ARGF.lazy.map(&:chomp).each_consented('Pick "%s"?').to_a
16
+
17
+ if nul
18
+ print consented.join("\0")
19
+ else
20
+ puts consented
21
+ end
22
+
23
+ # That's all Folks!
@@ -1,3 +1,4 @@
1
1
  class Consenter
2
- VERSION = '1.0.3'.freeze
2
+ NAME = 'consenter'.freeze
3
+ VERSION = '1.0.4'.freeze
3
4
  end
metadata CHANGED
@@ -1,75 +1,76 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: consenter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Vandenberk
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-07 00:00:00.000000000 Z
11
+ date: 2018-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.16'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.16'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: minitest
28
+ name: pry
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '5.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '5.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: pry
42
+ name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '0.11'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '0.11'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rake
56
+ name: rubocop
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '0'
69
69
  description: Ask for consent for each element in an Enumerable
70
70
  email:
71
71
  - pvandenberk@mac.com
72
- executables: []
72
+ executables:
73
+ - pick
73
74
  extensions: []
74
75
  extra_rdoc_files: []
75
76
  files:
@@ -84,10 +85,12 @@ files:
84
85
  - bin/console
85
86
  - bin/setup
86
87
  - consenter.gemspec
88
+ - exe/pick
87
89
  - lib/consenter.rb
88
90
  - lib/consenter/version.rb
89
91
  homepage: https://github.com/pvdb/consenter
90
- licenses: []
92
+ licenses:
93
+ - MIT
91
94
  metadata: {}
92
95
  post_install_message:
93
96
  rdoc_options: []