castiel 0.0.1
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 +15 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/Guardfile +5 -0
- data/LICENSE.txt +22 -0
- data/README.md +41 -0
- data/Rakefile +12 -0
- data/castiel.gemspec +30 -0
- data/lib/castiel.rb +32 -0
- data/lib/castiel/elements/base_element.rb +15 -0
- data/lib/castiel/elements/date_element.rb +17 -0
- data/lib/castiel/elements/hour_element.rb +15 -0
- data/lib/castiel/elements/symbol_element.rb +29 -0
- data/lib/castiel/parsers/base_parser.rb +27 -0
- data/lib/castiel/parsers/date_time_parser.rb +13 -0
- data/lib/castiel/version.rb +3 -0
- data/spec/castiel_spec.rb +44 -0
- data/spec/elements/base_element_spec.rb +14 -0
- data/spec/elements/date_element_spec.rb +22 -0
- data/spec/elements/hour_element_spec.rb +22 -0
- data/spec/elements/symbol_element_spec.rb +47 -0
- data/spec/parsers/base_parser_spec.rb +90 -0
- data/spec/parsers/date_time_parser_spec.rb +15 -0
- data/spec/spec.opts +3 -0
- data/spec/spec_helper.rb +11 -0
- metadata +176 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
N2FkY2JiNzMwNmIwZDFmYzY3ODU0OGQ2YzBlMzgzYzIwM2FlM2FiNQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YTAxM2M4YTdiZTYyYzZlOWViNTg2ZWY4Y2JlOTlkNWU2MTZhMTU1Ng==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZTQzY2IxYWI3ODhlNWQyYTZiYjU2MDg5MzI2ZDRkMTQ0MGExOTlhNDcyODBh
|
10
|
+
NjYzOTZjYjk2NDViN2FmYWY4NzBjZGJhMTRlZTQ1MGU0MzlkOGUwNGM2NmFm
|
11
|
+
N2I3ZDY4MzAxM2M4ZjRhNGM2MGJjM2M0MWY5MDNmZGUwMDc4MTI=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZjNkYTE3NTNjMDBjMmZiODZhNGEyNzFlZTk4NTBmZjA1ODk1NTRkY2U1YTEz
|
14
|
+
MTU4ZjhiZTM5YzViMTkwNDg3MjA5YzI2ZjU2OTY1MWE2NTczZTc0ZTcyZjA2
|
15
|
+
YWIxMTIyNDQ0ZjI2NTU2OTY0ZTU4YjlkMjA2MTYyNWQ4N2ZmYjc=
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Guardfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Adilson Carvalho
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# Castiel
|
2
|
+
|
3
|
+
[Castiel](http://va.mu/cUmX) was written to rescue me from hell every time I have to write any kind
|
4
|
+
of script that must deal with dates and times to be parsed on command line.
|
5
|
+
|
6
|
+
It is common to me to write summarization daemons that must accept command lines like:
|
7
|
+
|
8
|
+
`sales-count yesterday`
|
9
|
+
|
10
|
+
or
|
11
|
+
|
12
|
+
`hit-count yesterday today 11..17`
|
13
|
+
|
14
|
+
## Installation
|
15
|
+
|
16
|
+
Add this line to your application's Gemfile:
|
17
|
+
|
18
|
+
gem 'castiel'
|
19
|
+
|
20
|
+
And then execute:
|
21
|
+
|
22
|
+
$ bundle
|
23
|
+
|
24
|
+
Or install it yourself as:
|
25
|
+
|
26
|
+
$ gem install castiel
|
27
|
+
|
28
|
+
## Usage
|
29
|
+
|
30
|
+
````ruby
|
31
|
+
Castiel.parse 'yesterday today 1977-04-13'
|
32
|
+
# => [2013-04-21 00:00:00 -0300, 2013-04-22 00:00:00 -0300, 1977-04-13 00:00:00 -0300]
|
33
|
+
````
|
34
|
+
|
35
|
+
## Contributing
|
36
|
+
|
37
|
+
1. Fork it
|
38
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
39
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
40
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
41
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
data/castiel.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
lib = File.expand_path('../lib', __FILE__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
|
6
|
+
require 'castiel/version'
|
7
|
+
|
8
|
+
Gem::Specification.new do |spec|
|
9
|
+
spec.name = "castiel"
|
10
|
+
spec.version = Castiel::VERSION
|
11
|
+
spec.authors = ["Adilson Carvalho"]
|
12
|
+
spec.email = ["adilson@adilsoncarvalho.com.br"]
|
13
|
+
spec.description = 'Extension do add date and time parsing capabilities to OptionsParse'
|
14
|
+
spec.summary = 'Extension do add date and time parsing capabilities to OptionsParse'
|
15
|
+
spec.homepage = 'https://github.com/adilsoncarvalho/castiel'
|
16
|
+
spec.license = "MIT"
|
17
|
+
|
18
|
+
spec.files = `git ls-files`.split($/)
|
19
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
20
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
21
|
+
spec.require_paths = ["lib"]
|
22
|
+
|
23
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
24
|
+
spec.add_development_dependency 'rake', '~> 0.9.2'
|
25
|
+
spec.add_development_dependency 'rspec', '~> 2.5'
|
26
|
+
spec.add_development_dependency 'fuubar', '~> 1.1.0'
|
27
|
+
spec.add_development_dependency 'guard'
|
28
|
+
spec.add_development_dependency 'guard-rspec'
|
29
|
+
spec.add_development_dependency 'growl'
|
30
|
+
end
|
data/lib/castiel.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require "castiel/version"
|
2
|
+
|
3
|
+
module Castiel
|
4
|
+
|
5
|
+
module Elements
|
6
|
+
# elements stuff
|
7
|
+
autoload :BaseElement, 'castiel/elements/base_element'
|
8
|
+
autoload :DateElement, 'castiel/elements/date_element'
|
9
|
+
autoload :HourElement, 'castiel/elements/hour_element'
|
10
|
+
autoload :SymbolElement, 'castiel/elements/symbol_element'
|
11
|
+
end
|
12
|
+
|
13
|
+
module Parsers
|
14
|
+
# parsers
|
15
|
+
autoload :BaseParser, 'castiel/parsers/base_parser'
|
16
|
+
autoload :DateTimeParser, 'castiel/parsers/date_time_parser'
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.default_parser_class
|
20
|
+
@default_parser ||= Castiel::Parsers::DateTimeParser
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.default_parser_class=(klass)
|
24
|
+
raise 'Parser class must have a "parse" method declared' unless klass.instance_methods.include? :parse
|
25
|
+
@default_parser = klass
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.parse(elements)
|
29
|
+
default_parser_class.new.parse elements
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Castiel
|
2
|
+
module Elements
|
3
|
+
|
4
|
+
class DateElement < BaseElement
|
5
|
+
def match?(element, context = nil)
|
6
|
+
return false unless element =~ /^\d{4}[-\/]\d{2}[-\/]\d{2}|\d{2}[-\/]\d{2}[-\/]\d{4}$/
|
7
|
+
return false unless ::Date.parse(element) rescue nil
|
8
|
+
true
|
9
|
+
end
|
10
|
+
|
11
|
+
def evaluate(element, context = nil)
|
12
|
+
::Date.parse(element).to_time
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Castiel
|
2
|
+
module Elements
|
3
|
+
|
4
|
+
class SymbolElement < BaseElement
|
5
|
+
def match?(element, context = nil)
|
6
|
+
element = element.to_s.downcase
|
7
|
+
respond_to? "run_#{element}"
|
8
|
+
end
|
9
|
+
|
10
|
+
def evaluate(element, context = nil)
|
11
|
+
element = element.to_s.downcase
|
12
|
+
send "run_#{element}", element, context
|
13
|
+
end
|
14
|
+
|
15
|
+
def run_today(element, context = nil)
|
16
|
+
::Date.today.to_time
|
17
|
+
end
|
18
|
+
|
19
|
+
def run_yesterday(element, context = nil)
|
20
|
+
(::Date.today - 1).to_time
|
21
|
+
end
|
22
|
+
|
23
|
+
def run_tomorrow(element, context = nil)
|
24
|
+
(::Date.today + 1).to_time
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Castiel
|
2
|
+
module Parsers
|
3
|
+
|
4
|
+
class BaseParser
|
5
|
+
def parsers
|
6
|
+
@parsers ||= []
|
7
|
+
end
|
8
|
+
|
9
|
+
def <<(element)
|
10
|
+
parsers << element
|
11
|
+
end
|
12
|
+
|
13
|
+
def parse(elements)
|
14
|
+
elements = elements.split ' ' if elements.is_a? String
|
15
|
+
elements.collect{|element| parse_element element}
|
16
|
+
end
|
17
|
+
|
18
|
+
def parse_element(element, context = nil)
|
19
|
+
parsers.each do |parser|
|
20
|
+
return parser.evaluate(element, context) if parser.match? element
|
21
|
+
end
|
22
|
+
nil
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Castiel
|
2
|
+
module Parsers
|
3
|
+
|
4
|
+
class DateTimeParser < BaseParser
|
5
|
+
def initialize
|
6
|
+
parsers << Castiel::Elements::SymbolElement.new
|
7
|
+
parsers << Castiel::Elements::DateElement.new
|
8
|
+
parsers << Castiel::Elements::HourElement.new
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Castiel' do
|
4
|
+
let(:subject) { Castiel }
|
5
|
+
|
6
|
+
describe '.default_parser_class' do
|
7
|
+
it{ subject.default_parser_class.should == Castiel::Parsers::DateTimeParser }
|
8
|
+
end
|
9
|
+
|
10
|
+
describe '.default_parser_class=' do
|
11
|
+
class InvalidParserClass; end
|
12
|
+
it{ lambda{ subject.default_parser_class = InvalidParserClass }.should raise_error }
|
13
|
+
|
14
|
+
class ValidParserClass
|
15
|
+
def parse(elements); end
|
16
|
+
end
|
17
|
+
|
18
|
+
it do
|
19
|
+
subject.default_parser_class = ValidParserClass
|
20
|
+
subject.default_parser_class.should == ValidParserClass
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
describe '.parse' do
|
26
|
+
it 'Should call the default parser and pass the given elements' do
|
27
|
+
parser_double = double(:parser)
|
28
|
+
parser_double.should_receive(:new)
|
29
|
+
.once
|
30
|
+
.and_return(parser_double)
|
31
|
+
parser_double.should_receive(:parse)
|
32
|
+
.with(:elements)
|
33
|
+
.once
|
34
|
+
.and_return(:parsed_elements)
|
35
|
+
|
36
|
+
subject.should_receive(:default_parser_class)
|
37
|
+
.once
|
38
|
+
.and_return(parser_double)
|
39
|
+
|
40
|
+
subject.parse(:elements).should == :parsed_elements
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Castiel::Elements::BaseElement do
|
4
|
+
|
5
|
+
describe '#match?' do
|
6
|
+
it{ subject.match?('').should be_true }
|
7
|
+
it{ subject.match?(nil).should be_true }
|
8
|
+
end
|
9
|
+
|
10
|
+
describe '#evaluate' do
|
11
|
+
it{ subject.evaluate(:anything).should == :anything }
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Castiel::Elements::DateElement do
|
4
|
+
|
5
|
+
describe '#match?' do
|
6
|
+
context 'Should return true' do
|
7
|
+
it{ subject.match?('1977-03-14').should be_true }
|
8
|
+
it{ subject.match?('14/03/1977').should be_true }
|
9
|
+
end
|
10
|
+
|
11
|
+
context 'Should return false' do
|
12
|
+
it{ subject.match?('1977-03').should be_false }
|
13
|
+
it{ subject.match?('14 03 1977').should be_false }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe '#evaluate' do
|
18
|
+
it{ subject.evaluate('1977-03-14').should == Time.parse('1977-03-14 00:00') }
|
19
|
+
it{ subject.evaluate('14/03/1977').should == Time.parse('1977-03-14 00:00') }
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Castiel::Elements::HourElement do
|
4
|
+
|
5
|
+
describe '#match?' do
|
6
|
+
context 'Should return true' do
|
7
|
+
it{ ('0'..'23').each {|hour| subject.match?(hour).should be_true} }
|
8
|
+
it{ ('00'..'23').each{|hour| subject.match?(hour).should be_true} }
|
9
|
+
end
|
10
|
+
|
11
|
+
context 'Should return false' do
|
12
|
+
it{ ('24'..'99').each{|hour| subject.match?(hour).should be_false} }
|
13
|
+
it{ subject.match?('').should be_false }
|
14
|
+
it{ subject.match?(nil).should be_false }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe '#evaluate' do
|
19
|
+
it{ ('0'..'23').each{|hour| subject.evaluate(hour).should == hour.to_i}}
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Castiel::Elements::SymbolElement do
|
4
|
+
|
5
|
+
describe '#match?' do
|
6
|
+
context 'Should return true' do
|
7
|
+
context 'when written the proper way' do
|
8
|
+
it { subject.match?('yesterday').should be_true }
|
9
|
+
it { subject.match?('today').should be_true }
|
10
|
+
it { subject.match?('tomorrow').should be_true }
|
11
|
+
end
|
12
|
+
|
13
|
+
context 'when written with different case' do
|
14
|
+
it { subject.match?('YESTERDAY').should be_true }
|
15
|
+
it { subject.match?('TODAY').should be_true }
|
16
|
+
it { subject.match?('TOMORROW').should be_true }
|
17
|
+
end
|
18
|
+
|
19
|
+
context 'when using symbols on any case' do
|
20
|
+
it { subject.match?(:yesterday).should be_true }
|
21
|
+
it { subject.match?(:today).should be_true }
|
22
|
+
it { subject.match?(:tomorrow).should be_true }
|
23
|
+
it { subject.match?(:YESTERDAY).should be_true }
|
24
|
+
it { subject.match?(:TODAY).should be_true }
|
25
|
+
it { subject.match?(:TOMORROW).should be_true }
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
context 'Should return false' do
|
30
|
+
it { subject.match?('teretete').should be_false }
|
31
|
+
it { subject.match?('').should be_false }
|
32
|
+
it { subject.match?(nil).should be_false }
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe '#evaluate' do
|
37
|
+
# making the clock go back in time on my favorite day ;)
|
38
|
+
before(:each) { Date.stub(:today) { Date.parse('1977-03-14') } }
|
39
|
+
let(:yesterday) { (Date.today - 1).to_time }
|
40
|
+
let(:today) { (Date.today).to_time }
|
41
|
+
let(:tomorrow) { (Date.today + 1).to_time }
|
42
|
+
|
43
|
+
it{ subject.evaluate('yesterday').should == yesterday }
|
44
|
+
it{ subject.evaluate('today').should == today }
|
45
|
+
it{ subject.evaluate('tomorrow').should == tomorrow }
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Castiel::Parsers::BaseParser do
|
4
|
+
|
5
|
+
describe '#parsers' do
|
6
|
+
it{ subject.parsers.empty?.should be_true }
|
7
|
+
end
|
8
|
+
|
9
|
+
describe '#<<' do
|
10
|
+
it 'Should add element parsers into parsers list' do
|
11
|
+
subject << :element1
|
12
|
+
subject << :element2
|
13
|
+
subject << :element3
|
14
|
+
|
15
|
+
subject.parsers.should == [:element1, :element2, :element3]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe '#parse' do
|
20
|
+
before(:each) do
|
21
|
+
subject.should_receive(:parse_element)
|
22
|
+
.with('element1')
|
23
|
+
.once
|
24
|
+
.and_return('element1')
|
25
|
+
subject.should_receive(:parse_element)
|
26
|
+
.with('element2')
|
27
|
+
.once
|
28
|
+
.and_return('element2')
|
29
|
+
subject.should_receive(:parse_element)
|
30
|
+
.with('element3')
|
31
|
+
.once
|
32
|
+
.and_return('element3')
|
33
|
+
end
|
34
|
+
|
35
|
+
it{ subject.parse('element1 element2 element3').should == %w(element1 element2 element3) }
|
36
|
+
it{ subject.parse(%w(element1 element2 element3)).should == %w(element1 element2 element3) }
|
37
|
+
end
|
38
|
+
|
39
|
+
describe '#parse_element' do
|
40
|
+
it 'Should evaluate for the element who says match and stop' do
|
41
|
+
e1 = double(:element_1)
|
42
|
+
e1.should_receive(:match?)
|
43
|
+
.with(:element)
|
44
|
+
.and_return(false)
|
45
|
+
|
46
|
+
e2 = double(:element_2)
|
47
|
+
e2.should_receive(:match?)
|
48
|
+
.with(:element)
|
49
|
+
.and_return(true)
|
50
|
+
e2.should_receive(:evaluate)
|
51
|
+
.with(:element, nil)
|
52
|
+
.and_return(:success)
|
53
|
+
|
54
|
+
e3 = double(:element_3)
|
55
|
+
e3.should_receive(:match?)
|
56
|
+
.with(:element)
|
57
|
+
.exactly(0)
|
58
|
+
|
59
|
+
subject << e1
|
60
|
+
subject << e2
|
61
|
+
subject << e3
|
62
|
+
|
63
|
+
subject.parse_element(:element).should == :success
|
64
|
+
end
|
65
|
+
|
66
|
+
it 'Should return nil if no element says match' do
|
67
|
+
e1 = double(:element_1)
|
68
|
+
e1.should_receive(:match?)
|
69
|
+
.with(:element)
|
70
|
+
.and_return(false)
|
71
|
+
|
72
|
+
e2 = double(:element_2)
|
73
|
+
e2.should_receive(:match?)
|
74
|
+
.with(:element)
|
75
|
+
.and_return(false)
|
76
|
+
|
77
|
+
e3 = double(:element_3)
|
78
|
+
e3.should_receive(:match?)
|
79
|
+
.with(:element)
|
80
|
+
.and_return(false)
|
81
|
+
|
82
|
+
subject << e1
|
83
|
+
subject << e2
|
84
|
+
subject << e3
|
85
|
+
|
86
|
+
subject.parse_element(:element).should be_nil
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Castiel::Parsers::DateTimeParser do
|
4
|
+
|
5
|
+
describe '#parsers' do
|
6
|
+
it 'Should contain the following parsers' do
|
7
|
+
subject.parsers.size.should == 3
|
8
|
+
|
9
|
+
subject.parsers[0].class.should == Castiel::Elements::SymbolElement
|
10
|
+
subject.parsers[1].class.should == Castiel::Elements::DateElement
|
11
|
+
subject.parsers[2].class.should == Castiel::Elements::HourElement
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
data/spec/spec.opts
ADDED
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,176 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: castiel
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Adilson Carvalho
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-04-22 00:00:00.000000000 Z
|
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: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
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.9.2
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.9.2
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.5'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.5'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: fuubar
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.1.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.1.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: guard
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: guard-rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: growl
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ! '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description: Extension do add date and time parsing capabilities to OptionsParse
|
112
|
+
email:
|
113
|
+
- adilson@adilsoncarvalho.com.br
|
114
|
+
executables: []
|
115
|
+
extensions: []
|
116
|
+
extra_rdoc_files: []
|
117
|
+
files:
|
118
|
+
- .gitignore
|
119
|
+
- Gemfile
|
120
|
+
- Guardfile
|
121
|
+
- LICENSE.txt
|
122
|
+
- README.md
|
123
|
+
- Rakefile
|
124
|
+
- castiel.gemspec
|
125
|
+
- lib/castiel.rb
|
126
|
+
- lib/castiel/elements/base_element.rb
|
127
|
+
- lib/castiel/elements/date_element.rb
|
128
|
+
- lib/castiel/elements/hour_element.rb
|
129
|
+
- lib/castiel/elements/symbol_element.rb
|
130
|
+
- lib/castiel/parsers/base_parser.rb
|
131
|
+
- lib/castiel/parsers/date_time_parser.rb
|
132
|
+
- lib/castiel/version.rb
|
133
|
+
- spec/castiel_spec.rb
|
134
|
+
- spec/elements/base_element_spec.rb
|
135
|
+
- spec/elements/date_element_spec.rb
|
136
|
+
- spec/elements/hour_element_spec.rb
|
137
|
+
- spec/elements/symbol_element_spec.rb
|
138
|
+
- spec/parsers/base_parser_spec.rb
|
139
|
+
- spec/parsers/date_time_parser_spec.rb
|
140
|
+
- spec/spec.opts
|
141
|
+
- spec/spec_helper.rb
|
142
|
+
homepage: https://github.com/adilsoncarvalho/castiel
|
143
|
+
licenses:
|
144
|
+
- MIT
|
145
|
+
metadata: {}
|
146
|
+
post_install_message:
|
147
|
+
rdoc_options: []
|
148
|
+
require_paths:
|
149
|
+
- lib
|
150
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ! '>='
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ! '>='
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
requirements: []
|
161
|
+
rubyforge_project:
|
162
|
+
rubygems_version: 2.0.3
|
163
|
+
signing_key:
|
164
|
+
specification_version: 4
|
165
|
+
summary: Extension do add date and time parsing capabilities to OptionsParse
|
166
|
+
test_files:
|
167
|
+
- spec/castiel_spec.rb
|
168
|
+
- spec/elements/base_element_spec.rb
|
169
|
+
- spec/elements/date_element_spec.rb
|
170
|
+
- spec/elements/hour_element_spec.rb
|
171
|
+
- spec/elements/symbol_element_spec.rb
|
172
|
+
- spec/parsers/base_parser_spec.rb
|
173
|
+
- spec/parsers/date_time_parser_spec.rb
|
174
|
+
- spec/spec.opts
|
175
|
+
- spec/spec_helper.rb
|
176
|
+
has_rdoc:
|