tempus 1.0.1 → 1.1.0

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
  SHA256:
3
- metadata.gz: 2001b2e89f2be1909675a61ef595fcb3fa103b575c90cdcf1186961bac14077e
4
- data.tar.gz: 3952d416260d86f7ef8c2fadc77077e6c27f937462625bcca5b177e09dd01499
3
+ metadata.gz: 0407fddff5c39851a88b354fb1331d90eb4852d56abfbd090f3474c8f5f2a411
4
+ data.tar.gz: a0ae7f69d30b4d16708e3fcc6fd6ee1804cc12c0d06fa932e6e2bff82ed56be0
5
5
  SHA512:
6
- metadata.gz: fed0de79e4abb9a77b68606052c5011a16dd5dadf7abf4782b61ac225dbdbddca39b8d39f22d139c515c48013a617b160012e89eaba9f3f8a95e75848e89cde3
7
- data.tar.gz: 5d4f7b6952b668b061ffb83451f721d97809810089b0b4c0748060a2cdde89c7729e0badc2d31ab0eb7ed6b4088cbcda0a9a80dde56baec837bffb17289d8627
6
+ metadata.gz: 4db278fdc44a03fcac353c171aae9c35babb67cf470905bbea45252252634bcd5204ac1f5806a9011e256344f54001f1dffbc99d517a0a45a43250a1d13aa557
7
+ data.tar.gz: 4388ddaf13be7edcda9d332fa0367013da2c022a465e819feb69516461dfd416a1a235da81fee1caaf4920e6c867972293cf25c01b8dcef855108d1818156c81
data/.rubocop.yml CHANGED
@@ -1,3 +1,24 @@
1
- Metrics/BlockLength:
2
- Exclude:
3
- - 'spec/**/*.rb'
1
+ require:
2
+ - rubocop-rake
3
+ - rubocop-rspec
4
+ - rubocop-performance
5
+ AllCops:
6
+ NewCops: enable
7
+ TargetRubyVersion: 2.7
8
+
9
+ Style/StringLiterals:
10
+ Enabled: true
11
+ EnforcedStyle: double_quotes
12
+
13
+ Style/StringLiteralsInInterpolation:
14
+ Enabled: true
15
+ EnforcedStyle: double_quotes
16
+
17
+ Layout/LineLength:
18
+ Max: 120
19
+
20
+ RSpec/MultipleExpectations:
21
+ Enabled: false
22
+
23
+ RSpec/ExampleLength:
24
+ Max: 25
data/CODE_OF_CONDUCT.md CHANGED
@@ -2,73 +2,83 @@
2
2
 
3
3
  ## Our Pledge
4
4
 
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
11
8
 
12
9
  ## Our Standards
13
10
 
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
11
+ Examples of behavior that contributes to a positive environment for our community include:
16
12
 
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
22
18
 
23
- Examples of unacceptable behavior by participants include:
19
+ Examples of unacceptable behavior include:
24
20
 
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
28
24
  * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
31
27
  * Other conduct which could reasonably be considered inappropriate in a
32
28
  professional setting
33
29
 
34
- ## Our Responsibilities
30
+ ## Enforcement Responsibilities
35
31
 
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
39
33
 
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
45
35
 
46
36
  ## Scope
47
37
 
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
54
39
 
55
40
  ## Enforcement
56
41
 
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at daniloj.dasilva@gmail.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at daniloj.dasilva@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
63
59
 
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
67
73
 
68
74
  ## Attribution
69
75
 
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
72
82
 
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019 Danilo Jeremias da Silva
3
+ Copyright (c) 2023 Danilo Jeremias da Silva
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -8,22 +8,17 @@ Gem to efficiently manipulate the time, adding, subtracting and converting hours
8
8
 
9
9
  ## Installation
10
10
 
11
- Add this line to your application's Gemfile:
11
+ Install the gem and add to the application's Gemfile by executing:
12
12
 
13
- ```ruby
14
- gem 'tempus'
15
- ```
16
-
17
- And then execute:
13
+ $ bundle add tempus
18
14
 
19
- $ bundle
20
-
21
- Or install it yourself as:
15
+ If bundler is not being used to manage dependencies, install the gem by executing:
22
16
 
23
17
  $ gem install tempus
24
18
 
25
19
  ## Usage
26
- With this gem you can manage durations of time.
20
+
21
+ With this gem you can manage durations of time.
27
22
 
28
23
  ### Initialize with duration
29
24
  ```ruby
@@ -57,11 +52,11 @@ Or install it yourself as:
57
52
 
58
53
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
59
54
 
60
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
55
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
61
56
 
62
57
  ## Contributing
63
58
 
64
- Bug reports and pull requests are welcome on GitHub at https://github.com/dannnylo/tempus. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
59
+ Bug reports and pull requests are welcome on GitHub at https://github.com/dannnylo/tempus. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/dannnylo/tempus/blob/master/CODE_OF_CONDUCT.md).
65
60
 
66
61
  ## License
67
62
 
@@ -69,4 +64,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
69
64
 
70
65
  ## Code of Conduct
71
66
 
72
- Everyone interacting in the Tempus projects codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/dannnylo/tempus/blob/master/CODE_OF_CONDUCT.md).
67
+ Everyone interacting in the Tempus project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/dannnylo/tempus/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile CHANGED
@@ -1,8 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'bundler/gem_tasks'
4
- require 'rspec/core/rake_task'
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
5
 
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
8
- task default: :spec
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Parser others types to value
4
+ class Parser
5
+ def initialize(only_hours: true)
6
+ @only_hours = only_hours
7
+ end
8
+
9
+ def parse(value)
10
+ @value = value
11
+
12
+ case @value
13
+ when String
14
+ from_string.to_f
15
+ when Time
16
+ from_time.to_f
17
+ else
18
+ @value.to_f
19
+ end
20
+ end
21
+
22
+ private
23
+
24
+ def from_time
25
+ return @value.to_f unless @only_hours
26
+
27
+ (@value - @value.beginning_of_day).to_f
28
+ end
29
+
30
+ def from_string
31
+ str = @value.to_s.split(":")
32
+ value = 0
33
+
34
+ %i[hours minutes seconds].each_with_index do |m, i|
35
+ value += str.at(i).to_i.abs.send(m.to_s)
36
+ end
37
+
38
+ str.to_s.include?("-") ? value * -1 : value
39
+ end
40
+ end
@@ -7,4 +7,4 @@ module TempusHelper
7
7
  end
8
8
  end
9
9
 
10
- Object.send(:include, TempusHelper)
10
+ Object.include(TempusHelper)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Tempus
4
- VERSION = '1.0.1'
4
+ VERSION = "1.1.0"
5
5
  end
data/lib/tempus.rb CHANGED
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_support'
4
- require 'active_support/core_ext'
3
+ require "active_support"
4
+ require "active_support/core_ext"
5
5
 
6
- require 'tempus/version'
7
- require 'tempus/tempus_helper'
6
+ require_relative "tempus/version"
7
+ require_relative "tempus/parser"
8
+ require_relative "tempus/tempus_helper"
8
9
 
9
10
  # Class to manipulate efficiently time
10
11
  #=== Example:
@@ -13,42 +14,23 @@ require 'tempus/tempus_helper'
13
14
  class Tempus
14
15
  class Error < StandardError; end
15
16
 
16
- HOURS_REGEX = /(\%h|\%hh|\%H|\%HH)/.freeze
17
- MINUTES_REGEX = /(\%m|\%mm|\%M|\%MM)/.freeze
18
- SECONDS_REGEX = /(\%s|\%ss|\%S|\%SS)/.freeze
17
+ HOURS_REGEX = /(%h|%hh|%H|%HH)/.freeze
18
+ MINUTES_REGEX = /(%m|%mm|%M|%MM)/.freeze
19
+ SECONDS_REGEX = /(%s|%ss|%S|%SS)/.freeze
20
+ OPERATIONS = %i[+ - * /].freeze
19
21
 
20
22
  attr_reader :data
21
23
 
22
24
  delegate :to_i, :to_f, :negative?, :positive?, to: :data
23
25
 
24
- def initialize(value = 0, only_hours = true)
25
- @data = transform(value, only_hours)
26
- end
27
-
28
- def set(value, only_hours = true)
29
- @data = transform(value, only_hours)
30
- end
26
+ def initialize(value = 0, only_hours: true)
27
+ @parser = Parser.new(only_hours: only_hours)
31
28
 
32
- def transform(value, only_hours = true)
33
- return from_string(value).to_f if value.is_a?(String)
34
- return from_time(value, only_hours).to_f if value.is_a?(Time)
35
-
36
- value.to_f
29
+ set(value)
37
30
  end
38
31
 
39
- def from_string(value)
40
- str = value.to_s.split(':')
41
- value = 0
42
-
43
- %i[hours minutes seconds].each_with_index do |m, i|
44
- value += str.at(i).to_i.abs.send(m.to_s)
45
- end
46
-
47
- str.to_s.include?('-') ? value * -1 : value
48
- end
49
-
50
- def from_time(value, only_hours = true)
51
- (only_hours ? value - value.beginning_of_day : value).to_f
32
+ def set(value)
33
+ @data = @parser.parse(value)
52
34
  end
53
35
 
54
36
  # Format the duration to para HH:MM:SS .
@@ -65,10 +47,10 @@ class Tempus
65
47
  ## => "-30:05"
66
48
  ## >> duration.to_s("%H*%M*%S")
67
49
  ## => "-30*05*03"
68
- def to_s(string = '%H:%M:%S')
50
+ def to_s(string = "%H:%M:%S")
69
51
  text = string.dup
70
52
 
71
- text['%'] = '-%' if text != '' && negative?
53
+ text["%"] = "-%" if text != "" && negative?
72
54
 
73
55
  text = text.gsub(HOURS_REGEX, format_number_abs(hours))
74
56
  text = text.gsub(MINUTES_REGEX, format_number_abs(minutes))
@@ -78,7 +60,7 @@ class Tempus
78
60
  alias to_string to_s
79
61
 
80
62
  def format_number_abs(number)
81
- format('%02d', number.to_i.abs)
63
+ format("%02<number>d", number: number.to_i.abs)
82
64
  end
83
65
 
84
66
  def seconds
@@ -111,34 +93,14 @@ class Tempus
111
93
 
112
94
  alias to_xls_time value_in_days
113
95
 
114
- # Sum values of instance
115
- def +(other)
116
- Tempus.new(data + transform(other))
117
- end
118
-
119
- # Subtract values of instance
120
- def -(other)
121
- Tempus.new(data - transform(other))
122
- end
123
-
124
- # Multiplication values of instance
125
- def *(other)
126
- Tempus.new(data * transform(other))
127
- end
128
-
129
- # Division values of instance
130
- def /(other)
131
- Tempus.new(data / transform(other))
132
- end
133
-
134
96
  def human
135
97
  [
136
- ('menos' if negative?),
98
+ ("menos" if negative?),
137
99
  "#{hours.abs} horas",
138
100
  "#{minutes.abs} minutos",
139
- 'e',
101
+ "e",
140
102
  "#{seconds.abs} segundos"
141
- ].compact.join(' ')
103
+ ].compact.join(" ")
142
104
  end
143
105
 
144
106
  def inspect
@@ -150,4 +112,14 @@ class Tempus
150
112
 
151
113
  data == other.data
152
114
  end
115
+
116
+ def method_missing(method_name, *args, &block)
117
+ return super unless OPERATIONS.include?(method_name)
118
+
119
+ @data.send(method_name, @parser.parse(args.first)).to_tempus
120
+ end
121
+
122
+ def respond_to_missing?(method_name, include_private = false)
123
+ OPERATIONS.include?(method_name.to_sym) || super
124
+ end
153
125
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tempus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danilo Jeremias da Silva
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-11 00:00:00.000000000 Z
11
+ date: 2023-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -24,76 +24,6 @@ dependencies:
24
24
  - - ">"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '5'
27
- - !ruby/object:Gem::Dependency
28
- name: bundler
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '1.17'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '1.17'
41
- - !ruby/object:Gem::Dependency
42
- name: coveralls
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '0.8'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '0.8'
55
- - !ruby/object:Gem::Dependency
56
- name: rake
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '10.0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '10.0'
69
- - !ruby/object:Gem::Dependency
70
- name: rspec
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '3.0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '3.0'
83
- - !ruby/object:Gem::Dependency
84
- name: simplecov
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '0.1'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '0.1'
97
27
  description: |2
98
28
  Gem to efficiently manipulate the time.
99
29
  Adding, subtracting and converting more than 24 hours easy.'
@@ -103,45 +33,39 @@ executables: []
103
33
  extensions: []
104
34
  extra_rdoc_files: []
105
35
  files:
106
- - ".coveralls.yml"
107
- - ".gitignore"
108
- - ".hound.yml"
109
36
  - ".rspec"
110
37
  - ".rubocop.yml"
111
- - ".travis.yml"
112
38
  - CODE_OF_CONDUCT.md
113
- - Gemfile
114
- - Gemfile.lock
115
39
  - LICENSE.txt
116
40
  - README.md
117
41
  - Rakefile
118
- - bin/console
119
- - bin/setup
120
42
  - lib/tempus.rb
43
+ - lib/tempus/parser.rb
121
44
  - lib/tempus/tempus_helper.rb
122
45
  - lib/tempus/version.rb
123
- - tempus.gemspec
124
46
  homepage: https://github.com/dannnylo/tempus
125
47
  licenses:
126
48
  - MIT
127
- metadata: {}
49
+ metadata:
50
+ homepage_uri: https://github.com/dannnylo/tempus
51
+ source_code_uri: https://github.com/dannnylo/tempus
52
+ rubygems_mfa_required: 'true'
128
53
  post_install_message:
129
54
  rdoc_options: []
130
55
  require_paths:
131
56
  - lib
132
- - lib/tempus
133
57
  required_ruby_version: !ruby/object:Gem::Requirement
134
58
  requirements:
135
59
  - - ">="
136
60
  - !ruby/object:Gem::Version
137
- version: '0'
61
+ version: 2.7.0
138
62
  required_rubygems_version: !ruby/object:Gem::Requirement
139
63
  requirements:
140
64
  - - ">="
141
65
  - !ruby/object:Gem::Version
142
66
  version: '0'
143
67
  requirements: []
144
- rubygems_version: 3.0.6
68
+ rubygems_version: 3.4.10
145
69
  signing_key:
146
70
  specification_version: 4
147
71
  summary: Gem to efficiently manipulate the time.
data/.coveralls.yml DELETED
@@ -1 +0,0 @@
1
- repo_token: ELpdfYjCf7cMiE663I70rR0V4mcZwmeia
data/.gitignore DELETED
@@ -1,11 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
data/.hound.yml DELETED
@@ -1,3 +0,0 @@
1
- rubocop:
2
- config_file: .rubocop.yml
3
- version: 0.72.0
data/.travis.yml DELETED
@@ -1,8 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.5.0
7
- - 2.6.3
8
- before_install: gem install bundler -v 1.17.3
data/Gemfile DELETED
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
-
7
- # Specify your gem's dependencies in tempus.gemspec
8
- gemspec
data/Gemfile.lock DELETED
@@ -1,69 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- tempus (1.0.1)
5
- activesupport (> 5)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- activesupport (6.0.0)
11
- concurrent-ruby (~> 1.0, >= 1.0.2)
12
- i18n (>= 0.7, < 2)
13
- minitest (~> 5.1)
14
- tzinfo (~> 1.1)
15
- zeitwerk (~> 2.1, >= 2.1.8)
16
- concurrent-ruby (1.1.5)
17
- coveralls (0.8.23)
18
- json (>= 1.8, < 3)
19
- simplecov (~> 0.16.1)
20
- term-ansicolor (~> 1.3)
21
- thor (>= 0.19.4, < 2.0)
22
- tins (~> 1.6)
23
- diff-lcs (1.3)
24
- docile (1.3.2)
25
- i18n (1.6.0)
26
- concurrent-ruby (~> 1.0)
27
- json (2.2.0)
28
- minitest (5.11.3)
29
- rake (10.5.0)
30
- rspec (3.8.0)
31
- rspec-core (~> 3.8.0)
32
- rspec-expectations (~> 3.8.0)
33
- rspec-mocks (~> 3.8.0)
34
- rspec-core (3.8.2)
35
- rspec-support (~> 3.8.0)
36
- rspec-expectations (3.8.4)
37
- diff-lcs (>= 1.2.0, < 2.0)
38
- rspec-support (~> 3.8.0)
39
- rspec-mocks (3.8.1)
40
- diff-lcs (>= 1.2.0, < 2.0)
41
- rspec-support (~> 3.8.0)
42
- rspec-support (3.8.2)
43
- simplecov (0.16.1)
44
- docile (~> 1.1)
45
- json (>= 1.8, < 3)
46
- simplecov-html (~> 0.10.0)
47
- simplecov-html (0.10.2)
48
- term-ansicolor (1.7.1)
49
- tins (~> 1.0)
50
- thor (0.20.3)
51
- thread_safe (0.3.6)
52
- tins (1.21.1)
53
- tzinfo (1.2.5)
54
- thread_safe (~> 0.1)
55
- zeitwerk (2.1.9)
56
-
57
- PLATFORMS
58
- ruby
59
-
60
- DEPENDENCIES
61
- bundler (~> 1.17)
62
- coveralls (~> 0.8)
63
- rake (~> 10.0)
64
- rspec (~> 3.0)
65
- simplecov (~> 0.1)
66
- tempus!
67
-
68
- BUNDLED WITH
69
- 1.17.3
data/bin/console DELETED
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'bundler/setup'
5
- require 'tempus'
6
-
7
- # You can add fixtures and/or initialization code here to make experimenting
8
- # with your gem easier. You can also use a different console, if you like.
9
-
10
- # (If you use this, don't forget to add pry to your Gemfile!)
11
- # require "pry"
12
- # Pry.start
13
-
14
- require 'irb'
15
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
data/tempus.gemspec DELETED
@@ -1,38 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- lib = File.expand_path('lib', __dir__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'tempus/version'
6
-
7
- Gem::Specification.new do |spec|
8
- spec.name = 'tempus'
9
- spec.version = Tempus::VERSION
10
- spec.authors = ['Danilo Jeremias da Silva']
11
- spec.email = ['daniloj.dasilva@gmail.com']
12
-
13
- spec.summary = 'Gem to efficiently manipulate the time.'
14
- spec.description = <<-DESCRIPTION
15
- Gem to efficiently manipulate the time.
16
- Adding, subtracting and converting more than 24 hours easy.'
17
- DESCRIPTION
18
-
19
- spec.homepage = 'https://github.com/dannnylo/tempus'
20
- spec.license = 'MIT'
21
-
22
- # Specify which files should be added to the gem when it is released.
23
- # The `git ls-files -z` loads the files in the RubyGem
24
- # that have been added into git.
25
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
26
- files = `git ls-files -z`.split("\x0")
27
- files.reject { |f| f.match(%r{^(test|spec|features)/}) }
28
- end
29
- spec.bindir = 'exe'
30
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
- spec.require_paths = ['lib', 'lib/tempus']
32
- spec.add_runtime_dependency 'activesupport', '> 5'
33
- spec.add_development_dependency 'bundler', '~> 1.17'
34
- spec.add_development_dependency 'coveralls', '~> 0.8'
35
- spec.add_development_dependency 'rake', '~> 10.0'
36
- spec.add_development_dependency 'rspec', '~> 3.0'
37
- spec.add_development_dependency 'simplecov', '~> 0.1'
38
- end