rab 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/Gemfile +9 -0
- data/Guardfile +6 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +38 -0
- data/bin/rab +7 -0
- data/lib/rab.rb +9 -0
- data/lib/rab/bower/command.rb +42 -0
- data/lib/rab/bower/command_error.rb +4 -0
- data/lib/rab/bower/project.rb +85 -0
- data/lib/rab/builder.rb +14 -0
- data/lib/rab/cli.rb +13 -0
- data/lib/rab/gem/packer.rb +92 -0
- data/lib/rab/gem/templates/Gemfile.erb +4 -0
- data/lib/rab/gem/templates/README.md.erb +19 -0
- data/lib/rab/gem/templates/Rakefile.erb +1 -0
- data/lib/rab/gem/templates/css.css.erb +5 -0
- data/lib/rab/gem/templates/gemspec.gemspec.erb +19 -0
- data/lib/rab/gem/templates/js.js.erb +3 -0
- data/lib/rab/gem/templates/lib.rb.erb +9 -0
- data/lib/rab/gem/templates/version.rb.erb +3 -0
- data/lib/rab/version.rb +3 -0
- data/rab.gemspec +25 -0
- data/test/bower/test_bower.rb +11 -0
- data/test/fixtures/bower_project/.gitignore +1 -0
- data/test/fixtures/bower_project/bower.json +11 -0
- data/test/fixtures/bower_project/foo.css +0 -0
- data/test/fixtures/bower_project/foo.js +0 -0
- data/test/test_builder.rb +62 -0
- metadata +137 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 70ec01c9cac79e43818cf4f443250646e68191ea
|
4
|
+
data.tar.gz: 91b1ccdbd5ce70063b92bd0bfc76a9e2504f762f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1b48382802e3cc59742e8f27fe6d1d60feb281d289e47da0d75735a44e86679844a51ba934c2cbbce15d477f7525f876d33c724bc5254d04c08b33f2436d1244
|
7
|
+
data.tar.gz: d2039afe8edd8dd07d3d33a20e6afba6d3b418b005bec480ecb100e53d579807e64c20e5cf5f7977f38df637d99707063d46f0efb8ce8f1837f3b50931ee9c0b
|
data/.gitignore
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
data/Gemfile
ADDED
data/Guardfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Jingwen Owen Ou
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Rab
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'rab'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install rab
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it ( https://github.com/[my-github-username]/rab/fork )
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
#############################################################################
|
5
|
+
#
|
6
|
+
# Helper functions
|
7
|
+
#
|
8
|
+
#############################################################################
|
9
|
+
|
10
|
+
def name
|
11
|
+
@name ||= Dir['*.gemspec'].first.split('.').first
|
12
|
+
end
|
13
|
+
|
14
|
+
#############################################################################
|
15
|
+
#
|
16
|
+
# Standard tasks
|
17
|
+
#
|
18
|
+
#############################################################################
|
19
|
+
|
20
|
+
task :default => :test
|
21
|
+
|
22
|
+
require 'rake/testtask'
|
23
|
+
Rake::TestTask.new(:test) do |test|
|
24
|
+
test.libs << 'lib' << 'test'
|
25
|
+
test.pattern = 'test/**/test_*.rb'
|
26
|
+
test.verbose = true
|
27
|
+
end
|
28
|
+
|
29
|
+
desc "Open an irb session preloaded with this library"
|
30
|
+
task :console do
|
31
|
+
sh "irb -rubygems -r ./lib/#{name}.rb"
|
32
|
+
end
|
33
|
+
|
34
|
+
#############################################################################
|
35
|
+
#
|
36
|
+
# Custom tasks (add your own tasks here)
|
37
|
+
#
|
38
|
+
#############################################################################
|
data/bin/rab
ADDED
data/lib/rab.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
require "open3"
|
2
|
+
|
3
|
+
module Bower
|
4
|
+
class Command
|
5
|
+
attr_reader :cwd
|
6
|
+
|
7
|
+
def initialize(cwd)
|
8
|
+
@cwd = cwd
|
9
|
+
end
|
10
|
+
|
11
|
+
def install!
|
12
|
+
bower(cwd, "install --production --force-latest")
|
13
|
+
end
|
14
|
+
|
15
|
+
def list!
|
16
|
+
bower(cwd, "list --offline")
|
17
|
+
end
|
18
|
+
|
19
|
+
def list_paths!
|
20
|
+
bower(cwd, "list --paths --offline")
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def bower(cwd, *command)
|
26
|
+
command = "bower #{command.join(' ')} --json"
|
27
|
+
command += " --config.interactive=false"
|
28
|
+
sh(cwd, command)
|
29
|
+
end
|
30
|
+
|
31
|
+
def sh(cwd, *cmd)
|
32
|
+
cmd = cmd.join(" ")
|
33
|
+
|
34
|
+
output, error, status =
|
35
|
+
Open3.capture3(cmd, :chdir => cwd)
|
36
|
+
|
37
|
+
raise CommandError.new(error, cwd, cmd) unless status.success?
|
38
|
+
|
39
|
+
output
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
require "json"
|
2
|
+
require "active_support"
|
3
|
+
|
4
|
+
module Bower
|
5
|
+
class Project < Struct.new(:name, :version, :assets)
|
6
|
+
include ActiveSupport::Inflector
|
7
|
+
|
8
|
+
class Creator
|
9
|
+
attr_reader :src
|
10
|
+
|
11
|
+
def initialize(src)
|
12
|
+
@src = src
|
13
|
+
end
|
14
|
+
|
15
|
+
def create!
|
16
|
+
cmd = Bower::Command.new(src)
|
17
|
+
cmd.install!
|
18
|
+
prj_json = JSON.parse(cmd.list!)
|
19
|
+
dep_paths = JSON.parse(cmd.list_paths!)
|
20
|
+
|
21
|
+
cwd = prj_json.fetch("canonicalDir")
|
22
|
+
pkg_meta = prj_json.fetch("pkgMeta")
|
23
|
+
name = pkg_meta.fetch("name")
|
24
|
+
version = pkg_meta.fetch("version")
|
25
|
+
|
26
|
+
prj = Bower::Project.new(name, version, [])
|
27
|
+
prj.assets += build_assets(cwd, pkg_meta["main"]) # current
|
28
|
+
prj.assets += build_dep_assets(cwd, dep_paths)
|
29
|
+
|
30
|
+
prj
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def build_assets(cwd, paths)
|
36
|
+
Array(paths).map do |p|
|
37
|
+
full_path(cwd, p)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def build_dep_assets(cwd, dep_paths)
|
42
|
+
dep_paths.map do |_, p|
|
43
|
+
build_assets(cwd, p)
|
44
|
+
end.flatten
|
45
|
+
end
|
46
|
+
|
47
|
+
def full_path(cwd, path)
|
48
|
+
File.expand_path File.join(cwd, path)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def initialize(*args)
|
53
|
+
super(*args)
|
54
|
+
self.assets ||= []
|
55
|
+
end
|
56
|
+
|
57
|
+
def dir_name
|
58
|
+
dasherize(name)
|
59
|
+
end
|
60
|
+
|
61
|
+
def rails_assets_dir_name
|
62
|
+
@dir_name ||= "rails-assets-#{dir_name}"
|
63
|
+
end
|
64
|
+
|
65
|
+
def rails_assets_namespace
|
66
|
+
@namespace ||= "RailsAssets#{classify(underscore(name))}"
|
67
|
+
end
|
68
|
+
|
69
|
+
def js_assets
|
70
|
+
@js_assets ||= assets.select { |a| File.extname(a) == ".js" }
|
71
|
+
end
|
72
|
+
|
73
|
+
def css_assets
|
74
|
+
@css_assets ||= assets.select { |a| [ ".scss", ".less", ".sass", ".css" ].include?(File.extname(a)) }
|
75
|
+
end
|
76
|
+
|
77
|
+
def font_assets
|
78
|
+
@font_assets ||= assets.select { |a| [ ".eot", ".svg", ".ttf", ".woff" ].include?(File.extname(a)) }
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.create!(src)
|
82
|
+
Creator.new(src).create!
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
data/lib/rab/builder.rb
ADDED
data/lib/rab/cli.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require "thor"
|
2
|
+
require "rab"
|
3
|
+
|
4
|
+
module Rab
|
5
|
+
class CLI < Thor
|
6
|
+
desc "build SRC DST", "Build Rails assets gem from bower folder SRC to destination folder DST"
|
7
|
+
|
8
|
+
def build(src, dst)
|
9
|
+
builder = Rab::Builder.new(src, dst)
|
10
|
+
builder.build!
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
require "erb"
|
2
|
+
|
3
|
+
module Gem
|
4
|
+
class Packer
|
5
|
+
attr_reader :project
|
6
|
+
|
7
|
+
def initialize(prj)
|
8
|
+
@project = prj
|
9
|
+
end
|
10
|
+
|
11
|
+
def pack!(dst)
|
12
|
+
write_readme(dst)
|
13
|
+
write_gemspec(dst)
|
14
|
+
write_gemfile(dst)
|
15
|
+
write_rakefile(dst)
|
16
|
+
write_lib_file(dst)
|
17
|
+
write_version_file(dst)
|
18
|
+
write_js_assets(dst)
|
19
|
+
write_css_assets(dst)
|
20
|
+
write_font_assets(dst)
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def write_readme(dst)
|
26
|
+
readme = File.join(dst, "README.md")
|
27
|
+
write_template("README.md.erb", readme)
|
28
|
+
end
|
29
|
+
|
30
|
+
def write_gemspec(dst)
|
31
|
+
gemspec = File.join(dst, "#{@project.rails_assets_dir_name}.gemspec")
|
32
|
+
write_template("gemspec.gemspec.erb", gemspec)
|
33
|
+
end
|
34
|
+
|
35
|
+
def write_gemfile(dst)
|
36
|
+
gemfile = File.join(dst, "Gemfile")
|
37
|
+
write_template("Gemfile.erb", gemfile)
|
38
|
+
end
|
39
|
+
|
40
|
+
def write_rakefile(dst)
|
41
|
+
rakefile = File.join(dst, "Rakefile")
|
42
|
+
write_template("Rakefile.erb", rakefile)
|
43
|
+
end
|
44
|
+
|
45
|
+
def write_lib_file(dst)
|
46
|
+
lib_file = File.join(dst, "lib", "#{@project.rails_assets_dir_name}.rb")
|
47
|
+
write_template("lib.rb.erb", lib_file)
|
48
|
+
end
|
49
|
+
|
50
|
+
def write_version_file(dst)
|
51
|
+
version_file = File.join(dst, "lib", @project.rails_assets_dir_name, "version.rb")
|
52
|
+
write_template("version.rb.erb", version_file)
|
53
|
+
end
|
54
|
+
|
55
|
+
def write_template(name, to_file)
|
56
|
+
FileUtils.mkdir_p File.dirname(to_file)
|
57
|
+
template = ERB.new File.read(template(name)), nil, "-"
|
58
|
+
File.open(to_file, "w") { |f| f.write template.result(binding) }
|
59
|
+
end
|
60
|
+
|
61
|
+
def write_js_assets(dst)
|
62
|
+
js_dir = File.join(dst, "vendor", "assets", "javascripts")
|
63
|
+
write_assets(js_dir, @project.js_assets)
|
64
|
+
|
65
|
+
manifest_file = File.join(js_dir, "#{@project.dir_name}.js")
|
66
|
+
write_template("js.js.erb", manifest_file)
|
67
|
+
end
|
68
|
+
|
69
|
+
def write_css_assets(dst)
|
70
|
+
css_dir = File.join(dst, "vendor", "assets", "stylesheets")
|
71
|
+
write_assets(css_dir, @project.css_assets)
|
72
|
+
|
73
|
+
manifest_file = File.join(css_dir, "#{@project.dir_name}.css")
|
74
|
+
write_template("css.css.erb", manifest_file)
|
75
|
+
end
|
76
|
+
|
77
|
+
def write_font_assets(dst)
|
78
|
+
font_dir = File.join(dst, "vendor", "assets", "fonts")
|
79
|
+
write_assets(font_dir, @project.font_assets)
|
80
|
+
end
|
81
|
+
|
82
|
+
def write_assets(dir, assets)
|
83
|
+
asset_dir = File.join(dir, @project.dir_name)
|
84
|
+
FileUtils.mkdir_p(asset_dir)
|
85
|
+
assets.each { |a| FileUtils.cp a, File.join(asset_dir, File.basename(a)) }
|
86
|
+
end
|
87
|
+
|
88
|
+
def template(name)
|
89
|
+
File.expand_path File.join(File.dirname(__FILE__), "templates", name)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# <%= @project.rails_assets_dir_name %>
|
2
|
+
|
3
|
+
This gem was automatically generated by `rab`. You can visit [https://github.com/jingweno/rab](https://github.com/jingweno/rab) for more information.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
Add these two lines to your application’s `Gemfile`:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
source "https://rails-assets.org"
|
11
|
+
|
12
|
+
gem "<%= @project.rails_assets_dir_name %>"
|
13
|
+
```
|
14
|
+
|
15
|
+
Then, import the asset using Sprockets’ `require` directive:
|
16
|
+
|
17
|
+
```js
|
18
|
+
//= require "<%= @project.name %>"
|
19
|
+
```
|
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require '<%= @project.rails_assets_dir_name %>/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "<%= @project.rails_assets_dir_name %>"
|
8
|
+
spec.version = <%= @project.rails_assets_namespace %>::VERSION
|
9
|
+
spec.authors = ["rails-assets.org"]
|
10
|
+
spec.description = ""
|
11
|
+
spec.summary = ""
|
12
|
+
spec.homepage = "https://github.com/angular/bower-angular"
|
13
|
+
|
14
|
+
spec.files = `find ./* -type f | cut -b 3-`.split($/)
|
15
|
+
spec.require_paths = ["lib"]
|
16
|
+
|
17
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
18
|
+
spec.add_development_dependency "rake"
|
19
|
+
end
|
data/lib/rab/version.rb
ADDED
data/rab.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'rab/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "rab"
|
8
|
+
spec.version = Rab::VERSION
|
9
|
+
spec.authors = ["Jingwen Owen Ou"]
|
10
|
+
spec.email = ["jingweno@gmail.com"]
|
11
|
+
spec.summary = %q{Rails Assets Buidler (RAB) builds Rails asset from a bower project.}
|
12
|
+
spec.homepage = "https://github.com/jingweno/rab"
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0")
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_dependency "activesupport", "~>4.0"
|
21
|
+
spec.add_dependency "thor", "~>0.19.1"
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
24
|
+
spec.add_development_dependency "rake"
|
25
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require "minitest/autorun"
|
2
|
+
require "rab"
|
3
|
+
|
4
|
+
describe Bower do
|
5
|
+
it "creates bower project" do
|
6
|
+
prj = Bower::Project.create!("test/fixtures/bower_project")
|
7
|
+
prj.name.must_equal "test-project"
|
8
|
+
prj.version.must_equal "0.0.0"
|
9
|
+
prj.assets.size.must_equal 9
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
public
|
File without changes
|
File without changes
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require "minitest/autorun"
|
2
|
+
require "tmpdir"
|
3
|
+
require "rab"
|
4
|
+
|
5
|
+
describe Rab::Builder do
|
6
|
+
it "builds rails asset" do
|
7
|
+
Dir.mktmpdir do |dir|
|
8
|
+
rab = Rab::Builder.new("test/fixtures/bower_project", dir)
|
9
|
+
rab.build!
|
10
|
+
|
11
|
+
readme = File.read File.join(dir, "README.md")
|
12
|
+
readme.must_include "# rails-assets-test-project"
|
13
|
+
readme.must_include "gem \"rails-assets-test-project\""
|
14
|
+
readme.must_include "//= require \"test-project\""
|
15
|
+
|
16
|
+
gemspec = File.read File.join(dir, "rails-assets-test-project.gemspec")
|
17
|
+
gemspec.must_include "require 'rails-assets-test-project/version'"
|
18
|
+
gemspec.must_include "RailsAssetsTestProject::VERSION"
|
19
|
+
|
20
|
+
gemfile = File.read File.join(dir, "Gemfile")
|
21
|
+
gemfile.must_include "source 'https://rails-assets.org'"
|
22
|
+
|
23
|
+
rakefile = File.read File.join(dir, "Rakefile")
|
24
|
+
rakefile.must_include "require \"bundler/gem_tasks\""
|
25
|
+
|
26
|
+
lib_file = File.read File.join(dir, "lib", "rails-assets-test-project.rb")
|
27
|
+
lib_file.must_include "require \"rails-assets-test-project/version\""
|
28
|
+
lib_file.must_include "module RailsAssetsTestProject"
|
29
|
+
|
30
|
+
version_file = File.read File.join(dir, "lib", "rails-assets-test-project", "version.rb")
|
31
|
+
version_file.must_include "module RailsAssetsTestProject"
|
32
|
+
version_file.must_include "VERSION = \"0.0.0\""
|
33
|
+
|
34
|
+
js_path = File.join(dir, "vendor", "assets", "javascripts", "test-project")
|
35
|
+
js_files = Dir.entries(js_path)
|
36
|
+
js_files.must_include "bootstrap.js"
|
37
|
+
js_files.must_include "foo.js"
|
38
|
+
js_files.must_include "jquery.js"
|
39
|
+
|
40
|
+
js_manifest = File.read File.join(dir, "vendor", "assets", "javascripts", "test-project.js")
|
41
|
+
js_manifest.must_include "test-project/foo"
|
42
|
+
js_manifest.must_include "test-project/bootstrap"
|
43
|
+
js_manifest.must_include "test-project/jquery"
|
44
|
+
|
45
|
+
css_path = File.join(dir, "vendor", "assets", "stylesheets", "test-project")
|
46
|
+
css_files = Dir.entries(css_path)
|
47
|
+
css_files.must_include "bootstrap.css"
|
48
|
+
css_files.must_include "foo.css"
|
49
|
+
|
50
|
+
css_manifest = File.read File.join(dir, "vendor", "assets", "stylesheets", "test-project.css")
|
51
|
+
css_manifest.must_include "test-project/foo"
|
52
|
+
css_manifest.must_include "test-project/bootstrap"
|
53
|
+
|
54
|
+
font_path = File.join(dir, "vendor", "assets", "fonts", "test-project")
|
55
|
+
font_files = Dir.entries(font_path)
|
56
|
+
font_files.must_include "glyphicons-halflings-regular.eot"
|
57
|
+
font_files.must_include "glyphicons-halflings-regular.svg"
|
58
|
+
font_files.must_include "glyphicons-halflings-regular.ttf"
|
59
|
+
font_files.must_include "glyphicons-halflings-regular.woff"
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
metadata
ADDED
@@ -0,0 +1,137 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rab
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jingwen Owen Ou
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-06-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: thor
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.19.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.19.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.6'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.6'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
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:
|
70
|
+
email:
|
71
|
+
- jingweno@gmail.com
|
72
|
+
executables:
|
73
|
+
- rab
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- ".gitignore"
|
78
|
+
- Gemfile
|
79
|
+
- Guardfile
|
80
|
+
- LICENSE.txt
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- bin/rab
|
84
|
+
- lib/rab.rb
|
85
|
+
- lib/rab/bower/command.rb
|
86
|
+
- lib/rab/bower/command_error.rb
|
87
|
+
- lib/rab/bower/project.rb
|
88
|
+
- lib/rab/builder.rb
|
89
|
+
- lib/rab/cli.rb
|
90
|
+
- lib/rab/gem/packer.rb
|
91
|
+
- lib/rab/gem/templates/Gemfile.erb
|
92
|
+
- lib/rab/gem/templates/README.md.erb
|
93
|
+
- lib/rab/gem/templates/Rakefile.erb
|
94
|
+
- lib/rab/gem/templates/css.css.erb
|
95
|
+
- lib/rab/gem/templates/gemspec.gemspec.erb
|
96
|
+
- lib/rab/gem/templates/js.js.erb
|
97
|
+
- lib/rab/gem/templates/lib.rb.erb
|
98
|
+
- lib/rab/gem/templates/version.rb.erb
|
99
|
+
- lib/rab/version.rb
|
100
|
+
- rab.gemspec
|
101
|
+
- test/bower/test_bower.rb
|
102
|
+
- test/fixtures/bower_project/.gitignore
|
103
|
+
- test/fixtures/bower_project/bower.json
|
104
|
+
- test/fixtures/bower_project/foo.css
|
105
|
+
- test/fixtures/bower_project/foo.js
|
106
|
+
- test/test_builder.rb
|
107
|
+
homepage: https://github.com/jingweno/rab
|
108
|
+
licenses:
|
109
|
+
- MIT
|
110
|
+
metadata: {}
|
111
|
+
post_install_message:
|
112
|
+
rdoc_options: []
|
113
|
+
require_paths:
|
114
|
+
- lib
|
115
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
requirements: []
|
126
|
+
rubyforge_project:
|
127
|
+
rubygems_version: 2.2.2
|
128
|
+
signing_key:
|
129
|
+
specification_version: 4
|
130
|
+
summary: Rails Assets Buidler (RAB) builds Rails asset from a bower project.
|
131
|
+
test_files:
|
132
|
+
- test/bower/test_bower.rb
|
133
|
+
- test/fixtures/bower_project/.gitignore
|
134
|
+
- test/fixtures/bower_project/bower.json
|
135
|
+
- test/fixtures/bower_project/foo.css
|
136
|
+
- test/fixtures/bower_project/foo.js
|
137
|
+
- test/test_builder.rb
|