arb 1.1.1 → 1.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: 52cf420f7acc3df64cbb8737af0f04283c72ae3a
4
- data.tar.gz: d8d385d9839a3acb63612d29f6743fe79fa444a3
3
+ metadata.gz: a12bae16337cd5a9f6d6533f9619ddddce4c350f
4
+ data.tar.gz: 4c0ad056ef4900f86b42411185dfb4e23bcc8871
5
5
  SHA512:
6
- metadata.gz: 5ad36b98e00d65b65c779c374ae7cb9b29ad21f215b3f5840b960decad86e5620aeda6b9ac88541a7c0c4180641cc212fd0217a1c80744c86a6ddb7f437feb48
7
- data.tar.gz: be04b3cad803d449c28ceda3046670e1918d631abd7f619a87c58d2b53c0f129638a542774dd662bbd1128fc9bb40e40a0c45c4c6cad9c196181a8bafec86790
6
+ metadata.gz: b83aeb82ad68b2de1dfb26c2aa5a5a70fd953d889db959ad30433fc612e0b4f14ca1d1731efad372b6876dcd553083973aec727aa93499731130ec9e48cdb3c4
7
+ data.tar.gz: 3850d5761a961bd2142c24f5a380185ebe87c236bac428bd37d6323a8f4fccb1e5f57a679d6777883f259da00773e1c7855e2a9c28f22fac5f7ebda61d481fef
data/lib/arb/kernel.rb ADDED
@@ -0,0 +1,21 @@
1
+ module Arb
2
+ #params: prefix of gems that need to be required
3
+ #default will require the series of 'arb' gems whose prefix is 'arb_'
4
+ Kernel.send :define_method, :arb_require do |*args, &block|
5
+ Arb.required_gems||=[]
6
+ args.unshift 'arb_'
7
+ tmp=[]
8
+ args.each { |arg| tmp << Gem::Specification.select { |gem| gem.author='arybin' && gem.name=~/^#{arg}/ }.map { |gem| gem.name }}
9
+ tmp.compact.uniq.flatten!.each { |gem| Arb.required_gems<< gem if require gem }
10
+ Arb.required_gems.empty? ? 'Nothing required yet!' : 'Gems successfully required: ' <<Arb.required_gems.uniq.join(',') <<'!'
11
+ end
12
+
13
+ #prepare the arb_* methods depend on the series of 'arb' gems to 'using' the refinement in Arb namespace quickly.
14
+ #Kernel.send :define_method, :arb_init_using do |*args, &block|
15
+ #Arb.constants.map{|const| const=~/(.*)refine$/i && ['arb_'<<$1.downcase,const] }.compact.each do |map|
16
+ #Kernel.send :define_method,map[0] do |*args,&block|
17
+ #Arb.const_get(map[1])
18
+ #end
19
+ #end
20
+ #end
21
+ end
data/lib/arb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Arb
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.3"
3
3
  end
data/lib/arb.rb CHANGED
@@ -3,27 +3,7 @@ module Arb
3
3
  attr_accessor :required_gems
4
4
  end
5
5
 
6
- #params: prefix of gems that need to be required
7
- #default will require the series of 'arb' gems whose prefix is 'arb_'
8
- Kernel.send :define_method, :arb_require do |*args, &block|
9
- Arb.required_gems||=[]
10
- args.unshift 'arb_'
11
- tmp=[]
12
- args.each { |arg| tmp << Gem::Specification.select { |gem| gem.author='arybin' && gem.name=~/^#{arg}/ }.map { |gem| gem.name }}
13
- tmp.compact.uniq.flatten!.each { |gem| Arb.required_gems<< gem if require gem }
14
- Arb.required_gems.empty? ? 'Nothing required yet!' : 'Gems successfully required: ' <<Arb.required_gems.uniq.join(',') <<'!'
15
- end
16
-
17
- #prepare the arb_* methods depend on the series of 'arb' gems to 'using' the refinement in Arb namespace quickly.
18
- Kernel.send :define_method, :arb_init_using do |*args, &block|
19
- Arb.constants.map{|const| const=~/(.*)refine$/i && ['arb_'<<$1.downcase,const] }.compact.each do |map|
20
- Kernel.send :define_method,map[0] do |*args,&block|
21
- self.class.send :using,Arb.const_get(map[1])
22
- end
23
- end
24
- end
25
-
26
-
6
+ #initialize
27
7
  arb_require
28
- arb_init_using
8
+ #arb_init_using
29
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - arybin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-20 00:00:00.000000000 Z
11
+ date: 2016-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -69,6 +69,7 @@ files:
69
69
  - bin/console
70
70
  - bin/setup
71
71
  - lib/arb.rb
72
+ - lib/arb/kernel.rb
72
73
  - lib/arb/version.rb
73
74
  homepage: https://github.com/arybin-cn
74
75
  licenses: []