rugular 0.6.9 → 0.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rugular/tasks/server/guards/rugular.rb +12 -5
- data/lib/rugular/tasks/server/guards/rugular_es6.rb +55 -0
- data/lib/rugular/version.rb +1 -1
- data/rugular.gemspec +16 -15
- metadata +17 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 47a11ca208aa3fe67fd088930ca59e1c22a4c197
|
|
4
|
+
data.tar.gz: 22139c8f960024939bc70e801806ba18e3dd0ee3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b9836e2de2e159cab6736353ad6d23a75df0bbf24a3d46fdf08fa8c83f8cd2028a39bd18c42f6d62bb36ad90d59b45843248d854715937d3f4704f762f5c815c
|
|
7
|
+
data.tar.gz: 563f626aeba5746c5101ed9e655b39e116ec0703c98b8724da811dd7e5ac4dd2fd63dc38b9f1b5575c1fd565d7a97df8d2dbab4fc7aec2cd2e0a80a1b355d77e
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
require 'guard'
|
|
2
|
-
require_relative '
|
|
3
|
-
require_relative 'rugular_coffee'
|
|
2
|
+
require_relative 'rugular_assets'
|
|
4
3
|
require_relative 'rugular_bower_components'
|
|
4
|
+
require_relative 'rugular_coffee'
|
|
5
|
+
require_relative 'rugular_es6'
|
|
6
|
+
require_relative 'rugular_haml'
|
|
5
7
|
require_relative 'rugular_index_html'
|
|
6
|
-
require_relative 'rugular_assets'
|
|
7
8
|
|
|
8
9
|
module Guard
|
|
9
10
|
class Rugular < Plugin
|
|
@@ -31,6 +32,7 @@ module Guard
|
|
|
31
32
|
[*paths].each do |file|
|
|
32
33
|
message =
|
|
33
34
|
case File.extname(file)
|
|
35
|
+
when '.es6' then ::RugularES6.compile(file)
|
|
34
36
|
when '.coffee' then ::RugularCoffee.compile(file)
|
|
35
37
|
when '.haml' then ::RugularHaml.compile(file)
|
|
36
38
|
when '.yaml' then ::RugularBowerComponents.compile
|
|
@@ -55,10 +57,15 @@ module Guard
|
|
|
55
57
|
|
|
56
58
|
message =
|
|
57
59
|
case File.extname(file)
|
|
60
|
+
when '.es6' then ::RugularES6.delete(file)
|
|
58
61
|
when '.coffee' then ::RugularCoffee.delete(file)
|
|
59
62
|
when '.haml' then ::RugularHaml.delete(file)
|
|
60
|
-
when '.yaml' then fail
|
|
61
|
-
|
|
63
|
+
when '.yaml' then fail "Please restore #{file}"
|
|
64
|
+
when '.png' then ::RugularAssets.delete_asset(file)
|
|
65
|
+
when '.jpg' then ::RugularAssets.delete_asset(file)
|
|
66
|
+
when '.ttf' then ::RugularAssets.delete_asset(file)
|
|
67
|
+
when '.woff' then ::RugularAssets.delete_asset(file)
|
|
68
|
+
else "Rugular does not know how to handle #{file}"
|
|
62
69
|
end
|
|
63
70
|
|
|
64
71
|
::RugularIndexHtml.update_javascript_script_tags
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
require 'babel/transpiler'
|
|
2
|
+
|
|
3
|
+
class RugularES6
|
|
4
|
+
def self.compile(es6_file)
|
|
5
|
+
new(es6_file).compile
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def self.delete(es6_file)
|
|
9
|
+
new(es6_file).delete
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def initialize(es6_file)
|
|
13
|
+
@es6_file = es6_file
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def compile
|
|
17
|
+
write_tmp_file
|
|
18
|
+
|
|
19
|
+
"Successfully compiled #{es6_file} to html!\n"
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def delete
|
|
23
|
+
FileUtils.rm(tmp_file)
|
|
24
|
+
|
|
25
|
+
"Sucessfully removed #{tmp_file}\n"
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
private
|
|
29
|
+
|
|
30
|
+
attr_reader :es6_file
|
|
31
|
+
|
|
32
|
+
def javascript
|
|
33
|
+
@_javascript ||= Babel::Transpiler.transform File.read(es6_file)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def tmp_file
|
|
37
|
+
es6_file.gsub('src', '.tmp').gsub('es6', 'js')
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def write_tmp_file
|
|
41
|
+
create_tmp_folder
|
|
42
|
+
|
|
43
|
+
File.open(tmp_file, 'w', &write_javascript)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def create_tmp_folder
|
|
47
|
+
dirname = File.dirname(tmp_file)
|
|
48
|
+
|
|
49
|
+
FileUtils.mkdir_p(dirname) unless File.directory? dirname
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def write_javascript
|
|
53
|
+
->(file) { file.write javascript }
|
|
54
|
+
end
|
|
55
|
+
end
|
data/lib/rugular/version.rb
CHANGED
data/rugular.gemspec
CHANGED
|
@@ -17,21 +17,22 @@ Gem::Specification.new do |spec|
|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
18
18
|
spec.require_paths = ['lib']
|
|
19
19
|
|
|
20
|
-
spec.add_runtime_dependency 'actionview',
|
|
21
|
-
spec.add_runtime_dependency '
|
|
22
|
-
spec.add_runtime_dependency '
|
|
23
|
-
spec.add_runtime_dependency '
|
|
24
|
-
spec.add_runtime_dependency '
|
|
25
|
-
spec.add_runtime_dependency '
|
|
26
|
-
spec.add_runtime_dependency 'guard
|
|
27
|
-
spec.add_runtime_dependency '
|
|
28
|
-
spec.add_runtime_dependency '
|
|
29
|
-
spec.add_runtime_dependency '
|
|
30
|
-
spec.add_runtime_dependency '
|
|
31
|
-
spec.add_runtime_dependency 'sass
|
|
32
|
-
spec.add_runtime_dependency '
|
|
33
|
-
spec.add_runtime_dependency '
|
|
34
|
-
spec.add_runtime_dependency '
|
|
20
|
+
spec.add_runtime_dependency 'actionview', '~> 4'
|
|
21
|
+
spec.add_runtime_dependency 'babel-transpiler', '~> 0'
|
|
22
|
+
spec.add_runtime_dependency 'bitters', '~> 1'
|
|
23
|
+
spec.add_runtime_dependency 'bourbon', '~> 4'
|
|
24
|
+
spec.add_runtime_dependency 'coffee-script', '~> 2'
|
|
25
|
+
spec.add_runtime_dependency 'foreman', '~> 0'
|
|
26
|
+
spec.add_runtime_dependency 'guard', '~> 2'
|
|
27
|
+
spec.add_runtime_dependency 'guard-compat', '~> 1'
|
|
28
|
+
spec.add_runtime_dependency 'haml', '~> 4'
|
|
29
|
+
spec.add_runtime_dependency 'neat', '~> 1'
|
|
30
|
+
spec.add_runtime_dependency 'nokogiri', '~> 1'
|
|
31
|
+
spec.add_runtime_dependency 'sass', '~> 3'
|
|
32
|
+
spec.add_runtime_dependency 'sass-globbing', '~> 1'
|
|
33
|
+
spec.add_runtime_dependency 'thor', '~> 0'
|
|
34
|
+
spec.add_runtime_dependency 'tmuxinator', '~> 0'
|
|
35
|
+
spec.add_runtime_dependency 'uglifier', '~> 2'
|
|
35
36
|
|
|
36
37
|
spec.add_development_dependency 'aruba', '~> 0'
|
|
37
38
|
spec.add_development_dependency 'byebug', '~> 3'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rugular
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nicholas Shook
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-02-
|
|
11
|
+
date: 2015-02-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionview
|
|
@@ -24,6 +24,20 @@ dependencies:
|
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '4'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: babel-transpiler
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
27
41
|
- !ruby/object:Gem::Dependency
|
|
28
42
|
name: bitters
|
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -325,6 +339,7 @@ files:
|
|
|
325
339
|
- lib/rugular/tasks/server/guards/rugular_assets.rb
|
|
326
340
|
- lib/rugular/tasks/server/guards/rugular_bower_components.rb
|
|
327
341
|
- lib/rugular/tasks/server/guards/rugular_coffee.rb
|
|
342
|
+
- lib/rugular/tasks/server/guards/rugular_es6.rb
|
|
328
343
|
- lib/rugular/tasks/server/guards/rugular_haml.rb
|
|
329
344
|
- lib/rugular/tasks/server/guards/rugular_index_html.rb
|
|
330
345
|
- lib/rugular/tasks/tmux.rb
|