tag_columns 0.1.9 → 0.1.10

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: 1bb5849e125d7d342653151b9376d43d904867a31c05df4716efde6f7a91d608
4
- data.tar.gz: 55a5b086ac67b2cde68c7befd6707d084d49e388357a940d21e1500d764c8a2e
3
+ metadata.gz: 6ff159c5c446ddf8b7ed9c075a5bdc200d86f752be429de79b0fcfc96460d437
4
+ data.tar.gz: 6c94c7984d4edb22400d3a2c547d20217d1b6985f495aa56884695283b936655
5
5
  SHA512:
6
- metadata.gz: f6fc69ae96f44815701774dee9b58fb72d51080c0c5930ddefa1cd2ee14a9ac444374cf1939b5a7133fdd56341a6be6c9410892476b6f6e83ee29c90c6115436
7
- data.tar.gz: 46f4f957e0f95c4d4177345f7bcffa3ce46416f3d9a6d93eb47e4e6c619dabe423a32ab31e0e5fcaddeb1a7f71314f37d107f99e63643c550ab1f2259a8c7c2f
6
+ metadata.gz: d57ab0bf42cc73ece60d40442fa009365246951b05bed00862dcba15a894e867c6cb8df7bcea0711123c05be31a9516e605275940e11743b296c2c92a4176a03
7
+ data.tar.gz: ae6222763a85f42eaea517c81bb065d81b3ccbf77a928948beb9f77c553b0d799c5f150473a18d4cc72f3bcdc981a1bc763bdb281c9622faabbf55fb325e8a8e
data/Gemfile.lock CHANGED
@@ -1,41 +1,41 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tag_columns (0.1.9)
4
+ tag_columns (0.1.10)
5
5
  activesupport
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (6.0.3.2)
10
+ activesupport (6.1.2.1)
11
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
- i18n (>= 0.7, < 2)
13
- minitest (~> 5.1)
14
- tzinfo (~> 1.1)
15
- zeitwerk (~> 2.2, >= 2.2.2)
16
- ast (2.4.1)
17
- binding_of_caller (0.8.0)
12
+ i18n (>= 1.6, < 2)
13
+ minitest (>= 5.1)
14
+ tzinfo (~> 2.0)
15
+ zeitwerk (~> 2.3)
16
+ ast (2.4.2)
17
+ binding_of_caller (1.0.0)
18
18
  debug_inspector (>= 0.0.1)
19
19
  byebug (11.1.3)
20
20
  coderay (1.1.3)
21
- concurrent-ruby (1.1.7)
21
+ concurrent-ruby (1.1.8)
22
22
  coveralls (0.8.23)
23
23
  json (>= 1.8, < 3)
24
24
  simplecov (~> 0.16.1)
25
25
  term-ansicolor (~> 1.3)
26
26
  thor (>= 0.19.4, < 2.0)
27
27
  tins (~> 1.6)
28
- debug_inspector (0.0.3)
29
- docile (1.3.2)
30
- i18n (1.8.5)
28
+ debug_inspector (1.0.0)
29
+ docile (1.3.5)
30
+ i18n (1.8.8)
31
31
  concurrent-ruby (~> 1.0)
32
32
  interception (0.5)
33
- json (2.3.1)
33
+ json (2.5.1)
34
34
  method_source (1.0.0)
35
- minitest (5.14.1)
35
+ minitest (5.14.3)
36
36
  os (1.1.1)
37
- parallel (1.19.2)
38
- parser (2.7.1.4)
37
+ parallel (1.20.1)
38
+ parser (3.0.0.0)
39
39
  ast (~> 2.4.1)
40
40
  pry (0.13.1)
41
41
  coderay (~> 1.1)
@@ -46,8 +46,8 @@ GEM
46
46
  pry-rescue (1.5.2)
47
47
  interception (>= 0.5)
48
48
  pry (>= 0.12.0)
49
- pry-stack_explorer (0.5.1)
50
- binding_of_caller (~> 0.7)
49
+ pry-stack_explorer (0.6.1)
50
+ binding_of_caller (~> 1.0)
51
51
  pry (~> 0.13)
52
52
  pry-test (0.6.6)
53
53
  os
@@ -56,44 +56,44 @@ GEM
56
56
  pry-rescue
57
57
  pry-stack_explorer
58
58
  rainbow (3.0.0)
59
- rake (13.0.1)
60
- regexp_parser (1.7.1)
59
+ rake (13.0.3)
60
+ regexp_parser (2.0.3)
61
61
  rexml (3.2.4)
62
- rubocop (0.89.1)
62
+ rubocop (1.8.1)
63
63
  parallel (~> 1.10)
64
- parser (>= 2.7.1.1)
64
+ parser (>= 3.0.0.0)
65
65
  rainbow (>= 2.2.2, < 4.0)
66
- regexp_parser (>= 1.7)
66
+ regexp_parser (>= 1.8, < 3.0)
67
67
  rexml
68
- rubocop-ast (>= 0.3.0, < 1.0)
68
+ rubocop-ast (>= 1.2.0, < 2.0)
69
69
  ruby-progressbar (~> 1.7)
70
- unicode-display_width (>= 1.4.0, < 2.0)
71
- rubocop-ast (0.3.0)
72
- parser (>= 2.7.1.4)
73
- rubocop-performance (1.7.1)
74
- rubocop (>= 0.82.0)
75
- ruby-progressbar (1.10.1)
70
+ unicode-display_width (>= 1.4.0, < 3.0)
71
+ rubocop-ast (1.4.1)
72
+ parser (>= 2.7.1.5)
73
+ rubocop-performance (1.9.2)
74
+ rubocop (>= 0.90.0, < 2.0)
75
+ rubocop-ast (>= 0.4.0)
76
+ ruby-progressbar (1.11.0)
76
77
  simplecov (0.16.1)
77
78
  docile (~> 1.1)
78
79
  json (>= 1.8, < 3)
79
80
  simplecov-html (~> 0.10.0)
80
81
  simplecov-html (0.10.2)
81
- standard (0.5.2)
82
- rubocop (~> 0.89.1)
83
- rubocop-performance (~> 1.7.1)
82
+ standard (0.12.0)
83
+ rubocop (= 1.8.1)
84
+ rubocop-performance (= 1.9.2)
84
85
  standardrb (1.0.0)
85
86
  standard
86
87
  sync (0.5.0)
87
88
  term-ansicolor (1.7.1)
88
89
  tins (~> 1.0)
89
- thor (1.0.1)
90
- thread_safe (0.3.6)
91
- tins (1.25.0)
90
+ thor (1.1.0)
91
+ tins (1.28.0)
92
92
  sync
93
- tzinfo (1.2.7)
94
- thread_safe (~> 0.1)
95
- unicode-display_width (1.7.0)
96
- zeitwerk (2.4.0)
93
+ tzinfo (2.0.4)
94
+ concurrent-ruby (~> 1.0)
95
+ unicode-display_width (2.0.0)
96
+ zeitwerk (2.4.2)
97
97
 
98
98
  PLATFORMS
99
99
  ruby
@@ -106,4 +106,4 @@ DEPENDENCIES
106
106
  tag_columns!
107
107
 
108
108
  BUNDLED WITH
109
- 1.17.2
109
+ 2.1.4
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Lines of Code](http://img.shields.io/badge/lines_of_code-88-brightgreen.svg?style=flat)](http://blog.codinghorror.com/the-best-code-is-no-code-at-all/)
1
+ [![Lines of Code](http://img.shields.io/badge/lines_of_code-89-brightgreen.svg?style=flat)](http://blog.codinghorror.com/the-best-code-is-no-code-at-all/)
2
2
  [![Maintainability](https://api.codeclimate.com/v1/badges/7503486b1bb494b5d976/maintainability)](https://codeclimate.com/github/hopsoft/tag_columns/maintainability)
3
3
  [![Build Status](http://img.shields.io/travis/hopsoft/tag_columns.svg?style=flat)](https://travis-ci.org/hopsoft/tag_columns)
4
4
  [![Coverage Status](https://img.shields.io/coveralls/hopsoft/tag_columns.svg?style=flat)](https://coveralls.io/r/hopsoft/tag_columns?branch=master)
data/bin/loc ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bash
2
+
3
+ cloc --exclude-dir=node_modules,test --include-ext=rb,js .
data/lib/tag_columns.rb CHANGED
@@ -7,6 +7,7 @@ module TagColumns
7
7
 
8
8
  module ClassMethods
9
9
  def tag_columns_sanitize_list(values = [])
10
+ return [] if values.nil?
10
11
  values.select(&:present?).map(&:to_s).uniq.sort
11
12
  end
12
13
 
@@ -85,13 +86,13 @@ module TagColumns
85
86
 
86
87
  define_method :"has_any_#{method_name}?" do |*values|
87
88
  values = self.class.tag_columns_sanitize_list(values)
88
- existing = self.class.tag_columns_sanitize_list(self[column_name] || [])
89
+ existing = self.class.tag_columns_sanitize_list(self[column_name])
89
90
  (values & existing).present?
90
91
  end
91
92
 
92
93
  define_method :"has_all_#{method_name}?" do |*values|
93
94
  values = self.class.tag_columns_sanitize_list(values)
94
- existing = self.class.tag_columns_sanitize_list(self[column_name] || [])
95
+ existing = self.class.tag_columns_sanitize_list(self[column_name])
95
96
  (values & existing).size == values.size
96
97
  end
97
98
 
@@ -1,3 +1,3 @@
1
1
  module TagColumns
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.10"
3
3
  end
data/tags ADDED
@@ -0,0 +1,12 @@
1
+ !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
2
+ !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
3
+ !_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
4
+ !_TAG_PROGRAM_NAME Exuberant Ctags //
5
+ !_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
6
+ !_TAG_PROGRAM_VERSION 5.8 //
7
+ ClassMethods lib/tag_columns.rb /^ module ClassMethods$/;" m class:TagColumns
8
+ TagColumns lib/tag_columns.rb /^module TagColumns$/;" m
9
+ TagColumns lib/tag_columns/version.rb /^module TagColumns$/;" m
10
+ TestTagColumns test/test_tag_columns.rb /^class TestTagColumns < PryTest::Test$/;" c
11
+ tag_columns lib/tag_columns.rb /^ def tag_columns(*column_names)$/;" f class:TagColumns.ClassMethods
12
+ tag_columns_sanitize_list lib/tag_columns.rb /^ def tag_columns_sanitize_list(values = [])$/;" f class:TagColumns.ClassMethods
@@ -4,8 +4,30 @@ Coveralls.wear!
4
4
  SimpleCov.command_name "pry-test"
5
5
  require_relative "../lib/tag_columns"
6
6
 
7
+ class TagColumnsTester
8
+ include TagColumns
9
+ end
10
+
7
11
  class TestTagColumns < PryTest::Test
8
- test "stub" do
9
- assert true
12
+ include TagColumns
13
+
14
+ test "tag_columns_sanitize_list with no arg" do
15
+ assert TagColumnsTester.tag_columns_sanitize_list == []
16
+ end
17
+
18
+ test "tag_columns_sanitize_list with empty list arg" do
19
+ assert TagColumnsTester.tag_columns_sanitize_list([]) == []
20
+ end
21
+
22
+ test "tag_columns_sanitize_list with nil arg" do
23
+ assert TagColumnsTester.tag_columns_sanitize_list(nil) == []
24
+ end
25
+
26
+ test "tag_columns_sanitize_list with upper case list" do
27
+ assert TagColumnsTester.tag_columns_sanitize_list(%w[C B A]) == %w[A B C]
28
+ end
29
+
30
+ test "tag_columns_sanitize_list with lower case list" do
31
+ assert TagColumnsTester.tag_columns_sanitize_list(%w[c b a]) == %w[a b c]
10
32
  end
11
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tag_columns
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Hopkins
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-27 00:00:00.000000000 Z
11
+ date: 2021-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -80,7 +80,7 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- description:
83
+ description:
84
84
  email:
85
85
  - natehop@gmail.com
86
86
  executables: []
@@ -93,17 +93,19 @@ files:
93
93
  - README.md
94
94
  - Rakefile
95
95
  - bin/console
96
+ - bin/loc
96
97
  - bin/setup
97
98
  - bin/standardize
98
99
  - lib/tag_columns.rb
99
100
  - lib/tag_columns/version.rb
100
101
  - tag_columns.gemspec
102
+ - tags
101
103
  - test/test_tag_columns.rb
102
104
  homepage: https://github.com/hopsoft/tag_columns
103
105
  licenses:
104
106
  - MIT
105
107
  metadata: {}
106
- post_install_message:
108
+ post_install_message:
107
109
  rdoc_options: []
108
110
  require_paths:
109
111
  - lib
@@ -118,8 +120,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
120
  - !ruby/object:Gem::Version
119
121
  version: '0'
120
122
  requirements: []
121
- rubygems_version: 3.0.3
122
- signing_key:
123
+ rubygems_version: 3.1.2
124
+ signing_key:
123
125
  specification_version: 4
124
126
  summary: Fast & simple Rails ActiveRecord model tagging using PostgreSQL's Array datatype
125
127
  test_files: