recurring_select 2.1.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +3 -6
- data/Rakefile +1 -1
- data/app/assets/javascripts/jquery-mobile-rs.js.coffee +2 -2
- data/app/assets/javascripts/recurring_select/fr.js.coffee +0 -1
- data/app/assets/javascripts/recurring_select.js.coffee +2 -2
- data/{app → lib}/helpers/recurring_select_helper.rb +18 -50
- data/{app → lib}/middleware/recurring_select_middleware.rb +0 -0
- data/lib/recurring_select/engine.rb +7 -5
- data/lib/recurring_select/version.rb +1 -1
- data/lib/recurring_select.rb +1 -2
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 823b393395bb4608d998ea0a5b8f9b38b985ae8ee91107523d5383aaa94a97ae
|
4
|
+
data.tar.gz: ecf294db986e90ea87ba5d2c6481053fbd466267a18949915201cdb04501774e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4870f4d76cc947ee2f20cdf3c917e05ddb804acae5a2852d4f0faf4576019f7f0656d8b70c7608b2a22b7487902da908f4c0d3d174cf768b42e0c4ab6f68314a
|
7
|
+
data.tar.gz: 3006029c17dab3353f0f89ba025996d280978e4e7fdf6cdf764dd67f930eac23f62f0da1877769df5d3adc5aa4616aa3f07dd15e67d4d4b750d794ea25bdde2a
|
data/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# Recurring Select
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/
|
3
|
+
[![Build Status](https://travis-ci.org/gregschmit/recurring_select.svg?branch=master)](https://travis-ci.org/GetJobber/recurring_select) [![Code Climate](https://codeclimate.com/github/gregschmit/recurring_select.png)](https://codeclimate.com/github/gregschmit/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
|
|
7
7
|
Created by the [Jobber](http://getjobber.com) team for Jobber, the leading business management tool for field service companies.
|
8
8
|
|
9
|
-
Check out the [live demo](http://recurring-select-demo.herokuapp.com/) (code in [spec/dummy](https://github.com/GetJobber/recurring_select/tree/master/spec/dummy) folder)
|
9
|
+
Check out the [live demo](http://recurring-select-demo.herokuapp.com/) (code in [spec/dummy](https://github.com/GetJobber/recurring_select/tree/master/spec/dummy) folder).
|
10
10
|
|
11
11
|
|
12
12
|
## Usage
|
@@ -148,9 +148,6 @@ Start the dummy server for clicking around the interface:
|
|
148
148
|
rails s
|
149
149
|
```
|
150
150
|
|
151
|
-
Use [Guard](https://github.com/guard/guard) and RSpec for all tests. I'd
|
152
|
-
love to get Jasmine running also, but haven't had time yet.
|
153
|
-
|
154
151
|
Tests can be ran against different versions of Rails like so:
|
155
152
|
|
156
153
|
```
|
@@ -162,4 +159,4 @@ Feel free to open issues or send pull requests.
|
|
162
159
|
|
163
160
|
## Licensing
|
164
161
|
|
165
|
-
This project rocks and uses MIT
|
162
|
+
This project rocks and uses the MIT license.
|
data/Rakefile
CHANGED
@@ -12,7 +12,7 @@ Bundler::GemHelper.install_tasks
|
|
12
12
|
require 'rdoc/task'
|
13
13
|
RDoc::Task.new(:rdoc) do |rdoc|
|
14
14
|
rdoc.rdoc_dir = 'rdoc'
|
15
|
-
rdoc.title
|
15
|
+
rdoc.title = 'RecurringSelect'
|
16
16
|
rdoc.options << '--line-numbers'
|
17
17
|
rdoc.rdoc_files.include('README.rdoc')
|
18
18
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
@@ -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,25 @@ 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
|
+
@template_object = template_object
|
104
|
+
add_default_name_and_id(@html_options)
|
105
|
+
|
106
|
+
super(object, method, template_object, options)
|
124
107
|
end
|
125
108
|
|
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
|
109
|
+
def render
|
110
|
+
option_tags = add_options(recurring_options_for_select(value, @default_schedules, @options), @options, value)
|
111
|
+
select_content_tag(option_tags, @options, @html_options)
|
142
112
|
end
|
143
113
|
end
|
144
|
-
|
145
|
-
|
146
114
|
end
|
File without changes
|
@@ -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
|
data/lib/recurring_select.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recurring_select
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jobber
|
8
8
|
- Forrest Zeisler
|
9
9
|
- Nathan Youngman
|
10
|
-
|
10
|
+
- Gregory Schmit
|
11
|
+
autorequire:
|
11
12
|
bindir: bin
|
12
13
|
cert_chain: []
|
13
|
-
date:
|
14
|
+
date: 2023-02-04 00:00:00.000000000 Z
|
14
15
|
dependencies:
|
15
16
|
- !ruby/object:Gem::Dependency
|
16
17
|
name: rails
|
@@ -18,14 +19,14 @@ dependencies:
|
|
18
19
|
requirements:
|
19
20
|
- - ">="
|
20
21
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
22
|
+
version: '5.2'
|
22
23
|
type: :runtime
|
23
24
|
prerelease: false
|
24
25
|
version_requirements: !ruby/object:Gem::Requirement
|
25
26
|
requirements:
|
26
27
|
- - ">="
|
27
28
|
- !ruby/object:Gem::Version
|
28
|
-
version: '
|
29
|
+
version: '5.2'
|
29
30
|
- !ruby/object:Gem::Dependency
|
30
31
|
name: jquery-rails
|
31
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -141,7 +142,7 @@ dependencies:
|
|
141
142
|
description: This gem provides a useful interface for creating recurring rules for
|
142
143
|
the ice_cube gem.
|
143
144
|
email:
|
144
|
-
-
|
145
|
+
- schmitgreg@gmail.com
|
145
146
|
executables: []
|
146
147
|
extensions: []
|
147
148
|
extra_rdoc_files: []
|
@@ -158,12 +159,12 @@ files:
|
|
158
159
|
- app/assets/stylesheets/jquery-mobile-rs.scss
|
159
160
|
- app/assets/stylesheets/recurring_select.scss
|
160
161
|
- app/assets/stylesheets/utilities.scss
|
161
|
-
- app/helpers/recurring_select_helper.rb
|
162
|
-
- app/middleware/recurring_select_middleware.rb
|
163
162
|
- config/locales/en.yml
|
164
163
|
- config/locales/fr.yml
|
165
164
|
- config/locales/nl.yml
|
166
165
|
- config/routes.rb
|
166
|
+
- lib/helpers/recurring_select_helper.rb
|
167
|
+
- lib/middleware/recurring_select_middleware.rb
|
167
168
|
- lib/recurring_select.rb
|
168
169
|
- lib/recurring_select/engine.rb
|
169
170
|
- lib/recurring_select/version.rb
|
@@ -171,7 +172,7 @@ homepage: http://github.com/getjobber/recurring_select
|
|
171
172
|
licenses:
|
172
173
|
- MIT
|
173
174
|
metadata: {}
|
174
|
-
post_install_message:
|
175
|
+
post_install_message:
|
175
176
|
rdoc_options: []
|
176
177
|
require_paths:
|
177
178
|
- lib
|
@@ -186,9 +187,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
187
|
- !ruby/object:Gem::Version
|
187
188
|
version: '0'
|
188
189
|
requirements: []
|
189
|
-
|
190
|
-
|
191
|
-
signing_key:
|
190
|
+
rubygems_version: 3.0.9
|
191
|
+
signing_key:
|
192
192
|
specification_version: 4
|
193
193
|
summary: A select helper which gives you magical powers to generate ice_cube rules.
|
194
194
|
test_files: []
|