hamlit 2.13.2-java → 2.14.0-java

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: 9c157cfa69dafaafe52824f77e7d8b42678ba3710dd09bbb5808a714cfda759a
4
- data.tar.gz: 1e734a39a56edf5cd3898d9245506dd865e15734cc590c990c72350f20e48ae6
3
+ metadata.gz: 9163c80fc74063f1aab7a0b3e70dcfc6e2287394403430984f6a81c6889e1a6f
4
+ data.tar.gz: fa89e8eccdc02d3e60b6e5978663ac91a7b1ee491903017fb2e1233168992bd1
5
5
  SHA512:
6
- metadata.gz: 6ab77e54fe32548c307d1f1fef0356915be976313721ec70bd33877f5063f5a953c00b722b267af01668ea33c05daef9e07d8c7732936126ca1d06791c81161f
7
- data.tar.gz: 57aea5e83ec4a34fd5bd41878b687f13e987c4a2d8a7bec1b7823d86755332f49084d20a61a88ecbdadd7278d9ef1517a871b1b8a338cad02f765bc4862f56d4
6
+ metadata.gz: 455784941d0c600eee62032bba661c0aee671f10883b56509200635f4f3cf128f783c1a3184089ad9260ed362e5c720efe28b10518ac9a5f146c8d138a35e83e
7
+ data.tar.gz: ab336937b54d70b05b071b707aeafe811bf7b2ce126f804d50ed34ea60695249b517e49a6b1d498e6d29cc67ed170d5609148ae232aadde322ce45a5145676eb
@@ -21,10 +21,16 @@ jobs:
21
21
  - ruby:2.5
22
22
  - ruby:2.6
23
23
  - ruby:2.7
24
+ - ruby:3.0
24
25
  # TODO: add jruby and truffleruby
25
26
  steps:
26
27
  - uses: actions/checkout@v2
28
+ - uses: actions/cache@v2
29
+ with:
30
+ path: vendor/bundle
31
+ key: ${{ runner.os }}-${{ matrix.ruby }}-gems-${{ hashFiles('**/Gemfile.lock') }}
32
+ restore-keys: ${{ runner.os }}-gems-
27
33
  - run: apt-get update && apt-get install -y nodejs # For execjs
28
34
  - name: bundle install
29
- run: bundle install -j$(nproc) --retry 3
35
+ run: bundle config path vendor/bundle && bundle install -j$(nproc) --retry 3
30
36
  - run: bundle exec rake test
data/.gitignore CHANGED
@@ -13,6 +13,6 @@
13
13
  *.bundle
14
14
  *.so
15
15
  *.su
16
- *.o
17
16
  *.a
17
+ *.o
18
18
  *.swp
data/CHANGELOG.md CHANGED
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file. This
4
4
  project adheres to [Semantic Versioning](http://semver.org/). This change log is based upon
5
5
  [keep-a-changelog](https://github.com/olivierlacan/keep-a-changelog).
6
6
 
7
+ ## [2.14.0](https://github.com/k0kubun/hamlit/compare/v2.13.2...v2.14.0) - 2021-01-07
8
+
9
+ ### Changed
10
+
11
+ - CLI changes
12
+ - Remove `-c` shorthand of `--color`.
13
+ - Make `--color` default. Please use `--no-color` to disable it.
14
+ - `--color` uses IRB instead of Pry for syntax highlight.
15
+ - Syntax highlight of `hamlit compile` is enabled only with IRB of Ruby 2.7+.
16
+ - Syntax highlight of `hamlit parse` / `hamlit temple` is enabled only with IRB of Ruby 3.1+.
17
+
7
18
  ## [2.13.2](https://github.com/k0kubun/hamlit/compare/v2.13.1...v2.13.2) - 2020-12-27
8
19
 
9
20
  ### Added
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/hamlit.svg)](http://badge.fury.io/rb/hamlit)
4
4
  [![Build Status](https://travis-ci.org/k0kubun/hamlit.svg?branch=master)](https://travis-ci.org/k0kubun/hamlit)
5
+ [![test](https://github.com/k0kubun/hamlit/workflows/test/badge.svg)](https://github.com/k0kubun/hamlit/actions?query=workflow%3Atest)
5
6
 
6
7
  Hamlit is a high performance [Haml](https://github.com/haml/haml) implementation.
7
8
 
data/lib/hamlit/cli.rb CHANGED
@@ -18,20 +18,20 @@ module Hamlit
18
18
 
19
19
  desc 'compile HAML', 'Show compile result'
20
20
  option :actionview, type: :boolean, default: false, aliases: %w[-a]
21
- option :color, type: :boolean, default: false, aliases: %w[-c]
21
+ option :color, type: :boolean, default: true
22
22
  def compile(file)
23
23
  code = generate_code(file)
24
24
  puts_code(code, color: options[:color])
25
25
  end
26
26
 
27
27
  desc 'temple HAML', 'Show temple intermediate expression'
28
- option :color, type: :boolean, default: false, aliases: %w[-c]
28
+ option :color, type: :boolean, default: true
29
29
  def temple(file)
30
30
  pp_object(generate_temple(file), color: options[:color])
31
31
  end
32
32
 
33
33
  desc 'parse HAML', 'Show parse result'
34
- option :color, type: :boolean, default: false, aliases: %w[-c]
34
+ option :color, type: :boolean, default: true
35
35
  def parse(file)
36
36
  pp_object(generate_ast(file), color: options[:color])
37
37
  end
@@ -107,20 +107,28 @@ module Hamlit
107
107
  render(args.first.to_s)
108
108
  end
109
109
 
110
- def puts_code(code, color: false)
110
+ def puts_code(code, color: true)
111
+ begin
112
+ require 'irb/color'
113
+ rescue LoadError
114
+ color = false
115
+ end
111
116
  if color
112
- require 'pry'
113
- puts Pry.Code(code).highlighted
117
+ puts IRB::Color.colorize_code(code)
114
118
  else
115
119
  puts code
116
120
  end
117
121
  end
118
122
 
119
123
  # Enable colored pretty printing only for development environment.
120
- def pp_object(arg, color: false)
124
+ def pp_object(arg, color: true)
125
+ begin
126
+ require 'irb/color_printer'
127
+ rescue LoadError
128
+ color = false
129
+ end
121
130
  if color
122
- require 'pry'
123
- Pry::ColorPrinter.pp(arg)
131
+ IRB::ColorPrinter.pp(arg)
124
132
  else
125
133
  require 'pp'
126
134
  pp(arg)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Hamlit
3
- VERSION = '2.13.2'
3
+ VERSION = '2.14.0'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hamlit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.13.2
4
+ version: 2.14.0
5
5
  platform: java
6
6
  authors:
7
7
  - Takashi Kokubun
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-28 00:00:00.000000000 Z
11
+ date: 2021-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement