rugular 0.2.0 → 0.2.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9aaa3794008306c36e7ce11e151c371855c0df3d
|
4
|
+
data.tar.gz: 372dd3910b71d7d571f17efd52a3a85125f29c92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd9d1f0fa4a307b308a1d0073485f93aee37748300797257933c2fb5c6d037444e1a7f30506c7af982dd6d287ee5e7609fc6492d182fbbc1af7baf570fd11a17
|
7
|
+
data.tar.gz: 355fb5e1992d14373962e52edf2e37e506302acdf5d1c16d7f605cfe63936bc670bfb5cd8d7ba94b8ebb44a5fd068d1da16fe5bd6bd0b1a7a6d5b37f99eb763c
|
data/README.md
CHANGED
@@ -41,6 +41,7 @@ Structure](https://docs.google.com/document/d/1XXMvReO8-Awi1EZXAXS4PzDzdNvV6pGcu
|
|
41
41
|
├── Gemfile
|
42
42
|
├── package.json
|
43
43
|
├── src/
|
44
|
+
│ ├── application.sass (manifest file)
|
44
45
|
│ ├── app/
|
45
46
|
│ │ ├── app.module.coffee
|
46
47
|
│ │ ├── app.config.coffee
|
@@ -48,7 +49,6 @@ Structure](https://docs.google.com/document/d/1XXMvReO8-Awi1EZXAXS4PzDzdNvV6pGcu
|
|
48
49
|
│ │ ├── app.controller.spec.coffee
|
49
50
|
│ │ ├── app.routes.coffee
|
50
51
|
│ │ ├── index.haml
|
51
|
-
│ │ ├── index.sass
|
52
52
|
│ ├── components/
|
53
53
|
│ ├── 404.html
|
54
54
|
│ ├── 500.html
|
@@ -1,6 +1,5 @@
|
|
1
|
-
web:
|
1
|
+
web: http-server dist
|
2
2
|
guard: bundle exec guard --guardfile=$(bundle show rugular)/lib/rugular/tasks/server/Guardfile
|
3
|
-
sass: sass --watch src/application.
|
4
|
-
selenium: webdriver-manager start &> /dev/null
|
3
|
+
sass: sass --watch --load-path src src/application.sass:dist/application.css
|
5
4
|
karma: ./node_modules/karma/bin/karma start karma.conf
|
6
5
|
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'guard/compat/plugin'
|
2
2
|
require 'haml'
|
3
3
|
require 'coffee_script'
|
4
|
-
require 'uglifier'
|
5
4
|
|
6
5
|
module Guard
|
7
6
|
class Rugular < Plugin
|
@@ -41,9 +40,9 @@ module Guard
|
|
41
40
|
def compile_haml(file)
|
42
41
|
html = ::Haml::Engine.new(File.read(file)).render
|
43
42
|
|
44
|
-
if file
|
43
|
+
if file.include? 'src/index.haml'
|
45
44
|
File.open('dist/index.html', 'w') do |file|
|
46
|
-
file.write
|
45
|
+
file.write html
|
47
46
|
end
|
48
47
|
else
|
49
48
|
compile_coffee('src/app/app.module.coffee')
|
@@ -59,21 +58,19 @@ module Guard
|
|
59
58
|
|
60
59
|
File.open('dist/application.js', 'w') do |file|
|
61
60
|
file.write(
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
).gsub('templateUrl', 'template'),
|
66
|
-
comments: false
|
67
|
-
)
|
61
|
+
CoffeeScript.compile(
|
62
|
+
javascript_files.map { |e| File.read(e) }.join,
|
63
|
+
).gsub('templateUrl', 'template'),
|
68
64
|
)
|
69
65
|
end
|
70
66
|
|
71
67
|
# Inline templates into javascript
|
72
68
|
(Dir.glob("**/*.haml") - ["src/index.haml"]).each do |haml_file|
|
73
|
-
|
74
|
-
|
69
|
+
haml_html = ::Haml::Engine.new(File.read(haml_file), {}).render
|
70
|
+
html = haml_html.tr("\n", '').gsub('"', '\"')
|
71
|
+
html_filename = haml_file.gsub('src/', '').gsub('haml', 'html')
|
75
72
|
IO.write('dist/application.js', File.open('dist/application.js') do |f|
|
76
|
-
f.read.gsub(
|
73
|
+
f.read.gsub(html_filename, html)
|
77
74
|
end)
|
78
75
|
end
|
79
76
|
|
@@ -131,10 +128,6 @@ module Guard
|
|
131
128
|
end
|
132
129
|
end
|
133
130
|
|
134
|
-
def sass_engine
|
135
|
-
@_sass_engine ||= Sass::Engine
|
136
|
-
end
|
137
|
-
|
138
131
|
end
|
139
132
|
end
|
140
133
|
|
data/lib/rugular/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rugular
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Shook
|
@@ -255,9 +255,7 @@ files:
|
|
255
255
|
- lib/rugular/tasks/server.rb
|
256
256
|
- lib/rugular/tasks/server/Guardfile
|
257
257
|
- lib/rugular/tasks/server/Procfile
|
258
|
-
- lib/rugular/tasks/server/guards/coffee.rb
|
259
258
|
- lib/rugular/tasks/server/guards/rugular.rb
|
260
|
-
- lib/rugular/tasks/server/guards/sass.rb
|
261
259
|
- lib/rugular/templates/directive/_app.sass.erb
|
262
260
|
- lib/rugular/templates/directive/app.directive.coffee.erb
|
263
261
|
- lib/rugular/templates/directive/app.directive.spec.coffee.erb
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'guard'
|
2
|
-
require 'guard/plugin'
|
3
|
-
|
4
|
-
module Guard
|
5
|
-
class RugularCoffeeScript < Plugin
|
6
|
-
def start; true end
|
7
|
-
def stop; true end
|
8
|
-
def reload; true end
|
9
|
-
def run_all
|
10
|
-
CoffeeScript.compile
|
11
|
-
|
12
|
-
end
|
13
|
-
|
14
|
-
def run_on_change
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'guard'
|
2
|
-
require 'guard/plugin'
|
3
|
-
|
4
|
-
module Guard
|
5
|
-
class RugularSass < Plugin
|
6
|
-
def initialize(opts = {})
|
7
|
-
end
|
8
|
-
|
9
|
-
def start; true end
|
10
|
-
def stop; true end
|
11
|
-
def reload; true end
|
12
|
-
def run_all
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
def run_on_change
|
17
|
-
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|