humanize 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 017d914f47b705a8a5b908c11ba32e62de7a8586
4
+ data.tar.gz: e57828af34c6a8376aaf4c68a73ddc5354ca6868
5
+ SHA512:
6
+ metadata.gz: c118621b52db0a182830edf263f8d8b5989300f52b2adf6271fccefbac811bbf7649509d9971bae884b966cf6f3f24daabbda049a0b996fcb56478fe94a4fde7
7
+ data.tar.gz: 3523bc8e6dbac7fb9102834d6748f500abacc7cf68af9459e154126cc1f33eb00387871e8ae0b904d949bd604b3cf0c159b07acb6a83685c3c851d5bcd22b930
@@ -2,13 +2,13 @@
2
2
 
3
3
  Converts numbers to strings.
4
4
 
5
- 2 => "two"
6
- 4 => "four"
7
- 8 => "eight"
8
- 15 => "fifteen"
9
- 16 => "sixteen"
10
- 23 => "twenty tree"
11
- 42 => "forty two"
5
+ 2.humanize => "two"
6
+ 4.humanize => "four"
7
+ 8.humanize => "eight"
8
+ 15.humanize => "fifteen"
9
+ 16.humanize => "sixteen"
10
+ 23.humanize => "twenty three"
11
+ 42.humanize => "forty two"
12
12
 
13
13
  All the way up to 156 digit numbers:
14
14
 
@@ -20,7 +20,7 @@ All the way up to 156 digit numbers:
20
20
  nine hundred and ninety nine quinquagintillion, nine hundred and ninety nine novenquadragintillion, nine hundred and ninety nine octoquadragintillion, nine hundred and ninety nine septenquadragintillion, nine hundred and ninety nine sesquadragintillion, nine hundred and ninety nine quinquadragintillion, nine hundred and ninety nine quattuorquadragintillion, nine hundred and ninety nine trequadragintillion, nine hundred and ninety nine duoquadragintillion, nine hundred and ninety nine unquadragintillion, nine hundred and ninety nine quadragintillion, nine hundred and ninety nine novemtrigintillion, nine hundred and ninety nine octotrigintillion, nine hundred and ninety nine septentrigintillion, nine hundred and ninety nine sextrigintillion, nine hundred and ninety nine quintrigintillion, nine hundred and ninety nine quattuortrigintillion, nine hundred and ninety nine trestrigintillion, nine hundred and ninety nine duotrigintillion, nine hundred and ninety nine untrigintillion, nine hundred and ninety nine trigintillion, nine hundred and ninety nine novemvigintillion, nine hundred and ninety nine octovigintillion, nine hundred and ninety nine septenvigintillion, nine hundred and ninety nine sexvigintillion, nine hundred and ninety nine quinvigintillion, nine hundred and ninety nine quattuortillion, nine hundred and ninety nine trevigintillion, nine hundred and ninety nine duovigintillion, nine hundred and ninety nine unvigintillion, nine hundred and ninety nine vigintillion, nine hundred and ninety nine novemdecillion, nine hundred and ninety nine octodecillion, nine hundred and ninety nine septendecillion, nine hundred and ninety nine sexdecillion, nine hundred and ninety nine quindecillion, nine hundred and ninety nine quattuordecillion, nine hundred and ninety nine tredecillion, nine hundred and ninety nine duodecillion, nine hundred and ninety nine undecillion, nine hundred and ninety nine decillion, nine hundred and ninety nine nonillion, nine hundred and ninety nine octillion, nine hundred and ninety nine septillion, nine hundred and ninety nine sextillion, nine hundred and ninety nine quintrillion, nine hundred and ninety nine quadrillion, nine hundred and ninety nine trillion, nine hundred and ninety nine billion, nine hundred and ninety nine million, nine hundred and ninety nine thousand nine hundred and ninety nine
21
21
 
22
22
 
23
- If you are dealing with numbers larger than 156, we accept patches. Word list is sourced from: http://home.hetnet.nl/~vanadovv/BignumbyN.html
23
+ If you are dealing with numbers larger than 156 digits, we accept patches. Word list is sourced from: [ Wordlist.source ]
24
24
 
25
25
  ## Benchmarks
26
26
 
@@ -37,6 +37,18 @@ If you are dealing with numbers larger than 156, we accept patches. Word list is
37
37
  2. 0.360000 0.000000 0.360000 ( 0.367845)
38
38
  3. 0.360000 0.000000 0.360000 ( 0.370599)
39
39
 
40
+ ### Mid 2012 Macbook Pro - Ruby 2.1.1
41
+
42
+ 1. 0.130000 0.000000 0.130000 ( 0.127581)
43
+ 2. 0.130000 0.000000 0.130000 ( 0.127327)
44
+ 3. 0.130000 0.000000 0.130000 ( 0.133094)
45
+
46
+ ### Mid 2014 Macbook Pro - Ruby 2.1.1
47
+
48
+ 1. 0.120000 0.000000 0.120000 ( 0.117996)
49
+ 2. 0.120000 0.000000 0.120000 ( 0.116230)
50
+ 3. 0.130000 0.000000 0.130000 ( 0.122856)
51
+
40
52
  ## Credits
41
53
 
42
54
  * *Original idea*: Brenton Fletcher
data/Rakefile CHANGED
@@ -1,71 +1,3 @@
1
- begin
2
- require 'jeweler'
3
- Jeweler::Tasks.new do |gem|
4
- gem.name = "humanize"
5
- gem.summary = %Q{Generates long winded string versions of numbers}
6
- gem.description = %Q{Generates long winded string versions of numbers}
7
- gem.email = "radarlistener@gmail.com"
8
- gem.homepage = "http://github.com/radar/"
9
- gem.authors = ["Ryan Bigg"]
10
- gem.add_development_dependency "rspec"
11
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 fo r additional settings
12
- end
13
- Jeweler::GemcutterTasks.new
14
- rescue LoadError
15
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
16
- end
1
+ require 'bundler'
17
2
 
18
-
19
- begin
20
- require 'spec'
21
- rescue LoadError
22
- require 'rubygems'
23
- require 'spec'
24
- end
25
-
26
- require 'rake/rdoctask'
27
- require 'spec/rake/spectask'
28
- desc 'Default: run unit tests.'
29
- task :default => :test
30
-
31
- desc "Run the specs under spec"
32
- Spec::Rake::SpecTask.new do |t|
33
- t.spec_files = FileList['spec/**/*_spec.rb']
34
- t.libs = %w(lib spec)
35
- t.spec_opts << "-c"
36
- t.ruby_opts << "-rubygems"
37
- end
38
-
39
- desc 'Generate documentation for the humanize plugin.'
40
- Rake::RDocTask.new(:rdoc) do |rdoc|
41
- rdoc.rdoc_dir = 'rdoc'
42
- rdoc.title = 'ByStar'
43
- rdoc.options << '--line-numbers' << '--inline-source'
44
- rdoc.rdoc_files.include('README')
45
- rdoc.rdoc_files.include('lib/**/*.rb')
46
- end
47
-
48
- task :bump => ["version:bump", :gemspec]
49
-
50
- namespace :version do
51
- task :read do
52
- unless defined? GEM_VERSION
53
- GEM_VERSION = File.read("VERSION")
54
- end
55
- end
56
-
57
- task :bump => :read do
58
- if ENV['VERSION']
59
- GEM_VERSION.replace ENV['VERSION']
60
- else
61
- GEM_VERSION.sub!(/\d+$/) { |num| num.to_i + 1 }
62
- end
63
-
64
- File.open("VERSION", 'w') { |v| v.write GEM_VERSION }
65
- end
66
- end
67
-
68
- task :release => :bump do
69
- system %(git add VERSION *.gemspec && git commit -m "release v#{GEM_VERSION}")
70
- system %(git tag -am "release v#{GEM_VERSION}" v#{GEM_VERSION})
71
- end
3
+ Bundler::GemHelper.install_tasks
@@ -1,16 +1,15 @@
1
1
  require 'rubygems'
2
- require 'lib/humanize'
3
- require 'spec'
2
+ require 'humanize'
3
+ require 'rspec'
4
+
4
5
  describe "Humanize" do
5
- require 'tests'
6
+ require_relative 'tests'
6
7
 
7
8
  TESTS.each do |num, human|
8
9
  it "#{num} is #{human}" do
9
10
  num.humanize.should eql(human)
10
11
  end
11
- end
12
-
13
-
12
+ end
14
13
  end
15
14
 
16
15
 
File without changes
metadata CHANGED
@@ -1,74 +1,51 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: humanize
3
- version: !ruby/object:Gem::Version
4
- version: 1.1.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.1
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
+ - Jack Chen
7
8
  - Ryan Bigg
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
-
12
- date: 2009-12-26 00:00:00 +10:00
13
- default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: rspec
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
24
- version:
25
- description: Generates long winded string versions of numbers
12
+ date: 2016-03-30 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description:
26
15
  email: radarlistener@gmail.com
27
16
  executables: []
28
-
29
17
  extensions: []
30
-
31
- extra_rdoc_files:
32
- - README.markdown
33
- files:
18
+ extra_rdoc_files: []
19
+ files:
34
20
  - README.markdown
35
21
  - Rakefile
36
- - VERSION
37
- - bench.rb
38
22
  - lib/cache.rb
39
23
  - lib/humanize.rb
40
24
  - lib/lots.rb
41
- - prof.rb
42
25
  - spec/TODO
43
26
  - spec/humanize_spec.rb
44
- - tests.rb
45
- has_rdoc: true
46
- homepage: http://github.com/radar/
27
+ - spec/tests.rb
28
+ homepage: http://github.com/mislav/humanize
47
29
  licenses: []
48
-
30
+ metadata: {}
49
31
  post_install_message:
50
- rdoc_options:
51
- - --charset=UTF-8
52
- require_paths:
32
+ rdoc_options: []
33
+ require_paths:
53
34
  - lib
54
- required_ruby_version: !ruby/object:Gem::Requirement
55
- requirements:
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ requirements:
56
37
  - - ">="
57
- - !ruby/object:Gem::Version
58
- version: "0"
59
- version:
60
- required_rubygems_version: !ruby/object:Gem::Requirement
61
- requirements:
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
41
+ requirements:
62
42
  - - ">="
63
- - !ruby/object:Gem::Version
64
- version: "0"
65
- version:
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
66
45
  requirements: []
67
-
68
46
  rubyforge_project:
69
- rubygems_version: 1.3.5
47
+ rubygems_version: 2.5.1
70
48
  signing_key:
71
- specification_version: 3
72
- summary: Generates long winded string versions of numbers
73
- test_files:
74
- - spec/humanize_spec.rb
49
+ specification_version: 4
50
+ summary: Extension to Numeric to humanize numbers
51
+ test_files: []
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 1.1.0
data/bench.rb DELETED
@@ -1,12 +0,0 @@
1
- require 'lib/humanize'
2
- # require 'other'
3
- require 'benchmark'
4
- require 'tests'
5
-
6
- Benchmark.benchmark do |x|
7
- x.report do
8
- 100.times { TESTS.each do |x, y|
9
- x.humanize
10
- end }
11
- end
12
- end
data/prof.rb DELETED
@@ -1,11 +0,0 @@
1
- require 'rubygems'
2
- require 'ruby-prof'
3
- require 'lib/humanize'
4
- RubyProf.start
5
-
6
- require 'bench'
7
- result = RubyProf.stop
8
-
9
- # Print a flat profile to text
10
- printer = RubyProf::FlatPrinter.new(result)
11
- printer.print(STDOUT, 0)