rugular 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -3
- data/bower.json +0 -3
- data/features/abstract.feature +17 -10
- data/lib/rugular/tasks/abstract.rb +2 -4
- data/lib/rugular/tasks/helpers/javascript_files.rb +11 -11
- data/lib/rugular/tasks/server/guards/rugular.rb +0 -3
- data/lib/rugular/tasks/server/guards/rugular_index_html.rb +1 -1
- data/lib/rugular/templates/abstract/bower.json.erb +0 -3
- data/lib/rugular/templates/factory/{app.factory.coffee → app.factory.coffee.erb} +0 -0
- data/lib/rugular/templates/factory/{app.module.coffee → app.module.coffee.erb} +0 -0
- data/lib/rugular/templates/new/bower_components.yaml +1 -0
- data/lib/rugular/templates/new/src/app/{app.controller.es6 → app.controller.coffee} +2 -3
- data/lib/rugular/templates/new/src/app/app.haml +2 -0
- data/lib/rugular/version.rb +1 -1
- metadata +5 -6
- data/lib/rugular/tasks/server/guards/rugular_es6.rb +0 -55
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9984dbdfd23f8ca2e33329b9a885207a4995b305
|
4
|
+
data.tar.gz: a715174ffa8e23b19ea7dbf202076bcecd794852
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29352b360c55f4147d32c6b07c500fe2a75903914a4497b4dad95360cee1a534585a10eaf02fce4289e34061f68641bbde664789860f70bc635d7073b4eb9eb1
|
7
|
+
data.tar.gz: 312329acdbf540b6381c7fc45f01136a5f3d46e51ff05945cca39206c75e247394a8981952d97f520a7677d7e9f600d40f90108c4946c9622cc215401c84c718
|
data/README.md
CHANGED
@@ -334,7 +334,8 @@ This will create the following files:
|
|
334
334
|
|
335
335
|
Features coming soon:
|
336
336
|
|
337
|
-
* Abstracting bower
|
337
|
+
* Abstracting a bower component from a either the ``components`` folder or both
|
338
|
+
the ``components`` and ``app`` folder as one component.
|
338
339
|
* Fingerprinting dist asset files for caching
|
339
340
|
* Nginx based docker container for deploying apps
|
340
341
|
|
@@ -342,11 +343,11 @@ As soon as it reaches a stable release:
|
|
342
343
|
|
343
344
|
* ``angular-ui-router`` will be replaced by the ``router`` re-write by the
|
344
345
|
Angular team.
|
345
|
-
* Angular 1.3 will be updated to Angular 1.4
|
346
|
+
* Angular 1.3 will be updated to Angular 1.4 (then to 1.5)
|
346
347
|
|
347
348
|
Post Angular 2.0 changes
|
348
349
|
|
349
|
-
* replace CoffeeScript with
|
350
|
+
* replace CoffeeScript with Typescript
|
350
351
|
* replace the folder structure and build scripts to take advantage of
|
351
352
|
EcmaScript 6 modules
|
352
353
|
|
data/bower.json
CHANGED
data/features/abstract.feature
CHANGED
@@ -4,13 +4,20 @@ Feature: Rugular CLI
|
|
4
4
|
As a user of the rugular framework
|
5
5
|
I want to create a bower_component from any component folder
|
6
6
|
|
7
|
-
Scenario:
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
7
|
+
# Scenario: Abstracting components folder
|
8
|
+
# When I set up Rugular and run "rugular g directive test"
|
9
|
+
# And I run `cd tmp/aruba/my-app && rugular abstract -c`
|
10
|
+
# Then the file "~/bower_components/myapp/bower.json" should contain:
|
11
|
+
# """
|
12
|
+
# "private": true,
|
13
|
+
# """
|
14
|
+
#
|
15
|
+
# Scenario: Abstracting both the app and components folder
|
16
|
+
# When I set up Rugular and run "rugular g directive test"
|
17
|
+
# And I run `cd tmp/aruba/my-app && rugular abstract`
|
18
|
+
# Then the file "~/bower_components/myapp/bower.json" should contain:
|
19
|
+
# """
|
20
|
+
# "private": true,
|
21
|
+
# """
|
22
|
+
#
|
23
|
+
#
|
@@ -1,17 +1,17 @@
|
|
1
1
|
module Rugular
|
2
2
|
class JavascriptFiles
|
3
3
|
def self.ordered_array
|
4
|
-
Dir.glob('src/components/**/*.module.
|
5
|
-
Dir.glob('src/components/**/*.constant.
|
6
|
-
Dir.glob('src/components/**/*.factory.
|
7
|
-
Dir.glob('src/components/**/*.filter.
|
8
|
-
Dir.glob('src/components/**/*.controller.
|
9
|
-
Dir.glob('src/components/**/*.directive.
|
10
|
-
Dir.glob('src/app/**/*.module.
|
11
|
-
Dir.glob('src/app/**/*.config.
|
12
|
-
Dir.glob('src/app/**/*.constant.
|
13
|
-
Dir.glob('src/app/**/*.controller.
|
14
|
-
Dir.glob('src/app/**/*.routes.
|
4
|
+
Dir.glob('src/components/**/*.module.coffee') +
|
5
|
+
Dir.glob('src/components/**/*.constant.coffee') +
|
6
|
+
Dir.glob('src/components/**/*.factory.coffee') +
|
7
|
+
Dir.glob('src/components/**/*.filter.coffee') +
|
8
|
+
Dir.glob('src/components/**/*.controller.coffee') +
|
9
|
+
Dir.glob('src/components/**/*.directive.coffee') +
|
10
|
+
Dir.glob('src/app/**/*.module.coffee') +
|
11
|
+
Dir.glob('src/app/**/*.config.coffee') +
|
12
|
+
Dir.glob('src/app/**/*.constant.coffee') +
|
13
|
+
Dir.glob('src/app/**/*.controller.coffee') +
|
14
|
+
Dir.glob('src/app/**/*.routes.coffee')
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -2,7 +2,6 @@ require 'guard'
|
|
2
2
|
require_relative 'rugular_assets'
|
3
3
|
require_relative 'rugular_bower_components'
|
4
4
|
require_relative 'rugular_coffee'
|
5
|
-
require_relative 'rugular_es6'
|
6
5
|
require_relative 'rugular_haml'
|
7
6
|
require_relative 'rugular_index_html'
|
8
7
|
|
@@ -32,7 +31,6 @@ module Guard
|
|
32
31
|
[*paths].each do |file|
|
33
32
|
message =
|
34
33
|
case File.extname(file)
|
35
|
-
when '.es6' then ::RugularES6.compile(file)
|
36
34
|
when '.coffee' then ::RugularCoffee.compile(file)
|
37
35
|
when '.haml' then ::RugularHaml.compile(file)
|
38
36
|
when '.yaml' then ::RugularBowerComponents.compile
|
@@ -57,7 +55,6 @@ module Guard
|
|
57
55
|
|
58
56
|
message =
|
59
57
|
case File.extname(file)
|
60
|
-
when '.es6' then ::RugularES6.delete(file)
|
61
58
|
when '.coffee' then ::RugularCoffee.delete(file)
|
62
59
|
when '.haml' then ::RugularHaml.delete(file)
|
63
60
|
when '.yaml' then fail "Please restore #{file}"
|
@@ -35,7 +35,7 @@ class RugularIndexHtml
|
|
35
35
|
|
36
36
|
def convert_to_script_tag
|
37
37
|
lambda do |javascript_file|
|
38
|
-
tmp_filename = javascript_file.gsub('src', '').gsub(
|
38
|
+
tmp_filename = javascript_file.gsub('src', '').gsub('coffee', 'js')
|
39
39
|
|
40
40
|
Nokogiri::XML::Node.new 'script', application_html do |node|
|
41
41
|
node['src'] = tmp_filename
|
File without changes
|
File without changes
|
data/lib/rugular/version.rb
CHANGED
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.7.
|
4
|
+
version: 0.7.1
|
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-03-
|
11
|
+
date: 2015-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -339,7 +339,6 @@ files:
|
|
339
339
|
- lib/rugular/tasks/server/guards/rugular_assets.rb
|
340
340
|
- lib/rugular/tasks/server/guards/rugular_bower_components.rb
|
341
341
|
- lib/rugular/tasks/server/guards/rugular_coffee.rb
|
342
|
-
- lib/rugular/tasks/server/guards/rugular_es6.rb
|
343
342
|
- lib/rugular/tasks/server/guards/rugular_haml.rb
|
344
343
|
- lib/rugular/tasks/server/guards/rugular_index_html.rb
|
345
344
|
- lib/rugular/tasks/tmux.rb
|
@@ -351,8 +350,8 @@ files:
|
|
351
350
|
- lib/rugular/templates/directive/app.directive.spec.coffee.erb
|
352
351
|
- lib/rugular/templates/directive/app.haml.erb
|
353
352
|
- lib/rugular/templates/directive/app.module.coffee.erb
|
354
|
-
- lib/rugular/templates/factory/app.factory.coffee
|
355
|
-
- lib/rugular/templates/factory/app.module.coffee
|
353
|
+
- lib/rugular/templates/factory/app.factory.coffee.erb
|
354
|
+
- lib/rugular/templates/factory/app.module.coffee.erb
|
356
355
|
- lib/rugular/templates/filter/app.filter.coffee.erb
|
357
356
|
- lib/rugular/templates/filter/app.filter.spec.coffee.erb
|
358
357
|
- lib/rugular/templates/filter/app.module.coffee.erb
|
@@ -364,7 +363,7 @@ files:
|
|
364
363
|
- lib/rugular/templates/new/e2e/app_spec.coffee
|
365
364
|
- lib/rugular/templates/new/karma.conf.js
|
366
365
|
- lib/rugular/templates/new/protractor.conf.js
|
367
|
-
- lib/rugular/templates/new/src/app/app.controller.
|
366
|
+
- lib/rugular/templates/new/src/app/app.controller.coffee
|
368
367
|
- lib/rugular/templates/new/src/app/app.controller.spec.coffee
|
369
368
|
- lib/rugular/templates/new/src/app/app.haml
|
370
369
|
- lib/rugular/templates/new/src/app/app.module.coffee
|
@@ -1,55 +0,0 @@
|
|
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 js!\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
|
-
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
|