bower-rails 0.1.3 → 0.2.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/README.md
CHANGED
@@ -3,14 +3,34 @@ bower-rails
|
|
3
3
|
|
4
4
|
rake tasks for bower on rails. Dependency file is bower.json in Rails root dir.
|
5
5
|
|
6
|
+
**Requirements**
|
7
|
+
|
8
|
+
* [node](http://nodejs.org) ([on github](https://github.com/joyent/node))
|
9
|
+
* [bower](https://github.com/twitter/bow) installed with npm
|
10
|
+
|
6
11
|
**Install**
|
12
|
+
|
7
13
|
in Gemfile
|
8
14
|
|
9
15
|
``` Ruby
|
10
|
-
|
16
|
+
gem 'bower-rails'
|
11
17
|
```
|
12
18
|
|
13
|
-
**
|
19
|
+
**Initialize**
|
20
|
+
|
21
|
+
To add an empty bower.json file to the project root.
|
22
|
+
|
23
|
+
``` Bash
|
24
|
+
rails g bower_rails:initialize
|
25
|
+
```
|
26
|
+
|
27
|
+
|
28
|
+
**Configuration**
|
29
|
+
|
30
|
+
The bower.json file is two seperate bower [component.js](https://github.com/twitter/bower#defining-a-package) files. Defining a package in lib and vendor will install those packages to the corresponding directories.
|
31
|
+
|
32
|
+
**example bower.json file**
|
33
|
+
|
14
34
|
``` javascript
|
15
35
|
{
|
16
36
|
"lib": {
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module BowerRails
|
2
|
+
module Generators
|
3
|
+
class InitializeGenerator < Rails::Generators::Base
|
4
|
+
desc "Adds a boilerplate component.json file to root of rails project"
|
5
|
+
|
6
|
+
def self.source_root
|
7
|
+
@_bower_rails_source_root ||= File.expand_path("../templates", __FILE__)
|
8
|
+
end
|
9
|
+
|
10
|
+
def create_initializer_file
|
11
|
+
template "bower.json", 'bower.json'
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/tasks/bower.rake
CHANGED
@@ -30,8 +30,11 @@ def perform_command remove_components = true
|
|
30
30
|
|
31
31
|
data = json[dir]
|
32
32
|
|
33
|
+
#check folder existence and create?
|
34
|
+
dir = "#{Rails.root}/#{dir}/assets/javascripts"
|
35
|
+
FileUtils.mkdir_p dir unless File.directory? dir
|
33
36
|
#go in to dir to act
|
34
|
-
Dir.chdir(
|
37
|
+
Dir.chdir(dir) do
|
35
38
|
|
36
39
|
#remove old components
|
37
40
|
FileUtils.rm_rf("components") if remove_components
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bower-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-30 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Bower for Rails
|
15
15
|
email: rtharrison86@gmail.com
|
@@ -19,6 +19,8 @@ extra_rdoc_files: []
|
|
19
19
|
files:
|
20
20
|
- lib/bower-rails/railtie.rb
|
21
21
|
- lib/bower-rails.rb
|
22
|
+
- lib/generators/bower_rails/initialize/initialize_generator.rb
|
23
|
+
- lib/generators/bower_rails/initialize/templates/bower.json
|
22
24
|
- lib/tasks/bower.rake
|
23
25
|
- MIT-LICENSE
|
24
26
|
- README.md
|
@@ -45,5 +47,5 @@ rubyforge_project:
|
|
45
47
|
rubygems_version: 1.8.24
|
46
48
|
signing_key:
|
47
49
|
specification_version: 3
|
48
|
-
summary: Bower
|
50
|
+
summary: Bower for Rails
|
49
51
|
test_files: []
|