recurring_select 2.1.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +1 -1
- data/app/assets/javascripts/jquery-mobile-rs.js.coffee +2 -2
- data/app/assets/javascripts/recurring_select.js.coffee +2 -2
- data/app/assets/javascripts/recurring_select/fr.js.coffee +0 -1
- data/{app → lib}/helpers/recurring_select_helper.rb +17 -50
- data/{app → lib}/middleware/recurring_select_middleware.rb +0 -0
- data/lib/recurring_select.rb +1 -2
- data/lib/recurring_select/engine.rb +7 -5
- data/lib/recurring_select/version.rb +1 -1
- metadata +10 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d2a0200c05a91d2e53f9893103e3ee5259a0bd0917efaf373e0fff2ced38caa6
|
4
|
+
data.tar.gz: e950b6d4f120e420885e68c7d69192d3e65c241d9c90d139a44691f676ad41a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2714208952ec80d4cecaf50f579a26ea06b7a1025803ace7486f31c7a307e57e965eb766b28ddfa478195c4557b9f8871a19c6b98125549df4825befc54082b
|
7
|
+
data.tar.gz: 679630c691151c92b59e98fcf08697f8f2ca5fccb6556e7737f9581aa319ce67ce02ceb9b948c3b86b8d9a8d3b37173b1eb15314e2e2bb5792c71cde4b0b1fc5
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Recurring Select
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/GetJobber/recurring_select.
|
3
|
+
[![Build Status](https://travis-ci.org/GetJobber/recurring_select.svg?branch=master)](https://travis-ci.org/GetJobber/recurring_select) [![Code Climate](https://codeclimate.com/github/GetJobber/recurring_select.png)](https://codeclimate.com/github/GetJobber/recurring_select)
|
4
4
|
|
5
5
|
This gem adds selectors and helpers for working with recurring schedules in a Rails app. It uses [ice_cube](https://github.com/seejohnrun/ice_cube) recurring scheduling gem.
|
6
6
|
|
@@ -2,14 +2,8 @@ require "ice_cube"
|
|
2
2
|
|
3
3
|
module RecurringSelectHelper
|
4
4
|
module FormHelper
|
5
|
-
|
6
|
-
|
7
|
-
RecurringSelectTag.new(object, method, self, default_schedules, options, html_options).render
|
8
|
-
end
|
9
|
-
elsif Rails::VERSION::MAJOR == 3
|
10
|
-
def select_recurring(object, method, default_schedules = nil, options = {}, html_options = {})
|
11
|
-
InstanceTag.new(object, method, self, options.delete(:object)).to_recurring_select_tag(default_schedules, options, html_options)
|
12
|
-
end
|
5
|
+
def select_recurring(object, method, default_schedules = nil, options = {}, html_options = {})
|
6
|
+
RecurringSelectTag.new(object, method, self, default_schedules, options, html_options).render
|
13
7
|
end
|
14
8
|
end
|
15
9
|
|
@@ -96,51 +90,24 @@ module RecurringSelectHelper
|
|
96
90
|
end
|
97
91
|
end
|
98
92
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
include RecurringSelectHelper::FormOptionsHelper
|
103
|
-
include SelectHTMLOptions
|
104
|
-
|
105
|
-
def initialize(object, method, template_object, default_schedules = nil, options = {}, html_options = {})
|
106
|
-
@default_schedules = default_schedules
|
107
|
-
@choices = @choices.to_a if @choices.is_a?(Range)
|
108
|
-
@method_name = method.to_s
|
109
|
-
@object_name = object.to_s
|
110
|
-
@html_options = recurring_select_html_options(html_options)
|
111
|
-
add_default_name_and_id(@html_options)
|
112
|
-
|
113
|
-
super(object, method, template_object, options)
|
114
|
-
end
|
93
|
+
class RecurringSelectTag < ActionView::Helpers::Tags::Base
|
94
|
+
include RecurringSelectHelper::FormOptionsHelper
|
95
|
+
include SelectHTMLOptions
|
115
96
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
97
|
+
def initialize(object, method, template_object, default_schedules = nil, options = {}, html_options = {})
|
98
|
+
@default_schedules = default_schedules
|
99
|
+
@choices = @choices.to_a if @choices.is_a?(Range)
|
100
|
+
@method_name = method.to_s
|
101
|
+
@object_name = object.to_s
|
102
|
+
@html_options = recurring_select_html_options(html_options)
|
103
|
+
add_default_name_and_id(@html_options)
|
104
|
+
|
105
|
+
super(object, method, template_object, options)
|
124
106
|
end
|
125
107
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
include RecurringSelectHelper::FormOptionsHelper
|
130
|
-
include SelectHTMLOptions
|
131
|
-
|
132
|
-
def to_recurring_select_tag(default_schedules, options, html_options)
|
133
|
-
html_options = recurring_select_html_options(html_options)
|
134
|
-
add_default_name_and_id(html_options)
|
135
|
-
value = value(object)
|
136
|
-
options = add_options(
|
137
|
-
recurring_options_for_select(value, default_schedules, options),
|
138
|
-
options, value
|
139
|
-
)
|
140
|
-
content_tag("select", options, html_options)
|
141
|
-
end
|
108
|
+
def render
|
109
|
+
option_tags = add_options(recurring_options_for_select(value, @default_schedules, @options), @options, value)
|
110
|
+
select_content_tag(option_tags, @options, @html_options)
|
142
111
|
end
|
143
112
|
end
|
144
|
-
|
145
|
-
|
146
113
|
end
|
File without changes
|
data/lib/recurring_select.rb
CHANGED
@@ -1,16 +1,18 @@
|
|
1
|
+
require "helpers/recurring_select_helper"
|
2
|
+
require "middleware/recurring_select_middleware"
|
3
|
+
|
1
4
|
module RecurringSelect
|
2
5
|
class Engine < Rails::Engine
|
3
|
-
|
6
|
+
|
4
7
|
initializer "recurring_select.extending_form_builder" do |app|
|
5
|
-
# config.to_prepare do
|
6
8
|
ActionView::Helpers::FormHelper.send(:include, RecurringSelectHelper::FormHelper)
|
7
9
|
ActionView::Helpers::FormOptionsHelper.send(:include, RecurringSelectHelper::FormOptionsHelper)
|
8
10
|
ActionView::Helpers::FormBuilder.send(:include, RecurringSelectHelper::FormBuilder)
|
9
11
|
end
|
10
|
-
|
12
|
+
|
11
13
|
initializer "recurring_select.connecting_middleware" do |app|
|
12
|
-
app.middleware.use RecurringSelectMiddleware # insert_after ActionDispatch::ParamsParser,
|
14
|
+
app.middleware.use RecurringSelectMiddleware # insert_after ActionDispatch::ParamsParser,
|
13
15
|
end
|
14
|
-
|
16
|
+
|
15
17
|
end
|
16
18
|
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recurring_select
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jobber
|
8
8
|
- Forrest Zeisler
|
9
9
|
- Nathan Youngman
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2020-08-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
21
|
+
version: '5.2'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: '
|
28
|
+
version: '5.2'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: jquery-rails
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -158,12 +158,12 @@ files:
|
|
158
158
|
- app/assets/stylesheets/jquery-mobile-rs.scss
|
159
159
|
- app/assets/stylesheets/recurring_select.scss
|
160
160
|
- app/assets/stylesheets/utilities.scss
|
161
|
-
- app/helpers/recurring_select_helper.rb
|
162
|
-
- app/middleware/recurring_select_middleware.rb
|
163
161
|
- config/locales/en.yml
|
164
162
|
- config/locales/fr.yml
|
165
163
|
- config/locales/nl.yml
|
166
164
|
- config/routes.rb
|
165
|
+
- lib/helpers/recurring_select_helper.rb
|
166
|
+
- lib/middleware/recurring_select_middleware.rb
|
167
167
|
- lib/recurring_select.rb
|
168
168
|
- lib/recurring_select/engine.rb
|
169
169
|
- lib/recurring_select/version.rb
|
@@ -171,7 +171,7 @@ homepage: http://github.com/getjobber/recurring_select
|
|
171
171
|
licenses:
|
172
172
|
- MIT
|
173
173
|
metadata: {}
|
174
|
-
post_install_message:
|
174
|
+
post_install_message:
|
175
175
|
rdoc_options: []
|
176
176
|
require_paths:
|
177
177
|
- lib
|
@@ -186,9 +186,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
186
|
- !ruby/object:Gem::Version
|
187
187
|
version: '0'
|
188
188
|
requirements: []
|
189
|
-
|
190
|
-
|
191
|
-
signing_key:
|
189
|
+
rubygems_version: 3.0.6
|
190
|
+
signing_key:
|
192
191
|
specification_version: 4
|
193
192
|
summary: A select helper which gives you magical powers to generate ice_cube rules.
|
194
193
|
test_files: []
|