hilight 0.3.0 → 0.4.0

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: efb96144dc97389952d9826395882b4a1dd5d68d9e552ec4bf8e1e818a996ce0
4
- data.tar.gz: e35ecc2c389873b224a1e22ba5e603dafd54d79cab186b91e03d6560ceacb970
3
+ metadata.gz: d736a7509a700e30a1e2909c9d48f6b2ddb1427294829d2a5e585b5576c890f4
4
+ data.tar.gz: 396a4c18e2e7988bbc2be4047385df1e7e7b2e7ffb7273eddf7fc40301ed0ef2
5
5
  SHA512:
6
- metadata.gz: d34ec3fcbf06c6eee8525b9ed51066f9c057bb4c9574d0d4c8d574e2c56a4cebff69d8f5ae5df341982b72bd04e68ed2dcccc5f54c1bf33dee0c4b96a33d70ab
7
- data.tar.gz: 25306cc41aff58fac69477acb38596940f129081035629bf736a64c74d939266a0eb34325d90143e6ad6a6be74c3792799bf85c1dc02ce07847efe5b4559cc71
6
+ metadata.gz: 7672e10724d584fd27d7ae86a7f94e9b0f041414690d7c796964358f2bdd967940f59f1edcff6d5274dd4ec136626dd204edb36a36d688503aa77246a73bbcbf
7
+ data.tar.gz: ad6cbaad3a10760905228870f2e4865736ff6550e3b688c6e4e5eae045a79baa70e2f481f3ac6897f051ab8193364be42af4a4fb7af072ef1882e6025a9651c0
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behavior:
15
+ 1. Go to '...'
16
+ 2. Click on '....'
17
+ 3. Scroll down to '....'
18
+ 4. See error
19
+
20
+ **Expected behavior**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Screenshots**
24
+ If applicable, add screenshots to help explain your problem.
25
+
26
+ **Desktop (please complete the following information):**
27
+ - OS: [e.g. iOS]
28
+ - Browser [e.g. chrome, safari]
29
+ - Version [e.g. 22]
30
+
31
+ **Smartphone (please complete the following information):**
32
+ - Device: [e.g. iPhone6]
33
+ - OS: [e.g. iOS8.1]
34
+ - Browser [e.g. stock browser, safari]
35
+ - Version [e.g. 22]
36
+
37
+ **Additional context**
38
+ Add any other context about the problem here.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
data/Gemfile CHANGED
@@ -9,12 +9,12 @@ group :development do
9
9
  gem "rspec"
10
10
  gem 'rubocop'
11
11
  gem 'rubocop-rspec'
12
- gem 'simplecov'
13
- gem 'simplecov-console'
14
- gem 'yard'
15
12
  end
16
13
 
17
14
  group :development, optional: true do
15
+ gem 'simplecov'
16
+ gem 'simplecov-console'
17
+ gem 'yard'
18
18
  gem 'guard'
19
19
  gem 'guard-bundler'
20
20
  gem 'guard-rspec'
@@ -26,3 +26,11 @@ group :development, optional: true do
26
26
  gem 'pry-debundle'
27
27
  gem 'solargraph'
28
28
  end
29
+
30
+ group :test do
31
+ gem "bundler"
32
+ gem "rake"
33
+ gem "rspec"
34
+ gem 'rubocop'
35
+ gem 'rubocop-rspec'
36
+ end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hilight (0.3.0)
4
+ hilight (0.4.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -156,4 +156,4 @@ DEPENDENCIES
156
156
  yard
157
157
 
158
158
  BUNDLED WITH
159
- 2.0.1
159
+ 2.0.2
data/README.md CHANGED
@@ -1,39 +1,40 @@
1
1
  # Hilight
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/hilight`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Hilight will highlight CLI based applications based on regular expressions.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ Ever wanted colors in an app that doesn't support them?
6
6
 
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'hilight'
13
- ```
14
-
15
- And then execute:
7
+ hilight git -h
16
8
 
17
- $ bundle
9
+ - Supports regexp for the command, as well as strings.
10
+ - No outside dependencies.
11
+ - Can add syntaxes via serializable JSON or ruby.
18
12
 
19
- Or install it yourself as:
13
+ ## Installation
20
14
 
21
- $ gem install hilight
15
+ gem install hilight
22
16
 
23
17
  ## Usage
24
18
 
25
- TODO: Write usage instructions here
19
+ Basic highlighting can be done with:
26
20
 
27
- ## Development
21
+ hilight command
28
22
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
23
+ It can be used in a piped expression.
30
24
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
25
+ git -h | hilight
32
26
 
33
27
  ## Contributing
34
28
 
35
29
  Bug reports and pull requests are welcome on GitHub at https://github.com/erniebrodeur/hilight. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
30
 
31
+ ## Pull Requests
32
+
33
+ Pull requests that do not pass current rspecs or do not contain coverage of the code in the pull request are, most likely, going to be rejected.
34
+
35
+ If you want to add a theme/change an existing one, please submit all updates
36
+ in the JSON form of the quilt.
37
+
37
38
  ## Code of Conduct
38
39
 
39
40
  Everyone interacting in the Hilight project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/erniebrodeur/hilight/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1 @@
1
+ theme: jekyll-theme-hacker
@@ -10,7 +10,7 @@ monokai_hex_colors = colors.map { |e| [e['name'], e['settings']['foreground']] }
10
10
  monokai_hex_colors.delete_if { |k, v| k.nil? || v.nil? }
11
11
 
12
12
  String.define_method(:to_rgb) { [self[1..2], self[2..3], self[4..5]].map { |s| s.to_i(16) }.join(";") }
13
- output = monokai_hex_colors.map { |k,v| [k,v.to_rgb] }.to_h
13
+ output = monokai_hex_colors.map { |k, v| [k, v.to_rgb] }.to_h
14
14
 
15
15
  puts Oj.dump output, indent: 2
16
16
 
@@ -19,4 +19,5 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 2.0"
22
+ spec.add_development_dependency "rake"
22
23
  end
@@ -2,7 +2,6 @@ require 'hilight/fabric'
2
2
  require 'hilight/pair'
3
3
  require 'hilight/pattern'
4
4
  require 'hilight/quilt'
5
- require 'hilight/quilts'
6
5
  require 'hilight/quilts/default'
7
6
  require 'hilight/quilts/help'
8
7
  require 'hilight/quilts/rspec'
@@ -1,28 +1,30 @@
1
- class Hilight::Fabric
2
- attr_accessor :regexps
3
- attr_accessor :match_pattern
1
+ module Hilight
2
+ class Fabric
3
+ attr_accessor :regexps
4
+ attr_accessor :match_pattern
4
5
 
5
- def initialize(match_pattern, regexps)
6
- @regexps = regexps
7
- @match_pattern = match_pattern
8
- end
6
+ def initialize(match_pattern, regexps)
7
+ @regexps = regexps
8
+ @match_pattern = match_pattern
9
+ end
9
10
 
10
- def match?(string)
11
- raise ArgumentError, "#{string} is not a kind of String" unless string.is_a? String
11
+ def match?(string)
12
+ raise ArgumentError, "#{string} is not a kind of String" unless string.is_a? String
12
13
 
13
- case match_pattern
14
- when Symbol then (match_pattern.to_s == string)
15
- when String then (match_pattern == string)
16
- when Regexp then (match_pattern.match? string.to_s)
17
- else false
14
+ case match_pattern
15
+ when Symbol then (match_pattern.to_s == string)
16
+ when String then (match_pattern == string)
17
+ when Regexp then (match_pattern.match? string.to_s)
18
+ else false
19
+ end
18
20
  end
19
- end
20
21
 
21
- def transform(string)
22
- Hilight.transform string, regexps
23
- end
22
+ def transform(string)
23
+ Hilight.transform string, regexps
24
+ end
24
25
 
25
- def to_h
26
- { match_pattern: match_pattern, regexps: regexps.map(&:to_s) }
26
+ def to_h
27
+ { match_pattern: match_pattern, regexps: regexps.map(&:to_s) }
28
+ end
27
29
  end
28
30
  end
@@ -1,3 +1,3 @@
1
1
  module Hilight
2
- Pair = Struct.new :verb, :code
2
+ Pair = Struct.new :verb, :code
3
3
  end
@@ -8,7 +8,7 @@ module Hilight
8
8
  /'(?<string>.*?)'/
9
9
  ]
10
10
  },
11
- 'pattern' => { "string" => "31", "comment" => "32" }
11
+ 'pattern' => { "string" => "33", "comment" => "32" }
12
12
  )
13
13
  end
14
14
  end
@@ -1,3 +1,3 @@
1
1
  module Hilight
2
- VERSION = "0.3.0".freeze
2
+ VERSION = "0.4.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hilight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernie Brodeur
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-07 00:00:00.000000000 Z
11
+ date: 2019-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  description: hilight all the things.
28
42
  email:
29
43
  - ebrodeur@ujami.net
@@ -32,6 +46,8 @@ executables:
32
46
  extensions: []
33
47
  extra_rdoc_files: []
34
48
  files:
49
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
50
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
35
51
  - ".gitignore"
36
52
  - ".rspec"
37
53
  - ".rubocop.yml"
@@ -42,6 +58,7 @@ files:
42
58
  - Guardfile
43
59
  - README.md
44
60
  - Rakefile
61
+ - _config.yml
45
62
  - bin/add
46
63
  - bin/add_theme
47
64
  - bin/console
@@ -55,7 +72,6 @@ files:
55
72
  - lib/hilight/pair.rb
56
73
  - lib/hilight/pattern.rb
57
74
  - lib/hilight/quilt.rb
58
- - lib/hilight/quilts.rb
59
75
  - lib/hilight/quilts/default.rb
60
76
  - lib/hilight/quilts/help.rb
61
77
  - lib/hilight/quilts/rspec.rb
@@ -79,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
95
  - !ruby/object:Gem::Version
80
96
  version: '0'
81
97
  requirements: []
82
- rubygems_version: 3.0.1
98
+ rubygems_version: 3.0.3
83
99
  signing_key:
84
100
  specification_version: 4
85
101
  summary: hilight
@@ -1,2 +0,0 @@
1
- module Hilight::Quilts
2
- end