chirrin-chirrion 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +4 -4
- data/lib/chirrin-chirrion.rb +6 -6
- data/lib/chirrin-chirrion/database_adapters/redis_adapter.rb +4 -4
- data/lib/chirrin-chirrion/version.rb +1 -1
- metadata +18 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e341870aee82b251ead9343bba2d1a9d7acca8fc
|
4
|
+
data.tar.gz: 77fdcf0f6399842edf51b107742874d83e6bd4d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69cc095c4f65d6195b523ec0643eafa4e692637fab6d3d7cdcff67f31ce1aac29d6ca8562226a3bb15fd1e533cae6f3f1eb86f846812761ce7e524eae1a38cc2
|
7
|
+
data.tar.gz: 098f863e10d232b3d28e2a8cb6ffc849abb0971bc5b6e0d9a494fd2a16e21cf68e7d8898c6a8842167a8e9550cee547ae269a3e52f849681c26594f03ca2ada2
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes of the project you will find here.
|
3
3
|
|
4
|
+
## [0.3.0] - 2015-06-08
|
5
|
+
### Changed
|
6
|
+
- Redis adaprer: methods #activate and #inactivate with beng because they raise exception
|
7
|
+
- ChirrinChirrion: methods #chirrin and #chirrion with beng because they raise exception
|
8
|
+
|
4
9
|
## [0.2.0] - 2015-03-30
|
5
10
|
### Changed
|
6
11
|
- Redis adaper inside of the module ChirrinChirrion::DatabaseAdapters
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@ Chirrin Chirrion is a gem to, easily, change the software behavior for new featu
|
|
5
5
|
The gem name was inspired in a funny Chapolim Colorado [episode](https://youtu.be/dzgrex7g_zY) called 'Chirrin Chirrion del Diablo'.
|
6
6
|
Where there is a magic object which the the key word 'chirrin' gives a new thing and 'chirrion' takes it away.
|
7
7
|
|
8
|
-
##
|
8
|
+
## Install
|
9
9
|
|
10
10
|
gem install chirrin-chirrion
|
11
11
|
|
@@ -16,7 +16,7 @@ Where there is a magic object which the the key word 'chirrin' gives a new thing
|
|
16
16
|
```ruby
|
17
17
|
require 'chirrin-chirrion'
|
18
18
|
redis_connection = Redis.new
|
19
|
-
redis_adapter = RedisAdapter.new(redis_connection)
|
19
|
+
redis_adapter = ChirrinChirrion::DatabaseAdapters::RedisAdapter.new(redis_connection)
|
20
20
|
ChirrinChirrion.config(database_adapter: redis_adapter)
|
21
21
|
```
|
22
22
|
|
@@ -32,12 +32,12 @@ ChirrinChirrion.remove_toggle('new_user_register_validation')
|
|
32
32
|
|
33
33
|
### Making a toggle active
|
34
34
|
```ruby
|
35
|
-
ChirrinChirrion.chirrin('new_user_register_validation')
|
35
|
+
ChirrinChirrion.chirrin!('new_user_register_validation')
|
36
36
|
```
|
37
37
|
|
38
38
|
### Making a toggle inactive
|
39
39
|
```ruby
|
40
|
-
ChirrinChirrion.chirrion('new_user_register_validation')
|
40
|
+
ChirrinChirrion.chirrion!('new_user_register_validation')
|
41
41
|
```
|
42
42
|
|
43
43
|
### Using a toggle with if else
|
data/lib/chirrin-chirrion.rb
CHANGED
@@ -43,20 +43,20 @@ module ChirrinChirrion
|
|
43
43
|
|
44
44
|
# Makes a toggle active (the toggle must already be registered)
|
45
45
|
#
|
46
|
-
# ChirrinChirrion.chirrin('my_inactive_feature')
|
46
|
+
# ChirrinChirrion.chirrin!('my_inactive_feature')
|
47
47
|
# ChirrinChirrion.chirrin?('my_inactive_feature') #=> true
|
48
48
|
#
|
49
|
-
def self.chirrin(toggle_name)
|
50
|
-
database_adapter.activate(toggle_name)
|
49
|
+
def self.chirrin!(toggle_name)
|
50
|
+
database_adapter.activate!(toggle_name)
|
51
51
|
end
|
52
52
|
|
53
53
|
# Makes a toggle inactive
|
54
54
|
#
|
55
|
-
# ChirrinChirrion.chirrion('my_active_feature')
|
55
|
+
# ChirrinChirrion.chirrion!('my_active_feature')
|
56
56
|
# ChirrinChirrion.chirrion?('my_active_feature') #=> false
|
57
57
|
#
|
58
|
-
def self.chirrion(toggle_name)
|
59
|
-
database_adapter.inactivate(toggle_name)
|
58
|
+
def self.chirrion!(toggle_name)
|
59
|
+
database_adapter.inactivate!(toggle_name)
|
60
60
|
end
|
61
61
|
|
62
62
|
# Checks if a toggle active (the toggle must already be registered)
|
@@ -35,9 +35,9 @@ module ChirrinChirrion
|
|
35
35
|
|
36
36
|
# Makes a toggle, existent or not, active:
|
37
37
|
#
|
38
|
-
# redis_adapter.activate('my_feature')
|
38
|
+
# redis_adapter.activate!('my_feature')
|
39
39
|
#
|
40
|
-
def activate(toggle_name)
|
40
|
+
def activate!(toggle_name)
|
41
41
|
toggle_info = get_toggle_info(toggle_name)
|
42
42
|
raise ChirrinChirrion::Errors::ToggleNotFound, "The toggle #{toggle_name} was not found" unless toggle_info
|
43
43
|
toggle_info['active'] = true
|
@@ -49,9 +49,9 @@ module ChirrinChirrion
|
|
49
49
|
|
50
50
|
# Makes a toggle, existent or not, iactive:
|
51
51
|
#
|
52
|
-
# redis_adapter.inactivate('my_feature')
|
52
|
+
# redis_adapter.inactivate!('my_feature')
|
53
53
|
#
|
54
|
-
def inactivate(toggle_name)
|
54
|
+
def inactivate!(toggle_name)
|
55
55
|
toggle_info = get_toggle_info(toggle_name)
|
56
56
|
raise ChirrinChirrion::Errors::ToggleNotFound, "The toggle #{toggle_name} was not found" unless toggle_info
|
57
57
|
toggle_info['active'] = false
|
metadata
CHANGED
@@ -1,83 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chirrin-chirrion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno Vicenzo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.8'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.8'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 3.2.0
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 3.2.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: redis
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 3.2.1
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 3.2.1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: json
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: 1.8.2
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 1.8.2
|
83
83
|
description: Chirrin for the new code apears, Chirrion for the new code desapears
|
@@ -88,9 +88,9 @@ executables: []
|
|
88
88
|
extensions: []
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
|
-
-
|
92
|
-
-
|
93
|
-
-
|
91
|
+
- .gitignore
|
92
|
+
- .rspec
|
93
|
+
- .travis.yml
|
94
94
|
- CHANGELOG.md
|
95
95
|
- Gemfile
|
96
96
|
- LICENSE
|
@@ -113,17 +113,17 @@ require_paths:
|
|
113
113
|
- lib
|
114
114
|
required_ruby_version: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
|
-
- -
|
116
|
+
- - '>='
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '0'
|
119
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
121
|
-
- -
|
121
|
+
- - '>='
|
122
122
|
- !ruby/object:Gem::Version
|
123
123
|
version: '0'
|
124
124
|
requirements: []
|
125
125
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.
|
126
|
+
rubygems_version: 2.4.7
|
127
127
|
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: Easy way to create and manage toggles
|