jass 0.9.3 → 0.9.4

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: 324ddf7781bbfba9401230e3b1b499c0c81b98a9862331235dfa5e32c0c83a15
4
- data.tar.gz: 0b134300473cf8d37fe3075814c0618ce29a620d6a7e26aa47f92597a4c29695
3
+ metadata.gz: 95641950492674a99916446a6d882688c23243dcd8ff0c9ba38f1e3d2fea2ff9
4
+ data.tar.gz: 9ed749532e4a8c83351be13a813fdf2520af2eb9731b8a67fde2f37aae53a2ce
5
5
  SHA512:
6
- metadata.gz: 4a752c5d6699ecf8a63b4febe8427216a4f36e85be3b85b752a796a372ff2f117678380536e1fc4e57f29da2ad5bec2e62f458ed93228d660642c1b8acd9f88d
7
- data.tar.gz: a8fe1d8f013ae8dbf0a1a842a9adbfc72841259a430918f6e1066921b809c097d4f11e24acc23361aa975d76c3a08f392341066f8d30ee9abad4b69a71a029e5
6
+ metadata.gz: 661a93b773e96410c86d1a48ec7db15fcf23e57c7bb06338baeffbb865e1c60c058e367aee1fdea192543dcd3465f7f14cafae744a734cfb7a8fdcacd0995328
7
+ data.tar.gz: 34dc9f49a4d355b69580ad3287da7d08e675f2cc06864acaa89273f37ceda7ef96b61dc00eb9e11e08f860a5f4cfc4c5f6fa97fcfeb8fc69fd9ac936b75f6ebe
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2018 Matthias Grosser
3
+ Copyright (c) 2019 Matthias Grosser
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@ require 'active_support/all'
7
7
 
8
8
  module Jass
9
9
  class << self
10
- attr_accessor :vendor_modules_root, :plugins
10
+ attr_accessor :vendor_modules_root, :plugins, :input_options
11
11
 
12
12
  def modules_root
13
13
  File.join(File.dirname(__FILE__), '..', 'vendor')
@@ -23,6 +23,10 @@ module Jass
23
23
  @compiler = nil
24
24
  end
25
25
 
26
+ def input_options
27
+ @input_options || {}
28
+ end
29
+
26
30
  def compiler
27
31
  @compiler ||= Jass::Compiler.new
28
32
  end
@@ -16,7 +16,7 @@ module Jass
16
16
  dependencies = Set.new(input.fetch(:metadata).fetch(:dependencies))
17
17
  globals = input.fetch(:metadata).fetch(:globals, {})
18
18
  bundle_root = Pathname.new(filename).dirname
19
- bundle = Jass.compiler.bundle(filename, {}, globals: globals)
19
+ bundle = Jass.compiler.bundle(filename, Jass.input_options, globals: globals)
20
20
  dependencies += bundle.fetch('map').fetch('sources').map { |dep| Sprockets::URIUtils.build_file_digest_uri(bundle_root.join(dep).to_s) }
21
21
 
22
22
  { data: bundle.fetch('code'),
@@ -50,32 +50,31 @@ module Jass
50
50
  function :js_bundle, <<~JS
51
51
  function(entry, moduleDirectories, inputOptions, outputOptions) {
52
52
  inputOptions = inputOptions || {};
53
- outputOptions = outputOptions || {}
53
+ outputOptions = outputOptions || {};
54
+ var inputDefaultOptions = {
55
+ input: entry,
56
+ treeshake: false,
57
+ plugins: [
58
+ ...__plugins__,
59
+ nodeResolve({ customResolveOptions: { moduleDirectory: moduleDirectories }}),
60
+ commonjs()
61
+ ]
62
+ };
54
63
  // TODO: throw error unless moduleDirectories
55
- Object.assign(inputOptions,
56
- { input: entry,
57
- treeshake: false,
58
- plugins: [
59
- ...__plugins__,
60
- nodeResolve({ customResolveOptions: { moduleDirectory: moduleDirectories }}),
61
- commonjs()
62
- ]
63
- }
64
- );
65
64
  Object.assign(outputOptions,
66
65
  { format: 'iife',
67
66
  sourcemap: true,
68
67
  exports: 'none'
69
68
  }
70
69
  );
71
- var promise = rollup.rollup(inputOptions)
70
+ var promise = rollup.rollup({ ...inputDefaultOptions, ...inputOptions })
72
71
  .then(bundle => bundle.generate(outputOptions))
73
72
  .then(bundle => { return { code: send('compile', bundle.code), map: bundle.map }; });
74
73
  return promise;
75
74
  }
76
75
  JS
77
76
 
78
- def bundle(entry, input_options = {}, output_options = {})
77
+ def bundle(entry, input_options = Jass.input_options, output_options = {})
79
78
  js_bundle(entry, self.class.node_paths, input_options, output_options)
80
79
  end
81
80
 
@@ -1,3 +1,3 @@
1
1
  module Jass
2
- VERSION = '0.9.3'
2
+ VERSION = '0.9.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthias Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-05 00:00:00.000000000 Z
11
+ date: 2019-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -108,7 +108,7 @@ dependencies:
108
108
  version: '5.0'
109
109
  description: ES6 support for the Rails asset pipeline
110
110
  email:
111
- - mtgrosser@gmx.net
111
+ - mtgrosse@gmx.net
112
112
  executables: []
113
113
  extensions: []
114
114
  extra_rdoc_files: []