unveil-ruby 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
- require 'unveil/version'
2
1
  require 'net/https'
2
+ require 'rails'
3
3
 
4
4
  module Unveil
5
5
  @@public_key = nil
@@ -9,7 +9,7 @@ module Unveil
9
9
  end
10
10
 
11
11
  def enabled(user_id)
12
- Unveil.get "features/#{name}/enabled/#{user_id}"
12
+ JSON.parse(Unveil.get("features/#{name}/enabled/#{user_id}").body)['enabled']
13
13
  end
14
14
 
15
15
  def deactivate_all
@@ -1,19 +1,19 @@
1
+ require 'action_controller'
2
+
1
3
  module Unveil
2
4
  module Controller
3
5
  module Helpers
4
6
  def self.included(base)
5
7
  base.send :helper_method, :rollout?
6
- base.send :helper_method, :unveil
7
8
  end
8
9
 
9
10
  def rollout?(feature)
10
11
  return false unless current_user
11
- ArRollout.active?(name, current_user)
12
- end
13
-
14
- def unveil
15
- @unveil ||= Unveil::App.new
12
+ session[:unveil_features] ||= Unveil::User.new(current_user.id).features
13
+ session[:unveil_features].include?(feature.to_s)
16
14
  end
17
15
  end
18
16
  end
19
17
  end
18
+
19
+ ActionController::Base.send :include, Unveil::Controller::Helpers
@@ -1,3 +1,3 @@
1
1
  module Unveil
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -1,7 +1,8 @@
1
1
  # -*- encoding: utf-8 -*-
2
- lib = File.expand_path('../', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- Dir['lib/unveil/**/*'].each { |f| require f }
2
+ top = File.expand_path('../', __FILE__)
3
+ $LOAD_PATH.unshift(top) unless $LOAD_PATH.include?(top)
4
+ Dir['lib/unveil/**/*'].each { |file| require file unless File.directory?(file) }
5
+ require File.expand_path('../lib/unveil.rb', __FILE__)
5
6
 
6
7
  Gem::Specification.new do |gem|
7
8
  gem.name = "unveil-ruby"
@@ -12,6 +13,8 @@ Gem::Specification.new do |gem|
12
13
  gem.summary = %q{}
13
14
  gem.homepage = ""
14
15
 
16
+ gem.add_dependency 'rails', '~>3.2'
17
+
15
18
  gem.files = `git ls-files`.split($/)
16
19
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
20
  gem.require_paths = ["lib"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unveil-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,23 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
  date: 2012-12-03 00:00:00.000000000 Z
13
- dependencies: []
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '3.2'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '3.2'
14
30
  description: A Rubygem for connecting to the Unveil service.
15
31
  email:
16
32
  - jonathan@jclem.net