frenerator 0.1.1
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 +7 -0
- data/.gitignore +9 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +36 -0
- data/Rakefile +1 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/frenerator.gemspec +33 -0
- data/lib/frenerator/engine.rb +5 -0
- data/lib/frenerator/version.rb +3 -0
- data/lib/frenerator.rb +6 -0
- data/lib/generators/frenerator/frontend/USAGE +5 -0
- data/lib/generators/frenerator/frontend/frontend_generator.rb +56 -0
- data/lib/generators/frenerator/frontend/templates/.bowerrc +3 -0
- data/lib/generators/frenerator/frontend/templates/.coffee-lint.json +14 -0
- data/lib/generators/frenerator/frontend/templates/.keep +0 -0
- data/lib/generators/frenerator/frontend/templates/.scss-lint.yml +168 -0
- data/lib/generators/frenerator/frontend/templates/Gruntfile.js +111 -0
- data/lib/generators/frenerator/frontend/templates/Guardfile +22 -0
- data/lib/generators/frenerator/frontend/templates/bower.json +21 -0
- data/lib/generators/frenerator/frontend/templates/javascripts/application.js +48 -0
- data/lib/generators/frenerator/frontend/templates/javascripts/base/view.coffee +37 -0
- data/lib/generators/frenerator/frontend/templates/javascripts/collections/.keep +0 -0
- data/lib/generators/frenerator/frontend/templates/javascripts/components.coffee +3 -0
- data/lib/generators/frenerator/frontend/templates/javascripts/main.coffee +18 -0
- data/lib/generators/frenerator/frontend/templates/javascripts/models/.keep +0 -0
- data/lib/generators/frenerator/frontend/templates/javascripts/namespace.js +14 -0
- data/lib/generators/frenerator/frontend/templates/javascripts/templates/.keep +0 -0
- data/lib/generators/frenerator/frontend/templates/javascripts/views/.keep +0 -0
- data/lib/generators/frenerator/frontend/templates/package.json +21 -0
- metadata +118 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: e817c25b719b14c2b43c098dd744e66a44afc5a2
|
|
4
|
+
data.tar.gz: 8e02f08dff43a0af3ef67fed19a1c95edc95b478
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: dc78b3a2bfbe967ca51e5e81bce731f485365427355a788b5d370b704bfa4ef851ec4150644e51b9cddb960e004dbecb8abda68b795e8098d71f992d73fd6074
|
|
7
|
+
data.tar.gz: d0dc886744b3aea4091e17d72ceb1e577289f1f28d54a18ba2098c57804ea0a8081b4750beec44455197d9f70f571d18d7734e66fca70a08d384ebec5b56ae9f
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 Anthony Karasavov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Frenerator
|
|
2
|
+
|
|
3
|
+
Rails generator for a common web front-end
|
|
4
|
+
|
|
5
|
+
## Installation and usage
|
|
6
|
+
|
|
7
|
+
On a *FRESH* Rails app in Gemfile:
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
gem 'frenerator'
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
And then execute:
|
|
14
|
+
|
|
15
|
+
$ bundle
|
|
16
|
+
|
|
17
|
+
You now have the frenerator. Run with:
|
|
18
|
+
|
|
19
|
+
$ rails g frenerator:frontend
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## Development
|
|
23
|
+
|
|
24
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
25
|
+
|
|
26
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
27
|
+
|
|
28
|
+
## Contributing
|
|
29
|
+
|
|
30
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/muxcmux/frenerator.
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## License
|
|
34
|
+
|
|
35
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
|
36
|
+
|
data/Rakefile
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/console
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "frenerator"
|
|
5
|
+
|
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
+
|
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
+
# require "pry"
|
|
11
|
+
# Pry.start
|
|
12
|
+
|
|
13
|
+
require "irb"
|
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/frenerator.gemspec
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'frenerator/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "frenerator"
|
|
8
|
+
spec.version = Frenerator::VERSION
|
|
9
|
+
spec.authors = ["Anthony Karasavov"]
|
|
10
|
+
spec.email = ["storm.bg@gmail.com"]
|
|
11
|
+
|
|
12
|
+
spec.summary = %q{Rails backbone.js frontend generator}
|
|
13
|
+
spec.description = %q{Rails frontend generators for managing assets with bower, grunt and some init code}
|
|
14
|
+
spec.homepage = "https://github.com/muxcmux/frenerator"
|
|
15
|
+
spec.license = "MIT"
|
|
16
|
+
|
|
17
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
|
18
|
+
# delete this section to allow pushing this gem to any host.
|
|
19
|
+
if spec.respond_to?(:metadata)
|
|
20
|
+
spec.metadata['allowed_push_host'] = "https://rubygems.org"
|
|
21
|
+
else
|
|
22
|
+
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
26
|
+
spec.bindir = "exe"
|
|
27
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
28
|
+
spec.require_paths = ["lib"]
|
|
29
|
+
|
|
30
|
+
spec.add_dependency "railties", "~> 4.2"
|
|
31
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
|
32
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
|
33
|
+
end
|
data/lib/frenerator.rb
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
require 'rails/generators/base'
|
|
2
|
+
|
|
3
|
+
module Frenerator
|
|
4
|
+
module Generators
|
|
5
|
+
class FrontendGenerator < Rails::Generators::Base
|
|
6
|
+
source_root File.expand_path('../templates', __FILE__)
|
|
7
|
+
|
|
8
|
+
def linters
|
|
9
|
+
copy_file ".coffee-lint.json", ".coffee-lint.json"
|
|
10
|
+
copy_file ".scss-lint.yml", ".scss-lint.yml"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def bower
|
|
14
|
+
copy_file ".bowerrc", ".bowerrc"
|
|
15
|
+
copy_file "bower.json", "bower.json"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def node
|
|
19
|
+
copy_file "package.json", "package.json"
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def grunt
|
|
23
|
+
copy_file "Gruntfile.js", "Gruntfile.js"
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def components
|
|
27
|
+
copy_file ".keep", "components/.keep"
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def javascripts
|
|
31
|
+
directory "javascripts", "app/assets/javascripts"
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def livereload
|
|
35
|
+
gem_group :development do
|
|
36
|
+
gem 'guard-bundler'
|
|
37
|
+
gem 'guard-rails'
|
|
38
|
+
gem 'guard-livereload'
|
|
39
|
+
gem 'rack-livereload'
|
|
40
|
+
end
|
|
41
|
+
copy_file "Guardfile", "Guardfile"
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def asset_gems
|
|
45
|
+
gem_group :development do
|
|
46
|
+
gem 'coffee-rails', version: '~> 4.1.0'
|
|
47
|
+
gem 'sass-rails', version: '~> 5.0.3'
|
|
48
|
+
gem 'scss-lint'
|
|
49
|
+
gem 'autoprefixer-rails', version: '~> 5.2.0.1'
|
|
50
|
+
gem 'sprockets-media_query_combiner', version: '~> 0.0.8'
|
|
51
|
+
gem 'htmlcompressor', version: '~> 0.2.0'
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"arrow_spacing": { "level": "warn" },
|
|
3
|
+
"max_line_length": { "level": "ignore" },
|
|
4
|
+
"no_debugger": { "level": "ignore" },
|
|
5
|
+
"no_empty_functions": { "level": "warn" },
|
|
6
|
+
"no_empty_param_list": { "level": "warn" },
|
|
7
|
+
"no_interpolation_in_single_quotes": { "level": "error" },
|
|
8
|
+
"no_plusplus": { "level": "error" },
|
|
9
|
+
"no_this": { "level": "warn" },
|
|
10
|
+
"no_trailing_whitespace": { "level": "warn" },
|
|
11
|
+
"no_unnecessary_double_quotes": { "level": "warn" },
|
|
12
|
+
"space_operators": { "level": "warn" },
|
|
13
|
+
"spacing_after_comma": { "level": "warn" }
|
|
14
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
linters:
|
|
2
|
+
BangFormat:
|
|
3
|
+
enabled: true
|
|
4
|
+
space_before_bang: true
|
|
5
|
+
space_after_bang: false
|
|
6
|
+
|
|
7
|
+
BorderZero:
|
|
8
|
+
enabled: true
|
|
9
|
+
|
|
10
|
+
ColorKeyword:
|
|
11
|
+
enabled: false
|
|
12
|
+
|
|
13
|
+
ColorVariable:
|
|
14
|
+
enabled: false
|
|
15
|
+
|
|
16
|
+
Comment:
|
|
17
|
+
enabled: false
|
|
18
|
+
|
|
19
|
+
DebugStatement:
|
|
20
|
+
enabled: true
|
|
21
|
+
|
|
22
|
+
DeclarationOrder:
|
|
23
|
+
enabled: false
|
|
24
|
+
|
|
25
|
+
DuplicateProperty:
|
|
26
|
+
enabled: true
|
|
27
|
+
|
|
28
|
+
ElsePlacement:
|
|
29
|
+
enabled: true
|
|
30
|
+
style: same_line # or 'new_line'
|
|
31
|
+
|
|
32
|
+
EmptyLineBetweenBlocks:
|
|
33
|
+
enabled: true
|
|
34
|
+
ignore_single_line_blocks: true
|
|
35
|
+
|
|
36
|
+
EmptyRule:
|
|
37
|
+
enabled: true
|
|
38
|
+
|
|
39
|
+
FinalNewline:
|
|
40
|
+
enabled: false
|
|
41
|
+
|
|
42
|
+
HexLength:
|
|
43
|
+
enabled: true
|
|
44
|
+
style: short # or 'long'
|
|
45
|
+
|
|
46
|
+
HexNotation:
|
|
47
|
+
enabled: true
|
|
48
|
+
style: lowercase # or 'uppercase'
|
|
49
|
+
|
|
50
|
+
HexValidation:
|
|
51
|
+
enabled: true
|
|
52
|
+
|
|
53
|
+
ImportantRule:
|
|
54
|
+
enabled: false
|
|
55
|
+
|
|
56
|
+
IdWithExtraneousSelector:
|
|
57
|
+
enabled: true
|
|
58
|
+
|
|
59
|
+
ImportPath:
|
|
60
|
+
enabled: false
|
|
61
|
+
leading_underscore: false
|
|
62
|
+
filename_extension: false
|
|
63
|
+
|
|
64
|
+
Indentation:
|
|
65
|
+
enabled: true
|
|
66
|
+
character: space # or 'tab'
|
|
67
|
+
width: 2
|
|
68
|
+
|
|
69
|
+
LeadingZero:
|
|
70
|
+
enabled: true
|
|
71
|
+
style: exclude_zero # or 'include_zero'
|
|
72
|
+
|
|
73
|
+
MergeableSelector:
|
|
74
|
+
enabled: true
|
|
75
|
+
force_nesting: true
|
|
76
|
+
|
|
77
|
+
NameFormat:
|
|
78
|
+
enabled: false
|
|
79
|
+
|
|
80
|
+
NestingDepth:
|
|
81
|
+
enabled: true
|
|
82
|
+
max_depth: 5
|
|
83
|
+
|
|
84
|
+
PlaceholderInExtend:
|
|
85
|
+
enabled: true
|
|
86
|
+
|
|
87
|
+
PropertySortOrder:
|
|
88
|
+
enabled: false
|
|
89
|
+
|
|
90
|
+
PropertySpelling:
|
|
91
|
+
enabled: true
|
|
92
|
+
extra_properties: []
|
|
93
|
+
|
|
94
|
+
QualifyingElement:
|
|
95
|
+
enabled: true
|
|
96
|
+
allow_with_attribute: false
|
|
97
|
+
allow_with_class: false
|
|
98
|
+
allow_with_id: false
|
|
99
|
+
|
|
100
|
+
SelectorDepth:
|
|
101
|
+
enabled: true
|
|
102
|
+
max_depth: 4
|
|
103
|
+
|
|
104
|
+
SelectorFormat:
|
|
105
|
+
enabled: false
|
|
106
|
+
convention: BEM # or 'hyphenated_lowercase', or 'snake_case', or 'camel_case', or a regex pattern
|
|
107
|
+
|
|
108
|
+
Shorthand:
|
|
109
|
+
enabled: true
|
|
110
|
+
|
|
111
|
+
SingleLinePerProperty:
|
|
112
|
+
enabled: true
|
|
113
|
+
allow_single_line_rule_sets: true
|
|
114
|
+
|
|
115
|
+
SingleLinePerSelector:
|
|
116
|
+
enabled: false
|
|
117
|
+
|
|
118
|
+
SpaceAfterComma:
|
|
119
|
+
enabled: true
|
|
120
|
+
|
|
121
|
+
SpaceAfterPropertyColon:
|
|
122
|
+
enabled: true
|
|
123
|
+
style: one_space # or 'no_space', or 'at_least_one_space', or 'aligned'
|
|
124
|
+
|
|
125
|
+
SpaceAfterPropertyName:
|
|
126
|
+
enabled: true
|
|
127
|
+
|
|
128
|
+
SpaceBeforeBrace:
|
|
129
|
+
enabled: true
|
|
130
|
+
style: space
|
|
131
|
+
allow_single_line_padding: false
|
|
132
|
+
|
|
133
|
+
SpaceBetweenParens:
|
|
134
|
+
enabled: true
|
|
135
|
+
spaces: 0
|
|
136
|
+
|
|
137
|
+
StringQuotes:
|
|
138
|
+
enabled: false
|
|
139
|
+
|
|
140
|
+
TrailingSemicolon:
|
|
141
|
+
enabled: true
|
|
142
|
+
|
|
143
|
+
TrailingZero:
|
|
144
|
+
enabled: false
|
|
145
|
+
|
|
146
|
+
UnnecessaryMantissa:
|
|
147
|
+
enabled: true
|
|
148
|
+
|
|
149
|
+
UnnecessaryParentReference:
|
|
150
|
+
enabled: true
|
|
151
|
+
|
|
152
|
+
UrlFormat:
|
|
153
|
+
enabled: true
|
|
154
|
+
|
|
155
|
+
UrlQuotes:
|
|
156
|
+
enabled: true
|
|
157
|
+
|
|
158
|
+
VendorPrefixes:
|
|
159
|
+
enabled: true
|
|
160
|
+
identifier_list: base
|
|
161
|
+
include: []
|
|
162
|
+
exclude: []
|
|
163
|
+
|
|
164
|
+
ZeroUnit:
|
|
165
|
+
enabled: true
|
|
166
|
+
|
|
167
|
+
Compass::*:
|
|
168
|
+
enabled: false
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
module.exports = function (grunt) {
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
require('load-grunt-tasks')(grunt);
|
|
6
|
+
|
|
7
|
+
grunt.initConfig({
|
|
8
|
+
|
|
9
|
+
coffeelint: {
|
|
10
|
+
app: ['app/assets/javascripts/**/*.coffee', 'app/components/**/*.coffee'],
|
|
11
|
+
options: {
|
|
12
|
+
configFile: '.coffee-lint.json'
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
scsslint: {
|
|
17
|
+
options: {
|
|
18
|
+
config: '.scss-lint.yml',
|
|
19
|
+
bundleExec: true,
|
|
20
|
+
colorizeOutput: true,
|
|
21
|
+
compact: true
|
|
22
|
+
},
|
|
23
|
+
app: ['app/assets/stylesheets/**/*.scss', 'app/components/**/*.scss']
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
svgstore: {
|
|
27
|
+
options: {
|
|
28
|
+
cleanup: ['fill'],
|
|
29
|
+
svg: {
|
|
30
|
+
id: 'icons',
|
|
31
|
+
class: 'icons'
|
|
32
|
+
},
|
|
33
|
+
inheritviewbox: true
|
|
34
|
+
},
|
|
35
|
+
icons: {
|
|
36
|
+
files: {
|
|
37
|
+
'app/assets/images/icons.svg': 'app/assets/images/icons/**/*.svg'
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
handlebars: {
|
|
43
|
+
compile: {
|
|
44
|
+
options: {
|
|
45
|
+
namespace: 'App.Templates',
|
|
46
|
+
processName: function processName(filePath) {
|
|
47
|
+
var noExt = filePath.replace('.hbs', '');
|
|
48
|
+
var noComp = noExt.replace('app/components/', '');
|
|
49
|
+
return noComp.replace('app/assets/javascripts/templates/', '');
|
|
50
|
+
},
|
|
51
|
+
processPartialName: function processPartialName(filePath) {
|
|
52
|
+
var noExt = filePath.replace('.hbs', '');
|
|
53
|
+
var noComp = noExt.replace('app/components/', '');
|
|
54
|
+
return noComp.replace('app/assets/javascripts/templates/', '');
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
files: {
|
|
58
|
+
'app/assets/javascripts/templates.js': [
|
|
59
|
+
'app/assets/javascripts/templates/*.hbs',
|
|
60
|
+
'app/components/**/*.hbs'
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
watch: {
|
|
67
|
+
sass: {
|
|
68
|
+
files: [
|
|
69
|
+
'app/assets/stylesheets/**/*.scss',
|
|
70
|
+
'app/components/**/*.scss'
|
|
71
|
+
],
|
|
72
|
+
tasks: ['scsslint']
|
|
73
|
+
},
|
|
74
|
+
handlebars: {
|
|
75
|
+
files: [
|
|
76
|
+
'app/assets/javascripts/templates/*.hbs',
|
|
77
|
+
'app/components/**/*.hbs'
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
coffee: {
|
|
81
|
+
files: [
|
|
82
|
+
'app/assets/javascripts/**/*.coffee',
|
|
83
|
+
'app/components/**/*.coffee'
|
|
84
|
+
],
|
|
85
|
+
tasks: ['coffeelint']
|
|
86
|
+
},
|
|
87
|
+
icons: {
|
|
88
|
+
files: ['app/assets/images/icons/**/*.svg'],
|
|
89
|
+
tasks: ['svgstore'],
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
grunt.registerTask('build', [
|
|
96
|
+
'handlebars',
|
|
97
|
+
'lint',
|
|
98
|
+
'svgstore',
|
|
99
|
+
]);
|
|
100
|
+
|
|
101
|
+
grunt.registerTask('default', [
|
|
102
|
+
'build',
|
|
103
|
+
'watch',
|
|
104
|
+
]);
|
|
105
|
+
|
|
106
|
+
grunt.registerTask('lint', [
|
|
107
|
+
'scsslint',
|
|
108
|
+
'coffeelint'
|
|
109
|
+
]);
|
|
110
|
+
|
|
111
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
guard :bundler do
|
|
2
|
+
watch('Gemfile')
|
|
3
|
+
# Uncomment next line if your Gemfile contains the `gemspec' command.
|
|
4
|
+
# watch(/^.+\.gemspec/)
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
guard 'rails' do
|
|
8
|
+
watch('Gemfile.lock')
|
|
9
|
+
watch(%r{^(config|lib)/.*})
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
guard 'livereload' do
|
|
13
|
+
watch(%r{app/views/.+\.erb})
|
|
14
|
+
watch(%r{app/components/.+\.erb})
|
|
15
|
+
watch(%r{app/helpers/.+\.rb})
|
|
16
|
+
# Rails Assets Pipeline
|
|
17
|
+
watch('app/assets/javascripts/application.js')
|
|
18
|
+
# Templates
|
|
19
|
+
watch('app/assets/javascripts/templates.js')
|
|
20
|
+
watch(%r{app/assets/stylesheets/(.+\.scss).*$}) { |m| "assets/#{m[1]}" }
|
|
21
|
+
watch(%r{app/components/(.+\.scss).*$}) { |m| "assets/#{m[1]}" }
|
|
22
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "assets",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"authors": [
|
|
5
|
+
"Tony <anthony.karasavov@artirix.com>"
|
|
6
|
+
],
|
|
7
|
+
"license": "No license",
|
|
8
|
+
"private": true,
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"susy": "~2.2.5",
|
|
11
|
+
"lodash": "~3.9.3",
|
|
12
|
+
"backbone": "~1.2.1",
|
|
13
|
+
"fastclick": "~1.0.6",
|
|
14
|
+
"jquery": "~2.1.4",
|
|
15
|
+
"handlebars": "~3.0.3",
|
|
16
|
+
"breakpoint-sass": "~2.6.1",
|
|
17
|
+
"compass-mixins": "~1.0.2",
|
|
18
|
+
"jquery-ujs": "~1.0.4",
|
|
19
|
+
"normalize-scss": "~3.0.3"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
|
17
|
+
//
|
|
18
|
+
// App Entry point
|
|
19
|
+
// ---------------
|
|
20
|
+
//= require namespace
|
|
21
|
+
//= require templates
|
|
22
|
+
//
|
|
23
|
+
// Require all the parts that make up the app
|
|
24
|
+
// ------------------------------------------
|
|
25
|
+
//
|
|
26
|
+
// 1. Base classes
|
|
27
|
+
// ---------------
|
|
28
|
+
//= require_tree ./base
|
|
29
|
+
//
|
|
30
|
+
// 2. Collections
|
|
31
|
+
// --------------
|
|
32
|
+
//= require_tree ./collections
|
|
33
|
+
//
|
|
34
|
+
// 3. Models
|
|
35
|
+
// ---------
|
|
36
|
+
//= require_tree ./models
|
|
37
|
+
//
|
|
38
|
+
// 4. Views
|
|
39
|
+
// --------
|
|
40
|
+
//= require_tree ./views
|
|
41
|
+
//
|
|
42
|
+
// 5. Components
|
|
43
|
+
// -------------
|
|
44
|
+
//= require components
|
|
45
|
+
//
|
|
46
|
+
// 6. Init code
|
|
47
|
+
// ------------
|
|
48
|
+
//= require main
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
class App.View extends Backbone.View
|
|
2
|
+
|
|
3
|
+
destroy: =>
|
|
4
|
+
# give a chance to subclasses before they die
|
|
5
|
+
@onBeforeDestroy()
|
|
6
|
+
# remove view's delegated events (the ones you add inside events: {})
|
|
7
|
+
@undelegateEvents()
|
|
8
|
+
# release anything subscribed to this with @on
|
|
9
|
+
@off()
|
|
10
|
+
# removes the view from the DOM and calls @stopListening()
|
|
11
|
+
@remove()
|
|
12
|
+
|
|
13
|
+
onBeforeDestroy: ->
|
|
14
|
+
undefined
|
|
15
|
+
|
|
16
|
+
forceChromeRepaint: =>
|
|
17
|
+
# ugly ugly ugly h4x0r shit for ugly ugly chrome
|
|
18
|
+
@$el[0].style.display = 'none'
|
|
19
|
+
@$el[0].offsetHeight
|
|
20
|
+
@$el[0].style.display = '';
|
|
21
|
+
|
|
22
|
+
# converts the containing form to model attributes and values
|
|
23
|
+
# use this when updating models with @model.set @serializeForm()
|
|
24
|
+
serializeForm: =>
|
|
25
|
+
obj = {}
|
|
26
|
+
# one form per view or I'll hunt you down and kill you
|
|
27
|
+
_.each @$('form').serializeArray(), (el) ->
|
|
28
|
+
# Rails array params shenanigans
|
|
29
|
+
if el.name.match /\[\]/
|
|
30
|
+
name = el.name.replace('[', '').replace(']', '')
|
|
31
|
+
if typeof obj[name] == 'undefined'
|
|
32
|
+
obj[name] = [el.value]
|
|
33
|
+
else
|
|
34
|
+
obj[name].push el.value
|
|
35
|
+
else
|
|
36
|
+
obj[el.name] = el.value
|
|
37
|
+
obj
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
App.init = ->
|
|
2
|
+
|
|
3
|
+
# Not components
|
|
4
|
+
FastClick.attach(document.body)
|
|
5
|
+
|
|
6
|
+
# Components
|
|
7
|
+
_.forIn App.Components, (component, name) ->
|
|
8
|
+
# only init a component if its 'el' exist in the DOM
|
|
9
|
+
# global component's 'el' is set to 'body' so they get
|
|
10
|
+
# initialized on all pages
|
|
11
|
+
if typeof(component.prototype.el) != 'undefined' && $(component.prototype.el).length != 0
|
|
12
|
+
console.info "Initializing component: #{name}"
|
|
13
|
+
new component
|
|
14
|
+
# Notify all components have initialized
|
|
15
|
+
console.info 'App ready'
|
|
16
|
+
App.Dispatch.trigger 'app:ready'
|
|
17
|
+
|
|
18
|
+
$(document).ready App.init
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
(function(root) {
|
|
2
|
+
root.App = {
|
|
3
|
+
// A component is a top level backbone view
|
|
4
|
+
// and it gets automatically instantiated in main
|
|
5
|
+
Components: {},
|
|
6
|
+
// coffee classes go here
|
|
7
|
+
Views: {},
|
|
8
|
+
Models: {},
|
|
9
|
+
Collections: {},
|
|
10
|
+
Templates: {},
|
|
11
|
+
// awesome sauce
|
|
12
|
+
Dispatch: _.clone(Backbone.Events)
|
|
13
|
+
}
|
|
14
|
+
})(window);
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "assets",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "== README",
|
|
5
|
+
"main": "Gruntfile.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"author": "Tony <anthony.karasavov@artirix.com>",
|
|
10
|
+
"license": "No license",
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"coffeelint": "^1.10.1",
|
|
13
|
+
"grunt": "^0.4.5",
|
|
14
|
+
"grunt-coffeelint": "0.0.13",
|
|
15
|
+
"grunt-contrib-handlebars": "^0.10.2",
|
|
16
|
+
"grunt-contrib-watch": "^0.6.1",
|
|
17
|
+
"grunt-scss-lint": "^0.3.3",
|
|
18
|
+
"grunt-svgstore": "^0.4.0",
|
|
19
|
+
"load-grunt-tasks": "^1.0.0"
|
|
20
|
+
}
|
|
21
|
+
}
|
metadata
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: frenerator
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Anthony Karasavov
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2015-08-05 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: railties
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '4.2'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '4.2'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: bundler
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '1.10'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '1.10'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rake
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '10.0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '10.0'
|
|
55
|
+
description: Rails frontend generators for managing assets with bower, grunt and some
|
|
56
|
+
init code
|
|
57
|
+
email:
|
|
58
|
+
- storm.bg@gmail.com
|
|
59
|
+
executables: []
|
|
60
|
+
extensions: []
|
|
61
|
+
extra_rdoc_files: []
|
|
62
|
+
files:
|
|
63
|
+
- ".gitignore"
|
|
64
|
+
- Gemfile
|
|
65
|
+
- LICENSE.txt
|
|
66
|
+
- README.md
|
|
67
|
+
- Rakefile
|
|
68
|
+
- bin/console
|
|
69
|
+
- bin/setup
|
|
70
|
+
- frenerator.gemspec
|
|
71
|
+
- lib/frenerator.rb
|
|
72
|
+
- lib/frenerator/engine.rb
|
|
73
|
+
- lib/frenerator/version.rb
|
|
74
|
+
- lib/generators/frenerator/frontend/USAGE
|
|
75
|
+
- lib/generators/frenerator/frontend/frontend_generator.rb
|
|
76
|
+
- lib/generators/frenerator/frontend/templates/.bowerrc
|
|
77
|
+
- lib/generators/frenerator/frontend/templates/.coffee-lint.json
|
|
78
|
+
- lib/generators/frenerator/frontend/templates/.keep
|
|
79
|
+
- lib/generators/frenerator/frontend/templates/.scss-lint.yml
|
|
80
|
+
- lib/generators/frenerator/frontend/templates/Gruntfile.js
|
|
81
|
+
- lib/generators/frenerator/frontend/templates/Guardfile
|
|
82
|
+
- lib/generators/frenerator/frontend/templates/bower.json
|
|
83
|
+
- lib/generators/frenerator/frontend/templates/javascripts/application.js
|
|
84
|
+
- lib/generators/frenerator/frontend/templates/javascripts/base/view.coffee
|
|
85
|
+
- lib/generators/frenerator/frontend/templates/javascripts/collections/.keep
|
|
86
|
+
- lib/generators/frenerator/frontend/templates/javascripts/components.coffee
|
|
87
|
+
- lib/generators/frenerator/frontend/templates/javascripts/main.coffee
|
|
88
|
+
- lib/generators/frenerator/frontend/templates/javascripts/models/.keep
|
|
89
|
+
- lib/generators/frenerator/frontend/templates/javascripts/namespace.js
|
|
90
|
+
- lib/generators/frenerator/frontend/templates/javascripts/templates/.keep
|
|
91
|
+
- lib/generators/frenerator/frontend/templates/javascripts/views/.keep
|
|
92
|
+
- lib/generators/frenerator/frontend/templates/package.json
|
|
93
|
+
homepage: https://github.com/muxcmux/frenerator
|
|
94
|
+
licenses:
|
|
95
|
+
- MIT
|
|
96
|
+
metadata:
|
|
97
|
+
allowed_push_host: https://rubygems.org
|
|
98
|
+
post_install_message:
|
|
99
|
+
rdoc_options: []
|
|
100
|
+
require_paths:
|
|
101
|
+
- lib
|
|
102
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
|
+
requirements:
|
|
104
|
+
- - ">="
|
|
105
|
+
- !ruby/object:Gem::Version
|
|
106
|
+
version: '0'
|
|
107
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
|
+
requirements:
|
|
109
|
+
- - ">="
|
|
110
|
+
- !ruby/object:Gem::Version
|
|
111
|
+
version: '0'
|
|
112
|
+
requirements: []
|
|
113
|
+
rubyforge_project:
|
|
114
|
+
rubygems_version: 2.4.5
|
|
115
|
+
signing_key:
|
|
116
|
+
specification_version: 4
|
|
117
|
+
summary: Rails backbone.js frontend generator
|
|
118
|
+
test_files: []
|