rugular 0.5.6 → 0.6.0
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/.hound.yml +9 -0
- data/.rubocop.yml +48 -0
- data/README.md +144 -23
- data/features/new.feature +1 -1
- data/lib/rugular/tasks/build.rb +12 -18
- data/lib/rugular/tasks/generate/factory.rb +11 -0
- data/lib/rugular/tasks/generate/generator_base.rb +0 -5
- data/lib/rugular/tasks/generate.rb +7 -0
- data/lib/rugular/tasks/new.rb +3 -1
- data/lib/rugular/tasks/server/Guardfile +2 -2
- data/lib/rugular/tasks/server/guards/rugular.rb +8 -8
- data/lib/rugular/tasks/server/guards/rugular_assets.rb +5 -14
- data/lib/rugular/tasks/server/guards/rugular_vendor_and_bower_components.rb +1 -1
- data/lib/rugular/tasks/tmux/tmuxinator.yml +15 -0
- data/lib/rugular/tasks/tmux.rb +23 -0
- data/lib/rugular/templates/directive/app.directive.coffee.erb +1 -0
- data/lib/rugular/templates/factory/app.factory.coffee +30 -0
- data/lib/rugular/templates/{filter/less_than_greater_than.module.coffee.erb → factory/app.module.coffee} +0 -0
- data/lib/rugular/templates/filter/{less_than_greater_than.filter.coffee.erb → app.filter.coffee.erb} +0 -0
- data/lib/rugular/templates/filter/{less_than_greater_then.filter.spec.coffee.erb → app.filter.spec.coffee.erb} +1 -1
- data/lib/rugular/templates/filter/app.module.coffee.erb +2 -0
- data/lib/rugular/templates/new/src/app/app.routes.coffee +1 -1
- data/lib/rugular/templates/new/vendor_and_bower_components.yaml +9 -0
- data/lib/rugular/templates/new_erb/bower.json.erb +9 -8
- data/lib/rugular/templates/new_erb/src/index.haml.erb +7 -0
- data/lib/rugular/version.rb +1 -1
- data/lib/rugular.rb +23 -16
- data/rugular.gemspec +1 -0
- metadata +28 -7
- data/lib/rugular/templates/new/src/bower_components.yaml +0 -6
- data/lib/rugular/templates/new/src/index.haml +0 -19
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 712ab8858ec0f97489e98b1159e8291f197f6a84
|
|
4
|
+
data.tar.gz: fe995427e041ce3c3dfa6b8713ac1a4d7807a358
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 069d560a2f150b89528c2fb986cae99fd95ed74e6d5125b6ce8a884be233a99f12c5a5a7e22041cf224e82b2a23331071b6b438468ff9efccb7381629a4d87df
|
|
7
|
+
data.tar.gz: 786a6cc2ca094a7c7d7a809bb5c698ddb9e5a995646303ae543dc58ce9cf0897f7c373a2f7f5e3082cc3971662525ffdac2704b7ec8ec52abe4544e118dc0b22
|
data/.hound.yml
ADDED
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
AllCops:
|
|
2
|
+
RunRailsCops: true
|
|
3
|
+
|
|
4
|
+
Metrics/BlockNesting:
|
|
5
|
+
Max: 2
|
|
6
|
+
|
|
7
|
+
Metrics/LineLength:
|
|
8
|
+
AllowURI: true
|
|
9
|
+
Max: 80
|
|
10
|
+
|
|
11
|
+
Metrics/MethodLength:
|
|
12
|
+
CountComments: false
|
|
13
|
+
Max: 10
|
|
14
|
+
|
|
15
|
+
Metrics/ParameterLists:
|
|
16
|
+
Max: 4
|
|
17
|
+
CountKeywordArgs: true
|
|
18
|
+
|
|
19
|
+
Style/CollectionMethods:
|
|
20
|
+
PreferredMethods:
|
|
21
|
+
map: 'collect'
|
|
22
|
+
reduce: 'inject'
|
|
23
|
+
find: 'detect'
|
|
24
|
+
find_all: 'select'
|
|
25
|
+
|
|
26
|
+
Style/Documentation:
|
|
27
|
+
Enabled: false
|
|
28
|
+
|
|
29
|
+
Style/EachWithObject:
|
|
30
|
+
Enabled: false
|
|
31
|
+
|
|
32
|
+
Style/Lambda:
|
|
33
|
+
Enabled: true
|
|
34
|
+
|
|
35
|
+
Style/MethodName:
|
|
36
|
+
Enabled: true
|
|
37
|
+
|
|
38
|
+
Style/RaiseArgs:
|
|
39
|
+
EnforcedStyle: compact
|
|
40
|
+
|
|
41
|
+
Style/SpaceInsideHashLiteralBraces:
|
|
42
|
+
EnforcedStyle: no_space
|
|
43
|
+
|
|
44
|
+
Style/StringLiterals:
|
|
45
|
+
EnforcedStyle: single_space
|
|
46
|
+
|
|
47
|
+
Style/TrailingComma:
|
|
48
|
+
EnforcedStyleForMultiline: 'comma'
|
data/README.md
CHANGED
|
@@ -3,12 +3,24 @@ Status](https://circleci.com/gh/currica/rugular.svg?style=shield&circle-token=:c
|
|
|
3
3
|
|
|
4
4
|
# Rugular
|
|
5
5
|
|
|
6
|
-
Rugular is a framework to build AngularJS apps
|
|
6
|
+
Rugular is a framework to build AngularJS 1.3 apps. The goal is to
|
|
7
7
|
provide a rails-like interface to constructing a UI with Sass, Haml, and
|
|
8
|
-
|
|
8
|
+
CoffeeScript with generators to create template files.
|
|
9
|
+
|
|
10
|
+
> AngularJS is a fast-moving framework, and it is a goal of Rugular to keep
|
|
11
|
+
> pace with all the exciting changes that are happening. Please read more about
|
|
12
|
+
> the anticipated changes in the [roadmap section](#roadmap) below.
|
|
9
13
|
|
|
10
14
|
## Installation
|
|
11
15
|
|
|
16
|
+
### Prerequesites
|
|
17
|
+
|
|
18
|
+
* nodejs
|
|
19
|
+
* bower
|
|
20
|
+
* ruby 2.0 or later
|
|
21
|
+
|
|
22
|
+
### Installing the Gem
|
|
23
|
+
|
|
12
24
|
```bash
|
|
13
25
|
gem install rugular
|
|
14
26
|
```
|
|
@@ -19,7 +31,7 @@ gem install rugular
|
|
|
19
31
|
rugular new <project_name>
|
|
20
32
|
```
|
|
21
33
|
|
|
22
|
-
A new Rugular project contains the following folders:
|
|
34
|
+
A new Rugular project contains the following folders and files:
|
|
23
35
|
|
|
24
36
|
<pre>
|
|
25
37
|
├── .application.sass
|
|
@@ -39,41 +51,87 @@ A new Rugular project contains the following folders:
|
|
|
39
51
|
│ │ ├── app.controller.spec.coffee
|
|
40
52
|
│ │ ├── app.routes.coffee
|
|
41
53
|
│ │ ├── index.haml
|
|
54
|
+
│ ├── assets/
|
|
42
55
|
│ ├── components/
|
|
43
56
|
│ ├── favico.ico
|
|
44
|
-
│ ├── fonts/
|
|
45
|
-
│ ├── images/
|
|
46
|
-
│ ├── images/
|
|
47
|
-
│ ├── vendor_and_bower_components.yaml
|
|
48
57
|
├── vendor/
|
|
58
|
+
├── vendor_and_bower_components.yaml
|
|
49
59
|
</pre>
|
|
50
60
|
|
|
51
61
|
| Folder/File Name | Description |
|
|
52
62
|
| --- | --- |
|
|
53
|
-
| .application.sass | A manifest sass file for development purposes |
|
|
63
|
+
| .application.sass | A manifest sass file for development purposes, you do not need to edit this file. |
|
|
54
64
|
| .gitignore | Many of the files and folders here are not needed for source control, when deploying an application, please use the ``rugular build`` command described below |
|
|
55
|
-
| .tmp | A temporary folder used for storing compiled Haml, Sass, and Coffeescript files. |
|
|
65
|
+
| .tmp | A temporary folder used for storing compiled Haml, Sass, and Coffeescript file, you do not need to edit any files in this folder. |
|
|
56
66
|
| bower_components | A folder used by bower to install packages. |
|
|
57
|
-
| bower.json | A list of packages to be installed by bower |
|
|
58
|
-
| Gemfile | A way to install the ``rugular`` gem locally. This is not needed if you install ``rugular`` globally |
|
|
67
|
+
| bower.json | A list of packages to be installed by bower. |
|
|
68
|
+
| Gemfile | A way to install the ``rugular`` gem locally. This is not needed if you install ``rugular`` globally. |
|
|
59
69
|
| node_modules | A folder used by npm to install packages. |
|
|
60
|
-
| package.json | A list of packages to be installed by npm |
|
|
61
|
-
| src | A folder containing the source code unique to a rugular application.
|
|
62
|
-
| src/
|
|
63
|
-
| src/
|
|
70
|
+
| package.json | A list of packages to be installed by npm. |
|
|
71
|
+
| src | A folder containing the source code unique to a rugular application. |
|
|
72
|
+
| src/app | A folder for application code that correlates to the layout of the application and a URL route in the application. A section is detailed below about [How to Write Rugular apps](#how-to-write-rugular-apps). |
|
|
73
|
+
| src/components | A folder for isolate-scope directives to be used in your application code. This folder is also described in [How to Write Rugular apps](#how-to-write-rugular-apps). |
|
|
74
|
+
| src/assets | A folder to place assets, including but not limited to, ``.png``, ``.woff``, ``.svg``, ``.pdf``. All files placed in the assets folder can be linked by their relative filename, e.g. ``src/assets/logo.png`` can be linked as ``<img src='assets/logo.png'></img>``
|
|
64
75
|
| vendor | 3rd-party javascript, coffeescript, css, and sass files that do not come with bower management. All of these files are included before any code in src. |
|
|
76
|
+
| vendor_and_bower_components.yaml | A file to declare what third party files in the bower_components and vendor folder you would like to include. |
|
|
77
|
+
|
|
78
|
+
## How to Write Rugular Apps
|
|
79
|
+
|
|
80
|
+
Application specific code lies in the ``src`` folder. Other files, such as
|
|
81
|
+
bower_components or other 3rd party vendor files are declared in the
|
|
82
|
+
``vendor_and_bower_components.yaml`` file.
|
|
83
|
+
|
|
84
|
+
Code in the src folder are written in Coffeescript, Haml and Sass and designed
|
|
85
|
+
to follow [Google's Best Practices for an Angular App
|
|
86
|
+
Structure](https://docs.google.com/document/d/1XXMvReO8-Awi1EZXAXS4PzDzdNvV6pGcuaF4Q9821Es/pub).
|
|
87
|
+
The ``rugular new`` command creates an initial folder setup with an ``src/app``
|
|
88
|
+
folder and an ``src/components`` folder.
|
|
89
|
+
|
|
90
|
+
### The src/app folder
|
|
91
|
+
|
|
92
|
+
The files in the ``src/app`` folder that have ``app`` are special to a rugular
|
|
93
|
+
application.
|
|
94
|
+
|
|
95
|
+
The ``src/app/app.module.coffee`` declares the base module for the application.
|
|
96
|
+
Any modules that are created within one level of nesting in the ``src/app``
|
|
97
|
+
folder (e.g. ``src/app/dashboard/dashboard.module.coffee``) are to be included
|
|
98
|
+
in the ``app.module.coffee`` declaration.
|
|
99
|
+
|
|
100
|
+
The ``src/app/app.routes.coffee`` file declares a base route for the
|
|
101
|
+
application from which all other routes are derived from. As such, it is
|
|
102
|
+
advised to prepend all other routes with ``'root.'``.
|
|
65
103
|
|
|
66
|
-
|
|
104
|
+
Because the ``app.routes.coffee`` file declares a base route, the
|
|
105
|
+
``src/app/app.haml`` file serves as an application layout for the rest of your
|
|
106
|
+
application. If you have directives such as a ``navbar`` or ``footer``
|
|
107
|
+
directive, it is advised to add these directives to this ``haml`` file.
|
|
108
|
+
|
|
109
|
+
### The src/components folder
|
|
110
|
+
|
|
111
|
+
The ``src/components`` folder should contain folders of one-off modules that
|
|
112
|
+
contain one or more of the following:
|
|
113
|
+
|
|
114
|
+
* A directive with isolate scope.
|
|
115
|
+
* A factory for encapsulating server-side calls.
|
|
116
|
+
* A filter for sorting data.
|
|
117
|
+
|
|
118
|
+
These files can also live in the ``app`` directory. It is recommended to put
|
|
119
|
+
abstract modules that can be used in other projects in the ``src/components``
|
|
120
|
+
directory. YMMV.
|
|
121
|
+
|
|
122
|
+
## Rugular Generators
|
|
67
123
|
|
|
68
124
|
Rugular generators assist with developing apps by creating template files in
|
|
69
|
-
the src directory.
|
|
70
|
-
Guide](https://github.com/johnpapa/angularjs-styleguide).
|
|
125
|
+
the src directory. The generated files are heavily influenced by [John Papa's
|
|
126
|
+
AngularJS Style Guide](https://github.com/johnpapa/angularjs-styleguide).
|
|
71
127
|
|
|
72
128
|
Each command will create a folder in the ``src/app`` directory that will
|
|
73
129
|
contain the template files and new angular module file if one does not already
|
|
74
130
|
exist. It will also register the angular module, by inserting its declaration
|
|
75
131
|
in the appropriate spot in your application.
|
|
76
132
|
|
|
133
|
+
#### Nesting with Rugular
|
|
134
|
+
|
|
77
135
|
Each command can also contain nesting instructions when you find it appropriate
|
|
78
136
|
to nest angular modules. An example of nesting is given below.
|
|
79
137
|
|
|
@@ -92,6 +150,7 @@ For example, ``rugular generate route dashboard`` generates the following files:
|
|
|
92
150
|
```
|
|
93
151
|
src/app/_dashboard.sass
|
|
94
152
|
src/app/dashboard.controller.coffee
|
|
153
|
+
src/app/dashboard.controller.spec.coffee
|
|
95
154
|
src/app/dashboard.haml
|
|
96
155
|
src/app/dashboard.module.coffee
|
|
97
156
|
src/app/dashboard.routes.coffee
|
|
@@ -110,6 +169,7 @@ generates:
|
|
|
110
169
|
```
|
|
111
170
|
src/app/admin/_dashboard.sass
|
|
112
171
|
src/app/admin/dashboard.controller.coffee
|
|
172
|
+
src/app/admin/dashboard.controller.spec.coffee
|
|
113
173
|
src/app/admin/dashboard.haml
|
|
114
174
|
src/app/admin/dashboard.module.coffee
|
|
115
175
|
src/app/admin/dashboard.routes.coffee
|
|
@@ -120,24 +180,57 @@ with a new route at ``/admin/dashboard``
|
|
|
120
180
|
#### Create a Directive
|
|
121
181
|
|
|
122
182
|
A [directive](https://docs.angularjs.org/guide/directive) refers to an
|
|
123
|
-
abstracted
|
|
183
|
+
abstracted DOM element.
|
|
124
184
|
|
|
125
185
|
```bash
|
|
126
186
|
rugular generate directive <directive_name>
|
|
127
187
|
```
|
|
128
188
|
|
|
129
|
-
|
|
189
|
+
For example, ``rugular generate directive navbar`` generates:
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
src/app/_navbar.sass
|
|
193
|
+
src/app/navbar.controller.coffee
|
|
194
|
+
src/app/navbar.controller.spec.coffee
|
|
195
|
+
src/app/navbar.directive.coffee
|
|
196
|
+
src/app/navbar.haml
|
|
197
|
+
src/app/navbar.module.coffee
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
#### Create a Factory
|
|
201
|
+
|
|
202
|
+
A [factory](https://docs.angularjs.org/guide/services) is an angular service
|
|
203
|
+
that encapsulates data pulled in from other sources.
|
|
130
204
|
|
|
131
205
|
```bash
|
|
132
206
|
rugular generate factory <factory_name>
|
|
133
207
|
```
|
|
134
208
|
|
|
209
|
+
For example, ``rugular generate factory questions`` generates:
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
src/app/questions.factory.coffee
|
|
213
|
+
src/app/questions.module.coffee
|
|
214
|
+
```
|
|
215
|
+
|
|
135
216
|
#### Create a Filter
|
|
136
217
|
|
|
218
|
+
A [filter](https://docs.angularjs.org/guide/filter) refers to special
|
|
219
|
+
formatters in your app. For example, a filter can encapsulate a sorting
|
|
220
|
+
function for displaying an ``ng-repeat``.
|
|
221
|
+
|
|
137
222
|
```bash
|
|
138
223
|
rugular generate filter <factory_name>
|
|
139
224
|
```
|
|
140
225
|
|
|
226
|
+
For example, ``rugular generate filter reverse_alphabetical`` generates:
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
src/app/reverse_alphabetical.filter.coffee
|
|
230
|
+
src/app/reverse_alphabetical.filter.spec.coffee
|
|
231
|
+
src/app/reverse_alphabetical.module.coffee
|
|
232
|
+
```
|
|
233
|
+
|
|
141
234
|
### Creating a component
|
|
142
235
|
|
|
143
236
|
A component refers to shareable, abstracted angular modules, that are not
|
|
@@ -155,12 +248,25 @@ and run a server on ``localhost:5000``. To run the server, type:
|
|
|
155
248
|
bundle exec rugular server
|
|
156
249
|
```
|
|
157
250
|
|
|
251
|
+
## Development Tmux
|
|
252
|
+
|
|
253
|
+
Instead of running the server, rugular has built in support to generate a tmux
|
|
254
|
+
session with [Tmuxinator](https://github.com/tmuxinator/tmuxinator) that
|
|
255
|
+
includes all the processes on different panes and vim in the first pane. To
|
|
256
|
+
start a new tmuxinator session, type:
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
bundle exec rugular tmux
|
|
260
|
+
```
|
|
261
|
+
|
|
158
262
|
## Running the tests
|
|
159
263
|
|
|
160
264
|
### During development
|
|
161
265
|
|
|
162
|
-
``rugular server`` runs the tests with karma
|
|
163
|
-
|
|
266
|
+
``rugular server`` or ``rugular tmux`` runs the unit tests with karma and the
|
|
267
|
+
end-to-end tests with protractor. Karma watches the files in the ``src``
|
|
268
|
+
directory and runs the unit tests on each save. Protractor tests are intended
|
|
269
|
+
to be run individually, or as a suite in CI.
|
|
164
270
|
|
|
165
271
|
### Running the tests once
|
|
166
272
|
|
|
@@ -186,6 +292,21 @@ This will create the following files:
|
|
|
186
292
|
* application.js (a minified version of the coffee files in the src folder)
|
|
187
293
|
* vendor.js (a minified version of bower_component and vendor files)
|
|
188
294
|
|
|
295
|
+
|
|
296
|
+
## Roadmap
|
|
297
|
+
|
|
298
|
+
As soon as it reaches a stable release:
|
|
299
|
+
|
|
300
|
+
* ``angular-ui-router`` will be replaced by the ``router`` re-write by the
|
|
301
|
+
Angular team.
|
|
302
|
+
* Angular 1.3 will be updated to Angular 1.4
|
|
303
|
+
|
|
304
|
+
Post Angular 2.0 changes
|
|
305
|
+
|
|
306
|
+
* replace CoffeeScript with EcmaScript6
|
|
307
|
+
* replace the folder structure and build scripts to take advantage of
|
|
308
|
+
EcmaScript 6 modules
|
|
309
|
+
|
|
189
310
|
## Contributing
|
|
190
311
|
|
|
191
312
|
1. Fork it ( https://github.com/currica/rugular/fork )
|
|
@@ -195,4 +316,4 @@ This will create the following files:
|
|
|
195
316
|
5. Create a new Pull Request
|
|
196
317
|
|
|
197
318
|
## License
|
|
198
|
-
Copyright 2014-2015. Q-Centrix. MIT License.
|
|
319
|
+
Copyright 2014-2015. [Q-Centrix](http://www.q-centrix.com/). MIT License.
|
data/features/new.feature
CHANGED
|
@@ -24,7 +24,7 @@ Feature: Rugular CLI
|
|
|
24
24
|
"""
|
|
25
25
|
And the file "my-app/src/index.haml" should contain:
|
|
26
26
|
"""
|
|
27
|
-
%
|
|
27
|
+
%title my-app
|
|
28
28
|
"""
|
|
29
29
|
And a directory named "my-app/src/components" should exist
|
|
30
30
|
And the output should contain "Thank you for installing Rugular"
|
data/lib/rugular/tasks/build.rb
CHANGED
|
@@ -96,18 +96,18 @@ module Rugular
|
|
|
96
96
|
end
|
|
97
97
|
|
|
98
98
|
def javascript_files
|
|
99
|
-
Dir.glob("src/components/**/*.module.coffee")
|
|
100
|
-
Dir.glob("src/components/**/*.factory.coffee")
|
|
101
|
-
Dir.glob("src/components/**/*.filter.coffee")
|
|
102
|
-
Dir.glob("src/components/**/*.controller.coffee")
|
|
103
|
-
Dir.glob("src/components/**/*.directive.coffee")
|
|
104
|
-
Dir.glob("src/components/**/*.routes.coffee")
|
|
105
|
-
Dir.glob("src/app/**/*.module.coffee")
|
|
106
|
-
Dir.glob("src/app/**/*.factory.coffee")
|
|
107
|
-
Dir.glob("src/app/**/*.filter.coffee")
|
|
108
|
-
Dir.glob("src/app/**/*.controller.coffee")
|
|
109
|
-
Dir.glob("src/app/**/*.directive.coffee")
|
|
110
|
-
Dir.glob("src/app/**/*.routes.coffee")
|
|
99
|
+
Dir.glob("src/components/**/*.module.coffee") +
|
|
100
|
+
Dir.glob("src/components/**/*.factory.coffee") +
|
|
101
|
+
Dir.glob("src/components/**/*.filter.coffee") +
|
|
102
|
+
Dir.glob("src/components/**/*.controller.coffee") +
|
|
103
|
+
Dir.glob("src/components/**/*.directive.coffee") +
|
|
104
|
+
Dir.glob("src/components/**/*.routes.coffee") +
|
|
105
|
+
Dir.glob("src/app/**/*.module.coffee") +
|
|
106
|
+
Dir.glob("src/app/**/*.factory.coffee") +
|
|
107
|
+
Dir.glob("src/app/**/*.filter.coffee") +
|
|
108
|
+
Dir.glob("src/app/**/*.controller.coffee") +
|
|
109
|
+
Dir.glob("src/app/**/*.directive.coffee") +
|
|
110
|
+
Dir.glob("src/app/**/*.routes.coffee")
|
|
111
111
|
end
|
|
112
112
|
|
|
113
113
|
def bower_css
|
|
@@ -124,11 +124,5 @@ module Rugular
|
|
|
124
124
|
def lib_directory
|
|
125
125
|
__dir__.chomp('tasks')
|
|
126
126
|
end
|
|
127
|
-
|
|
128
|
-
def reverse_nested
|
|
129
|
-
lambda do |x, y|
|
|
130
|
-
x.scan('/').length <=> y.scan('/').length
|
|
131
|
-
end
|
|
132
|
-
end
|
|
133
127
|
end
|
|
134
128
|
end
|
|
@@ -32,7 +32,6 @@ module Rugular
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def inject_module_into_module
|
|
35
|
-
return if component?
|
|
36
35
|
if nested?
|
|
37
36
|
insert_into_file(
|
|
38
37
|
nested_module_file,
|
|
@@ -110,9 +109,5 @@ module Rugular
|
|
|
110
109
|
def app_or_component
|
|
111
110
|
options[:c] ? 'components' : 'app'
|
|
112
111
|
end
|
|
113
|
-
|
|
114
|
-
def component?
|
|
115
|
-
app_or_component == 'components'
|
|
116
|
-
end
|
|
117
112
|
end
|
|
118
113
|
end
|
data/lib/rugular/tasks/new.rb
CHANGED
|
@@ -17,7 +17,9 @@ module Rugular
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def create_custom_files
|
|
20
|
-
Dir.glob(
|
|
20
|
+
Dir.glob(
|
|
21
|
+
"#{lib_directory}/templates/new_erb/**/*.erb"
|
|
22
|
+
).each do |file_name|
|
|
21
23
|
pathname = Pathname.new(file_name)
|
|
22
24
|
|
|
23
25
|
create_file "#{app_name}/#{pathname.basename('.erb').to_s}" do
|
|
@@ -29,10 +29,10 @@ module Guard
|
|
|
29
29
|
when '.coffee' then ::RugularCoffee.compile(file)
|
|
30
30
|
when '.haml' then ::RugularHaml.compile(file)
|
|
31
31
|
when '.yaml' then ::RugularVendorAndBowerComponents.compile
|
|
32
|
-
when '.png' then ::RugularAssets.
|
|
33
|
-
when '.jpg' then ::RugularAssets.
|
|
34
|
-
when '.ttf' then ::RugularAssets.
|
|
35
|
-
when '.woff' then ::RugularAssets.
|
|
32
|
+
when '.png' then ::RugularAssets.copy_asset(file)
|
|
33
|
+
when '.jpg' then ::RugularAssets.copy_asset(file)
|
|
34
|
+
when '.ttf' then ::RugularAssets.copy_asset(file)
|
|
35
|
+
when '.woff' then ::RugularAssets.copy_asset(file)
|
|
36
36
|
else next 'Rugular does not know how to handle this file'
|
|
37
37
|
end
|
|
38
38
|
|
|
@@ -51,10 +51,10 @@ module Guard
|
|
|
51
51
|
message = case File.extname(file)
|
|
52
52
|
when '.coffee' then ::RugularCoffee.delete(file)
|
|
53
53
|
when '.haml' then ::RugularHaml.delete(file)
|
|
54
|
-
when '.png' then ::RugularAssets.
|
|
55
|
-
when '.jpg' then ::RugularAssets.
|
|
56
|
-
when '.ttf' then ::RugularAssets.
|
|
57
|
-
when '.woff' then ::RugularAssets.
|
|
54
|
+
when '.png' then ::RugularAssets.delete_asset(file)
|
|
55
|
+
when '.jpg' then ::RugularAssets.delete_asset(file)
|
|
56
|
+
when '.ttf' then ::RugularAssets.delete_asset(file)
|
|
57
|
+
when '.woff' then ::RugularAssets.delete_asset(file)
|
|
58
58
|
when '.yaml'
|
|
59
59
|
then fail 'what are you doing? trying to break rugular?!'
|
|
60
60
|
else next 'Rugular does not know how to handle this file'
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
class RugularAssets
|
|
2
|
-
def self.
|
|
3
|
-
FileUtils.mkdir('.tmp/
|
|
4
|
-
FileUtils.cp(file, ".tmp/
|
|
2
|
+
def self.copy_asset(file)
|
|
3
|
+
FileUtils.mkdir('.tmp/assets') unless File.directory? '.tmp/assets'
|
|
4
|
+
FileUtils.cp(file, ".tmp/assets/#{File.basename(file)}")
|
|
5
5
|
end
|
|
6
6
|
|
|
7
|
-
def self.
|
|
8
|
-
FileUtils.
|
|
9
|
-
FileUtils.cp(file, ".tmp/fonts/#{File.basename(file)}")
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def self.delete_image(file)
|
|
13
|
-
FileUtils.rm(".tmp/images/#{File.basename(file)}")
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def self.delete_font(file)
|
|
17
|
-
FileUtils.rm(".tmp/fonts/#{File.basename(file)}")
|
|
7
|
+
def self.delete_asset(file)
|
|
8
|
+
FileUtils.rm(".tmp/assets/#{File.basename(file)}")
|
|
18
9
|
end
|
|
19
10
|
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
name: rugular
|
|
2
|
+
root: .
|
|
3
|
+
|
|
4
|
+
pre: git fetch origin --prune
|
|
5
|
+
|
|
6
|
+
windows:
|
|
7
|
+
- vim: vim .
|
|
8
|
+
- console: git status
|
|
9
|
+
- karma: ./node_modules/karma/bin/karma start karma.conf
|
|
10
|
+
- server:
|
|
11
|
+
layout: ff0c,204x46,0,0[204x23,0,0,49,204x11,0,24,50,204x10,0,36,51]
|
|
12
|
+
panes:
|
|
13
|
+
- bundle exec guard --guardfile=$(bundle show rugular)/lib/rugular/tasks/server/Guardfile
|
|
14
|
+
- http-server .tmp
|
|
15
|
+
- sass --watch .application.sass:.tmp/application.css -r sass-globbing
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module Rugular
|
|
2
|
+
class Tmux < Thor::Group
|
|
3
|
+
include Thor::Actions
|
|
4
|
+
|
|
5
|
+
Rugular::AppChecker.check_rugular!(name, new.destination_root)
|
|
6
|
+
|
|
7
|
+
desc "creates a new tmux session with the processes necessary for rugular"
|
|
8
|
+
|
|
9
|
+
def copy_tmux_file
|
|
10
|
+
FileUtils.cp tmuxinator_file, "#{Dir.home}/.tmuxinator/rugular.yml"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def start_tmux
|
|
14
|
+
system "tmuxinator start rugular"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
private
|
|
18
|
+
|
|
19
|
+
def tmuxinator_file
|
|
20
|
+
"#{__dir__}/tmux/tmuxinator.yml"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<%= name %>Factory = ($q) ->
|
|
2
|
+
getquestions = ->
|
|
3
|
+
questions = [
|
|
4
|
+
{
|
|
5
|
+
id: 1
|
|
6
|
+
prompt: 'What is your favorite color?'
|
|
7
|
+
type: 'select-one'
|
|
8
|
+
answers: [
|
|
9
|
+
{
|
|
10
|
+
description: 'blue'
|
|
11
|
+
}
|
|
12
|
+
{
|
|
13
|
+
description: 'yellow'
|
|
14
|
+
}
|
|
15
|
+
{
|
|
16
|
+
description: 'red'
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
return $q.when(questions)
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
questions: getQuestions()
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
<%= name %>Factory.$inject = ['$q']
|
|
29
|
+
|
|
30
|
+
angular.module('<%= name %>').factory('<%= name %>Factory', <%= name %>Factory)
|
|
File without changes
|
data/lib/rugular/templates/filter/{less_than_greater_than.filter.coffee.erb → app.filter.coffee.erb}
RENAMED
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "<%= name %>",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"authors": [
|
|
6
6
|
],
|
|
@@ -14,17 +14,18 @@
|
|
|
14
14
|
"tests"
|
|
15
15
|
],
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"angular-mocks": "~1.
|
|
17
|
+
"angular-mocks": "~1.3"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"angular": "~1.
|
|
21
|
-
"angular-
|
|
22
|
-
"angular-
|
|
20
|
+
"angular": "~1.3",
|
|
21
|
+
"angular-animate": "~1.3",
|
|
22
|
+
"angular-sanitize": "~1.3",
|
|
23
|
+
"angular-ui-router": "*",
|
|
24
|
+
"bourbon": "*",
|
|
23
25
|
"font-awesome": "*",
|
|
24
26
|
"moment": "*",
|
|
25
|
-
"
|
|
27
|
+
"neat": "*",
|
|
26
28
|
"toastr": "*",
|
|
27
|
-
"
|
|
28
|
-
"neat": "*"
|
|
29
|
+
"traceur": "*"
|
|
29
30
|
}
|
|
30
31
|
}
|
data/lib/rugular/version.rb
CHANGED
data/lib/rugular.rb
CHANGED
|
@@ -6,24 +6,24 @@ module Rugular
|
|
|
6
6
|
register(New, 'new', 'new', 'create a new Rugular project')
|
|
7
7
|
|
|
8
8
|
register(
|
|
9
|
-
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
9
|
+
Build,
|
|
10
|
+
'build',
|
|
11
|
+
'build',
|
|
12
|
+
'build the Rugular distribution'
|
|
13
13
|
)
|
|
14
14
|
|
|
15
15
|
register(
|
|
16
|
-
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
16
|
+
ContinuousIntegration,
|
|
17
|
+
'ci',
|
|
18
|
+
'ci',
|
|
19
|
+
'run the Rugular tests once for CI'
|
|
20
20
|
)
|
|
21
21
|
|
|
22
22
|
register(
|
|
23
|
-
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
23
|
+
Dependencies,
|
|
24
|
+
'dependencies',
|
|
25
|
+
'dependencies',
|
|
26
|
+
'install project dependencies'
|
|
27
27
|
)
|
|
28
28
|
|
|
29
29
|
register(
|
|
@@ -34,10 +34,17 @@ module Rugular
|
|
|
34
34
|
)
|
|
35
35
|
|
|
36
36
|
register(
|
|
37
|
-
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
37
|
+
Server,
|
|
38
|
+
'server',
|
|
39
|
+
'server',
|
|
40
|
+
'start the Rugular server'
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
register(
|
|
44
|
+
Tmux,
|
|
45
|
+
'tmux',
|
|
46
|
+
'tmux',
|
|
47
|
+
'start a rugular tmux session'
|
|
41
48
|
)
|
|
42
49
|
end
|
|
43
50
|
end
|
data/rugular.gemspec
CHANGED
|
@@ -28,6 +28,7 @@ Gem::Specification.new do |spec|
|
|
|
28
28
|
spec.add_runtime_dependency 'thor', '~> 0'
|
|
29
29
|
spec.add_runtime_dependency 'sass-globbing', '~> 1'
|
|
30
30
|
spec.add_runtime_dependency 'nokogiri', '~> 1'
|
|
31
|
+
spec.add_runtime_dependency 'tmuxinator', '~> 0'
|
|
31
32
|
|
|
32
33
|
spec.add_development_dependency 'aruba', '~> 0'
|
|
33
34
|
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.
|
|
4
|
+
version: 0.6.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-02-
|
|
11
|
+
date: 2015-02-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionview
|
|
@@ -164,6 +164,20 @@ dependencies:
|
|
|
164
164
|
- - "~>"
|
|
165
165
|
- !ruby/object:Gem::Version
|
|
166
166
|
version: '1'
|
|
167
|
+
- !ruby/object:Gem::Dependency
|
|
168
|
+
name: tmuxinator
|
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
|
170
|
+
requirements:
|
|
171
|
+
- - "~>"
|
|
172
|
+
- !ruby/object:Gem::Version
|
|
173
|
+
version: '0'
|
|
174
|
+
type: :runtime
|
|
175
|
+
prerelease: false
|
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
177
|
+
requirements:
|
|
178
|
+
- - "~>"
|
|
179
|
+
- !ruby/object:Gem::Version
|
|
180
|
+
version: '0'
|
|
167
181
|
- !ruby/object:Gem::Dependency
|
|
168
182
|
name: aruba
|
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -229,6 +243,8 @@ extensions: []
|
|
|
229
243
|
extra_rdoc_files: []
|
|
230
244
|
files:
|
|
231
245
|
- ".gitignore"
|
|
246
|
+
- ".hound.yml"
|
|
247
|
+
- ".rubocop.yml"
|
|
232
248
|
- ".ruby-version"
|
|
233
249
|
- Gemfile
|
|
234
250
|
- README.md
|
|
@@ -247,6 +263,7 @@ files:
|
|
|
247
263
|
- lib/rugular/tasks/dependencies.rb
|
|
248
264
|
- lib/rugular/tasks/generate.rb
|
|
249
265
|
- lib/rugular/tasks/generate/directive.rb
|
|
266
|
+
- lib/rugular/tasks/generate/factory.rb
|
|
250
267
|
- lib/rugular/tasks/generate/filter.rb
|
|
251
268
|
- lib/rugular/tasks/generate/generator_base.rb
|
|
252
269
|
- lib/rugular/tasks/generate/route.rb
|
|
@@ -262,15 +279,19 @@ files:
|
|
|
262
279
|
- lib/rugular/tasks/server/guards/rugular_haml.rb
|
|
263
280
|
- lib/rugular/tasks/server/guards/rugular_index_html.rb
|
|
264
281
|
- lib/rugular/tasks/server/guards/rugular_vendor_and_bower_components.rb
|
|
282
|
+
- lib/rugular/tasks/tmux.rb
|
|
283
|
+
- lib/rugular/tasks/tmux/tmuxinator.yml
|
|
265
284
|
- lib/rugular/templates/directive/_app.sass.erb
|
|
266
285
|
- lib/rugular/templates/directive/app.controller.coffee.erb
|
|
267
286
|
- lib/rugular/templates/directive/app.directive.coffee.erb
|
|
268
287
|
- lib/rugular/templates/directive/app.directive.spec.coffee.erb
|
|
269
288
|
- lib/rugular/templates/directive/app.haml.erb
|
|
270
289
|
- lib/rugular/templates/directive/app.module.coffee.erb
|
|
271
|
-
- lib/rugular/templates/
|
|
272
|
-
- lib/rugular/templates/
|
|
273
|
-
- lib/rugular/templates/filter/
|
|
290
|
+
- lib/rugular/templates/factory/app.factory.coffee
|
|
291
|
+
- lib/rugular/templates/factory/app.module.coffee
|
|
292
|
+
- lib/rugular/templates/filter/app.filter.coffee.erb
|
|
293
|
+
- lib/rugular/templates/filter/app.filter.spec.coffee.erb
|
|
294
|
+
- lib/rugular/templates/filter/app.module.coffee.erb
|
|
274
295
|
- lib/rugular/templates/new/.gitignore
|
|
275
296
|
- lib/rugular/templates/new/Gemfile
|
|
276
297
|
- lib/rugular/templates/new/e2e/app_spec.coffee
|
|
@@ -283,12 +304,12 @@ files:
|
|
|
283
304
|
- lib/rugular/templates/new/src/app/app.routes.coffee
|
|
284
305
|
- lib/rugular/templates/new/src/app/app.sass
|
|
285
306
|
- lib/rugular/templates/new/src/application.sass
|
|
286
|
-
- lib/rugular/templates/new/src/bower_components.yaml
|
|
287
307
|
- lib/rugular/templates/new/src/favicon.ico
|
|
288
|
-
- lib/rugular/templates/new/src/index.haml
|
|
289
308
|
- lib/rugular/templates/new/test/spec_helper.js
|
|
309
|
+
- lib/rugular/templates/new/vendor_and_bower_components.yaml
|
|
290
310
|
- lib/rugular/templates/new_erb/bower.json.erb
|
|
291
311
|
- lib/rugular/templates/new_erb/package.json.erb
|
|
312
|
+
- lib/rugular/templates/new_erb/src/index.haml.erb
|
|
292
313
|
- lib/rugular/templates/route/_app.sass.erb
|
|
293
314
|
- lib/rugular/templates/route/app.controller.coffee.erb
|
|
294
315
|
- lib/rugular/templates/route/app.controller.spec.coffee.erb
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
!!!
|
|
2
|
-
%html{'ng-app' => 'app'}
|
|
3
|
-
%head
|
|
4
|
-
%title Hello
|
|
5
|
-
|
|
6
|
-
-# add a list of bower css and javascript files you wish to include in the
|
|
7
|
-
-# bower_components.yml file
|
|
8
|
-
%link(href='bower_components.css', media='screen', rel='stylesheet')
|
|
9
|
-
%link(href='application.css', media='screen', rel='stylesheet')
|
|
10
|
-
|
|
11
|
-
%body
|
|
12
|
-
/[f lt IE 9] <a href='http://browsehappy.com/'> You are using an out of date browser; this is very dangerous. I strongly urge you to update today.</a>
|
|
13
|
-
|
|
14
|
-
%ui-view
|
|
15
|
-
|
|
16
|
-
-# Do not change these two lines, the application.js file is the manifest
|
|
17
|
-
-# file in dist
|
|
18
|
-
%script(src='bower_components.js')
|
|
19
|
-
%script(src='application.js')
|