feature_cop 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/lib/feature_cop/blacklist.rb +4 -4
- data/lib/feature_cop/version.rb +1 -1
- data/lib/feature_cop/whitelist.rb +4 -4
- data/lib/feature_cop.rb +8 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 744428c79e0913d8fc57735d3ac47b7db45a83bc
|
4
|
+
data.tar.gz: 266f69efb8d0da96821510f7240ee4eceac4912a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6315bcb3c3810d6deeae7bf1c09e7ef8061af45a144626f51635830cbf2b9e1b58ee65fbca210e6d357d1f140ad9e996c2d8aafe5ffdfa62ab72881ef95356c
|
7
|
+
data.tar.gz: d741f509668cd5f009dd1f75555342e505908ddedf6385a10b85252aa66374b9d33a3907c1eeac9f9c943bb14d3361e7e203363cbd44db6de142b48684e610e2
|
data/Rakefile
CHANGED
@@ -8,14 +8,14 @@ module FeatureCop
|
|
8
8
|
module ClassMethods
|
9
9
|
|
10
10
|
def blacklist_from_yaml(file = "feature_cop_blacklist.yml")
|
11
|
-
if ::File.
|
12
|
-
absolute_path = file
|
11
|
+
if ::File.exist?(file)
|
12
|
+
absolute_path = file
|
13
13
|
elsif defined?(Rails)
|
14
14
|
absolute_path = ::File.join(Rails.root, "config", file)
|
15
15
|
end
|
16
16
|
|
17
|
-
raise "#{file} not found!" unless ::File.
|
18
|
-
self.blacklist = ::YAML.load_file(absolute_path)[env]
|
17
|
+
raise "#{file} not found!" unless ::File.exist?(absolute_path)
|
18
|
+
self.blacklist = ::YAML.load_file(absolute_path)[env]
|
19
19
|
end
|
20
20
|
|
21
21
|
def all_except_blacklist(identifier)
|
data/lib/feature_cop/version.rb
CHANGED
@@ -8,14 +8,14 @@ module FeatureCop
|
|
8
8
|
module ClassMethods
|
9
9
|
|
10
10
|
def whitelist_from_yaml(file = "feature_cop_whitelist.yml")
|
11
|
-
if ::File.
|
12
|
-
absolute_path = file
|
11
|
+
if ::File.exist?(file)
|
12
|
+
absolute_path = file
|
13
13
|
elsif defined?(Rails)
|
14
14
|
absolute_path = ::File.join(Rails.root, "config", file)
|
15
15
|
end
|
16
16
|
|
17
|
-
raise "#{file} not found!" unless ::File.
|
18
|
-
self.whitelist = ::YAML.load_file(absolute_path)[env]
|
17
|
+
raise "#{file} not found!" unless ::File.exist?(absolute_path)
|
18
|
+
self.whitelist = ::YAML.load_file(absolute_path)[env]
|
19
19
|
end
|
20
20
|
|
21
21
|
def whitelist
|
data/lib/feature_cop.rb
CHANGED
@@ -65,13 +65,17 @@ module FeatureCop
|
|
65
65
|
end
|
66
66
|
return features
|
67
67
|
end
|
68
|
-
|
69
|
-
def self.
|
68
|
+
|
69
|
+
def self.as_json(identifier = nil)
|
70
70
|
feature_set = {}
|
71
71
|
features.each_pair do |key, value|
|
72
|
-
feature_set[key.downcase.camelize(:lower)] = self.method(value.downcase).call(identifier)
|
72
|
+
feature_set[key.downcase.camelize(:lower)] = self.method(value.downcase).call(identifier)
|
73
73
|
end
|
74
|
-
feature_set
|
74
|
+
feature_set
|
75
|
+
end
|
76
|
+
|
77
|
+
def self.to_json(identifier = nil)
|
78
|
+
self.as_json(identifier).to_json
|
75
79
|
end
|
76
80
|
end
|
77
81
|
|