humanize 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/bench.rb ADDED
@@ -0,0 +1,11 @@
1
+ require 'benchmark'
2
+ require_relative 'lib/humanize'
3
+ require_relative 'spec/tests'
4
+
5
+ Benchmark.benchmark do |x|
6
+ x.report do
7
+ 100.times { TESTS.each do |x, y|
8
+ x.humanize
9
+ end }
10
+ end
11
+ end
data/humanize.gemspec ADDED
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # stub: humanize 1.1.0 ruby lib
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "humanize"
6
+ s.version = "1.2.1"
7
+
8
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
+ s.require_paths = ["lib"]
10
+ s.authors = ["Jack Chen", "Ryan Bigg"]
11
+ s.date = "2016-03-30"
12
+ s.email = "radarlistener@gmail.com"
13
+ s.files = `git ls-files`.split($/)
14
+ s.test_files = s.files.grep(%r{^(spec)/})
15
+ s.homepage = "https://github.com/radar/humanize"
16
+ s.rubygems_version = "2.5.1"
17
+ s.summary = "Extension to Numeric to humanize numbers"
18
+
19
+ s.add_development_dependency 'rspec'
20
+ end
data/lib/words.rb ADDED
@@ -0,0 +1,16 @@
1
+ WORDS = {
2
+ :en => {
3
+ :negative => 'negative',
4
+ :zero => 'zero',
5
+ :point => 'point',
6
+ :and => 'and',
7
+ :comma => ','
8
+ },
9
+ :fr => {
10
+ :negative => 'négatif',
11
+ :zero => 'zéro',
12
+ :point => 'virgule',
13
+ :and => 'et',
14
+ :comma => ''
15
+ }
16
+ }
data/prof.rb ADDED
@@ -0,0 +1,11 @@
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)
@@ -0,0 +1,34 @@
1
+ require 'rubygems'
2
+ require 'humanize'
3
+ require 'rspec'
4
+
5
+ module Humanize
6
+ describe Configuration do
7
+
8
+ after(:each) do
9
+ Humanize.reset_config
10
+ end
11
+
12
+ describe "#default_locale" do
13
+
14
+ it "default value is :en" do
15
+ expect(Humanize.config.default_locale).to eq(:en)
16
+ end
17
+
18
+ it "value can be changed using a block" do
19
+ Humanize.configure do |config|
20
+ config.default_locale = :fr
21
+ end
22
+ expect(Humanize.config.default_locale).to eq(:fr)
23
+ end
24
+
25
+ it "value can be changed directly" do
26
+ Humanize.config.default_locale = :fr
27
+ expect(Humanize.config.default_locale).to eq(:fr)
28
+ end
29
+
30
+ end
31
+
32
+ end
33
+
34
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: humanize
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Chen
@@ -31,12 +31,21 @@ executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
+ - ".travis.yml"
35
+ - Gemfile
36
+ - LICENSE.md
34
37
  - README.markdown
35
38
  - Rakefile
39
+ - Wordlist.source
40
+ - bench.rb
41
+ - humanize.gemspec
36
42
  - lib/cache.rb
37
43
  - lib/humanize.rb
38
44
  - lib/lots.rb
45
+ - lib/words.rb
46
+ - prof.rb
39
47
  - spec/TODO
48
+ - spec/configuration_spec.rb
40
49
  - spec/humanize_spec.rb
41
50
  - spec/tests.rb
42
51
  homepage: https://github.com/radar/humanize
@@ -62,4 +71,8 @@ rubygems_version: 2.5.1
62
71
  signing_key:
63
72
  specification_version: 4
64
73
  summary: Extension to Numeric to humanize numbers
65
- test_files: []
74
+ test_files:
75
+ - spec/TODO
76
+ - spec/configuration_spec.rb
77
+ - spec/humanize_spec.rb
78
+ - spec/tests.rb