ruby-bower 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.
- checksums.yaml +15 -0
- data/.gitignore +18 -0
- data/Gemfile +4 -0
- data/Guardfile +18 -0
- data/LICENSE.txt +22 -0
- data/README.md +40 -0
- data/Rakefile +1 -0
- data/lib/ruby-bower.rb +7 -0
- data/lib/ruby-bower/ruby-bower.rb +30 -0
- data/lib/ruby-bower/support/node_event_emitter_runner.js +30 -0
- data/lib/ruby-bower/version.rb +3 -0
- data/package.json +16 -0
- data/ruby-bower.gemspec +24 -0
- data/spec/rails_bower_spec.rb +13 -0
- data/spec/spec_helper.rb +20 -0
- metadata +116 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
OTkzMGJhYmJhMmE3N2QwZGI2MzRkMzQ5NmVkNWM5MWFhMDA3MjlkOQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZmQ0MDY5YjRjZWMzYzc3MGU1MzcxYTNhMzE3MzU5NmEwZDJkNWUxYw==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NWQzOTMyMWNiZWU3OWE0ZjZlYzM2MThiYmU2ODIyOGM1NWViMTBiZjg0NTlm
|
10
|
+
ZDc3ZDkzZDM3OWM0Nzc3NDNiMzc4ODFiMjYyZWJkOTc1Y2IwMTA0NTNjMzU4
|
11
|
+
ZGJkNmZjMDg0MmYxZjk2MWFkYWVjMDAyNWM4MjQ4ODQwNjhiYmU=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
Mjg0MDM3Mjg0MTkyOTEwOWY1OGM0NTZjMWExYzUyMDdjMDQxMmY4MmM5YjNi
|
14
|
+
YmI4NmZkNDAwNGRmODJiM2I0Y2FiNWQxZmEwNDFhNDEyYTcwNTlmM2JkYTlh
|
15
|
+
ZjU4MTFhZjlhOWYxNzRkM2YxYzE2M2E1OWRmZWJhNWVjOGU5NzY=
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
guard 'rspec' do
|
5
|
+
watch(%r{^spec/.+_spec\.rb$})
|
6
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
7
|
+
watch('spec/spec_helper.rb') { "spec" }
|
8
|
+
|
9
|
+
# Rails example
|
10
|
+
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
11
|
+
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
12
|
+
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
|
13
|
+
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
|
14
|
+
watch('config/routes.rb') { "spec/routing" }
|
15
|
+
watch('app/controllers/application_controller.rb') { "spec/controllers" }
|
16
|
+
# Capybara request specs
|
17
|
+
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
|
18
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Klaus Fleerkötter
|
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,40 @@
|
|
1
|
+
# Ruby::Bower
|
2
|
+
|
3
|
+
A ruby wrapper for [Bower](https://github.com/twitter/bower).
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'ruby-bower'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install ruby-bower
|
18
|
+
|
19
|
+
Bower requires an installation of node.js. You could e.g. use the gem 'therubyracer' as described above.
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Ruby-bower gives you programmatic access to Bower's API - from Ruby.
|
24
|
+
You can pass in objects to commands as regular objects:
|
25
|
+
|
26
|
+
bower = Bower.new
|
27
|
+
bower.list sources: true
|
28
|
+
|
29
|
+
See [the Bower repository](https://github.com/twitter/bower/tree/master/lib/commands) or `$ bower help` for usage information on Bower's commands.
|
30
|
+
`Bower.commands` reveals all supported Bower commands. Currently, that's only the `list` command. Further implementations and ideas for this tool are heartily encouraged!
|
31
|
+
|
32
|
+
## Contributing
|
33
|
+
|
34
|
+
1. Fork it
|
35
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
36
|
+
3. Spec your changes using RSpec
|
37
|
+
4. Commit your changes (`git commit -am 'Add some feature'`)
|
38
|
+
5. Push to the branch (`git push origin my-new-feature`)
|
39
|
+
6. Test your changes
|
40
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/lib/ruby-bower.rb
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
require "ruby-bower/version"
|
2
|
+
require "ruby-bower/ruby-bower.rb"
|
3
|
+
|
4
|
+
# Exports the `.node_modules` folder on the working directory so npm can
|
5
|
+
# require modules installed locally.
|
6
|
+
# See https://github.com/lucasmazza/ruby-stylus/blob/f0d26f6d6b2c64596d3e7d28265f663f2555cf92/lib/stylus.rb#L116-L118
|
7
|
+
ENV['NODE_PATH'] = "#{File.expand_path('node_modules')}:#{ENV['NODE_PATH']}"
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'execjs'
|
2
|
+
|
3
|
+
class Bower
|
4
|
+
|
5
|
+
class << self
|
6
|
+
def backend
|
7
|
+
@@backend ||= ExecJS::ExternalRuntime.new(
|
8
|
+
:name => 'Node.js (V8) (customized for module loading)',
|
9
|
+
:command => ["nodejs", "node"],
|
10
|
+
:runner_path => File.expand_path("../support/node_event_emitter_runner.js", __FILE__)
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
def context
|
15
|
+
@context ||= backend.compile <<-JS
|
16
|
+
var bower = require('bower');
|
17
|
+
JS
|
18
|
+
end
|
19
|
+
|
20
|
+
def commands
|
21
|
+
[:list]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
commands.each do |command|
|
26
|
+
define_method command do |*arguments|
|
27
|
+
Bower.context.call "bower.commands.#{command}", *arguments
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
// A custom execjs runner that expects the source to return an instance of EventEmitter
|
2
|
+
// http://nodejs.org/api/events.html#events_class_events_eventemitter
|
3
|
+
// Works in node only
|
4
|
+
(function(program, execJS) { execJS(program) })(function(callback) { #{source}
|
5
|
+
}, function(program) {
|
6
|
+
var output, print = function(string) {
|
7
|
+
process.stdout.write('' + string);
|
8
|
+
};
|
9
|
+
var callback = function(result){
|
10
|
+
if (typeof result == 'undefined' && result !== null) {
|
11
|
+
print('["ok"]');
|
12
|
+
} else {
|
13
|
+
try {
|
14
|
+
print('["ok", ' + JSON.stringify(result) + ']');
|
15
|
+
} catch (err) {
|
16
|
+
print('["err"]');
|
17
|
+
}
|
18
|
+
}
|
19
|
+
};
|
20
|
+
var returnError = function(err) {
|
21
|
+
print(JSON.stringify(['err', '' + err]));
|
22
|
+
};
|
23
|
+
|
24
|
+
// data and end -> success, error -> error
|
25
|
+
try {
|
26
|
+
program().on('data', callback).on('end', callback).on('error', returnError);
|
27
|
+
} catch (err) {
|
28
|
+
returnError(err);
|
29
|
+
}
|
30
|
+
});
|
data/package.json
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"name": "ruby-bower",
|
3
|
+
"version": "0.0.1",
|
4
|
+
"description": "A ruby wrapper for [Bower](https://github.com/twitter/bower).",
|
5
|
+
"dependencies": {
|
6
|
+
"bower": "~0.8.6",
|
7
|
+
"underscore": "~1.4.3"
|
8
|
+
},
|
9
|
+
"repository": {
|
10
|
+
"type": "git",
|
11
|
+
"url": "git://github.com/kaeff/ruby-bower.git"
|
12
|
+
},
|
13
|
+
"author": "Klaus Fleerkötter",
|
14
|
+
"license": "MIT",
|
15
|
+
"readmeFilename": "README.md"
|
16
|
+
}
|
data/ruby-bower.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'ruby-bower/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "ruby-bower"
|
8
|
+
gem.version = RubyBower::VERSION
|
9
|
+
gem.authors = ["Klaus Fleerkötter"]
|
10
|
+
gem.email = ["hi@kaeff.net"]
|
11
|
+
gem.description = %q{A ruby wrapper for Bower}
|
12
|
+
gem.summary = gem.description
|
13
|
+
gem.homepage = ""
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
|
20
|
+
gem.add_dependency 'execjs'
|
21
|
+
gem.add_development_dependency 'rspec'
|
22
|
+
gem.add_development_dependency 'guard'
|
23
|
+
gem.add_development_dependency 'guard-rspec'
|
24
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'ruby-bower'
|
2
|
+
|
3
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
4
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
5
|
+
# Require this file using `require "spec_helper"` to ensure that it is only
|
6
|
+
# loaded once.
|
7
|
+
#
|
8
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
9
|
+
RSpec.configure do |config|
|
10
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
11
|
+
config.run_all_when_everything_filtered = true
|
12
|
+
config.filter_run :focus
|
13
|
+
config.backtrace_clean_patterns = [
|
14
|
+
/\/lib\d*\/ruby\//,
|
15
|
+
/bin\//,
|
16
|
+
#/gems/,
|
17
|
+
/spec\/spec_helper\.rb/,
|
18
|
+
/lib\/rspec\/(core|expectations|matchers|mocks)/
|
19
|
+
]
|
20
|
+
end
|
metadata
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ruby-bower
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Klaus Fleerkötter
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-04-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: execjs
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ! '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: guard
|
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: guard-rspec
|
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: A ruby wrapper for Bower
|
70
|
+
email:
|
71
|
+
- hi@kaeff.net
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- .gitignore
|
77
|
+
- Gemfile
|
78
|
+
- Guardfile
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- lib/ruby-bower.rb
|
83
|
+
- lib/ruby-bower/ruby-bower.rb
|
84
|
+
- lib/ruby-bower/support/node_event_emitter_runner.js
|
85
|
+
- lib/ruby-bower/version.rb
|
86
|
+
- package.json
|
87
|
+
- ruby-bower.gemspec
|
88
|
+
- spec/rails_bower_spec.rb
|
89
|
+
- spec/spec_helper.rb
|
90
|
+
homepage: ''
|
91
|
+
licenses: []
|
92
|
+
metadata: {}
|
93
|
+
post_install_message:
|
94
|
+
rdoc_options: []
|
95
|
+
require_paths:
|
96
|
+
- lib
|
97
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ! '>='
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
requirements: []
|
108
|
+
rubyforge_project:
|
109
|
+
rubygems_version: 2.0.2
|
110
|
+
signing_key:
|
111
|
+
specification_version: 4
|
112
|
+
summary: A ruby wrapper for Bower
|
113
|
+
test_files:
|
114
|
+
- spec/rails_bower_spec.rb
|
115
|
+
- spec/spec_helper.rb
|
116
|
+
has_rdoc:
|