enum_style 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98b788e7423c8a01cca8f6e820e6c78354a9d7ea6a4840f6f75710b862277030
4
- data.tar.gz: 1ec01276ae7ad5d751141c6e7b024c29c35decf34b4efb5db439d24e67e36767
3
+ metadata.gz: d9b08c0964cca66d7da7798b41ba8d2286bfdb0812495d536e4e617964e8679f
4
+ data.tar.gz: a2b94d171fc7015e909e257b11161a21f14407948db4b060e5cad0fa8e25d397
5
5
  SHA512:
6
- metadata.gz: 7e5f59d2dcae051995be12ded6f64bffb90584bb88cb8ebcd50bbb9fe23958b9ba43e9ecbe23f9edade5a39eb2f6c99044950e2fdcbe69ab3f8b59172aff56f4
7
- data.tar.gz: bd435ebad1a689ad057ce56ee079d004cfec16ee74b7f40f37a3d6df3894b074785fad104997300957dd29f3266139830583a16fde236ffe49571cc9e53776d6
6
+ metadata.gz: 157452700a518f671b2dd4d0af586617ef20c6fb64d7b7b6bdf0c6f0dc1bcd0c1d1ceceeb36b2a3c90601006569092fc644973b246f44e910ced20550a83b0e9
7
+ data.tar.gz: fe66e2c75b574bd4fca191563f112e4c502136f718015f1458e8253d44404c97ea165af28963342f882d6f75dc29def0fbb034eeb832741bf3dd0115391e7f43
data/README.md CHANGED
@@ -1,10 +1,6 @@
1
- # EnumStyle
2
- Short description and motivation.
3
1
 
4
- ## Usage
5
- How to use my plugin.
2
+ ## Installing
6
3
 
7
- ## Installation
8
4
  Add this line to your application's Gemfile:
9
5
 
10
6
  ```ruby
@@ -16,13 +12,48 @@ And then execute:
16
12
  $ bundle
17
13
  ```
18
14
 
19
- Or install it yourself as:
20
- ```bash
21
- $ gem install enum_style
22
15
  ```
16
+ rails g enum_style:install
17
+ ```
18
+
19
+ ```
20
+ config/enum_style.yml
21
+ ```
22
+
23
+ You can now edit them to adjust to your needs.
24
+
25
+ ## Usage
26
+
27
+ In model file:
28
+
29
+ ```ruby
30
+ class Article < ApplicationRecord
23
31
 
24
- ## Contributing
25
- Contribution directions go here.
32
+ #----------------------------------------
33
+ # ** Enums **
34
+ #----------------------------------------
35
+ enum publish: { draft: 0, preview: 10, published: 20 }
36
+
37
+ end
38
+ ```
39
+
40
+ You can call:
41
+
42
+ ```ruby
43
+ article = Article.first
44
+ article.published!
45
+
46
+ article.publish
47
+ # -> published
48
+
49
+ article.publish_style
50
+ # -> primary
51
+ ```
52
+
53
+ ```ruby
54
+ <%= tag.p(class: "btn-#{article.publish_style}") { 'content' } %>
55
+ # -> "<p class='btn-primary'>content</p>"
56
+ ```
26
57
 
27
58
  ## License
28
59
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -1,3 +1,3 @@
1
1
  module EnumStyle
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -1,5 +1,5 @@
1
1
  article:
2
2
  publish:
3
3
  draft: '#ff4500'
4
- preview: green
5
- published: blue
4
+ preview: success
5
+ published: primary
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enum_style
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kenzooooo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-18 00:00:00.000000000 Z
11
+ date: 2019-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -17,7 +17,7 @@ dependencies:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 5.2.1
20
- type: :runtime
20
+ type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements: