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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4cabe7a01dcefc8682a70850814515545fdbc4ef
4
- data.tar.gz: 191681842a5ef0c281e045f6854bad2145620327
2
+ SHA256:
3
+ metadata.gz: d2a0200c05a91d2e53f9893103e3ee5259a0bd0917efaf373e0fff2ced38caa6
4
+ data.tar.gz: e950b6d4f120e420885e68c7d69192d3e65c241d9c90d139a44691f676ad41a8
5
5
  SHA512:
6
- metadata.gz: d1a272091bdb190e6824469338e4635c5904ad8def50196484eb421269be435ddc2b53fdf1a0dc5f3eacaa081f092943983632f35cc36955ff5f45ae0ff8d0a5
7
- data.tar.gz: ddb128c7a89adbbd6974e7e3d52282de0fb49dea9e5e5b1117333f071b512b2ac089a773632f6760ff750144a78eabb6bb5238e0f731b3860abbd0cb52cc1b37
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.png?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)
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
 
@@ -1,5 +1,5 @@
1
- //= require recurring_select
2
- //= require_self
1
+ #= require recurring_select
2
+ #= require_self
3
3
 
4
4
  $ ->
5
5
  $(document).on "recurring_select:cancel recurring_select:save", ".recurring_select", ->
@@ -1,5 +1,5 @@
1
- //= require recurring_select_dialog
2
- //= require_self
1
+ #= require recurring_select_dialog
2
+ #= require_self
3
3
 
4
4
  $ = jQuery
5
5
  $ ->
@@ -16,7 +16,6 @@ $.fn.recurring_select.texts = {
16
16
  day_of_month: "Jour du mois"
17
17
  day_of_week: "Jour de la semaine"
18
18
  ok: "OK"
19
- cancel: "Annuler"
20
19
  summary: "Résumé"
21
20
  first_day_of_week: 1
22
21
  days_first_letter: ["D", "L", "M", "M", "J", "V", "S" ]
@@ -2,14 +2,8 @@ require "ice_cube"
2
2
 
3
3
  module RecurringSelectHelper
4
4
  module FormHelper
5
- if Rails::VERSION::MAJOR >= 4
6
- def select_recurring(object, method, default_schedules = nil, options = {}, html_options = {})
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
- if Rails::VERSION::STRING.to_f >= 4.0
100
- # === Rails 4
101
- class RecurringSelectTag < ActionView::Helpers::Tags::Base
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
- def render
117
- if Rails::VERSION::STRING >= '5.2'
118
- option_tags = add_options(recurring_options_for_select(value, @default_schedules, @options), @options, value)
119
- else
120
- option_tags = add_options(recurring_options_for_select(value(object), @default_schedules, @options), @options, value(object))
121
- end
122
- select_content_tag(option_tags, @options, @html_options)
123
- end
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
- else
127
- # === Rails 3
128
- class InstanceTag < ActionView::Helpers::InstanceTag
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
@@ -25,8 +25,7 @@ module RecurringSelect
25
25
 
26
26
  if possible_rule.is_a?(String)
27
27
  begin
28
- JSON.parse(possible_rule)
29
- return true
28
+ return JSON.parse(possible_rule).is_a?(Hash)
30
29
  rescue JSON::ParserError
31
30
  return false
32
31
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module RecurringSelect
2
- VERSION = "2.1.0"
2
+ VERSION = "3.0.0"
3
3
  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: 2.1.0
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: 2018-07-20 00:00:00.000000000 Z
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: '3.2'
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: '3.2'
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
- rubyforge_project:
190
- rubygems_version: 2.5.2.3
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: []