cgem 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e19f81fe6c9b1da7769729b3bf2acbdb6182c79
4
- data.tar.gz: 6280cb63fd40e538f4c3ce7aea0df77ec96057a7
3
+ metadata.gz: 206a514335b6e6a03e36b89a4e1c6311fc618e79
4
+ data.tar.gz: 73a345aeaef5fff0a35f5cd408c2df4f1b9148ab
5
5
  SHA512:
6
- metadata.gz: 3ac0ad1615a47cc2083530befc6181d040d63cb2c5dce1a999998b74a78b337df1e8365b76d633c0d06d1e06f1cd196331cfdcad3baf4f4c30e7366eb3758f20
7
- data.tar.gz: b23760419d65f2543cb2271886218b21c1338e234427140061a96fa376f3eaf43a19f761bc976f4106b5eb01a6f21882a29e27565a5c9bcd92c81f7f78ec6295
6
+ metadata.gz: b41ad4e73701e131c926985a19a5d4022e43822170ec589a70d79d58a540eb894b71b9b1741d8c10bec25f523713bfbe7e8c67a9d00adc2a384718d1a376edc7
7
+ data.tar.gz: ffdc3d03f64043286b6e7a869f8753e77e92ad67aed45a347037b4857ad71fca77149a7782babe73e6c8228ff0a3644eddd12b7880b44b6f942769ae6ab0b4bd
data/Gemfile CHANGED
@@ -1,4 +1,2 @@
1
1
  source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in cgem.gemspec
4
2
  gemspec
data/README.md CHANGED
@@ -13,9 +13,11 @@ Install it yourself as:
13
13
  ```bash
14
14
  cgem help
15
15
  cgem use rchina
16
- cgem use rubygems
16
+ cgem use default # rubygems
17
17
  cgem list
18
- cgem
18
+ cgem setup rchina
19
+ GEM_SOURCE=rchina cgem setup
20
+ cgem status # default
19
21
  ```
20
22
 
21
23
  ## Development
data/exe/cgem CHANGED
@@ -35,6 +35,15 @@ class CgemCLI < Thor
35
35
  end
36
36
  map '-v' => :version
37
37
  map '--version' => :version
38
+
39
+ desc 'setup [SOURCE]', 'install by environment variable'
40
+ def setup(source = nil)
41
+ env_key = 'GEM_SOURCE'
42
+ source ||= ENV[env_key]
43
+ abort "Not specify gem source or environment variable #{env_key}" if source.nil?
44
+ abort "Please use source key in #{Cgem.gem_sources.keys}" if source.start_with?('http')
45
+ use(source)
46
+ end
38
47
  end
39
48
 
40
49
  CgemCLI.start
@@ -1,3 +1,3 @@
1
1
  module Cgem
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  gem_sources:
3
- rubygems: https://rubygems.org
4
- rchina: https://gems.ruby-china.org
3
+ rubygems: &default https://rubygems.org
4
+ default: *default
5
+ rubychina: &rchina https://gems.ruby-china.org
6
+ rchina: *rchina
5
7
  taobao: https://ruby.taobao.org
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cgem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruijian Cao