haml_i18n_lint 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
  SHA1:
3
- metadata.gz: 2beec174c434dfd4d3be76698331dbbf2ddc74b9
4
- data.tar.gz: 2afa523e7846ce69f6fb488062f4552798542cb8
3
+ metadata.gz: a293a7c2b2c4df8e438af76d9403ac7fd1777a0f
4
+ data.tar.gz: 8a38f5e7d38c9ccb3cd0c6101386924072158c5b
5
5
  SHA512:
6
- metadata.gz: 12800ee694a4df7e5f77b5a28cff57137adad4d7cd2aeea354e19a61a53608587dd62327f87cc47cd77485a5d190a5a1b2048efef85039bf5c15d612d03f5ffe
7
- data.tar.gz: 52ed786be8fa6919d56ea44a35a49c7eabc245467ab5913f6dc3013b39a1ef225c9f86e0d13db5493e74bb9589ad6215097a2fedd4d03e691f742a991b408e66
6
+ metadata.gz: 3aab066b41cde91fc1c88dca8b6376d28757b00d90aef0447f197b7f6555f0bd3e9f4fb748b2f10b9aca0bc54d03991c85f8d62066c818eec3295cb5acbffdf8
7
+ data.tar.gz: 493f28a7034e25a4500f66f9038a9ea44f39f34424cac28066a2236852e165cf4d8478dafced194e6f76dd33577a7951b39ffd7bcfdf78717ac18bef3b58c127
checksums.yaml.gz.sig CHANGED
Binary file
data/Rakefile CHANGED
@@ -2,6 +2,17 @@ require "bundler/gem_tasks"
2
2
  require "rake/testtask"
3
3
  require "appraisal"
4
4
  require "yard"
5
+ require "digest/sha2"
6
+
7
+ version = Bundler::GemHelper.gemspec.version
8
+ desc "Create checksum of pkg/haml_i18n_lint-#{version}.gem"
9
+ task :checksum do
10
+ built_gem_path = "pkg/haml_i18n_lint-#{version}.gem"
11
+ checksum = Digest::SHA512.new.hexdigest(File.read(built_gem_path))
12
+ mkdir_p 'checksum'
13
+ checksum_path = "checksum/haml_i18n_lint-#{version}.gem.sha512"
14
+ File.write(checksum_path, checksum)
15
+ end
5
16
 
6
17
  Rake::TestTask.new(:test) do |t|
7
18
  t.libs << "test"
@@ -0,0 +1 @@
1
+ 17d064a699bc123a907cd91680a85a33216f9eadf100cf8f7aeec7a396b079307248d036e73b0c3d02d6c6639f687fd4620f690dfe60e311c91a3c82d99f7e3a
@@ -27,7 +27,7 @@ module HamlI18nLint
27
27
  file = File.readlines(result.filename)
28
28
  result.matched_nodes.each do |node|
29
29
  puts "#{result.filename}:#{node.line}"
30
- puts "#{node.line-1}: #{file[node.line - 2]}" if file[node.line - 2]
30
+ puts "#{node.line-1}: #{file[node.line - 2]}" if file[node.line - 2] && !(node.line - 2).negative?
31
31
  puts "#{node.line}: #{file[node.line - 1]}"
32
32
  puts "#{node.line+1}: #{file[node.line]}" if file[node.line]
33
33
  puts '-' * 16
@@ -37,7 +37,7 @@ module HamlI18nLint
37
37
 
38
38
  # @return [Array<String>] the list of files to be linted.
39
39
  def files
40
- Dir[*@options.files]
40
+ Dir[*@options.files].uniq
41
41
  end
42
42
 
43
43
  # @return [String] the list of methods, which takes string. The string is no translation required.
@@ -4,7 +4,12 @@ module HamlI18nLint
4
4
 
5
5
  def compile_script
6
6
  super
7
- program = Ripper.sexp(@node.value[:text]).flatten
7
+ _, on_kw, kw_do = Ripper.lex(@node.value[:text].rstrip).last
8
+ if on_kw == :on_kw && kw_do == "do"
9
+ program = Ripper.sexp(@node.value[:text] + "\nend").flatten
10
+ else
11
+ program = Ripper.sexp(@node.value[:text]).flatten
12
+ end
8
13
  str_num = program.flatten.count { |t| t == :string_literal }
9
14
  tstr_num = program.each_with_index.count do |t, i|
10
15
  lint_config.ignore_methods.any? do |m|
@@ -14,7 +14,7 @@ module HamlI18nLint
14
14
  # Run lint and report the result
15
15
  # @return [true, false] all of the files passed lint or not.
16
16
  def run
17
- @config.files.all? do |file|
17
+ @config.files.map do |file|
18
18
  result = lint(file)
19
19
 
20
20
  if result.success?
@@ -23,7 +23,7 @@ module HamlI18nLint
23
23
  @config.report(result)
24
24
  false
25
25
  end
26
- end
26
+ end.all?
27
27
  end
28
28
 
29
29
  private
@@ -1,3 +1,3 @@
1
1
  module HamlI18nLint
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
data.tar.gz.sig CHANGED
@@ -1 +1,2 @@
1
- k��XR0 m`�����
1
+ UK�!׻$�,߭����8ۊ=W���HP�X豢T�np��w[�� E;�^�\K���Is��+�����|n�����ukꊳ! -��Q8���Ìp�Ee`�R����\G�5�-8� {�6�ϙ��w��!O�$Y=5�]z6��3��4�:��kCB�vc����x×&,�,Q����Z��uE�������"�[/�2�� *����u�+��y�(@�L7a+�[.)�y��Q�o��,`�1 �s
2
+ e�ר1��}n�b}�
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml_i18n_lint
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
  - Seiei Miyagi
@@ -135,6 +135,7 @@ files:
135
135
  - bin/console
136
136
  - bin/setup
137
137
  - certs/hanachin.pem
138
+ - checksum/haml_i18n_lint-0.3.0.gem.sha512
138
139
  - exe/haml-i18n-lint
139
140
  - gemfiles/haml_4.gemfile
140
141
  - gemfiles/haml_5.gemfile
metadata.gz.sig CHANGED
Binary file