recurring_select 2.1.0 → 3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4cabe7a01dcefc8682a70850814515545fdbc4ef
4
- data.tar.gz: 191681842a5ef0c281e045f6854bad2145620327
2
+ SHA256:
3
+ metadata.gz: 823b393395bb4608d998ea0a5b8f9b38b985ae8ee91107523d5383aaa94a97ae
4
+ data.tar.gz: ecf294db986e90ea87ba5d2c6481053fbd466267a18949915201cdb04501774e
5
5
  SHA512:
6
- metadata.gz: d1a272091bdb190e6824469338e4635c5904ad8def50196484eb421269be435ddc2b53fdf1a0dc5f3eacaa081f092943983632f35cc36955ff5f45ae0ff8d0a5
7
- data.tar.gz: ddb128c7a89adbbd6974e7e3d52282de0fb49dea9e5e5b1117333f071b512b2ac089a773632f6760ff750144a78eabb6bb5238e0f731b3860abbd0cb52cc1b37
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/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/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-LICENSE.
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 = 'RecurringSelect'
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')
@@ -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", ->
@@ -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" ]
@@ -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
  $ ->
@@ -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,25 @@ 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
+ @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
- 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
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
@@ -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.1"
3
3
  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
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: 2.1.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jobber
8
8
  - Forrest Zeisler
9
9
  - Nathan Youngman
10
- autorequire:
10
+ - Gregory Schmit
11
+ autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2018-07-20 00:00:00.000000000 Z
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: '3.2'
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: '3.2'
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
- - forrest@getjobber.com
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
- rubyforge_project:
190
- rubygems_version: 2.5.2.3
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: []