opal-haml 0.4.6 → 0.5.1

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: 1cc6eff881eee7f0547abedbe1ced796b247ebfe766ff1fb8a12e2534d05f7cc
4
- data.tar.gz: 60937e8f9424a9b7b2bb0dbb1ff463a58ec82802611028ed6c94302831f385a3
3
+ metadata.gz: ef7296c031e9ec10349bd34063c97ffb2ad4f9bd6eb32e40a7c7a0d4e8b4b526
4
+ data.tar.gz: a235fd2f8d4ba97adcff18336476c12121d94844536ffebbc87e419552d7bd3a
5
5
  SHA512:
6
- metadata.gz: 4c87b4b2c50b813ef922a0a8ebc432efad3a4e9f6f016efd96e748f09824a6dc6b13d39c167692b3235d006f461cf7e1754963e7bb1cd4113ce4a0ec6907d21c
7
- data.tar.gz: 1132bf23069a58109c1a6a4525fe92f642f1637e488bcfcb1113f0b64838c408d86257457f87526084332295a9c17e100b7dfbcc861d3397424784dbec6c4f37
6
+ metadata.gz: 504f9c2f9d931fd5aceadf6e44c24f9bdf90f800bfa2508769886aac96460eefde4970c8963a3c039adfd1663e29b8ec8decdb3cedb7b6bd48b1676dc20e11f3
7
+ data.tar.gz: 1875bcd0a6fb58982aa352b72eb0ac391c85af1939cb7ab991ae550bb366ea87f7ac18c4d0c8319bfda428c6b01e8f2b8dd8fd300f454854043db2e90b78488b
@@ -0,0 +1,29 @@
1
+ name: Tests
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+ - "*-stable"
7
+ - "*/ci-check"
8
+ pull_request:
9
+
10
+ jobs:
11
+ tests:
12
+ name: Tests
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ ruby: [2.6, 2.7, 3.0]
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - name: Checkout code
20
+ uses: actions/checkout@v2
21
+
22
+ - name: Setup Ruby
23
+ uses: ruby/setup-ruby@v1
24
+ with:
25
+ ruby-version: ${{ matrix.ruby }}
26
+ bundler-cache: true
27
+
28
+ - name: Run tests
29
+ run: bundle exec rake
data/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
- ## 0.4.6 unreleased
1
+ ## 0.5.0 2021-12-01
2
+
3
+ - Compatibility for Haml v5.2
4
+
5
+ - Support Sprockets 4.0
6
+
7
+ ## 0.4.6 2019-07-13
2
8
 
3
9
  - Add support for Opal v1.0
4
10
 
data/Gemfile CHANGED
@@ -3,12 +3,17 @@ gemspec
3
3
 
4
4
  github = -> repo { "https://github.com/#{repo}" }
5
5
  version = -> rs { -> vs { Gem::Requirement.new(rs) === Gem::Version.new(vs) } }
6
- haml_version = ENV['HAML_VERSION'] || 0
6
+ haml_version = ENV['HAML_VERSION'] ? "~> #{ENV['HAML_VERSION']}" : ">= 0"
7
7
 
8
- gem 'haml', "~> #{haml_version}"
8
+ gem 'haml', haml_version
9
9
 
10
10
  case ENV['OPAL_VERSION']
11
11
 
12
+ when 'local'
13
+ gem 'opal', path: '../opal'
14
+ gem 'opal-sprockets', path: '../opal-sprockets'
15
+ gem 'opal-rspec', path: '../opal-rspec'
16
+
12
17
  when 'master'
13
18
  gem 'opal', git: github['opal/opal'], branch: :master
14
19
  gem 'opal-sprockets', git: github['opal/opal-sprockets']
data/README.md CHANGED
@@ -81,7 +81,7 @@ $ bundle exec rackup
81
81
 
82
82
  (The MIT License)
83
83
 
84
- Copyright (C) 2013 by Adam Beynon
84
+ Copyright (C) 2013 by Adam Beynon, 2015 Elia Schito
85
85
 
86
86
  Permission is hereby granted, free of charge, to any person obtaining a copy
87
87
  of this software and associated documentation files (the "Software"), to deal
data/config.ru CHANGED
@@ -4,10 +4,16 @@ Bundler.require
4
4
  require 'opal-sprockets'
5
5
  require 'opal-rspec'
6
6
 
7
- OPAL_SPROCKETS_SERVER = defined?(Opal::Server) ? Opal::Server : Opal::Sprockets::Server
7
+ OPAL_SPROCKETS_SERVER = defined?(Opal::Sprockets::Server) ? Opal::Sprockets::Server : Opal::Server
8
8
 
9
- run OPAL_SPROCKETS_SERVER.new { |s|
9
+ sprockets_env = Opal::RSpec::SprocketsEnvironment.new(
10
+ spec_pattern = 'spec-opal/**/*_spec.{rb,opal}',
11
+ spec_exclude_pattern = nil,
12
+ spec_files = nil,
13
+ default_path = 'spec-opal')
14
+
15
+ run OPAL_SPROCKETS_SERVER.new(sprockets: sprockets_env) { |s|
10
16
  s.main = 'opal/rspec/sprockets_runner'
11
- s.append_path 'spec'
17
+ s.append_path 'spec-opal'
12
18
  s.debug = true
13
19
  }
@@ -7,6 +7,7 @@ module Opal
7
7
 
8
8
  def initialize(*args)
9
9
  super
10
+ @filename = ::Opal::Compiler.module_name(@filename)
10
11
  @source = prepare(@source, @filename)
11
12
  end
12
13
 
@@ -3,30 +3,15 @@ require 'opal-sprockets'
3
3
 
4
4
  module Opal
5
5
  module Haml
6
- OPAL_SPROCKETS_PROCESSOR = defined?(Opal::Processor) ?
7
- ::Opal::Processor :
8
- ::Opal::Sprockets::Processor
9
-
10
- class Processor < OPAL_SPROCKETS_PROCESSOR
11
- self.default_mime_type = 'application/javascript'
12
-
13
- def evaluate(context, locals, &block)
14
- @data = Opal::Haml.compile_haml @data, context.logical_path.sub(/^templates\//, '')
6
+ class Processor < ::Opal::Sprockets::Processor
7
+ def call
8
+ @data = Opal::Haml.compile_haml @data, context.logical_path.sub(/#{Opal::REGEXP_START}templates\//, '')
15
9
  super
16
10
  end
17
-
18
- def self.compiler_options
19
- # otherwise would check current class `attr_accessor`s
20
- OPAL_SPROCKETS_PROCESSOR.compiler_options
21
- end
22
11
  end
23
12
  end
24
13
  end
25
14
 
26
- if Sprockets.respond_to? :register_transformer
27
- extra_args = [{mime_type: 'application/javascript', silence_deprecation: true}]
28
- else
29
- extra_args = []
30
- end
31
-
32
- Sprockets.register_engine '.haml', Opal::Haml::Processor, *extra_args
15
+ Sprockets.register_mime_type 'application/html+haml', extensions: ['.haml', '.html.haml']
16
+ Sprockets.register_transformer 'application/html+haml', 'application/javascript', Opal::Haml::Processor
17
+ Opal::Sprockets.register_mime_type 'application/html+haml'
@@ -1,5 +1,5 @@
1
1
  module Opal
2
2
  module Haml
3
- VERSION = '0.4.6'
3
+ VERSION = '0.5.1'
4
4
  end
5
5
  end
data/lib/opal/haml.rb CHANGED
@@ -35,4 +35,4 @@ module Opal
35
35
  end
36
36
  end
37
37
 
38
- Opal.append_path File.expand_path('../../../lib-opal', __FILE__).untaint
38
+ Opal.append_path File.expand_path("#{__dir__}../../../lib-opal")
@@ -27,6 +27,8 @@ module Haml
27
27
  .replace(/[\r\n]/g, '&#13;');
28
28
  }
29
29
  end
30
+
31
+ singleton_class.alias_method :html_escape_without_haml_xss, :html_escape
30
32
  end
31
33
  end
32
34
 
data/opal-haml.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.require_paths = ['lib']
19
19
 
20
20
  s.add_dependency 'opal', ['>= 0.10', '< 2']
21
- s.add_dependency 'opal-sprockets', '~> 0.4.1'
21
+ s.add_dependency 'opal-sprockets', '>= 0.5.0'
22
22
  s.add_dependency 'haml'
23
23
 
24
24
  s.add_development_dependency 'opal-rspec'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-haml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Beynon
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-13 00:00:00.000000000 Z
11
+ date: 2024-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal
@@ -34,16 +34,16 @@ dependencies:
34
34
  name: opal-sprockets
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: 0.4.1
39
+ version: 0.5.0
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - "~>"
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 0.4.1
46
+ version: 0.5.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: haml
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -92,8 +92,8 @@ executables: []
92
92
  extensions: []
93
93
  extra_rdoc_files: []
94
94
  files:
95
+ - ".github/workflows/build.yml"
95
96
  - ".gitignore"
96
- - ".travis.yml"
97
97
  - CHANGELOG.md
98
98
  - Gemfile
99
99
  - LICENSE
@@ -119,7 +119,7 @@ homepage: https://github.com/opal/opal-haml#readme
119
119
  licenses:
120
120
  - MIT
121
121
  metadata: {}
122
- post_install_message:
122
+ post_install_message:
123
123
  rdoc_options: []
124
124
  require_paths:
125
125
  - lib
@@ -134,8 +134,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  - !ruby/object:Gem::Version
135
135
  version: '0'
136
136
  requirements: []
137
- rubygems_version: 3.0.3
138
- signing_key:
137
+ rubygems_version: 3.5.4
138
+ signing_key:
139
139
  specification_version: 4
140
140
  summary: Run Haml templates client-side with Opal
141
141
  test_files: []
data/.travis.yml DELETED
@@ -1,27 +0,0 @@
1
- language: ruby
2
- sudo: false
3
- rvm: 2.6.2
4
-
5
- env:
6
- - HAML_VERSION="4.0" OPAL_VERSION="0.10"
7
- - HAML_VERSION="5.0" OPAL_VERSION="0.10"
8
- - HAML_VERSION="4.0" OPAL_VERSION="0.11"
9
- - HAML_VERSION="5.0" OPAL_VERSION="0.11"
10
- - HAML_VERSION="4.0" OPAL_VERSION="1.0"
11
- - HAML_VERSION="5.0" OPAL_VERSION="1.0"
12
- - HAML_VERSION="4.0" OPAL_VERSION=master
13
- - HAML_VERSION="5.0" OPAL_VERSION=master
14
-
15
- cache:
16
- bundler: true
17
- directories:
18
- - node_modules
19
-
20
- before_install:
21
- - gem update --system
22
- - "export PATH=$PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH"
23
- - "if [ $(phantomjs --version) != '2.1.1' ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi"
24
- - "if [ $(phantomjs --version) != '2.1.1' ]; then wget https://assets.membergetmember.co/software/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2; fi"
25
- - "if [ $(phantomjs --version) != '2.1.1' ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi"
26
- - "phantomjs --version"
27
-