administrate-field-boolean_emoji 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: 58ba45c6324ce48464e5477526f36e7515a6fd53
4
+ data.tar.gz: 235e3ce7a80b1912da96f0ade02698e3d7d120aa
5
+ SHA512:
6
+ metadata.gz: 26a965c3ef1faea0c70202da86e01fe9a7c9205bb4716a798933ca14c710172fa77607d7e8963f826eed139b7ef8e87718b3600b136e641d32f6e13f3f7820b3
7
+ data.tar.gz: aceab4d60916b10100aa628d5de81862a2b9d336b15f603e94ac7df4f665b2d2e216a3069e9560ddbf52f301b7285f70dbec41152058a0b6b9286b960bf1d802
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ *.gem
data/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+ # Changelog
2
+
3
+ ## [v0.0.1](https://github.com/z-productions/administrate-field-boolean_emoji/tree/v0.0.1) (2016-11-29)
4
+ First release
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,159 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ administrate-field-boolean_emoji (0.0.1)
5
+ administrate (~> 0.3.0)
6
+ rails (>= 4.2)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actioncable (5.0.0.1)
12
+ actionpack (= 5.0.0.1)
13
+ nio4r (~> 1.2)
14
+ websocket-driver (~> 0.6.1)
15
+ actionmailer (5.0.0.1)
16
+ actionpack (= 5.0.0.1)
17
+ actionview (= 5.0.0.1)
18
+ activejob (= 5.0.0.1)
19
+ mail (~> 2.5, >= 2.5.4)
20
+ rails-dom-testing (~> 2.0)
21
+ actionpack (5.0.0.1)
22
+ actionview (= 5.0.0.1)
23
+ activesupport (= 5.0.0.1)
24
+ rack (~> 2.0)
25
+ rack-test (~> 0.6.3)
26
+ rails-dom-testing (~> 2.0)
27
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
28
+ actionview (5.0.0.1)
29
+ activesupport (= 5.0.0.1)
30
+ builder (~> 3.1)
31
+ erubis (~> 2.7.0)
32
+ rails-dom-testing (~> 2.0)
33
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
34
+ activejob (5.0.0.1)
35
+ activesupport (= 5.0.0.1)
36
+ globalid (>= 0.3.6)
37
+ activemodel (5.0.0.1)
38
+ activesupport (= 5.0.0.1)
39
+ activerecord (5.0.0.1)
40
+ activemodel (= 5.0.0.1)
41
+ activesupport (= 5.0.0.1)
42
+ arel (~> 7.0)
43
+ activesupport (5.0.0.1)
44
+ concurrent-ruby (~> 1.0, >= 1.0.2)
45
+ i18n (~> 0.7)
46
+ minitest (~> 5.1)
47
+ tzinfo (~> 1.1)
48
+ administrate (0.3.0)
49
+ autoprefixer-rails (~> 6.0)
50
+ bourbon (~> 4.2)
51
+ datetime_picker_rails (~> 0.0.7)
52
+ jquery-rails (~> 4.0)
53
+ kaminari (~> 0.16)
54
+ momentjs-rails (~> 2.8)
55
+ neat (~> 1.1)
56
+ normalize-rails (~> 3.0)
57
+ rails (>= 4.2, < 5.1)
58
+ sass-rails (~> 5.0)
59
+ selectize-rails (~> 0.6)
60
+ arel (7.1.4)
61
+ autoprefixer-rails (6.5.3)
62
+ execjs
63
+ bourbon (4.2.7)
64
+ sass (~> 3.4)
65
+ thor (~> 0.19)
66
+ builder (3.2.2)
67
+ concurrent-ruby (1.0.2)
68
+ datetime_picker_rails (0.0.7)
69
+ momentjs-rails (>= 2.8.1)
70
+ erubis (2.7.0)
71
+ execjs (2.7.0)
72
+ globalid (0.3.7)
73
+ activesupport (>= 4.1.0)
74
+ i18n (0.7.0)
75
+ jquery-rails (4.2.1)
76
+ rails-dom-testing (>= 1, < 3)
77
+ railties (>= 4.2.0)
78
+ thor (>= 0.14, < 2.0)
79
+ kaminari (0.17.0)
80
+ actionpack (>= 3.0.0)
81
+ activesupport (>= 3.0.0)
82
+ loofah (2.0.3)
83
+ nokogiri (>= 1.5.9)
84
+ mail (2.6.4)
85
+ mime-types (>= 1.16, < 4)
86
+ method_source (0.8.2)
87
+ mime-types (3.1)
88
+ mime-types-data (~> 3.2015)
89
+ mime-types-data (3.2016.0521)
90
+ mini_portile2 (2.1.0)
91
+ minitest (5.9.1)
92
+ momentjs-rails (2.15.1)
93
+ railties (>= 3.1)
94
+ neat (1.8.0)
95
+ sass (>= 3.3)
96
+ thor (~> 0.19)
97
+ nio4r (1.2.1)
98
+ nokogiri (1.6.8.1)
99
+ mini_portile2 (~> 2.1.0)
100
+ normalize-rails (3.0.3)
101
+ rack (2.0.1)
102
+ rack-test (0.6.3)
103
+ rack (>= 1.0)
104
+ rails (5.0.0.1)
105
+ actioncable (= 5.0.0.1)
106
+ actionmailer (= 5.0.0.1)
107
+ actionpack (= 5.0.0.1)
108
+ actionview (= 5.0.0.1)
109
+ activejob (= 5.0.0.1)
110
+ activemodel (= 5.0.0.1)
111
+ activerecord (= 5.0.0.1)
112
+ activesupport (= 5.0.0.1)
113
+ bundler (>= 1.3.0, < 2.0)
114
+ railties (= 5.0.0.1)
115
+ sprockets-rails (>= 2.0.0)
116
+ rails-dom-testing (2.0.1)
117
+ activesupport (>= 4.2.0, < 6.0)
118
+ nokogiri (~> 1.6.0)
119
+ rails-html-sanitizer (1.0.3)
120
+ loofah (~> 2.0)
121
+ railties (5.0.0.1)
122
+ actionpack (= 5.0.0.1)
123
+ activesupport (= 5.0.0.1)
124
+ method_source
125
+ rake (>= 0.8.7)
126
+ thor (>= 0.18.1, < 2.0)
127
+ rake (11.3.0)
128
+ sass (3.4.22)
129
+ sass-rails (5.0.6)
130
+ railties (>= 4.0.0, < 6)
131
+ sass (~> 3.1)
132
+ sprockets (>= 2.8, < 4.0)
133
+ sprockets-rails (>= 2.0, < 4.0)
134
+ tilt (>= 1.1, < 3)
135
+ selectize-rails (0.12.4)
136
+ sprockets (3.7.0)
137
+ concurrent-ruby (~> 1.0)
138
+ rack (> 1, < 3)
139
+ sprockets-rails (3.2.0)
140
+ actionpack (>= 4.0)
141
+ activesupport (>= 4.0)
142
+ sprockets (>= 3.0.0)
143
+ thor (0.19.4)
144
+ thread_safe (0.3.5)
145
+ tilt (2.0.5)
146
+ tzinfo (1.2.2)
147
+ thread_safe (~> 0.1)
148
+ websocket-driver (0.6.4)
149
+ websocket-extensions (>= 0.1.0)
150
+ websocket-extensions (0.1.2)
151
+
152
+ PLATFORMS
153
+ ruby
154
+
155
+ DEPENDENCIES
156
+ administrate-field-boolean_emoji!
157
+
158
+ BUNDLED WITH
159
+ 1.13.6
data/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015-2016 z.productions.
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
13
+ all 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
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # Administrate::Field::BooleanEmoji
2
+
3
+ [![Code Climate](https://codeclimate.com/github/z-productions/administrate-field-boolean_emoji/badges/gpa.svg)](https://codeclimate.com/github/z-productions/administrate-field-boolean_emoji)
4
+
5
+ A plugin to visually display boolean fields in [Administrate].
6
+
7
+ ## Usage
8
+
9
+ Add it to your `Gemfile`:
10
+
11
+ ```ruby
12
+ gem 'administrate-field-boolean_emoji', '~> 0.0.1'
13
+ ```
14
+
15
+ Run:
16
+
17
+ ```bash
18
+ $ bundle install
19
+ ```
20
+
21
+ Add to your `FooDashboard`:
22
+
23
+ ```ruby
24
+ ATTRIBUTE_TYPES = {
25
+ bar: Field::BooleanEmoji
26
+ }.freeze
27
+ ```
28
+
29
+ ## About
30
+
31
+ `Administrate::Field::BooleanEmoji` is maintained by [z.productions].
32
+
33
+ [Administrate]: https://github.com/thoughtbot/administrate
34
+ [z.productions]: https://www.z.productions/
@@ -0,0 +1,19 @@
1
+ $:.push File.expand_path('../lib', __FILE__)
2
+
3
+ Gem::Specification.new do |gem|
4
+ gem.name = 'administrate-field-boolean_emoji'
5
+ gem.version = '0.0.1'
6
+ gem.authors = ['Michele Gerarduzzi']
7
+ gem.email = ['michele.gerarduzzi@gmail.com']
8
+ gem.homepage = 'https://github.com/z-productions/administrate-field-boolean_emoji'
9
+ gem.summary = 'A plugin to visually display boolean fields in Administrate'
10
+ gem.description = gem.summary
11
+ gem.license = 'MIT'
12
+
13
+ gem.require_paths = ['lib']
14
+ gem.files = `git ls-files`.split("\n")
15
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+
17
+ gem.add_runtime_dependency 'administrate', '~> 0.3.0'
18
+ gem.add_runtime_dependency 'rails', '>= 4.2'
19
+ end
@@ -0,0 +1,21 @@
1
+ <%#
2
+ # BooleanEmoji Form Partial
3
+
4
+ This partial renders an input element for a boolean attribute.
5
+ By default, the input is a checkbox.
6
+
7
+ ## Local variables:
8
+
9
+ - `f`:
10
+ A Rails form generator, used to help create the appropriate input fields.
11
+ - `field`:
12
+ An instance of Administrate::Field::BooleanEmoji.
13
+ A wrapper around the attribute pulled from the database.
14
+ %>
15
+
16
+ <div class="field-unit__label">
17
+ <%= f.label field.attribute %>
18
+ </div>
19
+ <div class="field-unit__field">
20
+ <%= f.check_box field.attribute %>
21
+ </div>
@@ -0,0 +1,15 @@
1
+ <%#
2
+ # BooleanEmoji Index Partial
3
+
4
+ This partial renders an emoji based on the value of the attribute.
5
+
6
+ ## Local variables:
7
+
8
+ - `field`:
9
+ An instance of Administrate::Field::BooleanEmoji.
10
+ A wrapper around the attribute pulled from the database.
11
+ %>
12
+
13
+ <% if field.data.present? %>
14
+ <%= field.data ? field.positive_emoji : field.negative_emoji %>
15
+ <% end %>
@@ -0,0 +1,15 @@
1
+ <%#
2
+ # BooleanEmoji Show Partial
3
+
4
+ This partial renders an emoji based on the value of the attribute.
5
+
6
+ ## Local variables:
7
+
8
+ - `field`:
9
+ An instance of Administrate::Field::BooleanEmoji.
10
+ A wrapper around the attribute pulled from the database.
11
+ %>
12
+
13
+ <% unless field.data.nil? %>
14
+ <%= field.data ? field.positive_emoji : field.negative_emoji %>
15
+ <% end %>
@@ -0,0 +1,29 @@
1
+ require 'administrate/field/base'
2
+ require 'rails'
3
+
4
+ module Administrate
5
+ module Field
6
+ class BooleanEmoji < Administrate::Field::Base
7
+ class Engine < ::Rails::Engine; end
8
+
9
+ EMOJIS = {
10
+ default: {
11
+ positive: '&#9989;',
12
+ negative: '&#10060;'
13
+ }
14
+ }
15
+
16
+ def style
17
+ :default
18
+ end
19
+
20
+ def positive_emoji
21
+ EMOJIS[style][:positive].html_safe
22
+ end
23
+
24
+ def negative_emoji
25
+ EMOJIS[style][:negative].html_safe
26
+ end
27
+ end
28
+ end
29
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: administrate-field-boolean_emoji
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Michele Gerarduzzi
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-11-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: administrate
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.3.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.3.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '4.2'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '4.2'
41
+ description: A plugin to visually display boolean fields in Administrate
42
+ email:
43
+ - michele.gerarduzzi@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - CHANGELOG.md
50
+ - Gemfile
51
+ - Gemfile.lock
52
+ - LICENSE.md
53
+ - README.md
54
+ - administrate-field-boolean_emoji.gemspec
55
+ - app/views/fields/boolean_emoji/_form.html.erb
56
+ - app/views/fields/boolean_emoji/_index.html.erb
57
+ - app/views/fields/boolean_emoji/_show.html.erb
58
+ - lib/administrate/field/boolean_emoji.rb
59
+ homepage: https://github.com/z-productions/administrate-field-boolean_emoji
60
+ licenses:
61
+ - MIT
62
+ metadata: {}
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubyforge_project:
79
+ rubygems_version: 2.5.2
80
+ signing_key:
81
+ specification_version: 4
82
+ summary: A plugin to visually display boolean fields in Administrate
83
+ test_files: []