plug 0.1.7 → 0.1.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: abca8d64bea6f07000560960f761ef8cf9685ab1
4
- data.tar.gz: 0f607e0b63a90f7abdba554aac17c97cd240d5e9
3
+ metadata.gz: 19246ab9387032253ed9b13aac4fb10bd03cbf41
4
+ data.tar.gz: b63f935e9e157e70d1b98d9583c0d478ed541ce4
5
5
  SHA512:
6
- metadata.gz: e7731f594219d50f5134b6a00a668b41af41b2bb80a8b7a5a51cbbf56ae5ccf743eafb8658ebb46cd9cf7350eb7b949ab1833ae7dbbbdfb9fc5209a0103fe19f
7
- data.tar.gz: 7ffd23598f9f7f70727d344a1693d95632e4a7cd948235046cfdc1c87c23a43f504b86dd93a56334ecd85211fe1c60502911f5d5a2c5f6ffe5a987116333f7e6
6
+ metadata.gz: a48e1d5fbe882b65012799c3a18445c54fb8097bb61c7fd4ddc93b79798e0589228ffb099a224c7668e9c4490eaa7acb1eb69cd492121162dad48a602d9cb011
7
+ data.tar.gz: 50323022408bd5474cabbe4d3a18e154021a2a2a843841a6c848fb9b9559af1454d3d4438b93ffc6993777b58d7ae9f2d0cd7b1eae87152845bfba5c2a2e4308
data/README.md CHANGED
@@ -1,28 +1,68 @@
1
- # Plug
2
- Short description and motivation.
1
+ # 🔌 Plug
3
2
 
4
- ## Usage
5
- How to use my plugin.
3
+ A Rails engine to turn on/off features (Feature flipper).
4
+
5
+ ### Features
6
+
7
+ - Supports Rails 3 and above
8
+ - MySQL
9
+ - Set notices (WIP)
10
+
11
+ ### Prerequisites
12
+
13
+ - Rails version 3 and above
14
+ - MySQL
15
+
16
+ ### Getting Started
6
17
 
7
- ## Installation
8
18
  Add this line to your application's Gemfile:
9
19
 
10
20
  ```ruby
11
21
  gem 'plug'
12
22
  ```
13
23
 
14
- And then execute:
24
+ Execute:
25
+
15
26
  ```bash
16
- $ bundle
27
+ bundle
17
28
  ```
18
29
 
19
- Or install it yourself as:
30
+ And run the install generator:
31
+
20
32
  ```bash
21
- $ gem install plug
33
+ rails g plug:install
34
+ → rails g plug:install:migrations
35
+ → rails db:migrate # Newer version of Rails
36
+ → rake db:migrate # Older version of Rails
37
+ → rails s
22
38
  ```
23
39
 
24
- ## Contributing
25
- Contribution directions go here.
40
+ ### Usage
41
+
42
+ Go to `localhost:3000/plug` and start creating features.
43
+
44
+ Use the provided method to check if the feature is enabled.
45
+
46
+ ```ruby
47
+ Plug.enabled?('my-awesome-feature-slug')
48
+ ```
49
+
50
+ If you wanted to restrict routes, you can use `Plug::Constraint` class
51
+
52
+ ```ruby
53
+ Rails.application.routes.draw do
54
+ resources :blog, constraint: Plug::Constraint.new('my-awesome-feature-slug')
55
+ end
56
+ ```
57
+
58
+ ### Questions/Issues?
59
+
60
+ File a new [issue](https://github.com/boost/plug/issues/new) if you have questions or issues.
61
+
62
+ ### Contributing
26
63
 
27
- ## License
28
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
64
+ 1. Fork it ( https://github.com/boost/plug/fork )
65
+ 2. Create your feature branch (`git checkout -b my-awesome-feature`)
66
+ 3. Commit your changes (`git commit -am 'Add my awesome feature!'`)
67
+ 4. Push to the branch (`git push origin my-awesome-feature`)
68
+ 5. Create a new Pull Request
@@ -0,0 +1,13 @@
1
+ module Plug
2
+ class InstallGenerator < Rails::Generators::Base
3
+ source_root File.expand_path("../templates", __FILE__)
4
+
5
+ def copy_initializer_file
6
+ copy_file 'plug.rb', 'config/initializers/plug.rb'
7
+ end
8
+
9
+ def mount_engine
10
+ inject_into_file('config/routes.rb', "\n mount Plug::Engine => '/plug', as: 'plug'\n\n", :before => /^end/)
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,6 @@
1
+ # /config/initializers/plug.rb
2
+
3
+ Plug.configure do |config|
4
+ config.auth_user = 'admin'
5
+ config.auth_password = 'password'
6
+ end
data/lib/plug/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Plug
2
- VERSION = '0.1.7'
2
+ VERSION = '0.1.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plug
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-12-18 00:00:00.000000000 Z
12
+ date: 2017-12-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -222,6 +222,8 @@ files:
222
222
  - app/views/plug/shared/_nav.html.haml
223
223
  - config/routes.rb
224
224
  - db/migrate/20171207020316_create_plug_features.rb
225
+ - lib/generators/plug/install_generator.rb
226
+ - lib/generators/plug/templates/plug.rb
225
227
  - lib/plug.rb
226
228
  - lib/plug/configuration.rb
227
229
  - lib/plug/constraint.rb