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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2029d25d2c8e8d61e3a1030e7a5644b5703242f9
4
- data.tar.gz: 7dbd98a4455e4932982a6b121c44e1c80f28adb7
3
+ metadata.gz: 443e9894e0b73f60233fbad19a3b0f75d2ea0bd1
4
+ data.tar.gz: 6d532d9980646cbc38962016e4b38bf0f8f11911
5
5
  SHA512:
6
- metadata.gz: dd0cc85b65de7553801b78617c4fe0ce16b208ceb2076c8569bbda37727ab1530c4b1937838940d9dac13fd29144b105ad3055fa14f3a304c05355ae88716d9f
7
- data.tar.gz: 9e4ad7024470390c317698a6541cf274b28d049efb78f82d81c6038bb83a204f1d21aaf6cef4231764bebcf0f568ff468e7c57743b17ca76f98cae9b313d487b
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>] [--github=<git@github.com:project/repo.git]',
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 :github, type: 'string'
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
 
@@ -1,3 +1,3 @@
1
1
  module BrewGem
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
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[:github]
53
+ elsif options[:git]
54
54
  # clone from github and build gem
55
- github_gem_path = options[:github]
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
- run "git clone #{github_gem_path} #{target_dir_name}"
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
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: 2015-12-19 00:00:00.000000000 Z
13
+ date: 2016-01-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor