Skip to content

Commit 7176c89

Browse files
authored
Merge pull request gregschmit#147 from GetJobber/bump-version-for-3.0
Bump version for 3.0
2 parents 742dc12 + 8b0dc27 commit 7176c89

File tree

9 files changed

+20
-213
lines changed

9 files changed

+20
-213
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*.gem
22
spec/gemfiles/Gemfile*.lock
3+
Gemfile.lock
34

45
.bundle/
56
tmp/*

Gemfile.lock

Lines changed: 0 additions & 131 deletions
This file was deleted.

lib/helpers/recurring_select_helper.rb

Lines changed: 17 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@
22

33
module RecurringSelectHelper
44
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
137
end
148
end
159

@@ -96,51 +90,24 @@ def recurring_select_html_options(html_options)
9690
end
9791
end
9892

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
11596

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)
124106
end
125107

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)
142111
end
143112
end
144-
145-
146113
end

lib/recurring_select/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module RecurringSelect
2-
VERSION = "2.1.0"
2+
VERSION = "3.0.0"
33
end

recurring_select.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
1616
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.md"]
1717
s.test_files = Dir["test/**/*"]
1818

19-
s.add_dependency "rails", ">= 3.2"
19+
s.add_dependency "rails", ">= 5.2"
2020
s.add_dependency "jquery-rails", ">= 3.0"
2121
s.add_dependency "ice_cube", ">= 0.11"
2222
s.add_dependency "sass-rails", ">= 4.0"

spec/gemfiles/Gemfile.rails-4.0.x

Lines changed: 0 additions & 10 deletions
This file was deleted.

spec/gemfiles/Gemfile.rails-4.1.x

Lines changed: 0 additions & 10 deletions
This file was deleted.

spec/gemfiles/Gemfile.rails-4.2.x

Lines changed: 0 additions & 10 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)