frenerator 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12c52b60d56c1cd6a61cecb89c91f495b358d6b2
4
- data.tar.gz: a65d725e5f3e7a7110c866a9d70380bdca78223f
3
+ metadata.gz: 453115bf5b73b64cda1f0bf57cd0ed7b11fb014e
4
+ data.tar.gz: e31f3988625807c9b774db5013e7f3c226483501
5
5
  SHA512:
6
- metadata.gz: 5a535851fdda99063bcdbb76d4b27b0040cd613cc2e6b34ac151dc540d918f08c8d5b59e032ad04c88fe3b82cf471f258fac80775e50961b40a95c4914cd1e99
7
- data.tar.gz: fa5dfa53da0db44ea83ef9c04dae8daef6ee7afce4e33266d760a95dfa700fdde6bd0c34cce64c454bd40cf937cde40093693410f06eb7f92befc6b5fc7489f1
6
+ metadata.gz: ccd87c21ebe4ec9293dfde742aa5f24f2d95cc18addf876fca46bee1e60a4b35c45c11a93e388e95c3931937416178cd34aa14d20835d9b0bb76c2ef06c511b0
7
+ data.tar.gz: ec79018705cdecad737b7f5cb05e87c8d98b487915f2ccd0fed96db9d43f27c18b175e8ea909545ca544c2bbb8022039021bbe1a877fd02f1b80063e77dd0ffa
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Rails generator for a common web front-end
4
4
 
5
- ## Installation and usage
5
+ ## Installation
6
6
 
7
7
  On a *FRESH* Rails app in Gemfile:
8
8
 
@@ -18,6 +18,49 @@ You now have the frenerator. Run with:
18
18
 
19
19
  $ rails g frenerator:frontend
20
20
 
21
+ ## Usage
22
+
23
+ 1. `npm install && bower install`
24
+ 2. `bundle exec guard` (if you want livereload, else `bundle exec rails s`)
25
+ 3. `grunt`
26
+
27
+ The grunt linter uses the 'sass-lint' ruby gem to lint stylesheets and it is
28
+ configured with `bundleExec: true` to make sure everyone is on the same page.
29
+
30
+ ### Javascript structure overview
31
+
32
+ Main javascript file is `application.js` (the one that gets included via a `script` tag)
33
+
34
+ Sprockets for dependency management: `application.js` includes app parts:
35
+
36
+ 1. `dependencies` Place to include all libs, frameworks, etc.
37
+ 2. `namespace` Gives common top level structure and defines `App`
38
+ 3. `templates` Handlebars templates
39
+ 4. `base` Define base coffee classes here
40
+ 5. `collections` -||- collections
41
+ 6. `models` -||- models
42
+ 7. `views` -||- views
43
+ 8. `components` All the top level backbone views live here
44
+ 9. `main` - the init code
45
+
46
+ _You HAVE to manually include all the components you want to use inside `components.coffee`
47
+ or your component code will not be compiled in `application.js`_
48
+
49
+ Components are basically top level views and they live in the `components` dir
50
+ along with their associated `scss` styles, `.hbs` templates and `.erb` partials.
51
+ Every component _must_ have an associated `el`, which is a valid dom selector.
52
+ If it doesn't `main` will not initialize this component. This is handy, because
53
+ you can have components that are initialized only on certain pages. If you want
54
+ a component to be initialized everywhere, you can simply set it's `el` to `body`
55
+
56
+ ##### App.Dispatch and app:ready
57
+
58
+ `App.Dispatch` is a plain old backbone events mixin and is globally available to
59
+ components to comunicate with each other. When all components have initialized
60
+ `App.Dispatch` triggers an `app:ready` event, so that if your component is depending
61
+ on something else, you can wait until `app:ready` to do your work. It will be more
62
+ likely that the component you are depending on will be available at the time this
63
+ event is fired, rather than in your `@initialize` method
21
64
 
22
65
  ## Development
23
66
 
@@ -1,3 +1,3 @@
1
1
  module Frenerator
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -16,6 +16,7 @@
16
16
  "breakpoint-sass": "~2.6.1",
17
17
  "compass-mixins": "~1.0.2",
18
18
  "jquery-ujs": "~1.0.4",
19
- "normalize-scss": "~3.0.3"
19
+ "normalize-scss": "~3.0.3",
20
+ "jquery.cookie": "~1.4.1"
20
21
  }
21
22
  }
@@ -1,19 +1,6 @@
1
- // Require all external lib dependencies
2
- // Sprockets reads bower.json, so you can
3
- // only require component directory and
4
- // it will load the main js file, e.g.:
5
- // {
6
- // ...
7
- // main: 'lib/whatever.js'
8
- // ...
9
- // }
10
- // --------------------------------------
11
- //= require jquery
12
- //= require jquery-ujs
13
- //= require lodash
14
- //= require backbone
15
- //= require handlebars/handlebars.runtime
16
- //= require fastclick
1
+ // App Dependencies
2
+ // ----------------
3
+ //= require dependencies
17
4
  //
18
5
  // App Entry point
19
6
  // ---------------
@@ -0,0 +1,18 @@
1
+ # Require all external lib dependencies
2
+ # Sprockets reads bower.json, so you can
3
+ # only require component directory and
4
+ # it will load the main js file, e.g.:
5
+ # {
6
+ # ...
7
+ # main: 'lib/whatever.js'
8
+ # ...
9
+ # }
10
+ #
11
+ # ------------------------
12
+ #= require jquery
13
+ #= require jquery.cookie
14
+ #= require jquery-ujs
15
+ #= require lodash
16
+ #= require backbone
17
+ #= require handlebars/handlebars.runtime
18
+ #= require fastclick
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frenerator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Karasavov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-05 00:00:00.000000000 Z
11
+ date: 2015-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -83,6 +83,7 @@ files:
83
83
  - lib/generators/frenerator/frontend/templates/javascripts/base/view.coffee
84
84
  - lib/generators/frenerator/frontend/templates/javascripts/collections/.keep
85
85
  - lib/generators/frenerator/frontend/templates/javascripts/components.coffee
86
+ - lib/generators/frenerator/frontend/templates/javascripts/dependencies.coffee
86
87
  - lib/generators/frenerator/frontend/templates/javascripts/main.coffee
87
88
  - lib/generators/frenerator/frontend/templates/javascripts/models/.keep
88
89
  - lib/generators/frenerator/frontend/templates/javascripts/namespace.js