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.
- data/lib/unveil.rb +1 -1
- data/lib/unveil/feature.rb +1 -1
- data/lib/unveil/helpers.rb +6 -6
- data/lib/unveil/version.rb +1 -1
- data/unveil-ruby.gemspec +6 -3
- metadata +18 -2
data/lib/unveil.rb
CHANGED
data/lib/unveil/feature.rb
CHANGED
data/lib/unveil/helpers.rb
CHANGED
@@ -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
|
-
|
12
|
-
|
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
|
data/lib/unveil/version.rb
CHANGED
data/unveil-ruby.gemspec
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
$LOAD_PATH.unshift(
|
4
|
-
Dir['lib/unveil/**/*'].each { |
|
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.
|
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
|