vendorise 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -0
- data/README.md +17 -15
- data/lib/vendorise/tasks.rb +1 -1
- data/lib/vendorise/version.rb +1 -1
- data/spec/lib/vendorise/tasks_spec.rb +16 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e5cae912a9bd5f013c43802064dabca1f78cb0f
|
4
|
+
data.tar.gz: b26e429ca1191a918db36407ec765eb1e72779ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1728664bc30325c19ddb74ae8a890187d888ebc2f3b94a5c120f8731f225aa314aecf041926750aadb7ad4f72cca684587916025cd0541adf8e3a445953f90b5
|
7
|
+
data.tar.gz: 6ee71f91f8c51043cac76db62d12d183c277c8be93acb3180d19bc6f01642790904e58d47027b51b24aa6990e1a5c95dac05b03959eb2a2f5303eabf7984bdf1
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,18 +1,27 @@
|
|
1
1
|
# Vendorise
|
2
2
|
|
3
|
-
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/vendorise.png)](http://badge.fury.io/rb/vendorise)
|
4
|
+
[![Build Status](https://travis-ci.org/New-Bamboo/vendorise.png)](https://travis-ci.org/New-Bamboo/vendorise)
|
4
5
|
|
5
|
-
|
6
|
+
Sometimes you need to use a gem that is only available in a private git repository. There are a few ways to do this:
|
7
|
+
|
8
|
+
* Install an SSH certificate on your server, but it's not always an option (for example, if you use [Heroku](http://heroku.com))
|
9
|
+
* Use [Gemfury](http://gemfury.com), but that costs money and potentially creates privacy concerns
|
10
|
+
* Hard-code an oauth token into your Gemfile (if the gem is hosted on [github](http://github.com)), but then anyone with access to the code also has access to all of your github repositories
|
11
|
+
|
12
|
+
Vendorise offers a different way of accessing privately hosted gems, by using git's subtree command to download the gem on your development machine and commit it into the source tree of your repository.
|
6
13
|
|
7
|
-
|
14
|
+
By using subtree, updating the code is straightforward and your server does not need to have access to the private git repository. For more explanation about git subtree and why you'd want to use it, I recommend reading [Alternatives To Git Submodule: Git Subtree](http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/).
|
8
15
|
|
9
|
-
|
16
|
+
*Note:* vendorise relies on the git subtree command to work - only recent versions of git have this
|
10
17
|
|
11
|
-
|
18
|
+
## Installation
|
19
|
+
|
20
|
+
If you're using bundler add this line to your application's Gemfile:
|
12
21
|
|
13
|
-
|
22
|
+
gem 'vendorise', group: :development
|
14
23
|
|
15
|
-
Or
|
24
|
+
Or if you don't use bundler:
|
16
25
|
|
17
26
|
$ gem install vendorise
|
18
27
|
|
@@ -21,12 +30,5 @@ Or install it yourself as:
|
|
21
30
|
1. Run `rake vendorise:gem[repo_url]` to vendorise the gem hosted at `repo_url` into `/vendor/gems`.
|
22
31
|
2. Add `gem '<gem_name>', path: 'vendor/gems/<gem_name>'` to your Gemfile
|
23
32
|
|
24
|
-
You can update the gem at any time by running the rake task again
|
25
|
-
|
26
|
-
## Contributing
|
33
|
+
You can update the gem at any time by running the rake task again. Vendorise always uses the code from the master branch on git (tags are not supported yet).
|
27
34
|
|
28
|
-
1. Fork it
|
29
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
30
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
31
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
32
|
-
5. Create new Pull Request
|
data/lib/vendorise/tasks.rb
CHANGED
@@ -8,6 +8,6 @@ namespace :vendorise do
|
|
8
8
|
path = "vendor/gems/#{Vendorise::Parser.gem_name(args[:url])}"
|
9
9
|
cmd = Dir.exist?(path) ? "pull" : "add"
|
10
10
|
|
11
|
-
|
11
|
+
system("git subtree #{cmd} --prefix #{path} #{url} master --squash")
|
12
12
|
end
|
13
13
|
end
|
data/lib/vendorise/version.rb
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
require_relative "../../spec_helper.rb"
|
2
|
+
require_relative "../../../lib/vendorise/tasks"
|
3
|
+
|
4
|
+
module Vendorise
|
5
|
+
describe "rake vendorise:gem" do
|
6
|
+
subject(:task) { Rake::Task["vendorise:gem"] }
|
7
|
+
|
8
|
+
it "defines vendorise:gem" do
|
9
|
+
expect(task).to_not eq nil
|
10
|
+
end
|
11
|
+
|
12
|
+
it "accepts a url argument" do
|
13
|
+
expect(task.arg_names).to match_array [:url]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vendorise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Iain Beeston
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -60,6 +60,7 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- .gitignore
|
63
|
+
- .travis.yml
|
63
64
|
- Gemfile
|
64
65
|
- LICENSE.txt
|
65
66
|
- README.md
|
@@ -69,6 +70,7 @@ files:
|
|
69
70
|
- lib/vendorise/tasks.rb
|
70
71
|
- lib/vendorise/version.rb
|
71
72
|
- spec/lib/vendorise/parser_spec.rb
|
73
|
+
- spec/lib/vendorise/tasks_spec.rb
|
72
74
|
- spec/spec_helper.rb
|
73
75
|
- vendorise.gemspec
|
74
76
|
homepage: http://github.com/New-Bamboo/vendorise
|
@@ -97,4 +99,5 @@ specification_version: 4
|
|
97
99
|
summary: Uses git subtree to download the source for a gem into /vendor/gems
|
98
100
|
test_files:
|
99
101
|
- spec/lib/vendorise/parser_spec.rb
|
102
|
+
- spec/lib/vendorise/tasks_spec.rb
|
100
103
|
- spec/spec_helper.rb
|