faml 0.7.2 → 0.7.3

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: c14024dd27014d4d1b41a1313b1e85f2ba2d4be2
4
- data.tar.gz: 1125ce25dca9c6daafe7fc42d04be96057ad9ba6
3
+ metadata.gz: 5c1985c1c33828570eb9a4e6ce654e873d2c14d2
4
+ data.tar.gz: ff0d4c7edf3e8d35afaafc6724d4ae1d93e1a252
5
5
  SHA512:
6
- metadata.gz: 0b39519a1514a4eb09800291310e7be514a70f8d51ec1eff80f048baafa7fe8237b93ae2cba8ff4ea400a1a0559a89ad4574bd3e12e031684ac34579095982e6
7
- data.tar.gz: 2f0f94f8ee613989a4476d0d7165e1712259be33cb679834f1f2eb9a625c384bd26dc49fdb1ec2c713519531d4107a2b8d5dd70d8227264c20463c72c9a108d5
6
+ metadata.gz: a1d921fc14f34d6f885d4d0d6d13d82a8a6713274dc93d534b0ba5853d95019f486e569c3c23dd0cd56db991c4ce1cd3375ca30538ac7562caa89d50a4396a0a
7
+ data.tar.gz: ce97e6f0f4f989fa04d754b0635dc2852cfa538b73df19fb737bfa076c21ec42297c6b6f1bcbbbc71ddcdd95b593fb143c4d8b04cd22494c115a64d1f5ee6900
@@ -46,7 +46,13 @@ Style/RaiseArgs:
46
46
  Style/SignalException:
47
47
  Enabled: false
48
48
 
49
- Style/TrailingComma:
49
+ Style/TrailingCommaInLiteral:
50
+ Enabled: false
51
+
52
+ Style/TrailingCommaInArguments:
53
+ Enabled: false
54
+
55
+ Style/ConditionalAssignment:
50
56
  Enabled: false
51
57
 
52
58
  Style/TrailingWhitespace:
@@ -1,3 +1,7 @@
1
+ ## 0.7.3 (2016-01-22)
2
+ - Fix build error when `$CXXFLAGS` is unavailable
3
+ - Fix StaticHashParser for parser 2.3.0.0
4
+
1
5
  ## 0.7.2 (2015-12-13)
2
6
  - Improve AttributeBuilder performance
3
7
  - Replace std::ostringstream with std::string
@@ -2,7 +2,11 @@
2
2
  require 'mkmf'
3
3
 
4
4
  $CFLAGS << ' -Wall -W'
5
- $CXXFLAGS << ' -Wall -W'
5
+ if $CXXFLAGS
6
+ # $CXXFLAGS might be undefined
7
+ # https://github.com/ruby/ruby/pull/492
8
+ $CXXFLAGS << ' -Wall -W'
9
+ end
6
10
  houdini_dir = File.expand_path('../../vendor/houdini', __dir__)
7
11
  $INCFLAGS << " -I#{houdini_dir}"
8
12
 
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.add_development_dependency 'rake-compiler'
37
37
  spec.add_development_dependency 'redcarpet'
38
38
  spec.add_development_dependency 'rspec', '>= 3.3'
39
- spec.add_development_dependency 'rubocop'
39
+ spec.add_development_dependency 'rubocop', '>= 0.36.0'
40
40
  spec.add_development_dependency 'sass'
41
41
  spec.add_development_dependency 'simplecov', '>= 0.9.0'
42
42
  spec.add_development_dependency 'slim' # for benchmark
@@ -14,8 +14,8 @@ module Faml
14
14
  DEFAULT_AUTO_CLOSE_TAGS = %w[
15
15
  area base basefont br col command embed frame hr img input isindex keygen
16
16
  link menuitem meta param source track wbr
17
- ]
18
- DEFAULT_PRESERVE_TAGS = %w[pre textarea code]
17
+ ].freeze
18
+ DEFAULT_PRESERVE_TAGS = %w[pre textarea code].freeze
19
19
 
20
20
  define_options(
21
21
  autoclose: DEFAULT_AUTO_CLOSE_TAGS,
@@ -5,7 +5,7 @@ module Faml
5
5
  module Helpers
6
6
  def self.preserve(input)
7
7
  # Taken from the original haml code
8
- input.to_s.chomp("\n").gsub(/\n/, '&#x000A;').gsub(/\r/, '')
8
+ input.to_s.chomp("\n").gsub(/\n/, '&#x000A;').delete("\r")
9
9
  end
10
10
 
11
11
  def preserve(input)
@@ -15,9 +15,8 @@ module Faml
15
15
  end
16
16
 
17
17
  def parse(text)
18
- builder = ::Parser::Builders::Default.new
19
- builder.emit_file_line_as_literals = false
20
- parser = ::Parser::CurrentRuby.new(builder)
18
+ parser = ::Parser::CurrentRuby.default_parser
19
+ parser.builder.emit_file_line_as_literals = false
21
20
  parser.diagnostics.consumer = nil
22
21
  buffer = ::Parser::Source::Buffer.new('(faml)')
23
22
  buffer.source = text
@@ -117,16 +117,14 @@ module Faml
117
117
  if static_hash_parser.parse("{#{ast.new_attributes}#{ast.old_attributes}}")
118
118
  if static_hash_parser.dynamic_attributes.empty?
119
119
  info.static_attribute_count += 1
120
+ elsif static_hash_parser.dynamic_attributes.key?('data') || static_hash_parser.dynamic_attributes.key?(:data)
121
+ info.dynamic_attribute_with_data_count += 1
122
+ elsif ast.old_attributes && ast.old_attributes.include?("\n")
123
+ info.dynamic_attribute_with_newline_count += 1
124
+ elsif ast.new_attributes && ast.new_attributes.include?("\n")
125
+ info.dynamic_attribute_with_newline_count += 1
120
126
  else
121
- if static_hash_parser.dynamic_attributes.key?('data') || static_hash_parser.dynamic_attributes.key?(:data)
122
- info.dynamic_attribute_with_data_count += 1
123
- elsif ast.old_attributes && ast.old_attributes.include?("\n")
124
- info.dynamic_attribute_with_newline_count += 1
125
- elsif ast.new_attributes && ast.new_attributes.include?("\n")
126
- info.dynamic_attribute_with_newline_count += 1
127
- else
128
- info.dynamic_attribute_count += 1
129
- end
127
+ info.dynamic_attribute_count += 1
130
128
  end
131
129
  else
132
130
  call_ast = Parser::CurrentRuby.parse("call(#{ast.new_attributes}#{ast.old_attributes})")
@@ -1,4 +1,4 @@
1
1
  # frozen-string-literal: true
2
2
  module Faml
3
- VERSION = '0.7.2'
3
+ VERSION = '0.7.3'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kohei Suzuki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-13 00:00:00.000000000 Z
11
+ date: 2016-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: escape_utils
@@ -240,14 +240,14 @@ dependencies:
240
240
  requirements:
241
241
  - - ">="
242
242
  - !ruby/object:Gem::Version
243
- version: '0'
243
+ version: 0.36.0
244
244
  type: :development
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
248
  - - ">="
249
249
  - !ruby/object:Gem::Version
250
- version: '0'
250
+ version: 0.36.0
251
251
  - !ruby/object:Gem::Dependency
252
252
  name: sass
253
253
  requirement: !ruby/object:Gem::Requirement
@@ -521,7 +521,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
521
521
  version: '0'
522
522
  requirements: []
523
523
  rubyforge_project:
524
- rubygems_version: 2.5.0
524
+ rubygems_version: 2.4.5.1
525
525
  signing_key:
526
526
  specification_version: 4
527
527
  summary: Faster implementation of Haml template language.