conflict-calendars 0.1.0 → 0.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: bc5c23dcc0ffefc4901762ef63c89cea12d9b125
4
- data.tar.gz: 9e828441f5970b79a473ef4a0c1abead6152f2d1
3
+ metadata.gz: 4c7afb4ee02482c198e8363c8af48f6308770b4f
4
+ data.tar.gz: 1b126180c369001438dc04657d034f37e1bbd32f
5
5
  SHA512:
6
- metadata.gz: 9a4dda46464856e5d4dfb4ff83fc1d6ea22d9eca2f1b6871e4458755f54e92c30470723779cfd49f9b4e18f609f629534be3cb04c2137c0a1e109339b28ab9b5
7
- data.tar.gz: 9eca5fa2cdfa81fecce03d3296562654637e1aff33a90329526b5319b89c71152519437a7590977e468fcaaddb7e81b9b649aed462837931c807143f7b0f32cb
6
+ metadata.gz: e0aaf2dfd45334b53623f76549574639d903c90f9561f57eeff8a100f360182c5c17fb844ed218880671516734ad33cf020e2689d344048c60ae062010ae4f99
7
+ data.tar.gz: '090837b0584785249bd554fda7c0c7ddf814882ca98ba27881bb1384a55d7b52c31da1381ab00dca138a34eccba9a8aa3103c8b4028263944ab24b1306eb52f8'
data/.gitignore CHANGED
@@ -8,3 +8,5 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  /.DS_Store
11
+ /lib/.DS_Store
12
+ /lib/conflict/.DS_Store
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Conflict::Calendars
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/conflict/calendars`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ The gem help you find the conflict-calendars from calendars
6
4
 
7
5
  ## Installation
8
6
 
@@ -22,8 +20,36 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+ First you should create Ccs::Calendar object by this way
24
+
25
+ ```ruby
26
+ calendar_A = Ccs::Calendar.new("enter the name of calendar",Time.new(2016,12,10,8,0),Time.new(2016,12,10,13,0)
27
+ #=> #<Ccs::Calendar:0x007f9892be85e8 @name="enter the name of calendar", @start_time=2016-12-10 08:00:00 +0800, @end_time=2016-12-10 13:00:00 +0800>
28
+ ```
29
+ ```ruby
30
+ calendar_B = Ccs::Calendar.new(Time.new(2016,12,10,9,0),Time.new(2016,12,10,10,30))
31
+ #=> #<Ccs::Calendar:0x007fa36c55bf38 @name=nil, @start_time=2016-12-10 09:00:00 +0800, @end_time=2016-12-10 10:30:00 +0800>
32
+ ```
33
+ And then you can find the conflicts by this way
26
34
 
35
+ ```ruby
36
+ conflicts = Ccs::Conflicts.new(calendar_A,calendar_B)
37
+ conflicts.size #=> 1
38
+ conflicts.each do |conflict|
39
+ p conflict #=> #<Set: {#<Ccs::Calendar:0x007fb..>, #<Ccs::Calendar:0x007fc..>} >
40
+ end
41
+ ```
42
+ Now, you can know there are exist two calendars that conflict in the same set.
43
+ So, you can do that :
44
+
45
+ ```ruby
46
+ conflict.each do |calendar|
47
+ p calendar #=> #<Ccs::Calendar:0x007fb..>
48
+ p calendar.name #=> "enter the name of calendar"
49
+ p calendar.start_time #=> "2016-12-10 08:00:00 +0800"
50
+ p calendar.end_time #=> "2016-12-10 13:00:00 +0800"
51
+ end
52
+ ```
27
53
  ## Development
28
54
 
29
55
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -1,5 +1,5 @@
1
1
  module Conflict
2
2
  module Calendars
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conflict-calendars
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tsao