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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 132bd553ebe8639ffa00c6c6662655a9d3356c54676630dd70696b844ab31f94
4
- data.tar.gz: 6bbeac0a7ac6394dedeba49290344f466063c46a30651bd8d918d75e7ea7937c
3
+ metadata.gz: '08b1ff0198e0f6f389ee13707020581608ac96eadff6cb34a0e47821aa6d03d6'
4
+ data.tar.gz: b9d3e3b3d42cb76e7df568da374488b0c8047d19cc1985f38a34021e5720fd22
5
5
  SHA512:
6
- metadata.gz: 3bbd652dde4ac9056e2082e21b376952787c6881885d5059a36ee3a8e0a5bbf2f0becc0b451dc92bbd2fe5d4439b0c2e0f83d2da1289d56f07542cbd964c289f
7
- data.tar.gz: 31c8988bfc69608a44795104df41384699448b4d9a1c2ebb932d9cae854240dc27741eec549386672834df60c60f766ee41231e3908b1bc8e3ae2c8b0af81678
6
+ metadata.gz: 1a9e8cc02d838eac96ab0952f009d0281104fd63ee25e8846a76143f56be0d64a8704abb8a08d579b2009fb010f94e7914ef2395457f05861d1d734992cf24e6
7
+ data.tar.gz: 9b857bd50998ef0e71696c78fe77e89262545c94e02b8f67008a9f87d46887bc6387e08feda977be6f4c1829c05ff1ea5212207b0234217004fee17491735559
@@ -1,12 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- linter (0.1.2)
4
+ linter (0.1.4)
5
+ colorize (~> 0.8)
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
8
9
  specs:
9
10
  coderay (1.1.3)
11
+ colorize (0.8.1)
10
12
  diff-lcs (1.3)
11
13
  method_source (1.0.0)
12
14
  pry (0.13.1)
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
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative "../lib/linter"
3
+
4
+ Linter::CLI.analyze(ARGV[0])
@@ -1,10 +1,19 @@
1
- require "linter/version"
2
- require "linter/base_association"
3
- require "linter/gender_association"
4
- require "linter/pronoun_association"
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Linter
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -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.3
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-04 00:00:00.000000000 Z
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