rugular 0.5.6 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/.hound.yml +9 -0
  3. data/.rubocop.yml +48 -0
  4. data/README.md +144 -23
  5. data/features/new.feature +1 -1
  6. data/lib/rugular/tasks/build.rb +12 -18
  7. data/lib/rugular/tasks/generate/factory.rb +11 -0
  8. data/lib/rugular/tasks/generate/generator_base.rb +0 -5
  9. data/lib/rugular/tasks/generate.rb +7 -0
  10. data/lib/rugular/tasks/new.rb +3 -1
  11. data/lib/rugular/tasks/server/Guardfile +2 -2
  12. data/lib/rugular/tasks/server/guards/rugular.rb +8 -8
  13. data/lib/rugular/tasks/server/guards/rugular_assets.rb +5 -14
  14. data/lib/rugular/tasks/server/guards/rugular_vendor_and_bower_components.rb +1 -1
  15. data/lib/rugular/tasks/tmux/tmuxinator.yml +15 -0
  16. data/lib/rugular/tasks/tmux.rb +23 -0
  17. data/lib/rugular/templates/directive/app.directive.coffee.erb +1 -0
  18. data/lib/rugular/templates/factory/app.factory.coffee +30 -0
  19. data/lib/rugular/templates/{filter/less_than_greater_than.module.coffee.erb → factory/app.module.coffee} +0 -0
  20. data/lib/rugular/templates/filter/{less_than_greater_than.filter.coffee.erb → app.filter.coffee.erb} +0 -0
  21. data/lib/rugular/templates/filter/{less_than_greater_then.filter.spec.coffee.erb → app.filter.spec.coffee.erb} +1 -1
  22. data/lib/rugular/templates/filter/app.module.coffee.erb +2 -0
  23. data/lib/rugular/templates/new/src/app/app.routes.coffee +1 -1
  24. data/lib/rugular/templates/new/vendor_and_bower_components.yaml +9 -0
  25. data/lib/rugular/templates/new_erb/bower.json.erb +9 -8
  26. data/lib/rugular/templates/new_erb/src/index.haml.erb +7 -0
  27. data/lib/rugular/version.rb +1 -1
  28. data/lib/rugular.rb +23 -16
  29. data/rugular.gemspec +1 -0
  30. metadata +28 -7
  31. data/lib/rugular/templates/new/src/bower_components.yaml +0 -6
  32. 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: 828aaed71855c15f785eb94c3fbcba03b8f81476
4
- data.tar.gz: 242c83fa177fedf08d8fe221567b074c7e3de17d
3
+ metadata.gz: 712ab8858ec0f97489e98b1159e8291f197f6a84
4
+ data.tar.gz: fe995427e041ce3c3dfa6b8713ac1a4d7807a358
5
5
  SHA512:
6
- metadata.gz: 12fdf2ee6b6303683fa9e90e64d2b27e577e21f2bfc0d3549d15dd7755c5d420ba474ae69292a47f2a069c00a65926c502a128fe7072269d51240a155f890bd1
7
- data.tar.gz: 9477c521894ca6bcc5a02524fa24615fd5ba11fb283ee628e3ffc87522ac4c61fb0ffb7cf1cc01f8f7f20343d354c239479e5d675187b6b2590880f46ed7eb65
6
+ metadata.gz: 069d560a2f150b89528c2fb986cae99fd95ed74e6d5125b6ce8a884be233a99f12c5a5a7e22041cf224e82b2a23331071b6b438468ff9efccb7381629a4d87df
7
+ data.tar.gz: 786a6cc2ca094a7c7d7a809bb5c698ddb9e5a995646303ae543dc58ce9cf0897f7c373a2f7f5e3082cc3971662525ffdac2704b7ec8ec52abe4544e118dc0b22
data/.hound.yml ADDED
@@ -0,0 +1,9 @@
1
+ ruby:
2
+ enabled: true
3
+ config_file: .rubocop.yml
4
+
5
+ coffee_script:
6
+ enabled: true
7
+
8
+ scss:
9
+ enabled: true
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; the goal is to
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
- Coffeescript, and generators to create template files.
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. Rugular apps are written in Haml, Coffeescript and Sass and designed to follow [Google's Best Practices for an Angular App Structure](https://docs.google.com/document/d/1XXMvReO8-Awi1EZXAXS4PzDzdNvV6pGcuaF4Q9821Es/pub). |
62
- | src/fonts and src/images | Folders to place fonts and images respectively, in a rugular application they are referenced by their relative filename, e.g. ``src/images/logo.png`` can be linked as ``<img src='images/logo.png'></img>``
63
- | src/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.
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
- ### Rugular Generators
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. These are influenced by [John Papa's AngularJS Style
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 piece of DOM.
183
+ abstracted DOM element.
124
184
 
125
185
  ```bash
126
186
  rugular generate directive <directive_name>
127
187
  ```
128
188
 
129
- #### Create a Factory (TODO)
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. Karma watches the files in the
163
- ``src`` directory and runs the tests on each save.
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
- %link(href='application.css', media='screen', rel='stylesheet')
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"
@@ -96,18 +96,18 @@ module Rugular
96
96
  end
97
97
 
98
98
  def javascript_files
99
- Dir.glob("src/components/**/*.module.coffee").sort(&reverse_nested) +
100
- Dir.glob("src/components/**/*.factory.coffee").sort(&reverse_nested) +
101
- Dir.glob("src/components/**/*.filter.coffee").sort(&reverse_nested) +
102
- Dir.glob("src/components/**/*.controller.coffee").sort(&reverse_nested) +
103
- Dir.glob("src/components/**/*.directive.coffee").sort(&reverse_nested) +
104
- Dir.glob("src/components/**/*.routes.coffee").sort(&reverse_nested) +
105
- Dir.glob("src/app/**/*.module.coffee").sort(&reverse_nested) +
106
- Dir.glob("src/app/**/*.factory.coffee").sort(&reverse_nested) +
107
- Dir.glob("src/app/**/*.filter.coffee").sort(&reverse_nested) +
108
- Dir.glob("src/app/**/*.controller.coffee").sort(&reverse_nested) +
109
- Dir.glob("src/app/**/*.directive.coffee").sort(&reverse_nested) +
110
- Dir.glob("src/app/**/*.routes.coffee").sort(&reverse_nested)
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
@@ -0,0 +1,11 @@
1
+ require_relative 'generator_base'
2
+
3
+ module Rugular
4
+ class Factory < GeneratorBase
5
+
6
+ def template_files
7
+ Dir.glob("#{lib_directory}/templates/factory/*.erb")
8
+ end
9
+
10
+ end
11
+ 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
@@ -44,5 +44,12 @@ module Rugular
44
44
  'filter',
45
45
  'build an angular filter'
46
46
  )
47
+
48
+ register(
49
+ Rugular::Factory,
50
+ 'factory',
51
+ 'factory',
52
+ 'build an angular factory'
53
+ )
47
54
  end
48
55
  end
@@ -17,7 +17,9 @@ module Rugular
17
17
  end
18
18
 
19
19
  def create_custom_files
20
- Dir.glob("#{lib_directory}/templates/new_erb/*.erb").each do |file_name|
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
@@ -1,6 +1,6 @@
1
1
  require "#{__dir__}/guards/rugular.rb"
2
- directories %w(src)
3
2
 
4
3
  guard :rugular do
5
- watch /^.+.[^sass]/
4
+ watch /^src\/.+\.[^sass]/
5
+ watch /^vendor_and_bower_components.yaml/
6
6
  end
@@ -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.copy_image(file)
33
- when '.jpg' then ::RugularAssets.copy_image(file)
34
- when '.ttf' then ::RugularAssets.copy_font(file)
35
- when '.woff' then ::RugularAssets.copy_font(file)
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.delete_image(file)
55
- when '.jpg' then ::RugularAssets.delete_image(file)
56
- when '.ttf' then ::RugularAssets.delete_font(file)
57
- when '.woff' then ::RugularAssets.delete_font(file)
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.copy_image(file)
3
- FileUtils.mkdir('.tmp/images') unless File.directory? '.tmp/images'
4
- FileUtils.cp(file, ".tmp/images/#{File.basename(file)}")
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.copy_font(file)
8
- FileUtils.mkdir('.tmp/fonts') unless File.directory? '.tmp/fonts'
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
@@ -44,6 +44,6 @@ class RugularVendorAndBowerComponents
44
44
  end
45
45
 
46
46
  def bower_yaml
47
- YAML.load(File.read('src/vendor_and_bower_components.yaml'))
47
+ YAML.load(File.read('vendor_and_bower_components.yaml'))
48
48
  end
49
49
  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
@@ -3,6 +3,7 @@
3
3
 
4
4
  <%= name %> = ->
5
5
  return {
6
+ bindToController: true
6
7
  controller: <%= name %>Controller
7
8
  controllerAs: 'vm'
8
9
  restrict: 'A'
@@ -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)
@@ -1,5 +1,5 @@
1
1
  describe '<%= name %>', ->
2
- subject = <%= name %>
2
+ subject = <%= name %>FilterHelper
3
3
 
4
4
  context 'given anything', ->
5
5
  aRandomArray = [
@@ -0,0 +1,2 @@
1
+ angular.module '<%= name %>', [
2
+ ]
@@ -3,7 +3,7 @@ AppRouting = ($stateProvider, $urlRouterProvider) ->
3
3
 
4
4
  $stateProvider.state 'root',
5
5
  url: '/'
6
- templateUrl: "app/app.html"
6
+ templateUrl: 'app/app.html'
7
7
  controller: 'AppController'
8
8
  controllerAs: 'app'
9
9
 
@@ -0,0 +1,9 @@
1
+ bower_components:
2
+ css:
3
+ - 'font-awesome/css/font-awesome.min.css'
4
+ js:
5
+ - 'angular/angular.js'
6
+ - 'angular-ui-router/release/angular-ui-router.js'
7
+ vendor:
8
+ coffee:
9
+ - 'jquery/jquery.minical.js.coffee'
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "<%= name %>",
3
- "version": "0.0.1",
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.2"
17
+ "angular-mocks": "~1.3"
18
18
  },
19
19
  "dependencies": {
20
- "angular": "~1.2",
21
- "angular-sanitize": "~1.2",
22
- "angular-animate": "~1.2",
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
- "angular-ui-router": "*",
27
+ "neat": "*",
26
28
  "toastr": "*",
27
- "bourbon": "*",
28
- "neat": "*"
29
+ "traceur": "*"
29
30
  }
30
31
  }
@@ -0,0 +1,7 @@
1
+ !!!
2
+ %html{'ng-app' => 'app'}
3
+ %head
4
+ %title <%= name %>
5
+ -# You do not need to add link or script tags. Rugular will do that for you.
6
+ %body
7
+ %ui-view
@@ -1,3 +1,3 @@
1
1
  module Rugular
2
- VERSION = '0.5.6'
2
+ VERSION = '0.6.0'
3
3
  end
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
- Dependencies,
10
- 'dependencies',
11
- 'dependencies',
12
- 'install project dependencies'
9
+ Build,
10
+ 'build',
11
+ 'build',
12
+ 'build the Rugular distribution'
13
13
  )
14
14
 
15
15
  register(
16
- Server,
17
- 'server',
18
- 'server',
19
- 'start the Rugular server'
16
+ ContinuousIntegration,
17
+ 'ci',
18
+ 'ci',
19
+ 'run the Rugular tests once for CI'
20
20
  )
21
21
 
22
22
  register(
23
- Build,
24
- 'build',
25
- 'build',
26
- 'build the Rugular distribution'
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
- ContinuousIntegration,
38
- 'ci',
39
- 'ci',
40
- 'run the Rugular tests once for CI'
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.5.6
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-05 00:00:00.000000000 Z
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/filter/less_than_greater_than.filter.coffee.erb
272
- - lib/rugular/templates/filter/less_than_greater_than.module.coffee.erb
273
- - lib/rugular/templates/filter/less_than_greater_then.filter.spec.coffee.erb
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,6 +0,0 @@
1
- css:
2
- - 'font-awesome/css/font-awesome.min.css'
3
- js:
4
- - 'angular/angular.js'
5
- - 'angular-ui-router/release/angular-ui-router.js'
6
-
@@ -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')