frontend-generators 0.0.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.
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "frontend/generators"
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
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'frontend_generators/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "frontend-generators"
8
+ spec.version = FrontendGenerators::VERSION
9
+ spec.authors = ["MrPowers"]
10
+ spec.email = ["matthewkevinpowers@gmail.com"]
11
+
12
+ spec.summary = %q{Rake tasks to get Bootstrap and Font Awesome code into your Rails application}
13
+ spec.description = %q{There are separate Ruby gems to access Bootstrap and Font Awesome in your Rails application, but they can be annoying when it comes time to deploy or when you want to look at the source code. These rake tasks actually move the source code into your application, so you have full control.}
14
+ spec.homepage = "https://github.com/MrPowers/frontend-generators"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.10"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "rspec"
25
+ spec.add_development_dependency "pry"
26
+ end
@@ -0,0 +1,7 @@
1
+ require "frontend_generators/version"
2
+ require_relative "./frontend_generators/bootstrap.rb"
3
+ require_relative "./frontend_generators/font_awesome.rb"
4
+
5
+ module FrontendGenerators
6
+
7
+ end
@@ -0,0 +1,38 @@
1
+ module FrontendGenerators; class Bootstrap
2
+
3
+ def add_assets
4
+ FileUtils.cp(bootstrap_css, css_destination)
5
+ FileUtils.cp(bootstrap_js, js_destination)
6
+ FileUtils.mkdir_p(fonts_dirname)
7
+ FileUtils.cp(fonts, fonts_dirname)
8
+ end
9
+
10
+ def fonts
11
+ Dir.glob("#{root}/assets/bootstrap/fonts/**/*")
12
+ end
13
+
14
+ def fonts_dirname
15
+ File.join(Rails.root, "public", "fonts")
16
+ end
17
+
18
+ def css_destination
19
+ File.join(Rails.root, "vendor", "assets", "stylesheets")
20
+ end
21
+
22
+ def bootstrap_css
23
+ File.join(root, "assets", "bootstrap", "bootstrap.css")
24
+ end
25
+
26
+ def bootstrap_js
27
+ File.join(root, "assets", "bootstrap", "bootstrap.js")
28
+ end
29
+
30
+ def js_destination
31
+ File.join(Rails.root, "vendor", "assets", "javascripts")
32
+ end
33
+
34
+ def root
35
+ File.expand_path("../../", File.dirname(__FILE__))
36
+ end
37
+
38
+ end; end
@@ -0,0 +1,30 @@
1
+ module FrontendGenerators; class FontAwesome
2
+
3
+ def add_assets
4
+ FileUtils.cp(font_awesome_css, css_destination)
5
+ FileUtils.mkdir_p(fonts_dirname)
6
+ FileUtils.cp(fonts, fonts_dirname)
7
+ end
8
+
9
+ def fonts
10
+ Dir.glob("#{root}/assets/font_awesome/fonts/**/*")
11
+ end
12
+
13
+ def fonts_dirname
14
+ File.join(Rails.root, "public", "fonts")
15
+ end
16
+
17
+ def css_destination
18
+ File.join(Rails.root, "vendor", "assets", "stylesheets")
19
+ end
20
+
21
+ def font_awesome_css
22
+ File.join(root, "assets", "font_awesome", "font_awesome.css")
23
+ end
24
+
25
+ def root
26
+ File.expand_path("../../", File.dirname(__FILE__))
27
+ end
28
+
29
+ end; end
30
+
@@ -0,0 +1,3 @@
1
+ module FrontendGenerators
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,13 @@
1
+ namespace :add_assets do
2
+
3
+ desc "Add Bootstrap assets to your project"
4
+ task :bootstrap do
5
+ FrontendGenerators::Bootstrap.new.add_assets
6
+ end
7
+
8
+ desc "Add Font-Awesome assets to your project"
9
+ task :font_awesome do
10
+ FrontendGenerators::FontAwesome.new.add_assets
11
+ end
12
+
13
+ end
@@ -0,0 +1,5 @@
1
+ desc "launches pry with frontend-generators environment loaded"
2
+ task :console do
3
+ sh "pry -r ./lib/frontend_generators.rb"
4
+ end
5
+
metadata ADDED
@@ -0,0 +1,133 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: frontend-generators
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - MrPowers
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-08-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: There are separate Ruby gems to access Bootstrap and Font Awesome in
70
+ your Rails application, but they can be annoying when it comes time to deploy or
71
+ when you want to look at the source code. These rake tasks actually move the source
72
+ code into your application, so you have full control.
73
+ email:
74
+ - matthewkevinpowers@gmail.com
75
+ executables: []
76
+ extensions: []
77
+ extra_rdoc_files: []
78
+ files:
79
+ - ".gitignore"
80
+ - ".rspec"
81
+ - ".travis.yml"
82
+ - Gemfile
83
+ - LICENSE.txt
84
+ - README.md
85
+ - Rakefile
86
+ - assets/bootstrap/bootstrap.css
87
+ - assets/bootstrap/bootstrap.js
88
+ - assets/bootstrap/fonts/glyphicons-halflings-regular.eot
89
+ - assets/bootstrap/fonts/glyphicons-halflings-regular.svg
90
+ - assets/bootstrap/fonts/glyphicons-halflings-regular.ttf
91
+ - assets/bootstrap/fonts/glyphicons-halflings-regular.woff
92
+ - assets/bootstrap/fonts/glyphicons-halflings-regular.woff2
93
+ - assets/font_awesome/font_awesome.css
94
+ - assets/font_awesome/fonts/FontAwesome.otf
95
+ - assets/font_awesome/fonts/fontawesome-webfont.eot
96
+ - assets/font_awesome/fonts/fontawesome-webfont.svg
97
+ - assets/font_awesome/fonts/fontawesome-webfont.ttf
98
+ - assets/font_awesome/fonts/fontawesome-webfont.woff
99
+ - assets/font_awesome/fonts/fontawesome-webfont.woff2
100
+ - bin/console
101
+ - bin/setup
102
+ - frontend-generators.gemspec
103
+ - lib/frontend_generators.rb
104
+ - lib/frontend_generators/bootstrap.rb
105
+ - lib/frontend_generators/font_awesome.rb
106
+ - lib/frontend_generators/version.rb
107
+ - lib/tasks/add_assets.rake
108
+ - lib/tasks/console.rake
109
+ homepage: https://github.com/MrPowers/frontend-generators
110
+ licenses:
111
+ - MIT
112
+ metadata: {}
113
+ post_install_message:
114
+ rdoc_options: []
115
+ require_paths:
116
+ - lib
117
+ required_ruby_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
122
+ required_rubygems_version: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
127
+ requirements: []
128
+ rubyforge_project:
129
+ rubygems_version: 2.4.5
130
+ signing_key:
131
+ specification_version: 4
132
+ summary: Rake tasks to get Bootstrap and Font Awesome code into your Rails application
133
+ test_files: []