simple_calendar 2.1.0 → 2.1.1

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
2
  SHA1:
3
- metadata.gz: 30f9a905897bec1f2aa6ca50db79a859af2e1620
4
- data.tar.gz: 7f2e0f099aa7bdb9bb2630aaf28a3b8f5c58dcca
3
+ metadata.gz: 7b1e55a8908e0a4b08914cb7ab29d65e7ffb663d
4
+ data.tar.gz: f51b57f8c4f5793ef0ba8b239b75564b487c4e51
5
5
  SHA512:
6
- metadata.gz: f5665ddcfa19aca666994ec0dacbe3ad4fba3be565a5ace251fb104b829732e94c933d116d714664992fcb053e76a5edbb55d0389758bc88e677db0405e88675
7
- data.tar.gz: 83b695471fc4da275e318c2575c608a7e458935ee991f67a8ad9c153637568455b413eb61fc1d7eb870070a4ca967c3ca372cdef151931dde28da10811b0ab30
6
+ metadata.gz: 9fa2ea181e2ab663772657fdf02801082e9a08682c6659c10af791d4f9d2a1f0acc4caff00e1ce157cc13ad2956b456552867452bd71d21dcde65162802c5bd9
7
+ data.tar.gz: fd5e76a474b59eba0bb377f48fd8304fb8f8714177ff312b98bb404ae76460cf5e219eea12a0b8759db932c191967cc3be3e860d752cc1fe286652e909730ce0
data/README.md CHANGED
@@ -89,7 +89,7 @@ pass it in as the `attribute` option**
89
89
 
90
90
  ```erb
91
91
  <%= month_calendar(attribute: :starts_at) do |date| %>
92
- <%= day %>
92
+ <%= date %>
93
93
  <% end %>
94
94
  ```
95
95
  **If you already have a model with a start time attribute called something other than `start_time` or accesses it through a relationship, you can alias the attribute by defining a `start_time` method in the my_model.rb file and not have to specify it separately as in the above example**
@@ -4,4 +4,3 @@ require "simple_calendar/week_calendar"
4
4
  require "simple_calendar/railtie"
5
5
  require "simple_calendar/version"
6
6
  require "simple_calendar/view_helpers"
7
-
@@ -10,7 +10,7 @@ module SimpleCalendar
10
10
  @view_context = view_context
11
11
  @options = opts
12
12
 
13
- @params = @view_context.params
13
+ @params = @view_context.respond_to?(:params) ? @view_context.params : Hash.new
14
14
  @params = @params.to_unsafe_h if @params.respond_to?(:to_unsafe_h)
15
15
  @params = @params.with_indifferent_access.except(*PARAM_KEY_BLACKLIST)
16
16
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleCalendar
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
3
3
  end
@@ -1,4 +1,5 @@
1
1
  require 'spec_helper'
2
+ require 'action_controller'
2
3
  require 'simple_calendar/calendar'
3
4
 
4
5
  class ViewContext
@@ -10,15 +11,15 @@ class ViewContext
10
11
 
11
12
  def params
12
13
  if @start_date.present?
13
- {start_date: @start_date}
14
+ ActionController::Parameters.new({start_date: @start_date})
14
15
  else
15
- {}
16
+ ActionController::Parameters.new
16
17
  end
17
18
  end
18
19
  end
19
20
 
20
21
  describe SimpleCalendar::Calendar do
21
- let(:calendar) { SimpleCalendar::Calendar.new(nil) }
22
+ let(:calendar) { SimpleCalendar::Calendar.new(ViewContext.new) }
22
23
 
23
24
  it 'renders a partial with the same name as the class' do
24
25
  expect(calendar.send(:partial_name)).to eq("simple_calendar/calendar")
@@ -30,7 +31,7 @@ describe SimpleCalendar::Calendar do
30
31
  end
31
32
 
32
33
  it 'allows you to override the default attribute' do
33
- expect(SimpleCalendar::Calendar.new(nil, attribute: :starts_at).send(:attribute)).to eq(:starts_at)
34
+ expect(SimpleCalendar::Calendar.new(ViewContext.new, attribute: :starts_at).send(:attribute)).to eq(:starts_at)
34
35
  end
35
36
  end
36
37
 
@@ -43,7 +44,7 @@ describe SimpleCalendar::Calendar do
43
44
  event3 = double(start_time: tomorrow.at_noon)
44
45
 
45
46
  events = [event1, event2, event3].shuffle
46
- calendar = SimpleCalendar::Calendar.new(nil, events: events)
47
+ calendar = SimpleCalendar::Calendar.new(ViewContext.new, events: events)
47
48
 
48
49
  sorted_events = calendar.send(:sorted_events)
49
50
 
@@ -53,7 +54,7 @@ describe SimpleCalendar::Calendar do
53
54
 
54
55
  it 'handles events without a start time' do
55
56
  event = double(start_time: nil)
56
- calendar = SimpleCalendar::Calendar.new(nil, events: [event])
57
+ calendar = SimpleCalendar::Calendar.new(ViewContext.new, events: [event])
57
58
 
58
59
  expect{calendar.send(:sorted_events)}.not_to raise_error
59
60
  end
@@ -1,5 +1,6 @@
1
1
  require 'spec_helper'
2
2
  require 'rails'
3
+ require 'simple_calendar'
3
4
 
4
5
  describe SimpleCalendar do
5
6
  it 'has a version number' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_calendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Oliver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-04 00:00:00.000000000 Z
11
+ date: 2016-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  version: '0'
95
95
  requirements: []
96
96
  rubyforge_project: simple_calendar
97
- rubygems_version: 2.5.1
97
+ rubygems_version: 2.4.5.1
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: A simple Rails 3 and Rails 4 calendar