sprockets-illusionist 0.0.9 → 0.0.10

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: 6defa82d1b3604fae45f0018f645e582a3e0bf95
4
- data.tar.gz: e27753fd82ffdf0b260e68ab22c7633f23203c85
3
+ metadata.gz: db8263735ff2a9c52fae4e4b8a7fa3cd1b45ce91
4
+ data.tar.gz: 3f4a03f64f30a5c21ab2d30d046ef7885bc659cb
5
5
  SHA512:
6
- metadata.gz: 9ad4aa170e1734ed0967140dde311eef8cfceddf66f1f80f260759170aff6415f577764ef4a053f906395d5605c4c6cde8c3313841d2b9f877190df899528605
7
- data.tar.gz: db9b25cd20d5d3853a717e255f6d7b5ab3f8c208ec7c6fd69f4ca5663ee75435ec018f7d97877f539beb423c7232aff61de0b17b97bf0658adecf705362ec1a2
6
+ metadata.gz: fc87f893b4d412441cf8b05168473212807e6896939664c2384f604a411dcb23b4326edf1a79dac6e8df05c37e3df07c43b12e696b50ae6a95b4772874380e77
7
+ data.tar.gz: 96d991a6b44b871606697a676e7903e8a1e2fa2367cbd678ebf8f3f107ceec666f2cfc161a0ada3858df5db1387503a5f24aa190cf88c425c05a206e2778dac7
@@ -0,0 +1,53 @@
1
+ AllCops:
2
+ Include:
3
+ - Rakefile
4
+
5
+ Documentation:
6
+ Enabled: false
7
+
8
+ Encoding:
9
+ Enabled: false
10
+
11
+ LineLength:
12
+ Max: 200
13
+
14
+ AccessModifierIndentation:
15
+ EnforcedStyle: outdent
16
+
17
+ IfUnlessModifier:
18
+ Enabled: false
19
+
20
+ CaseIndentation:
21
+ IndentWhenRelativeTo: case
22
+ IndentOneStep: true
23
+
24
+ MethodLength:
25
+ CountComments: false
26
+ Max: 20
27
+
28
+ SignalException:
29
+ Enabled: false
30
+
31
+ ColonMethodCall:
32
+ Enabled: false
33
+
34
+ AsciiComments:
35
+ Enabled: false
36
+
37
+ Lambda:
38
+ Enabled: false
39
+
40
+ RegexpLiteral:
41
+ Enabled: false
42
+
43
+ RedundantBegin:
44
+ Enabled: false
45
+
46
+ AssignmentInCondition:
47
+ Enabled: false
48
+
49
+ Metrics/AbcSize:
50
+ Enabled: false
51
+
52
+ Style/FileName:
53
+ Exclude: ['lib/sprockets-illusionist.rb']
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # sprockets-illusionist
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/sprockets-illusionist.png)](http://badge.fury.io/rb/sprockets-illusionist) [![Code Climate](https://codeclimate.com/github/mirego/sprockets-illusionist.png)](https://codeclimate.com/github/mirego/sprockets-illusionist)
3
+ [![Gem Version](http://img.shields.io/gem/v/sprockets-illusionist.svg)](https://rubygems.org/gems/sprockets-illusionist)
4
+ [![Code Climate](http://img.shields.io/codeclimate/github/mirego/sprockets-illusionist.svg)](https://codeclimate.com/github/mirego/sprockets-illusionist)
4
5
 
5
6
  `sprockets-illusionist` makes it possible to transpile your ES6 files into ES5 using the [Illusionist node module](https://github.com/mirego/illusionist) and Sprockets.
6
7
 
@@ -84,16 +85,6 @@ With `sprockets-illusionist` just write your JavaScript files with the extension
84
85
 
85
86
  ## Deploying on Heroku
86
87
 
87
- **This guide assumes that you’re using environment variables which are available in Heroku Labs**
88
-
89
- You can enable this feature by doing:
90
-
91
- ```bash
92
- $ heroku labs:enable user-env-compile
93
- ```
94
-
95
- Let’s get started!
96
-
97
88
  1. You will need to use [heroku-buildpack-multi](https://github.com/ddollar/heroku-buildpack-multi) to install node and Ruby.
98
89
 
99
90
  Tell Heroku to use the right buildpack:
@@ -158,6 +149,11 @@ Let’s get started!
158
149
  $ heroku config:set ILLUSIONIST_BIN_PATH=./node_modules/.bin/illusionist
159
150
  ```
160
151
 
152
+ ## Contributors
153
+
154
+ * [@charlesdemers](https://github.com/charlesdemers)
155
+ * [@remiprev](https://github.com/remiprev)
156
+
161
157
  ## License
162
158
 
163
159
  `sprockets-illusionist` is © 2014 [Mirego](http://www.mirego.com) and may be freely distributed under the [New BSD license](http://opensource.org/licenses/BSD-3-Clause).
@@ -11,7 +11,7 @@ module SprocketsIllusionist
11
11
  def prepare
12
12
  end
13
13
 
14
- def evaluate(scope, locals, &block)
14
+ def evaluate(_, _)
15
15
  stdout, stderr, _status = Open3.capture3("#{node_path} #{illusionist_path} #{option_string_from_config}", stdin_data: data)
16
16
 
17
17
  if stderr.empty?
@@ -36,24 +36,28 @@ module SprocketsIllusionist
36
36
  file_name = File.basename(file, '.js.es6')
37
37
 
38
38
  if !base_path.nil?
39
- path = Pathname.new(file)
40
- dirname = File.dirname(path.relative_path_from(base_path))
41
-
42
- if dirname == '.'
43
- file_name
44
- else
45
- File.join(dirname, file_name)
46
- end
39
+ relative_module_path(file, file_name, base_path)
47
40
  else
48
41
  file_name
49
42
  end
50
43
  end
51
44
 
45
+ def relative_module_path(file, file_name, base_path)
46
+ path = Pathname.new(file)
47
+ directory = File.dirname(path.relative_path_from(base_path))
48
+
49
+ if directory == '.'
50
+ file_name
51
+ else
52
+ File.join(directory, file_name)
53
+ end
54
+ end
55
+
52
56
  def option_string_from_config
53
57
  module_type = SprocketsIllusionist::Config.try(:module_type)
54
58
  options = ["-m #{amd_module_name}"]
55
59
 
56
- if (!module_type.nil? && %w(amd cjs globals).include?(module_type))
60
+ if %w(amd cjs globals).include?(module_type)
57
61
  options << "-M #{module_type}"
58
62
  end
59
63
 
@@ -1,3 +1,3 @@
1
1
  module SprocketsIllusionist
2
- VERSION = '0.0.9'
2
+ VERSION = '0.0.10'
3
3
  end
@@ -18,7 +18,10 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_development_dependency 'bundler', '~> 1.5'
22
- spec.add_development_dependency 'rake'
23
- spec.add_dependency 'sprockets', '~> 2.10.1'
21
+ spec.add_development_dependency 'bundler', '~> 1.7'
22
+ spec.add_development_dependency 'rake', '~> 10.0'
23
+ spec.add_development_dependency 'rubocop', '0.27.1'
24
+ spec.add_development_dependency 'phare'
25
+
26
+ spec.add_dependency 'sprockets', '>= 2.10.1', '< 3.0'
24
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets-illusionist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Demers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-27 00:00:00.000000000 Z
11
+ date: 2014-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,16 +16,44 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.5'
19
+ version: '1.7'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.5'
26
+ version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 0.27.1
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 0.27.1
55
+ - !ruby/object:Gem::Dependency
56
+ name: phare
29
57
  requirement: !ruby/object:Gem::Requirement
30
58
  requirements:
31
59
  - - ">="
@@ -42,16 +70,22 @@ dependencies:
42
70
  name: sprockets
43
71
  requirement: !ruby/object:Gem::Requirement
44
72
  requirements:
45
- - - "~>"
73
+ - - ">="
46
74
  - !ruby/object:Gem::Version
47
75
  version: 2.10.1
76
+ - - "<"
77
+ - !ruby/object:Gem::Version
78
+ version: '3.0'
48
79
  type: :runtime
49
80
  prerelease: false
50
81
  version_requirements: !ruby/object:Gem::Requirement
51
82
  requirements:
52
- - - "~>"
83
+ - - ">="
53
84
  - !ruby/object:Gem::Version
54
85
  version: 2.10.1
86
+ - - "<"
87
+ - !ruby/object:Gem::Version
88
+ version: '3.0'
55
89
  description: Transpile your ES6 files into ES5 using the Illusionist node module and
56
90
  Sprockets
57
91
  email:
@@ -61,6 +95,7 @@ extensions: []
61
95
  extra_rdoc_files: []
62
96
  files:
63
97
  - ".gitignore"
98
+ - ".rubocop.yml"
64
99
  - Gemfile
65
100
  - LICENSE.md
66
101
  - README.md
@@ -91,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
126
  version: '0'
92
127
  requirements: []
93
128
  rubyforge_project:
94
- rubygems_version: 2.2.1
129
+ rubygems_version: 2.2.2
95
130
  signing_key:
96
131
  specification_version: 4
97
132
  summary: Transpile your ES6 files into ES5 using the Illusionist node module and Sprockets