linter 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -1
- data/README.md +10 -0
- data/bin/linter +4 -0
- data/lib/linter.rb +13 -4
- data/lib/linter/cli.rb +12 -0
- data/lib/linter/version.rb +1 -1
- data/linter.gemspec +2 -1
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08b1ff0198e0f6f389ee13707020581608ac96eadff6cb34a0e47821aa6d03d6'
|
4
|
+
data.tar.gz: b9d3e3b3d42cb76e7df568da374488b0c8047d19cc1985f38a34021e5720fd22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a9e8cc02d838eac96ab0952f009d0281104fd63ee25e8846a76143f56be0d64a8704abb8a08d579b2009fb010f94e7914ef2395457f05861d1d734992cf24e6
|
7
|
+
data.tar.gz: 9b857bd50998ef0e71696c78fe77e89262545c94e02b8f67008a9f87d46887bc6387e08feda977be6f4c1829c05ff1ea5212207b0234217004fee17491735559
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -27,6 +27,16 @@ Or install it yourself as:
|
|
27
27
|
text = 'Collaborate closely with the manager. Analytics all the way.'
|
28
28
|
Linter::GenderAssociation.analyze(text)
|
29
29
|
# #<OpenStruct feminine_coded_word_counts={"collaborate" => 1}, masculine_coded_word_counts={"analytics" => 1}, trend="neutral">
|
30
|
+
text = 'He was working at the bar.'
|
31
|
+
Linter::PronounAssociation.analyze(text)
|
32
|
+
```
|
33
|
+
|
34
|
+
## CLI Usage
|
35
|
+
|
36
|
+
```console
|
37
|
+
linter example.md
|
38
|
+
#<OpenStruct feminine_coded_word_counts={}, masculine_coded_word_counts={"analytical"=>1}, trend="strongly masculine-coded">
|
39
|
+
#<OpenStruct feminine_coded_word_counts={}, masculine_coded_word_counts={"he"=>1}, trend="masculine-coded">
|
30
40
|
```
|
31
41
|
|
32
42
|
## Development
|
data/bin/linter
ADDED
data/lib/linter.rb
CHANGED
@@ -1,10 +1,19 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
require_relative "linter/version"
|
2
|
+
require_relative "linter/base_association"
|
3
|
+
require_relative "linter/gender_association"
|
4
|
+
require_relative "linter/pronoun_association"
|
5
|
+
require_relative "linter/cli"
|
5
6
|
|
6
7
|
require 'yaml'
|
8
|
+
require 'colorize'
|
9
|
+
require "ostruct"
|
7
10
|
|
8
11
|
module Linter
|
9
12
|
class Error < StandardError; end
|
13
|
+
|
14
|
+
class << self
|
15
|
+
def cli_analyze(file_name)
|
16
|
+
Linter::CLI.analyze(file_name)
|
17
|
+
end
|
18
|
+
end
|
10
19
|
end
|
data/lib/linter/cli.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
module Linter
|
2
|
+
class CLI
|
3
|
+
def self.analyze(file_name)
|
4
|
+
# first read the file
|
5
|
+
text = File.read(file_name)
|
6
|
+
result = Linter::GenderAssociation.analyze(text)
|
7
|
+
puts result.inspect.colorize(:red)
|
8
|
+
result = Linter::PronounAssociation.analyze(text)
|
9
|
+
puts result.inspect.colorize(:red)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/lib/linter/version.rb
CHANGED
data/linter.gemspec
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
lib = File.expand_path("../lib", __FILE__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require "linter/version"
|
@@ -40,4 +39,6 @@ Gem::Specification.new do |spec|
|
|
40
39
|
spec.add_development_dependency "rake", "~> 10.0"
|
41
40
|
spec.add_development_dependency "rspec", "~> 3.0"
|
42
41
|
spec.add_development_dependency 'pry', '~> 0.13'
|
42
|
+
|
43
|
+
spec.add_dependency('colorize', '~> 0.8')
|
43
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lien van den steen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.13'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: colorize
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.8'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.8'
|
69
83
|
description:
|
70
84
|
email:
|
71
85
|
- lienvandensteen@gmail.com
|
@@ -85,11 +99,13 @@ files:
|
|
85
99
|
- README.md
|
86
100
|
- Rakefile
|
87
101
|
- bin/console
|
102
|
+
- bin/linter
|
88
103
|
- bin/setup
|
89
104
|
- data/gender_association_wordlist.yml
|
90
105
|
- data/pronoun_association_wordlist.yml
|
91
106
|
- lib/linter.rb
|
92
107
|
- lib/linter/base_association.rb
|
108
|
+
- lib/linter/cli.rb
|
93
109
|
- lib/linter/gender_association.rb
|
94
110
|
- lib/linter/pronoun_association.rb
|
95
111
|
- lib/linter/version.rb
|