lazier 4.2.0 → 4.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -8
  3. data/.rubocop.yml +48 -3
  4. data/.travis.yml +5 -4
  5. data/CHANGELOG.md +4 -0
  6. data/Gemfile +9 -8
  7. data/README.md +0 -1
  8. data/Rakefile +20 -4
  9. data/doc/Lazier.html +214 -3
  10. data/doc/Lazier/Boolean.html +2 -2
  11. data/doc/Lazier/Configuration.html +3 -3
  12. data/doc/Lazier/DateTime.html +16 -16
  13. data/doc/Lazier/DateTime/ClassMethods.html +6 -6
  14. data/doc/Lazier/Exceptions.html +2 -2
  15. data/doc/Lazier/Exceptions/Debug.html +2 -2
  16. data/doc/Lazier/Exceptions/MissingTranslation.html +2 -2
  17. data/doc/Lazier/Exceptions/TranslationExceptionHandler.html +2 -2
  18. data/doc/Lazier/Hash.html +3 -3
  19. data/doc/Lazier/I18n.html +11 -11
  20. data/doc/Lazier/Math.html +2 -2
  21. data/doc/Lazier/Math/ClassMethods.html +2 -2
  22. data/doc/Lazier/Object.html +16 -22
  23. data/doc/Lazier/Pathname.html +2 -2
  24. data/doc/Lazier/Settings.html +2 -2
  25. data/doc/Lazier/String.html +2 -2
  26. data/doc/Lazier/TimeZone.html +42 -42
  27. data/doc/Lazier/TimeZone/ClassMethods.html +2 -2
  28. data/doc/Lazier/Version.html +3 -3
  29. data/doc/_index.html +6 -6
  30. data/doc/file.README.html +3 -4
  31. data/doc/index.html +3 -4
  32. data/doc/method_list.html +106 -88
  33. data/doc/top-level-namespace.html +2 -2
  34. data/lazier.gemspec +2 -2
  35. data/lib/lazier.rb +0 -2
  36. data/lib/lazier/configuration.rb +1 -1
  37. data/lib/lazier/datetime.rb +10 -5
  38. data/lib/lazier/hash.rb +1 -1
  39. data/lib/lazier/i18n.rb +2 -2
  40. data/lib/lazier/object.rb +18 -10
  41. data/lib/lazier/timezone.rb +8 -8
  42. data/lib/lazier/version.rb +1 -1
  43. data/spec/spec_helper.rb +17 -0
  44. metadata +6 -8
  45. data/spec/coverage_helper.rb +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1bcc67f8bfb2475d2afc39c685d292f8dd266c79
4
- data.tar.gz: 0c8ade19144217ae44118a684a3c5defc788e99b
3
+ metadata.gz: 80a4c0c2841cf820d18204dfc416cb41e4521c03
4
+ data.tar.gz: c20da0c4e144b6abc2ede0cd71880c02c7c6877b
5
5
  SHA512:
6
- metadata.gz: c07bfe399861688859344dffe6ed72945fbce549c1536a8fa56d9e1ab02fd7c5b2037258e4af066365a1db8dd023a07e182aef4c9198bea46cfd817d61db3e44
7
- data.tar.gz: 2d0e2619a8fce7f028b5378efb9ec22e014769d2edd837d58b9ce6b1018d0e4aea109f3141ec19660ca884a760945ddffe7f6e81712f8b12e01227e80d1f6c49
6
+ metadata.gz: 5d07f997c85fdc6b96235140fb762923f311648bf1addb939f5b3b841c1e9a1882d4cbd8e4fa1833cd02227fb97b801aba983c2cc756c1ae1bd738baf724fbd9
7
+ data.tar.gz: 1c681a96bf11099975e49af5db9e601ffcaea05550b380c6b59326842fc3c89f9be83eab8adfa83ca1b91860409e69990ed953b58bd07ad233d0cf54aba380a9
data/.gitignore CHANGED
@@ -2,14 +2,7 @@ Gemfile.lock
2
2
  tester.rb
3
3
  coverage/
4
4
  pkg/
5
+ tmp/
5
6
  .idea/
6
7
  .yardoc/
7
8
  .bundle
8
-
9
- /metrics
10
- /.metrics
11
- /tmp/metric_fu
12
-
13
- /metrics
14
- /.metrics
15
- /tmp/metric_fu
data/.rubocop.yml CHANGED
@@ -1,7 +1,19 @@
1
- AsciiComments:
1
+ AllCops:
2
+ TargetRubyVersion: 2.3
3
+ Include:
4
+ - "*/**/.rb"
5
+ - "config.ru"
6
+ - "Rakefile"
7
+ - "Gemfile"
8
+ Exclude:
9
+ - "config/**/*"
10
+ - "db/**/*"
11
+ - "spec/**/*"
12
+
13
+ Alias:
2
14
  Enabled: false
3
15
 
4
- Blocks:
16
+ AsciiComments:
5
17
  Enabled: false
6
18
 
7
19
  BracesAroundHashParameters:
@@ -10,17 +22,41 @@ BracesAroundHashParameters:
10
22
  CyclomaticComplexity:
11
23
  Max: 15
12
24
 
25
+ ClassLength:
26
+ Max: 150
27
+
28
+ Documentation:
29
+ Enabled: false
30
+
13
31
  EachWithObject:
14
32
  Enabled: false
15
33
 
34
+ FormatString:
35
+ Enabled: false
36
+
37
+ FrozenStringLiteralComment:
38
+ Enabled: false
39
+
16
40
  IndentationConsistency:
17
41
  Enabled: false
18
42
 
19
43
  LineLength:
20
44
  Max: 160
21
45
 
46
+ MethodLength:
47
+ Max: 15
48
+
49
+ ModuleLength:
50
+ Max: 200
51
+
52
+ MultilineMethodCallIndentation:
53
+ Enabled: false
54
+
22
55
  ParameterLists:
23
- Max: 6
56
+ Max: 8
57
+
58
+ RegexpLiteral:
59
+ Enabled: false
24
60
 
25
61
  SignalException:
26
62
  Enabled: false
@@ -30,3 +66,12 @@ SpaceInsideHashLiteralBraces:
30
66
 
31
67
  StringLiterals:
32
68
  Enabled: false
69
+
70
+ StringLiteralsInInterpolation:
71
+ Enabled: false
72
+
73
+ StringReplacement:
74
+ Enabled: false
75
+
76
+ WordArray:
77
+ Enabled: false
data/.travis.yml CHANGED
@@ -1,9 +1,10 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.2
4
- #- jruby-head
5
- #- rbx-2.2.7
6
- script: bundle exec rake spec:coverage
3
+ - 2.3.0
4
+ script: bundle exec rake spec:ci
7
5
  gemfile: .travis-gemfile
8
6
  notifications:
9
7
  email: false
8
+ addons:
9
+ code_climate:
10
+ repo_token: 3341054bb0ae7ca3edbfa7e5c2d2aa02e8bbd940eeba651bae465a3dfb3f0d3d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 4.2.1 / 2016-03-29
2
+
3
+ * Updated dependencies and linted code.
4
+
1
5
  ### 4.2.0 / 2014-11-02
2
6
 
3
7
  * Added `Lazier::String#ensure_url_with_scheme`.
data/Gemfile CHANGED
@@ -9,13 +9,14 @@ source "http://rubygems.org"
9
9
  gemspec
10
10
 
11
11
  # Testing
12
- gem "rspec", "~> 3.1"
13
- gem "rake", "~> 10.3"
12
+ gem "rspec", "~> 3.4"
13
+ gem "rake", "~> 11.0"
14
14
 
15
15
  # Documentation
16
- gem "simplecov", ">= 0.9"
17
- gem "coveralls", ">= 0.7", require: false
18
- gem "pry", ">= 0"
19
- gem "yard", ">= 0.8"
20
- gem "kramdown", ">= 1.5"
21
- gem "github-markup", ">= 1.3" if RUBY_ENGINE != "jruby"
16
+ gem "simplecov", "~> 0.11"
17
+ gem "coveralls", "~> 0.8", require: false
18
+ gem "pry", "~> 0.10"
19
+ gem "yard", "~> 0.8"
20
+ gem "kramdown", "~> 1.10"
21
+ gem "github-markup", "~> 1.4"
22
+ gem "rubocop", "~> 0.39"
data/README.md CHANGED
@@ -5,7 +5,6 @@
5
5
  [![Build Status](https://secure.travis-ci.org/ShogunPanda/lazier.png?branch=master)](http://travis-ci.org/ShogunPanda/lazier)
6
6
  [![Code Climate](https://codeclimate.com/github/ShogunPanda/lazier.png)](https://codeclimate.com/github/ShogunPanda/lazier)
7
7
  [![Coverage Status](https://coveralls.io/repos/ShogunPanda/lazier/badge.png)](https://coveralls.io/r/ShogunPanda/lazier)
8
- [![Bitdeli Trend](https://d2weczhvl823v0.cloudfront.net/ShogunPanda/lazier/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
9
8
 
10
9
  Several Ruby object enhancements.
11
10
 
data/Rakefile CHANGED
@@ -7,21 +7,37 @@
7
7
  require "bundler/gem_tasks"
8
8
  require "rspec/core/rake_task"
9
9
 
10
+ # Compatibility layer for Rake 11.0
11
+ Rake.application.class.send(:alias_method, :last_comment, :last_description) unless Rake.application.respond_to?(:last_comment)
12
+
10
13
  RSpec::Core::RakeTask.new("spec")
11
- RSpec::Core::RakeTask.new("spec:coverage") { |t| t.ruby_opts = "-r./spec/coverage_helper" }
12
14
 
13
- desc "Generate the documentation"
15
+ RSpec::Core::RakeTask.new("spec:coverage") do
16
+ ENV["COVERAGE"] = "true"
17
+ end
18
+
19
+ RSpec::Core::RakeTask.new("spec:ci") do
20
+ ENV["COVERAGE"] = "true"
21
+ ENV["NO_COLOR"] = "true"
22
+ end
23
+
24
+ desc "Performs linting of the code using rubocop"
25
+ task "lint" do
26
+ Kernel.exec("rubocop -ED lib")
27
+ end
28
+
29
+ desc "Generates the documentation"
14
30
  task :docs do
15
31
  system("yardoc") || raise("Failed Execution of: yardoc")
16
32
  end
17
33
 
18
- desc "Get the current release version"
34
+ desc "Gets the current release version"
19
35
  task :version, :with_name do |_, args|
20
36
  gem = Bundler::GemHelper.instance.gemspec
21
37
  puts [args[:with_name] == "true" ? gem.name : nil, gem.version].compact.join("-")
22
38
  end
23
39
 
24
- desc "Prepare the release"
40
+ desc "Prepares the release"
25
41
  task :prerelease => ["spec:coverage", "docs"] do
26
42
  ["git add -A", "git commit -am \"Version #{Bundler::GemHelper.instance.gemspec.version}\""].each do |cmd|
27
43
  system(cmd) || raise("Failed Execution of: #{cmd}")
data/doc/Lazier.html CHANGED
@@ -80,7 +80,7 @@
80
80
 
81
81
  <dt class="r1 last">Defined in:</dt>
82
82
  <dd class="r1 last">lib/lazier.rb<span class="defines">,<br />
83
- lib/lazier/i18n.rb,<br /> lib/lazier/hash.rb,<br /> lib/lazier/math.rb,<br /> lib/lazier/string.rb,<br /> lib/lazier/object.rb,<br /> lib/lazier/boolean.rb,<br /> lib/lazier/version.rb,<br /> lib/lazier/settings.rb,<br /> lib/lazier/pathname.rb,<br /> lib/lazier/datetime.rb,<br /> lib/lazier/timezone.rb,<br /> lib/lazier/exceptions.rb,<br /> lib/lazier/configuration.rb</span>
83
+ lib/lazier/hash.rb,<br /> lib/lazier/math.rb,<br /> lib/lazier/i18n.rb,<br /> lib/lazier/object.rb,<br /> lib/lazier/string.rb,<br /> lib/lazier/version.rb,<br /> lib/lazier/boolean.rb,<br /> lib/lazier/pathname.rb,<br /> lib/lazier/settings.rb,<br /> lib/lazier/datetime.rb,<br /> lib/lazier/timezone.rb,<br /> lib/lazier/exceptions.rb,<br /> lib/lazier/configuration.rb</span>
84
84
  </dd>
85
85
 
86
86
  </dl>
@@ -166,6 +166,29 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
166
166
  <span class="summary_desc"><div class='inline'><p>Measure the time in milliseconds required to execute the given block.</p>
167
167
  </div></span>
168
168
 
169
+ </li>
170
+
171
+
172
+ <li class="public ">
173
+ <span class="summary_signature">
174
+
175
+ <a href="#clean_hash_compact-class_method" title="clean_hash_compact (class method)">+ (Object) <strong>clean_hash_compact</strong> </a>
176
+
177
+
178
+
179
+ </span>
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+ <span class="summary_desc"><div class='inline'><p>:nodoc:.</p>
190
+ </div></span>
191
+
169
192
  </li>
170
193
 
171
194
 
@@ -419,6 +442,29 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
419
442
  <span class="summary_desc"><div class='inline'><p>Checks if <em>all</em> of the specified modules have been loaded.</p>
420
443
  </div></span>
421
444
 
445
+ </li>
446
+
447
+
448
+ <li class="public ">
449
+ <span class="summary_signature">
450
+
451
+ <a href="#perform_load-class_method" title="perform_load (class method)">+ (Object) <strong>perform_load</strong>(mod, target = nil, extension = nil, &amp;block) </a>
452
+
453
+
454
+
455
+ </span>
456
+
457
+
458
+
459
+
460
+
461
+
462
+
463
+
464
+
465
+ <span class="summary_desc"><div class='inline'><p>:nodoc:.</p>
466
+ </div></span>
467
+
422
468
  </li>
423
469
 
424
470
 
@@ -442,6 +488,29 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
442
488
  <span class="summary_desc"><div class='inline'><p>Returns which platform are we running on.</p>
443
489
  </div></span>
444
490
 
491
+ </li>
492
+
493
+
494
+ <li class="public ">
495
+ <span class="summary_signature">
496
+
497
+ <a href="#search_class-class_method" title="search_class (class method)">+ (Object) <strong>search_class</strong>(cls, scope = nil) </a>
498
+
499
+
500
+
501
+ </span>
502
+
503
+
504
+
505
+
506
+
507
+
508
+
509
+
510
+
511
+ <span class="summary_desc"><div class='inline'><p>:nodoc:.</p>
512
+ </div></span>
513
+
445
514
  </li>
446
515
 
447
516
 
@@ -584,6 +653,52 @@ otherwise the duration alone as a number.</p>
584
653
  </td>
585
654
  </tr>
586
655
  </table>
656
+ </div>
657
+
658
+ <div class="method_details ">
659
+ <h3 class="signature " id="clean_hash_compact-class_method">
660
+
661
+ + (<tt><span class='object_link'><a href="Lazier/Object.html" title="Lazier::Object (module)">Object</a></span></tt>) <strong>clean_hash_compact</strong>
662
+
663
+
664
+
665
+
666
+
667
+ </h3><div class="docstring">
668
+ <div class="discussion">
669
+ <p>:nodoc:</p>
670
+
671
+
672
+ </div>
673
+ </div>
674
+ <div class="tags">
675
+
676
+
677
+ </div><table class="source_code">
678
+ <tr>
679
+ <td>
680
+ <pre class="lines">
681
+
682
+
683
+ 183
684
+ 184
685
+ 185
686
+ 186
687
+ 187
688
+ 188</pre>
689
+ </td>
690
+ <td>
691
+ <pre class="code"><span class="info file"># File 'lib/lazier.rb', line 183</span>
692
+
693
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_clean_hash_compact'>clean_hash_compact</span>
694
+ <span class='op'>::</span><span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_class_eval'>class_eval</span> <span class='kw'>do</span>
695
+ <span class='id identifier rubyid_remove_method'>remove_method</span><span class='lparen'>(</span><span class='symbol'>:compact</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:compact</span><span class='rparen'>)</span>
696
+ <span class='id identifier rubyid_remove_method'>remove_method</span><span class='lparen'>(</span><span class='symbol'>:compact!</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:compact!</span><span class='rparen'>)</span>
697
+ <span class='kw'>end</span>
698
+ <span class='kw'>end</span></pre>
699
+ </td>
700
+ </tr>
701
+ </table>
587
702
  </div>
588
703
 
589
704
  <div class="method_details ">
@@ -1355,6 +1470,56 @@ Otherwise the class of the object will returned.</p>
1355
1470
  </td>
1356
1471
  </tr>
1357
1472
  </table>
1473
+ </div>
1474
+
1475
+ <div class="method_details ">
1476
+ <h3 class="signature " id="perform_load-class_method">
1477
+
1478
+ + (<tt><span class='object_link'><a href="Lazier/Object.html" title="Lazier::Object (module)">Object</a></span></tt>) <strong>perform_load</strong>(mod, target = nil, extension = nil, &amp;block)
1479
+
1480
+
1481
+
1482
+
1483
+
1484
+ </h3><div class="docstring">
1485
+ <div class="discussion">
1486
+ <p>:nodoc:</p>
1487
+
1488
+
1489
+ </div>
1490
+ </div>
1491
+ <div class="tags">
1492
+
1493
+
1494
+ </div><table class="source_code">
1495
+ <tr>
1496
+ <td>
1497
+ <pre class="lines">
1498
+
1499
+
1500
+ 199
1501
+ 200
1502
+ 201
1503
+ 202
1504
+ 203
1505
+ 204
1506
+ 205
1507
+ 206</pre>
1508
+ </td>
1509
+ <td>
1510
+ <pre class="code"><span class="info file"># File 'lib/lazier.rb', line 199</span>
1511
+
1512
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_perform_load'>perform_load</span><span class='lparen'>(</span><span class='id identifier rubyid_mod'>mod</span><span class='comma'>,</span> <span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_extension'>extension</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
1513
+ <span class='ivar'>@loaded</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1514
+
1515
+ <span class='kw'>unless</span> <span class='ivar'>@loaded</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_mod'>mod</span><span class='rparen'>)</span>
1516
+ <span class='id identifier rubyid_block_given?'>block_given?</span> <span class='op'>?</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span> <span class='op'>:</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_class_eval'>class_eval</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_include'>include</span> <span class='id identifier rubyid_extension'>extension</span> <span class='rbrace'>}</span>
1517
+ <span class='ivar'>@loaded</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_mod'>mod</span>
1518
+ <span class='kw'>end</span>
1519
+ <span class='kw'>end</span></pre>
1520
+ </td>
1521
+ </tr>
1522
+ </table>
1358
1523
  </div>
1359
1524
 
1360
1525
  <div class="method_details ">
@@ -1441,6 +1606,52 @@ Otherwise the class of the object will returned.</p>
1441
1606
  </td>
1442
1607
  </tr>
1443
1608
  </table>
1609
+ </div>
1610
+
1611
+ <div class="method_details ">
1612
+ <h3 class="signature " id="search_class-class_method">
1613
+
1614
+ + (<tt><span class='object_link'><a href="Lazier/Object.html" title="Lazier::Object (module)">Object</a></span></tt>) <strong>search_class</strong>(cls, scope = nil)
1615
+
1616
+
1617
+
1618
+
1619
+
1620
+ </h3><div class="docstring">
1621
+ <div class="discussion">
1622
+ <p>:nodoc:</p>
1623
+
1624
+
1625
+ </div>
1626
+ </div>
1627
+ <div class="tags">
1628
+
1629
+
1630
+ </div><table class="source_code">
1631
+ <tr>
1632
+ <td>
1633
+ <pre class="lines">
1634
+
1635
+
1636
+ 191
1637
+ 192
1638
+ 193
1639
+ 194
1640
+ 195
1641
+ 196</pre>
1642
+ </td>
1643
+ <td>
1644
+ <pre class="code"><span class="info file"># File 'lib/lazier.rb', line 191</span>
1645
+
1646
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_search_class'>search_class</span><span class='lparen'>(</span><span class='id identifier rubyid_cls'>cls</span><span class='comma'>,</span> <span class='id identifier rubyid_scope'>scope</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
1647
+ <span class='id identifier rubyid_cls'>cls</span> <span class='op'>=</span> <span class='id identifier rubyid_scope'>scope</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>%CLASS%|[@%$?]</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='id identifier rubyid_cls'>cls</span><span class='rparen'>)</span>
1648
+ <span class='id identifier rubyid_cls'>cls</span><span class='period'>.</span><span class='id identifier rubyid_constantize'>constantize</span>
1649
+ <span class='kw'>rescue</span>
1650
+ <span class='kw'>nil</span>
1651
+ <span class='kw'>end</span></pre>
1652
+ </td>
1653
+ </tr>
1654
+ </table>
1444
1655
  </div>
1445
1656
 
1446
1657
  <div class="method_details ">
@@ -1505,9 +1716,9 @@ Otherwise the class of the object will returned.</p>
1505
1716
  </div>
1506
1717
 
1507
1718
  <div id="footer">
1508
- Generated on Sun Nov 2 11:08:44 2014 by
1719
+ Generated on Tue Mar 29 11:11:36 2016 by
1509
1720
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1510
- 0.8.7.6 (ruby-2.1.3).
1721
+ 0.8.7.6 (ruby-2.3.0).
1511
1722
  </div>
1512
1723
 
1513
1724
  </body>