timeboss 1.0.1 → 1.0.5
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 +5 -5
- data/.github/workflows/gem-push.yml +31 -0
- data/.github/workflows/ruby.yml +6 -4
- data/.travis.yml +11 -1
- data/Gemfile +2 -1
- data/README.md +1 -1
- data/Rakefile +3 -1
- data/lib/tasks/calendars.rake +4 -4
- data/lib/tasks/timeboss.rake +2 -2
- data/lib/timeboss.rb +1 -0
- data/lib/timeboss/calendar.rb +5 -4
- data/lib/timeboss/calendar/day.rb +3 -2
- data/lib/timeboss/calendar/half.rb +2 -1
- data/lib/timeboss/calendar/month.rb +2 -1
- data/lib/timeboss/calendar/parser.rb +9 -8
- data/lib/timeboss/calendar/period.rb +6 -5
- data/lib/timeboss/calendar/quarter.rb +2 -1
- data/lib/timeboss/calendar/support/formatter.rb +5 -4
- data/lib/timeboss/calendar/support/month_basis.rb +1 -1
- data/lib/timeboss/calendar/support/monthly_unit.rb +7 -6
- data/lib/timeboss/calendar/support/navigable.rb +2 -1
- data/lib/timeboss/calendar/support/shiftable.rb +12 -11
- data/lib/timeboss/calendar/support/translatable.rb +3 -2
- data/lib/timeboss/calendar/support/unit.rb +14 -13
- data/lib/timeboss/calendar/waypoints/absolute.rb +4 -3
- data/lib/timeboss/calendar/waypoints/relative.rb +14 -13
- data/lib/timeboss/calendar/week.rb +3 -2
- data/lib/timeboss/calendar/year.rb +2 -1
- data/lib/timeboss/calendars.rb +3 -2
- data/lib/timeboss/calendars/broadcast.rb +8 -7
- data/lib/timeboss/calendars/gregorian.rb +2 -1
- data/lib/timeboss/version.rb +2 -1
- data/spec/calendar/day_spec.rb +14 -14
- data/spec/calendar/quarter_spec.rb +9 -9
- data/spec/calendar/support/monthly_unit_spec.rb +36 -35
- data/spec/calendar/support/unit_spec.rb +23 -22
- data/spec/calendar/week_spec.rb +20 -20
- data/spec/calendars/broadcast_spec.rb +310 -310
- data/spec/calendars/gregorian_spec.rb +258 -258
- data/spec/calendars_spec.rb +19 -19
- data/spec/spec_helper.rb +2 -2
- data/timeboss.gemspec +15 -14
- metadata +21 -7
data/spec/calendars_spec.rb
CHANGED
@@ -1,48 +1,48 @@
|
|
1
1
|
module TimeBoss
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
super(basis: nil)
|
6
|
-
end
|
2
|
+
class TestMyCal < TimeBoss::Calendar
|
3
|
+
def initialize
|
4
|
+
super(basis: nil)
|
7
5
|
end
|
6
|
+
end
|
8
7
|
|
9
|
-
|
8
|
+
describe Calendars do
|
9
|
+
TimeBoss::Calendars.register(:my_amazing_calendar, TestMyCal)
|
10
10
|
|
11
|
-
describe
|
11
|
+
describe "#all" do
|
12
12
|
let(:all) { described_class.all }
|
13
13
|
|
14
|
-
it
|
14
|
+
it "can get a list of all the registered calendars" do
|
15
15
|
expect(all).to be_a Array
|
16
16
|
expect(all.length).to be > 1
|
17
17
|
all.each { |e| expect(e).to be_a described_class::Entry }
|
18
18
|
end
|
19
19
|
|
20
|
-
context
|
21
|
-
it
|
20
|
+
context "enumerability" do
|
21
|
+
it "can get a list of names" do
|
22
22
|
expect(described_class.map(&:name)).to include(:broadcast, :my_amazing_calendar)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
describe
|
28
|
-
it
|
27
|
+
describe "#[]" do
|
28
|
+
it "can return a baked-in calendar" do
|
29
29
|
c1 = described_class[:broadcast]
|
30
30
|
c2 = described_class[:broadcast]
|
31
31
|
expect(c1).to be_instance_of TimeBoss::Calendars::Broadcast
|
32
32
|
expect(c1).to be c2
|
33
33
|
|
34
|
-
expect(c1.name).to eq
|
35
|
-
expect(c1.title).to eq
|
34
|
+
expect(c1.name).to eq "broadcast"
|
35
|
+
expect(c1.title).to eq "Broadcast"
|
36
36
|
end
|
37
37
|
|
38
|
-
it
|
38
|
+
it "can return a new calendar" do
|
39
39
|
c1 = described_class[:my_amazing_calendar]
|
40
|
-
expect(c1).to be_instance_of
|
41
|
-
expect(c1.name).to eq
|
42
|
-
expect(c1.title).to eq
|
40
|
+
expect(c1).to be_instance_of TestMyCal
|
41
|
+
expect(c1.name).to eq "test_my_cal"
|
42
|
+
expect(c1.title).to eq "Test My Cal"
|
43
43
|
end
|
44
44
|
|
45
|
-
it
|
45
|
+
it "can graceully give you nothing" do
|
46
46
|
expect(described_class[:missing]).to be nil
|
47
47
|
end
|
48
48
|
end
|
data/spec/spec_helper.rb
CHANGED
data/timeboss.gemspec
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
|
-
lib = File.expand_path(
|
2
|
+
|
3
|
+
lib = File.expand_path("../lib", __FILE__)
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
require
|
5
|
+
require "timeboss/version"
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
|
-
spec.name
|
9
|
-
spec.version
|
10
|
-
spec.authors
|
11
|
-
spec.email
|
12
|
-
spec.summary
|
13
|
-
spec.description
|
14
|
-
spec.homepage
|
15
|
-
spec.license
|
8
|
+
spec.name = "timeboss"
|
9
|
+
spec.version = TimeBoss::VERSION
|
10
|
+
spec.authors = ["Kevin McDonald"]
|
11
|
+
spec.email = ["kevinstuffandthings@gmail.com"]
|
12
|
+
spec.summary = "Broadcast Calendar navigation in Ruby made simple"
|
13
|
+
spec.description = spec.summary
|
14
|
+
spec.homepage = "https://github.com/kevinstuffandthings/timeboss"
|
15
|
+
spec.license = "MIT"
|
16
16
|
|
17
|
-
spec.files
|
18
|
-
spec.executables
|
19
|
-
spec.test_files
|
17
|
+
spec.files = `git ls-files -z`.split("\x0")
|
18
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
22
|
spec.add_dependency "activesupport"
|
@@ -28,5 +28,6 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_development_dependency "rake"
|
29
29
|
spec.add_development_dependency "rspec"
|
30
30
|
spec.add_development_dependency "shellable"
|
31
|
+
spec.add_development_dependency "standard"
|
31
32
|
spec.add_development_dependency "yard"
|
32
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timeboss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin McDonald
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: standard
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: yard
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -146,6 +160,7 @@ extra_rdoc_files: []
|
|
146
160
|
files:
|
147
161
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
148
162
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
163
|
+
- ".github/workflows/gem-push.yml"
|
149
164
|
- ".github/workflows/ruby.yml"
|
150
165
|
- ".gitignore"
|
151
166
|
- ".replit"
|
@@ -198,7 +213,7 @@ homepage: https://github.com/kevinstuffandthings/timeboss
|
|
198
213
|
licenses:
|
199
214
|
- MIT
|
200
215
|
metadata: {}
|
201
|
-
post_install_message:
|
216
|
+
post_install_message:
|
202
217
|
rdoc_options: []
|
203
218
|
require_paths:
|
204
219
|
- lib
|
@@ -213,9 +228,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
213
228
|
- !ruby/object:Gem::Version
|
214
229
|
version: '0'
|
215
230
|
requirements: []
|
216
|
-
|
217
|
-
|
218
|
-
signing_key:
|
231
|
+
rubygems_version: 3.0.3.1
|
232
|
+
signing_key:
|
219
233
|
specification_version: 4
|
220
234
|
summary: Broadcast Calendar navigation in Ruby made simple
|
221
235
|
test_files:
|