activesupport-duration-human_string 0.1.1 → 1.0.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: 4f26808d70339292160cc34e94c6c4bf3d4b76a344269e51a714da471706d45f
4
- data.tar.gz: b00aa1e03d68ece37ba93ab7ae765d3dca9c11bd5da32b8d2055083a4a14981e
3
+ metadata.gz: 7a42d606d1f8510d965e98436ecb7232868bf0f00053da7cb7f6f430c0dd2321
4
+ data.tar.gz: c1c817cf2dcec49125adad4fc6c05f45331a255ec112b52e90926296aea1f45a
5
5
  SHA512:
6
- metadata.gz: c032fe5ce288994bb132f3896de00d3e6a45169bc57eaf9b5fb441c6049d593b105bf4d47ee3847405c3e40f378b4cf7c5df13321549d870055f28406f9a75d9
7
- data.tar.gz: 9707cfa9cbeff415f31f67f8fd2955cb660874c6c160df0e3a67b60e6a85ff43cca23d951de356af11a4be12480ca04c7619c1c5c3d96e14c0416d145cab201c
6
+ metadata.gz: 8705aed9bc654ba6667ad5b9c9ebe99931f479846c24fd2a5112ca848cee2f438b95746b8ef96296e7f5d6f50d677369d2f9d6d13f578e2f17cc2ef8b1d26d94
7
+ data.tar.gz: 29d6639d5c7131b4db0b8f7a8b48a3155c245169b53838d163c6bd308231e15e723a9630d46de119462a8315ae40f4c791403390b46f715d96419cfc6eb88a27
data/.gitignore CHANGED
@@ -6,6 +6,7 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /vendor/
9
10
 
10
11
  # rspec failure tracking
11
12
  .rspec_status
data/Changelog.md CHANGED
@@ -0,0 +1,14 @@
1
+ ## 1.0.0 (2024-02-16)
2
+
3
+ Fixes:
4
+
5
+ - Relax activesupport dependency version
6
+
7
+ Breaking changes:
8
+
9
+ - Extract `#change`, `#truncate`, `#round`, etc. out of this gem into the [activesupport-duration-change](https://github.com/TylerRick/activesupport-duration-change) gem
10
+
11
+ ## 0.1.1 (2019-04-02)
12
+
13
+ Initial release
14
+
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in activesupport-duration-human_string.gemspec
4
4
  gemspec
5
+
6
+ gem 'byebug'
data/Readme.md CHANGED
@@ -44,6 +44,10 @@ gem 'activesupport-duration-human_string'
44
44
 
45
45
  Also aliased as `human_string`, `to_human_s`.
46
46
 
47
+ ## See also
48
+
49
+ - [activesupport-duration-change](https://github.com/TylerRick/activesupport-duration-change), which adds methods such as `#change`, `#truncate`, `#round` to `Duration`
50
+
47
51
  ## Development
48
52
 
49
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.
@@ -54,7 +58,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
54
58
 
55
59
  Bug reports and pull requests are welcome on GitHub at https://github.com/TylerRick/activesupport-duration-human_string.
56
60
 
57
- ## Not really related
61
+ ## Not really related
58
62
 
59
63
  - https://github.com/josedonizetti/ruby-duration
60
64
  - https://github.com/janko/as-duration
@@ -30,9 +30,9 @@ Gem::Specification.new do |spec|
30
30
  spec.require_paths = ["lib"]
31
31
 
32
32
  spec.required_ruby_version = ">= 2.3.0"
33
- spec.add_dependency "activesupport", [">= 4.2", "< 5.3"]
33
+ spec.add_dependency "activesupport", [">= 5.2"]
34
34
 
35
- spec.add_development_dependency "bundler", "~> 2.0"
36
- spec.add_development_dependency "rake", "~> 10.0"
37
- spec.add_development_dependency "rspec", "~> 3.0"
35
+ spec.add_development_dependency "bundler"
36
+ spec.add_development_dependency "rake"
37
+ spec.add_development_dependency "rspec"
38
38
  end
@@ -1,9 +1,9 @@
1
1
  module ActiveSupport
2
2
  class Duration
3
3
  module HumanString
4
- def self.version
5
- "0.1.1"
6
- end
4
+ def self.version
5
+ "1.0.0"
6
+ end
7
7
  end
8
8
  end
9
9
  end
@@ -1,3 +1,4 @@
1
+ require 'active_support'
1
2
  require 'active_support/duration'
2
3
  require 'active_support/duration/iso8601_serializer'
3
4
 
@@ -42,7 +43,7 @@ module ActiveSupport
42
43
  #
43
44
  def human_str(precision: nil, separator: '', delimiter: ' ', use_2_digit_numbers: false)
44
45
  HumanStringSerializer.new(
45
- self,
46
+ self.class.build(value),
46
47
  precision: precision,
47
48
  separator: separator,
48
49
  delimiter: delimiter,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activesupport-duration-human_string
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Rick
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-02 00:00:00.000000000 Z
11
+ date: 2024-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,62 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.2'
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '5.3'
19
+ version: '5.2'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
- version: '4.2'
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '5.3'
26
+ version: '5.2'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: bundler
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
- - - "~>"
31
+ - - ">="
38
32
  - !ruby/object:Gem::Version
39
- version: '2.0'
33
+ version: '0'
40
34
  type: :development
41
35
  prerelease: false
42
36
  version_requirements: !ruby/object:Gem::Requirement
43
37
  requirements:
44
- - - "~>"
38
+ - - ">="
45
39
  - !ruby/object:Gem::Version
46
- version: '2.0'
40
+ version: '0'
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: rake
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
- - - "~>"
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
- version: '10.0'
47
+ version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
51
  requirements:
58
- - - "~>"
52
+ - - ">="
59
53
  - !ruby/object:Gem::Version
60
- version: '10.0'
54
+ version: '0'
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: rspec
63
57
  requirement: !ruby/object:Gem::Requirement
64
58
  requirements:
65
- - - "~>"
59
+ - - ">="
66
60
  - !ruby/object:Gem::Version
67
- version: '3.0'
61
+ version: '0'
68
62
  type: :development
69
63
  prerelease: false
70
64
  version_requirements: !ruby/object:Gem::Requirement
71
65
  requirements:
72
- - - "~>"
66
+ - - ">="
73
67
  - !ruby/object:Gem::Version
74
- version: '3.0'
68
+ version: '0'
75
69
  description: 'Convert ActiveSupport::Duration objects to human-friendly strings like
76
70
  ''2h 30m 17s''. '
77
71
  email:
@@ -116,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
110
  - !ruby/object:Gem::Version
117
111
  version: '0'
118
112
  requirements: []
119
- rubygems_version: 3.0.1
113
+ rubygems_version: 3.5.1
120
114
  signing_key:
121
115
  specification_version: 4
122
116
  summary: Convert Duration objects to human-friendly strings like '2h 30m 17s'