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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cfc3f020ac957af0592f60d8483b3290cbd45094
4
- data.tar.gz: b1b3f3aced850ffe765d09a6466c931f313093e6
3
+ metadata.gz: 744428c79e0913d8fc57735d3ac47b7db45a83bc
4
+ data.tar.gz: 266f69efb8d0da96821510f7240ee4eceac4912a
5
5
  SHA512:
6
- metadata.gz: c48cdd39b1fc6de45ccea25b9930eac1e2bc4853f735bc48f148c060d8f985d7c8e9309b5a8706571949183c6fc70192b2870f9bca7f12f7206ec55a81457f28
7
- data.tar.gz: 351df11878016e0e80a96fdd491dee93bf0aabdf452c44ff2cdb7552189ddcf108da2f8b9fef796754474544029dc3724a74cc4b9bb58c0c5feb23d40367016a
6
+ metadata.gz: f6315bcb3c3810d6deeae7bf1c09e7ef8061af45a144626f51635830cbf2b9e1b58ee65fbca210e6d357d1f140ad9e996c2d8aafe5ffdfa62ab72881ef95356c
7
+ data.tar.gz: d741f509668cd5f009dd1f75555342e505908ddedf6385a10b85252aa66374b9d33a3907c1eeac9f9c943bb14d3361e7e203363cbd44db6de142b48684e610e2
data/Rakefile CHANGED
@@ -7,4 +7,4 @@ Rake::TestTask.new(:test) do |t|
7
7
  t.test_files = FileList['test/**/*_test.rb']
8
8
  end
9
9
 
10
- task :default => :spec
10
+ task :default => :test
@@ -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.exists?(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.exists?(absolute_path)
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)
@@ -1,3 +1,3 @@
1
1
  module FeatureCop
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -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.exists?(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.exists?(absolute_path)
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.to_json(identifier = nil)
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.to_json
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feature_cop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Allred