egi 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/egi.gemspec +1 -0
- data/lib/egi.rb +4 -4
- data/lib/egi/env.rb +13 -0
- metadata +19 -8
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
data/egi.gemspec
CHANGED
data/lib/egi.rb
CHANGED
@@ -6,14 +6,15 @@ module Egi
|
|
6
6
|
autoload :Group, 'egi/group'
|
7
7
|
autoload :Item, 'egi/item'
|
8
8
|
|
9
|
+
module_function
|
9
10
|
def env
|
10
11
|
load_file(config_file) unless @env
|
11
12
|
|
12
|
-
|
13
|
-
self[name]
|
13
|
+
self[(ENV['EGI_ENV'] || 'default').to_sym]
|
14
14
|
end
|
15
15
|
|
16
16
|
def [](name)
|
17
|
+
name = name.to_sym
|
17
18
|
@env.has_key?(name) ? @env[name] : nil
|
18
19
|
end
|
19
20
|
|
@@ -28,6 +29,7 @@ module Egi
|
|
28
29
|
def reset
|
29
30
|
@env = nil
|
30
31
|
end
|
32
|
+
|
31
33
|
def config_file
|
32
34
|
@config_file ||
|
33
35
|
( File.exist?('./egi.conf') && './egi.conf' ) ||
|
@@ -38,6 +40,4 @@ module Egi
|
|
38
40
|
def config_file=(file)
|
39
41
|
@config_file = file
|
40
42
|
end
|
41
|
-
|
42
|
-
module_function :env, :[], :load, :reset, :config_file, :config_file=
|
43
43
|
end
|
data/lib/egi/env.rb
CHANGED
@@ -26,5 +26,18 @@ module Egi
|
|
26
26
|
def item(name, hash = {})
|
27
27
|
items[name.to_sym].update(hash)
|
28
28
|
end
|
29
|
+
|
30
|
+
def [](name)
|
31
|
+
items[name.to_sym]
|
32
|
+
end
|
33
|
+
|
34
|
+
def tags
|
35
|
+
@tags ||= items.values.map {|item| item[:tags] || [] }.flatten.uniq
|
36
|
+
end
|
37
|
+
|
38
|
+
def tagged(name)
|
39
|
+
name = name.to_sym
|
40
|
+
tags.include?(name) ? items.select {|k, v| v[:tags].include?(name) } : nil
|
41
|
+
end
|
29
42
|
end
|
30
43
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: egi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-11-
|
12
|
+
date: 2011-11-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement: &
|
16
|
+
requirement: &79798420 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *79798420
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &79798110 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *79798110
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: autowatchr
|
38
|
-
requirement: &
|
38
|
+
requirement: &79797870 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,18 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *79797870
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: tapp
|
49
|
+
requirement: &79797600 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *79797600
|
47
58
|
description: manage multi-environments
|
48
59
|
email:
|
49
60
|
- okitakunio@gmail.com
|