plug 0.1.3 → 0.1.5

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: f3e2710741a9c1a2b52ab9544173cd6e4975fbbe
4
- data.tar.gz: f74176e4c335a9a018a7e9d4551c8a61e5e32a53
3
+ metadata.gz: 75a58aa6dd10a22d5612e56d847ba8a28435a70a
4
+ data.tar.gz: 0eebbd65e9d323f56cb16fb7345d095c18b38950
5
5
  SHA512:
6
- metadata.gz: fb190cde3f4d8091fb1e8a7342de47cb1448ed860c5601c4befe29309a92ea7842ece773ed19f3ce94a25da843ad672a2d8b461ed07ed99e2c43d1b580bba7c8
7
- data.tar.gz: 4b3a174f8524883eda36751efeb6c5418d1de611a3dc061281800d410e4e29a6774d9a43b4874086aa6c08b8c19d2ea129e49a8816eedf69df0c75b901e64f1a
6
+ metadata.gz: 1e7c9f6326960e9b8a71f64d7ccb110bd707ec6aab11a9e190df37668619d6daa78db9c02e8996d2667ee84ec427447ff102a8bf9918a16f577da5ff785c3f77
7
+ data.tar.gz: 9ccc3bce86d5697f30ababcd96e94dbc1baeee703ca1c9f0034ebe477e338c7b93a9b3bfed08e254282af050a957b86295296cd24ba30f062aab795b30b82cac
@@ -1,5 +1,9 @@
1
1
  module Plug
2
2
  class ApplicationController < ActionController::Base
3
3
  protect_from_forgery with: :exception
4
+
5
+ unless Rails.env.test?
6
+ http_basic_authenticate_with name: Plug.auth_user, password: Plug.auth_password
7
+ end
4
8
  end
5
9
  end
data/lib/plug.rb CHANGED
@@ -1,7 +1,9 @@
1
1
  require 'plug/engine'
2
+ require 'plug/configuration'
2
3
 
3
4
  module Plug
4
5
  extend self
6
+ extend Configuration
5
7
 
6
8
  def enabled?(arg)
7
9
  arg = arg.to_s if arg.is_a? Symbol
@@ -0,0 +1,21 @@
1
+ module Plug
2
+ module Configuration
3
+ AUTH_USER = ''
4
+ AUTH_PASSWORD = ''
5
+
6
+ VALID_OPTIONS_KEYS = [
7
+ :auth_user,
8
+ :auth_password
9
+ ].freeze
10
+
11
+ attr_accessor *VALID_OPTIONS_KEYS
12
+
13
+ def configure
14
+ yield self
15
+ end
16
+
17
+ def options
18
+ Hash[ * VALID_OPTIONS_KEYS.map { |key| [key, send(key)] }.flatten ]
19
+ end
20
+ end
21
+ end
data/lib/plug/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Plug
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.5'
3
3
  end
metadata CHANGED
@@ -1,10 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plug
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben
8
+ - Boost
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
@@ -178,9 +179,10 @@ dependencies:
178
179
  - - ">="
179
180
  - !ruby/object:Gem::Version
180
181
  version: '0'
181
- description: Feature flipper
182
+ description: Rails engine that can plug/unplug features with notice (WIP)
182
183
  email:
183
184
  - benedict@boost.co.nz
185
+ - info@boost.co.nz
184
186
  executables: []
185
187
  extensions: []
186
188
  extra_rdoc_files: []
@@ -221,6 +223,7 @@ files:
221
223
  - config/routes.rb
222
224
  - db/migrate/20171207020316_create_plug_features.rb
223
225
  - lib/plug.rb
226
+ - lib/plug/configuration.rb
224
227
  - lib/plug/engine.rb
225
228
  - lib/plug/version.rb
226
229
  - lib/tasks/plug_tasks.rake
@@ -247,5 +250,5 @@ rubyforge_project:
247
250
  rubygems_version: 2.6.13
248
251
  signing_key:
249
252
  specification_version: 4
250
- summary: Feature flipper
253
+ summary: Rails engine that can plug/unplug features
251
254
  test_files: []