week_calc 0.0.5 → 0.0.6

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: 1a072585efe5857ff1439e3cb3170d09f7884b26
4
- data.tar.gz: f52cf7511fea92c40f53b997a25af616838479ea
3
+ metadata.gz: 94eb16606255d7084e8e9dbc3d64166ce2a189af
4
+ data.tar.gz: 5d1ccd26815b712cc6743783f1a818dd6347ceb5
5
5
  SHA512:
6
- metadata.gz: 2d5d485e9fb659105c66a7999671667a4876ea2a8b1b525725a9a73da1f79b5bfe9785c9be063b10b8137aae6119a7d3cc2cb653b140a2ef98c4030d44529d10
7
- data.tar.gz: cecdc2768712e494658c83121a11ba555e91813e1a89d5be023b64783fb50f267dffd3ba966a10507250998bfe380860473e90916bff64e32afd3517a45a24c8
6
+ metadata.gz: 758b50fd5122bef95fa26af4ea497616ac6b2b63c464f373e571b62adb500b96068149c5b62f24be610e71b61278503f0514b6e73b4bb20ccd1bd6ae2df99704
7
+ data.tar.gz: f866768135a02a9b5720e01dced9d34f6c087c1b382ad5b35e9a437c8f841193cbcfb90890b814495b1398729a15d4c801b7aee63bb8c07fafb08dde513c075c
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .config
3
+ Gemfile.lock
4
+ .rspec
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - '1.9.3'
4
+ - '2.0.0'
5
+ script:
6
+ - bundle exec rake
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in week_calc.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Gemathon-Chargers
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,48 @@
1
+ #[Week_Calc](http://documentup.com/gemathon-chargers/week_calc)
2
+ ### The week calculator
3
+
4
+ [![Gem Version](https://badge.fury.io/rb/week_calc.png)](http://badge.fury.io/rb/week_calc)
5
+
6
+
7
+ Week Calc is an extension to the Date class in ruby. It helps calculate the number of weeks between weeks as well as from the present date. Implementation on Pure Ruby {Date Class}[http://www.ruby-doc.org/core-1.9.3/Date.html].
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ gem 'week_calc'
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install week_calc
22
+
23
+ ## Usage
24
+
25
+ require 'week_calc'
26
+
27
+ There are mainly two helpers available for week_calc usage.
28
+
29
+ Date.weeks_in_between(start_date, end_date)
30
+ Date.weeks_till_now(date)
31
+
32
+ ###Example
33
+
34
+ Date.weeks_in_between('22/4/2012', '22/5/2012')
35
+ > 4
36
+ Date.weeks_in_between('22/5/2012', '22/3/2012')
37
+ > 9
38
+ Date.weeks_till_now('28/2/2014')
39
+ > 1
40
+
41
+ ## Contributing
42
+
43
+ 1. Fork it ( http://github.com/<my-github-username>/week_calc/fork )
44
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
45
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
46
+ 4. Push to the branch (`git push origin my-new-feature`)
47
+ 5. Create new Pull Request
48
+
@@ -0,0 +1,5 @@
1
+ require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+ task :default => :spec
@@ -0,0 +1,3 @@
1
+ module WeekCalc
2
+ VERSION = "0.0.6"
3
+ end
@@ -0,0 +1,24 @@
1
+ require 'bundler/setup'
2
+ Bundler.setup
3
+ require 'week_calc'
4
+
5
+
6
+ describe Date do
7
+
8
+ it "should return the number of weeks" do
9
+ Date.weeks_in_between('22/4/2012', '22/5/2012').should == 4
10
+ end
11
+
12
+ it "should return the number of weeks" do
13
+ Date.weeks_in_between('22/4/2012', '22/4/2012').should == 0
14
+ end
15
+
16
+ it "should return the number of weeks" do
17
+ Date.weeks_in_between('22/5/2012', '22/3/2012').should == 9
18
+ end
19
+
20
+ it "should return the number of weeks from now" do
21
+ Date.weeks_till_now((DateTime.now + 7).strftime('%d-%m-%Y')).should == 1
22
+ end
23
+
24
+ end
@@ -0,0 +1,22 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'week_calc/version'
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = 'week_calc'
8
+ s.version = WeekCalc::VERSION
9
+ s.date = '2014-02-19'
10
+ s.summary = "A week calculator gem"
11
+ s.description = "A week calculator gem"
12
+ s.authors = ["Souranil Sen, Amit Suryavanshi, Yashasree Barve, Twinkal Savani, Priya Joshi"]
13
+ s.email = 'souranil@gmail.com, amitbsuryavanshi@gmail.com, yashasree.barve@gmail.com, twinkal.savani@gmail.com, priya.joshi@gmail.com '
14
+ s.files = `git ls-files -z`.split("\x0")
15
+ s.require_paths = ["lib"]
16
+ s.homepage =
17
+ 'http://rubygems.org/gems/week_calc'
18
+ s.license = 'MIT'
19
+ s.add_development_dependency "bundler"
20
+ s.add_development_dependency "rake"
21
+ s.add_development_dependency "rspec"
22
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: week_calc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Souranil Sen, Amit Suryavanshi, Yashasree Barve, Twinkal Savani, Priya Joshi
@@ -9,7 +9,49 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2014-02-19 00:00:00.000000000 Z
12
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
13
55
  description: A week calculator gem
14
56
  email: 'souranil@gmail.com, amitbsuryavanshi@gmail.com, yashasree.barve@gmail.com,
15
57
  twinkal.savani@gmail.com, priya.joshi@gmail.com '
@@ -17,7 +59,16 @@ executables: []
17
59
  extensions: []
18
60
  extra_rdoc_files: []
19
61
  files:
62
+ - .gitignore
63
+ - .travis.yml
64
+ - Gemfile
65
+ - LICENSE
66
+ - README.md
67
+ - Rakefile
20
68
  - lib/week_calc.rb
69
+ - lib/week_calc/version.rb
70
+ - spec/week_calc_spec.rb
71
+ - week_calc.gemspec
21
72
  homepage: http://rubygems.org/gems/week_calc
22
73
  licenses:
23
74
  - MIT