frontend-generators 0.0.2 → 0.0.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.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/assets/freelancer/app/assets/images/freelancer/portfolio/cabin.png +0 -0
  3. data/assets/freelancer/app/assets/images/freelancer/portfolio/cake.png +0 -0
  4. data/assets/freelancer/app/assets/images/freelancer/portfolio/circus.png +0 -0
  5. data/assets/freelancer/app/assets/images/freelancer/portfolio/game.png +0 -0
  6. data/assets/freelancer/app/assets/images/freelancer/portfolio/safe.png +0 -0
  7. data/assets/freelancer/app/assets/images/freelancer/portfolio/submarine.png +0 -0
  8. data/assets/freelancer/app/assets/images/freelancer/profile.png +0 -0
  9. data/assets/freelancer/app/assets/javascripts/freelancer/cbpAnimatedHeader.js +44 -0
  10. data/assets/freelancer/app/assets/javascripts/freelancer/classie.js +84 -0
  11. data/assets/freelancer/app/assets/javascripts/freelancer/contact_me.js +73 -0
  12. data/assets/freelancer/app/assets/javascripts/freelancer/freelancer.js +41 -0
  13. data/assets/freelancer/app/assets/javascripts/freelancer/jqBootstrapValidation.js +912 -0
  14. data/assets/freelancer/app/assets/javascripts/freelancer/manifest.js +9 -0
  15. data/assets/freelancer/app/assets/stylesheets/freelancer/bootswatch_bootstrap.css +7065 -0
  16. data/assets/freelancer/app/assets/stylesheets/freelancer/freelancer.css +459 -0
  17. data/assets/freelancer/app/assets/stylesheets/freelancer/manifest.css +7 -0
  18. data/assets/freelancer/app/controllers/freelancers_controller.rb +7 -0
  19. data/assets/freelancer/app/views/freelancers/_about.html.erb +24 -0
  20. data/assets/freelancer/app/views/freelancers/_contact.html.erb +54 -0
  21. data/assets/freelancer/app/views/freelancers/_footer.html.erb +277 -0
  22. data/assets/freelancer/app/views/freelancers/_header.html.erb +15 -0
  23. data/assets/freelancer/app/views/freelancers/_navigation.html.erb +35 -0
  24. data/assets/freelancer/app/views/freelancers/_portfolio.html.erb +73 -0
  25. data/assets/freelancer/app/views/freelancers/index.html.erb +7 -0
  26. data/assets/freelancer/app/views/layouts/freelancer.html.erb +19 -0
  27. data/config/turf/default.rb +11 -0
  28. data/config/turf/development.rb +4 -0
  29. data/config/turf/local.rb +4 -0
  30. data/config/turf/production.rb +3 -0
  31. data/config/turf/test.rb +7 -0
  32. data/frontend-generators.gemspec +1 -0
  33. data/lib/frontend_generators.rb +7 -2
  34. data/lib/frontend_generators/asset_copier.rb +36 -0
  35. data/lib/frontend_generators/assets_copier.rb +10 -41
  36. data/lib/frontend_generators/version.rb +1 -1
  37. metadata +47 -2
@@ -0,0 +1,7 @@
1
+ <%= render "navigation" %>
2
+ <%= render "header" %>
3
+ <%= render "portfolio" %>
4
+ <%= render "about" %>
5
+ <%= render "contact" %>
6
+ <%= render "footer" %>
7
+
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Start Bootstrap Freelancer</title>
5
+ <%= stylesheet_link_tag 'freelancer/manifest.css', media: 'all' %>
6
+ <link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
7
+ <link href="http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css">
8
+ <%= javascript_include_tag 'freelancer/manifest.js' %>
9
+ <%= csrf_meta_tags %>
10
+ </head>
11
+
12
+ <body id="page-top" class="index">
13
+
14
+ <%= yield %>
15
+
16
+ </body>
17
+ </html>
18
+
19
+
@@ -0,0 +1,11 @@
1
+ module Turf; class Default
2
+
3
+ def root
4
+ @root ||= File.expand_path("../../", File.dirname(__FILE__))
5
+ end
6
+
7
+ def destination_root
8
+ Rails.root
9
+ end
10
+
11
+ end; end
@@ -0,0 +1,4 @@
1
+ module Turf; class Development
2
+
3
+ end; end
4
+
@@ -0,0 +1,4 @@
1
+ module Turf; class Local
2
+
3
+
4
+ end; end
@@ -0,0 +1,3 @@
1
+ module Turf; class Production
2
+
3
+ end; end
@@ -0,0 +1,7 @@
1
+ module Turf; class Test
2
+
3
+ def destination_root
4
+ "#{Turf.find(:root)}/tmp/"
5
+ end
6
+
7
+ end; end
@@ -25,4 +25,5 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency "pry"
26
26
 
27
27
  spec.add_dependency "rainbow", "2.0.0"
28
+ spec.add_dependency "turf", "0.0.5"
28
29
  end
@@ -1,8 +1,13 @@
1
+ require "rainbow"
2
+ require "turf"
3
+
4
+ turf_path = File.expand_path("../config/turf/", File.dirname(__FILE__))
5
+ Dir.glob("#{turf_path}/*.rb").each {|f| require f}
6
+
1
7
  require "frontend_generators/version"
8
+ require_relative "./frontend_generators/asset_copier.rb"
2
9
  require_relative "./frontend_generators/assets_copier.rb"
3
10
 
4
- require "rainbow"
5
-
6
11
  module FrontendGenerators
7
12
 
8
13
  end
@@ -0,0 +1,36 @@
1
+ module FrontendGenerators; class AssetCopier
2
+
3
+ attr_reader :asset_path, :asset_root_dirname
4
+
5
+ def initialize(asset_path, asset_root_dirname)
6
+ @asset_path = asset_path
7
+ @asset_root_dirname = asset_root_dirname
8
+ end
9
+
10
+ def full_copy
11
+ FileUtils.mkdir_p(destination_dirname)
12
+ copy_asset
13
+ puts message
14
+ end
15
+
16
+ def copy_asset
17
+ FileUtils.cp(asset_path, destination_dirname)
18
+ end
19
+
20
+ def message
21
+ "#{Rainbow("create").green} #{destination_partial_path}"
22
+ end
23
+
24
+ def destination_dirname
25
+ p = asset_path.gsub(asset_root_dirname, Turf.find(:destination_root))
26
+ dirname = File.dirname(p)
27
+ FileUtils.mkdir_p(dirname)
28
+ dirname
29
+ end
30
+
31
+ def destination_partial_path
32
+ asset_path.gsub(asset_root_dirname, "")
33
+ end
34
+
35
+ end; end
36
+
@@ -1,55 +1,24 @@
1
1
  module FrontendGenerators; class AssetsCopier
2
2
 
3
- attr_reader :local_asset_dirname
3
+ attr_reader :asset
4
4
 
5
- # local_asset_dirname is assets/bootstrap/ or assets/font_awesome/
6
-
7
- def initialize(local_asset_dirname, destination_root = Rails.root)
8
- @local_asset_dirname = local_asset_dirname
9
- @destination_root = destination_root
5
+ def initialize(asset)
6
+ @asset = asset
10
7
  end
11
8
 
12
9
  def copy_assets
13
- local_assets.each do |local_asset_path|
14
- d = destination_asset_dirname(local_asset_path)
15
- p message(local_asset_path)
16
- FileUtils.mkdir_p(d)
17
- copy_asset(local_asset_path)
10
+ asset_files.each do |asset_path|
11
+ copier = AssetCopier.new(asset_path, asset_root_dirname)
12
+ copier.full_copy
18
13
  end
19
14
  end
20
15
 
21
- def message(local_asset_path)
22
- puts "#{Rainbow("create").green} #{destination_truncated_path(local_asset_path)}"
23
- end
24
-
25
- def local_assets_root
26
- "#{root}/#{local_asset_dirname}"
27
- end
28
-
29
- def local_assets
30
- Dir.glob("#{local_assets_root}**/*").select{|f| File.file?(f)}
31
- end
32
-
33
- def destination_asset_dirname(local_asset_path)
34
- p = local_asset_path.gsub(local_assets_root, destination_root)
35
- File.dirname(p)
36
- end
37
-
38
- def destination_truncated_path(local_asset_path)
39
- local_asset_path.gsub(local_assets_root, "")
40
- end
41
-
42
- def copy_asset(local_asset_path)
43
- destination = destination_asset_dirname(local_asset_path)
44
- FileUtils.cp(local_asset_path, destination)
45
- end
46
-
47
- def root
48
- File.expand_path("../../", File.dirname(__FILE__))
16
+ def asset_root_dirname
17
+ File.join(Turf.find(:root), "assets", asset.to_s)
49
18
  end
50
19
 
51
- def destination_root
52
- "#{@destination_root}/"
20
+ def asset_files
21
+ Dir.glob("#{asset_root_dirname}/**/*").select{|f| File.file?(f)}
53
22
  end
54
23
 
55
24
  end; end
@@ -1,3 +1,3 @@
1
1
  module FrontendGenerators
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frontend-generators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - MrPowers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-22 00:00:00.000000000 Z
11
+ date: 2015-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
82
  version: 2.0.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: turf
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '='
88
+ - !ruby/object:Gem::Version
89
+ version: 0.0.5
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '='
95
+ - !ruby/object:Gem::Version
96
+ version: 0.0.5
83
97
  description: There are separate Ruby gems to access Bootstrap and Font Awesome in
84
98
  your Rails application, but they can be annoying when it comes time to deploy or
85
99
  when you want to look at the source code. These rake tasks actually move the source
@@ -139,6 +153,31 @@ files:
139
153
  - assets/font_awesome/public/fonts/fontawesome-webfont.woff
140
154
  - assets/font_awesome/public/fonts/fontawesome-webfont.woff2
141
155
  - assets/font_awesome/vendor/assets/stylesheets/font_awesome.css
156
+ - assets/freelancer/app/assets/images/freelancer/portfolio/cabin.png
157
+ - assets/freelancer/app/assets/images/freelancer/portfolio/cake.png
158
+ - assets/freelancer/app/assets/images/freelancer/portfolio/circus.png
159
+ - assets/freelancer/app/assets/images/freelancer/portfolio/game.png
160
+ - assets/freelancer/app/assets/images/freelancer/portfolio/safe.png
161
+ - assets/freelancer/app/assets/images/freelancer/portfolio/submarine.png
162
+ - assets/freelancer/app/assets/images/freelancer/profile.png
163
+ - assets/freelancer/app/assets/javascripts/freelancer/cbpAnimatedHeader.js
164
+ - assets/freelancer/app/assets/javascripts/freelancer/classie.js
165
+ - assets/freelancer/app/assets/javascripts/freelancer/contact_me.js
166
+ - assets/freelancer/app/assets/javascripts/freelancer/freelancer.js
167
+ - assets/freelancer/app/assets/javascripts/freelancer/jqBootstrapValidation.js
168
+ - assets/freelancer/app/assets/javascripts/freelancer/manifest.js
169
+ - assets/freelancer/app/assets/stylesheets/freelancer/bootswatch_bootstrap.css
170
+ - assets/freelancer/app/assets/stylesheets/freelancer/freelancer.css
171
+ - assets/freelancer/app/assets/stylesheets/freelancer/manifest.css
172
+ - assets/freelancer/app/controllers/freelancers_controller.rb
173
+ - assets/freelancer/app/views/freelancers/_about.html.erb
174
+ - assets/freelancer/app/views/freelancers/_contact.html.erb
175
+ - assets/freelancer/app/views/freelancers/_footer.html.erb
176
+ - assets/freelancer/app/views/freelancers/_header.html.erb
177
+ - assets/freelancer/app/views/freelancers/_navigation.html.erb
178
+ - assets/freelancer/app/views/freelancers/_portfolio.html.erb
179
+ - assets/freelancer/app/views/freelancers/index.html.erb
180
+ - assets/freelancer/app/views/layouts/freelancer.html.erb
142
181
  - assets/stylish_portfolio/app/assets/images/stylish_portfolio/bg.jpg
143
182
  - assets/stylish_portfolio/app/assets/images/stylish_portfolio/callout.jpg
144
183
  - assets/stylish_portfolio/app/assets/images/stylish_portfolio/portfolio-1.jpg
@@ -163,8 +202,14 @@ files:
163
202
  - assets/stylish_portfolio/app/views/stylish_portfolios/index.html.erb
164
203
  - bin/console
165
204
  - bin/setup
205
+ - config/turf/default.rb
206
+ - config/turf/development.rb
207
+ - config/turf/local.rb
208
+ - config/turf/production.rb
209
+ - config/turf/test.rb
166
210
  - frontend-generators.gemspec
167
211
  - lib/frontend_generators.rb
212
+ - lib/frontend_generators/asset_copier.rb
168
213
  - lib/frontend_generators/assets_copier.rb
169
214
  - lib/frontend_generators/version.rb
170
215
  - lib/tasks/add_assets.rake