File tree Expand file tree Collapse file tree 8 files changed +181
-138
lines changed
Expand file tree Collapse file tree 8 files changed +181
-138
lines changed Original file line number Diff line number Diff line change 55 tags-ignore : [ '**' ]
66 pull_request :
77jobs :
8+ rubocop :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Checkout
12+ uses : actions/checkout@v2
13+ - name : Set up Ruby
14+ uses : ruby/setup-ruby@v1
15+ with :
16+ ruby-version : ' 3.0'
17+ bundler-cache : true
18+ - name : Rubocop
19+ run : bundle exec rubocop
820 build :
921 strategy :
1022 matrix :
Original file line number Diff line number Diff line change 1+ Metrics/AbcSize :
2+ Enabled : false
3+ Metrics/BlockLength :
4+ Enabled : false
5+ Metrics/ClassLength :
6+ Enabled : false
7+ Metrics/CyclomaticComplexity :
8+ Enabled : false
9+ Layout/LineLength :
10+ Max : 120
11+ Metrics/MethodLength :
12+ Enabled : false
13+ Security/MarshalLoad :
14+ Enabled : false
15+ Style/StructInheritance :
16+ Enabled : false
17+ Style/Documentation :
18+ Enabled : false
Original file line number Diff line number Diff line change @@ -9,8 +9,6 @@ task default: :test
99# Packaging
1010# ==========================================================
1111
12- GEMSPEC = eval ( File . read ( 'pygments.rb.gemspec' ) )
13-
1412require 'rubygems/package_task'
1513
1614# ==========================================================
3634
3735# Write all the lexers to a file for easy lookup
3836task :lexers do
39- sh 'ruby cache-lexers .rb'
37+ sh 'ruby cache_lexers .rb'
4038end
4139
4240task ( :test ) . enhance ( [ :lexers ] )
Original file line number Diff line number Diff line change 33require File . join ( File . dirname ( __FILE__ ) , '/lib/pygments.rb' )
44require 'benchmark'
55
6- include Benchmark
76# number of iterations
87num = ARGV [ 0 ] ? ARGV [ 0 ] . to_i : 10
98
1716puts 'Iterations: ' + num . to_s + "\n "
1817
1918Benchmark . bm ( 40 ) do |x |
20- x . report ( 'pygments popen ' ) { ( 1 ..num ) . each { |_i |; Pygments . highlight ( code , lexer : 'python' ) ; } }
21- x . report ( 'pygments popen (process already started) ' ) { ( 1 ..num ) . each { |_i |; Pygments . highlight ( code , lexer : 'python' ) ; } }
22- x . report ( 'pygments popen (process already started 2) ' ) { ( 1 ..num ) . each { |_i |; Pygments . highlight ( code , lexer : 'python' ) ; } }
19+ x . report ( 'pygments popen ' ) do
20+ ( 1 ..num ) . each { |_i |; Pygments . highlight ( code , lexer : 'python' ) ; }
21+ end
22+ x . report ( 'pygments popen (process already started) ' ) do
23+ ( 1 ..num ) . each { |_i |; Pygments . highlight ( code , lexer : 'python' ) ; }
24+ end
25+ x . report ( 'pygments popen (process already started 2) ' ) do
26+ ( 1 ..num ) . each { |_i |; Pygments . highlight ( code , lexer : 'python' ) ; }
27+ end
2328end
File renamed without changes.
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ def self.create(hash)
3030 extnames = [ ]
3131
3232 extname = File . extname ( filename )
33- if m = extname . match ( /\[ (.+)\] / )
33+ if ( m = extname . match ( /\[ (.+)\] / ) )
3434 m [ 1 ] . scan ( /./ ) . each do |s |
3535 extnames << extname . sub ( m [ 0 ] , s )
3636 end
You can’t perform that action at this time.
0 commit comments