rugular 0.9.21 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rugular/tasks/build.rb +66 -12
- data/lib/rugular/tasks/generate/generator_base.rb +1 -17
- data/lib/rugular/templates/directive/app.jade.erb +1 -0
- data/lib/rugular/templates/route/app.jade.erb +1 -0
- data/lib/rugular/version.rb +1 -1
- metadata +4 -4
- data/lib/rugular/templates/directive/app.haml.erb +0 -1
- data/lib/rugular/templates/route/app.haml.erb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fa2393dcea642e77e819d75960eb0c8e98776bd
|
4
|
+
data.tar.gz: be78f67e033491d4c2ab56677474b41f26057838
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c2eb7dfbc552dff954f7d64dd6f03abc8b85e58aed480794e446f51b5ab9b6763333d93ab85a7ec1148a6573bc4c6c3cec5a80f6d4977b3b670b568e755d1cd
|
7
|
+
data.tar.gz: a5989d5c30c59ebb4470bde4dc5a134468836f26e0545adef655623d7a525d1d520455f499bf90c5cfda0f8b917382336dd310389034d171feb2b351cb303280
|
data/lib/rugular/tasks/build.rb
CHANGED
@@ -11,9 +11,9 @@ module Rugular
|
|
11
11
|
desc('Creates a minified, compressed version in the dist folder')
|
12
12
|
|
13
13
|
def check_for_rugular_directory
|
14
|
-
|
15
|
-
task_name:
|
16
|
-
root_directory: destination_root
|
14
|
+
Rugular::AppChecker.check_for_rugular_directory(
|
15
|
+
task_name: name,
|
16
|
+
root_directory: new.destination_root
|
17
17
|
)
|
18
18
|
end
|
19
19
|
|
@@ -25,27 +25,37 @@ module Rugular
|
|
25
25
|
|
26
26
|
def compile_bower_javascript
|
27
27
|
File.open('dist/vendor.js', 'w') do |file|
|
28
|
-
file.write(
|
28
|
+
file.write(Uglifier.compile(bower_and_vendor_javascript))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def compile_bower_stylesheets
|
33
|
+
File.open('dist/vendor.css', 'w') do |file|
|
34
|
+
file.write bower_css
|
29
35
|
end
|
30
36
|
end
|
31
37
|
|
32
38
|
def create_application_js_file
|
33
39
|
File.open('dist/application.js', 'w') do |file|
|
34
40
|
file.write(
|
35
|
-
|
36
|
-
|
41
|
+
Uglifier.compile(
|
42
|
+
|
43
|
+
Rugular::JavascriptFiles.ordered_array.map do |javascript_file|
|
44
|
+
text = File.read(javascript_file).gsub('templateUrl', 'template')
|
37
45
|
|
38
|
-
|
39
|
-
|
46
|
+
CoffeeScript.compile(text)
|
47
|
+
end.join
|
48
|
+
|
49
|
+
)
|
40
50
|
)
|
41
51
|
end
|
42
52
|
end
|
43
53
|
|
44
54
|
def inline_template_url_files
|
45
|
-
(Dir.glob(
|
55
|
+
(Dir.glob("**/*.haml") - ["src/index.haml"]).each do |haml_file|
|
46
56
|
haml_html = ::Haml::Engine.new(File.read(haml_file), {}).render
|
47
57
|
|
48
|
-
html = haml_html.tr("\n", '').gsub(
|
58
|
+
html = haml_html.tr("\n", '').gsub("'", "\'").gsub('"', '\"')
|
49
59
|
|
50
60
|
html_filename = haml_file.gsub('src/', '').gsub('haml', 'html')
|
51
61
|
|
@@ -55,16 +65,60 @@ module Rugular
|
|
55
65
|
end
|
56
66
|
end
|
57
67
|
|
68
|
+
def inject_backend_urls
|
69
|
+
Rugular::BackendURLInjector.inject_urls(
|
70
|
+
config_file: 'config.yaml',
|
71
|
+
constant_file: 'dist/application.js',
|
72
|
+
environment: :production
|
73
|
+
)
|
74
|
+
end
|
75
|
+
|
76
|
+
def add_template_application_sass_file
|
77
|
+
FileUtils.cp(
|
78
|
+
"#{lib_directory}/templates/server/application.sass",
|
79
|
+
"#{destination_root}/.application.sass"
|
80
|
+
)
|
81
|
+
end
|
82
|
+
|
83
|
+
def create_application_css_file
|
84
|
+
`sass .application.sass dist/application.css -r sass-globbing`
|
85
|
+
end
|
86
|
+
|
87
|
+
def copy_images
|
88
|
+
FileUtils.cp_r('src/images', 'dist')
|
89
|
+
end
|
90
|
+
|
91
|
+
def copy_fonts
|
92
|
+
FileUtils.cp_r('src/fonts', 'dist')
|
93
|
+
end
|
94
|
+
|
58
95
|
private
|
59
96
|
|
97
|
+
def bower_and_vendor_javascript
|
98
|
+
bower_javascript + vendor_javascript
|
99
|
+
end
|
100
|
+
|
60
101
|
def bower_javascript
|
61
|
-
bower_yaml.fetch('js').map do |filename|
|
102
|
+
bower_yaml.fetch('bower_components').fetch('js').map do |filename|
|
62
103
|
File.read('bower_components/' + filename)
|
63
104
|
end.join
|
64
105
|
end
|
65
106
|
|
107
|
+
def vendor_javascript
|
108
|
+
bower_yaml.fetch('vendor').fetch('coffee').map do |filename|
|
109
|
+
CoffeeScript.compile(File.read('vendor/' + filename))
|
110
|
+
end.join
|
111
|
+
end
|
112
|
+
|
113
|
+
def bower_css
|
114
|
+
bower_yaml.fetch('bower_components').fetch('css').map do |filename|
|
115
|
+
File.read('bower_components/' + filename)
|
116
|
+
end.join
|
117
|
+
end
|
118
|
+
|
119
|
+
|
66
120
|
def bower_yaml
|
67
|
-
YAML.load(File.read('bower_components.yaml'))
|
121
|
+
YAML.load(File.read('src/bower_components.yaml'))
|
68
122
|
end
|
69
123
|
|
70
124
|
def lib_directory
|
@@ -10,7 +10,7 @@ module Rugular
|
|
10
10
|
class_option(
|
11
11
|
:c,
|
12
12
|
type: :boolean,
|
13
|
-
desc: 'create the
|
13
|
+
desc: 'create the resource in the component folder'
|
14
14
|
)
|
15
15
|
|
16
16
|
def self.source_root
|
@@ -31,22 +31,6 @@ module Rugular
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
def inject_module_into_module
|
35
|
-
if nested?
|
36
|
-
insert_into_file(
|
37
|
-
nested_module_file,
|
38
|
-
module_declaration,
|
39
|
-
after: "angular.module '#{nested_module_name}', [\n"
|
40
|
-
) unless module_declaration_present?(nested_module_file)
|
41
|
-
else
|
42
|
-
insert_into_file(
|
43
|
-
app_module_file,
|
44
|
-
module_declaration,
|
45
|
-
after: "angular.module 'app', [\n"
|
46
|
-
) unless module_declaration_present?(app_module_file)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
34
|
def template_files; []; end
|
51
35
|
|
52
36
|
protected
|
@@ -0,0 +1 @@
|
|
1
|
+
h1 <%= name %>
|
@@ -0,0 +1 @@
|
|
1
|
+
h1 <%= name %>
|
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.
|
4
|
+
version: 0.10.0
|
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-
|
11
|
+
date: 2015-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -349,7 +349,7 @@ files:
|
|
349
349
|
- lib/rugular/templates/directive/app.controller.coffee.erb
|
350
350
|
- lib/rugular/templates/directive/app.directive.coffee.erb
|
351
351
|
- lib/rugular/templates/directive/app.directive.spec.coffee.erb
|
352
|
-
- lib/rugular/templates/directive/app.
|
352
|
+
- lib/rugular/templates/directive/app.jade.erb
|
353
353
|
- lib/rugular/templates/directive/app.module.coffee.erb
|
354
354
|
- lib/rugular/templates/factory/app.factory.coffee.erb
|
355
355
|
- lib/rugular/templates/factory/app.module.coffee.erb
|
@@ -379,7 +379,7 @@ files:
|
|
379
379
|
- lib/rugular/templates/route/_app.sass.erb
|
380
380
|
- lib/rugular/templates/route/app.controller.coffee.erb
|
381
381
|
- lib/rugular/templates/route/app.controller.spec.coffee.erb
|
382
|
-
- lib/rugular/templates/route/app.
|
382
|
+
- lib/rugular/templates/route/app.jade.erb
|
383
383
|
- lib/rugular/templates/route/app.module.coffee.erb
|
384
384
|
- lib/rugular/templates/route/app.routes.coffee.erb
|
385
385
|
- lib/rugular/templates/server/application.sass
|
@@ -1 +0,0 @@
|
|
1
|
-
%h1 <%= name %>
|
@@ -1 +0,0 @@
|
|
1
|
-
%h1 <%= name %>
|