brewgem 0.0.4 → 0.0.5
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 +4 -4
- data/lib/brewgem/cli.rb +4 -2
- data/lib/brewgem/version.rb +1 -1
- data/lib/brewgem.rb +5 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 443e9894e0b73f60233fbad19a3b0f75d2ea0bd1
|
|
4
|
+
data.tar.gz: 6d532d9980646cbc38962016e4b38bf0f8f11911
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f54a6335d191cc87494ef17178060815b805ef4621a742c955a02b0d18b1b278085067732edb6d51b41c32932fb9850c71ef7d748c92ac1cc983f713b821ae2a
|
|
7
|
+
data.tar.gz: 2e05af684bf39b51b07d2fdc71f8d1004757cc0f094cedc1c0d7876f7cb8f5f47aaeb4f9cfb1536088f9d1e437bcc079a267f44ae539c7989bc1e7cbe991f8da
|
data/lib/brewgem/cli.rb
CHANGED
|
@@ -8,12 +8,14 @@ module BrewGem
|
|
|
8
8
|
uninstall: 'Uninstall a gem installed from RubyGemss'
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
desc 'install [<gem-name>] [<version>] [--local=<path-to-local-dir-or-.gem>] [--
|
|
11
|
+
desc 'install [<gem-name>] [<version>] [--local=<path-to-local-dir-or-.gem>] [--git=<git@github.com:project/repo.git [--ref=<git-branch-or-tag>]]',
|
|
12
12
|
COMMANDS[:install]
|
|
13
13
|
method_option :local, type: 'string'
|
|
14
|
-
method_option :
|
|
14
|
+
method_option :git , type: 'string', aliases: '--github'
|
|
15
|
+
method_option :ref, type: 'string', aliases: ['--tag', '--branch']
|
|
15
16
|
method_option :verbose, :type => :boolean
|
|
16
17
|
def install(gem_name = nil, version = nil)
|
|
18
|
+
puts options
|
|
17
19
|
BrewGem.install(options.merge(name: gem_name, version: version))
|
|
18
20
|
end
|
|
19
21
|
|
data/lib/brewgem/version.rb
CHANGED
data/lib/brewgem.rb
CHANGED
|
@@ -50,12 +50,14 @@ module BrewGem
|
|
|
50
50
|
install(local: gem_path)
|
|
51
51
|
return
|
|
52
52
|
end
|
|
53
|
-
elsif options[:
|
|
53
|
+
elsif options[:git]
|
|
54
54
|
# clone from github and build gem
|
|
55
|
-
github_gem_path = options[:
|
|
55
|
+
github_gem_path = options[:git]
|
|
56
56
|
name = github_gem_path.match(/.*\/(.*)\.git$/)[1]
|
|
57
57
|
target_dir_name = File.join(Dir.tmpdir, "build-#{name}-#{rand(100000000)}")
|
|
58
|
-
|
|
58
|
+
git_command = "git clone #{github_gem_path} #{target_dir_name}"
|
|
59
|
+
git_command += " --single-branch -b #{options[:ref]}" if options[:ref]
|
|
60
|
+
run git_command
|
|
59
61
|
# recursively call self to install from local dir
|
|
60
62
|
install(local: target_dir_name)
|
|
61
63
|
return
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: brewgem
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joshua Peek
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 2016-01-08 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: thor
|