feature_gate 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: fae86217214b626628f056def9147d32a4896aa3
4
+ data.tar.gz: c62e63843fcdf1e9a7002dbc4819dc3a35745caa
5
+ SHA512:
6
+ metadata.gz: 3ba7a2a347d3389ca29422aec314bd3c047ab84611e816bdabb55b2ab5fc49e7fe1d23a217c5332ccfeb0b88c7df35fae16a53508f5202ea5b968a9d315554a3
7
+ data.tar.gz: bcac4c672c31ccfb76c09f4b628dc806e044c2a188f70d9638dfc5a33f449dd5a728daf4d3552716c48c34cac02a01660567a1ed9b282b90c453237a39845afc
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ # ignore .gem files
2
+ *.gem
3
+ .DS_Store
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Tiffany Huang
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # feature_gate
2
+ A gem to help toggle feature gates on and off
@@ -0,0 +1,4 @@
1
+ class GatedFeature < ActiveRecord::Base
2
+ validates :name, presence: true
3
+ validates :gated, inclusion: { in: [true, false] }
4
+ end
@@ -0,0 +1,14 @@
1
+ $:.push File.expand_path('../lib', __FILE__)
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = 'feature_gate'
5
+ s.version = '0.0.1'
6
+ s.date = '2016-05-01'
7
+ s.summary = 'A gem to toggle feature gates on and off'
8
+ s.description = 'A gem to toggle feature gates on and off'
9
+ s.authors = ['Tiffany Huang']
10
+ s.email = 'little.huang@gmail.'
11
+ s.files = `git ls-files`.split("\n")
12
+ s.homepage = 'https://github.com/tiffling/feature_gate'
13
+ s.license = 'MIT'
14
+ end
@@ -0,0 +1,7 @@
1
+ class FeatureGate
2
+ def self.gate
3
+ if true
4
+ yield
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,17 @@
1
+ require 'rails/generators/active_record'
2
+
3
+ class FeatureGateGenerator < Rails::Generators::Base
4
+ include Rails::Generators::Migration
5
+ source_root File.expand_path('../templates', __FILE__)
6
+
7
+ desc 'creates gated_features table'
8
+
9
+ def install
10
+ migration_template 'migration.rb', 'db/migrate/create_gated_features.rb'
11
+ end
12
+
13
+ def self.next_migration_number(dirname)
14
+ ActiveRecord::Generators::Base.next_migration_number(dirname)
15
+ end
16
+ private_class_method :next_migration_number
17
+ end
@@ -0,0 +1,11 @@
1
+ class CreateGatedFeatures < ActiveRecord::Migration
2
+ def change
3
+ create_table :gated_features do |t|
4
+ t.text :name, null: false
5
+ t.boolean :gated, default: true, null: false
6
+ t.timestamps
7
+ end
8
+
9
+ add_index :gated_features, :name, unique: true
10
+ end
11
+ end
metadata ADDED
@@ -0,0 +1,51 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: feature_gate
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Tiffany Huang
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-05-01 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A gem to toggle feature gates on and off
14
+ email: little.huang@gmail.
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - .gitignore
20
+ - LICENSE
21
+ - README.md
22
+ - app/models/gated_feature.rb
23
+ - feature_gate.gemspec
24
+ - lib/feature_gate.rb
25
+ - lib/generators/feature_gate/feature_gate_generator.rb
26
+ - lib/generators/feature_gate/templates/migration.rb
27
+ homepage: https://github.com/tiffling/feature_gate
28
+ licenses:
29
+ - MIT
30
+ metadata: {}
31
+ post_install_message:
32
+ rdoc_options: []
33
+ require_paths:
34
+ - lib
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ requirements: []
46
+ rubyforge_project:
47
+ rubygems_version: 2.1.10
48
+ signing_key:
49
+ specification_version: 4
50
+ summary: A gem to toggle feature gates on and off
51
+ test_files: []