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 +4 -4
- data/.github/workflows/build.yml +29 -0
- data/CHANGELOG.md +7 -1
- data/Gemfile +7 -2
- data/README.md +1 -1
- data/config.ru +9 -3
- data/lib/opal/haml/builder.rb +1 -0
- data/lib/opal/haml/processor.rb +6 -21
- data/lib/opal/haml/version.rb +1 -1
- data/lib/opal/haml.rb +1 -1
- data/lib-opal/opal-haml.rb +2 -0
- data/opal-haml.gemspec +1 -1
- metadata +11 -11
- data/.travis.yml +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef7296c031e9ec10349bd34063c97ffb2ad4f9bd6eb32e40a7c7a0d4e8b4b526
|
4
|
+
data.tar.gz: a235fd2f8d4ba97adcff18336476c12121d94844536ffebbc87e419552d7bd3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
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']
|
6
|
+
haml_version = ENV['HAML_VERSION'] ? "~> #{ENV['HAML_VERSION']}" : ">= 0"
|
7
7
|
|
8
|
-
gem 'haml',
|
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::
|
7
|
+
OPAL_SPROCKETS_SERVER = defined?(Opal::Sprockets::Server) ? Opal::Sprockets::Server : Opal::Server
|
8
8
|
|
9
|
-
|
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
|
}
|
data/lib/opal/haml/builder.rb
CHANGED
data/lib/opal/haml/processor.rb
CHANGED
@@ -3,30 +3,15 @@ require 'opal-sprockets'
|
|
3
3
|
|
4
4
|
module Opal
|
5
5
|
module Haml
|
6
|
-
|
7
|
-
|
8
|
-
|
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
|
-
|
27
|
-
|
28
|
-
|
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'
|
data/lib/opal/haml/version.rb
CHANGED
data/lib/opal/haml.rb
CHANGED
data/lib-opal/opal-haml.rb
CHANGED
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', '
|
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
|
+
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:
|
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.
|
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.
|
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.
|
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
|
-
|