lazier 3.2.5 → 3.2.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,4 +7,4 @@ rvm:
7
7
  script: bundle exec rake spec:coverage
8
8
  gemfile: .travis-gemfile
9
9
  notifications:
10
- email: false
10
+ email: false
@@ -969,7 +969,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
969
969
  </div>
970
970
 
971
971
  <div id="footer">
972
- Generated on Sun Jul 14 15:53:02 2013 by
972
+ Generated on Sat Jul 20 10:18:17 2013 by
973
973
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
974
974
  0.8.6.2 (ruby-1.9.3).
975
975
  </div>
@@ -288,7 +288,7 @@
288
288
  </div>
289
289
 
290
290
  <div id="footer">
291
- Generated on Sun Jul 14 15:53:03 2013 by
291
+ Generated on Sat Jul 20 10:18:18 2013 by
292
292
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
293
293
  0.8.6.2 (ruby-1.9.3).
294
294
  </div>
@@ -386,7 +386,7 @@ Options are as follows:</p>
386
386
  </div>
387
387
 
388
388
  <div id="footer">
389
- Generated on Sun Jul 14 15:53:04 2013 by
389
+ Generated on Sat Jul 20 10:18:19 2013 by
390
390
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
391
391
  0.8.6.2 (ruby-1.9.3).
392
392
  </div>
@@ -721,7 +721,7 @@ DateTime.civil(2013, 6, 1).in_months(2011)
721
721
  </div>
722
722
 
723
723
  <div id="footer">
724
- Generated on Sun Jul 14 15:53:03 2013 by
724
+ Generated on Sat Jul 20 10:18:18 2013 by
725
725
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
726
726
  0.8.6.2 (ruby-1.9.3).
727
727
  </div>
@@ -1542,7 +1542,7 @@ Date.years(1, true, 2010, true)
1542
1542
  </div>
1543
1543
 
1544
1544
  <div id="footer">
1545
- Generated on Sun Jul 14 15:53:03 2013 by
1545
+ Generated on Sat Jul 20 10:18:18 2013 by
1546
1546
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1547
1547
  0.8.6.2 (ruby-1.9.3).
1548
1548
  </div>
@@ -116,7 +116,7 @@
116
116
  </div>
117
117
 
118
118
  <div id="footer">
119
- Generated on Sun Jul 14 15:53:04 2013 by
119
+ Generated on Sat Jul 20 10:18:19 2013 by
120
120
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
121
121
  0.8.6.2 (ruby-1.9.3).
122
122
  </div>
@@ -124,7 +124,7 @@
124
124
  </div>
125
125
 
126
126
  <div id="footer">
127
- Generated on Sun Jul 14 15:53:04 2013 by
127
+ Generated on Sat Jul 20 10:18:19 2013 by
128
128
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
129
129
  0.8.6.2 (ruby-1.9.3).
130
130
  </div>
@@ -238,7 +238,7 @@
238
238
  </div>
239
239
 
240
240
  <div id="footer">
241
- Generated on Sun Jul 14 15:53:04 2013 by
241
+ Generated on Sat Jul 20 10:18:19 2013 by
242
242
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
243
243
  0.8.6.2 (ruby-1.9.3).
244
244
  </div>
@@ -111,7 +111,7 @@
111
111
  </div>
112
112
 
113
113
  <div id="footer">
114
- Generated on Sun Jul 14 15:53:02 2013 by
114
+ Generated on Sat Jul 20 10:18:17 2013 by
115
115
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
116
116
  0.8.6.2 (ruby-1.9.3).
117
117
  </div>
@@ -1056,7 +1056,7 @@
1056
1056
  </div>
1057
1057
 
1058
1058
  <div id="footer">
1059
- Generated on Sun Jul 14 15:53:02 2013 by
1059
+ Generated on Sat Jul 20 10:18:18 2013 by
1060
1060
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1061
1061
  0.8.6.2 (ruby-1.9.3).
1062
1062
  </div>
@@ -536,7 +536,7 @@
536
536
  </div>
537
537
 
538
538
  <div id="footer">
539
- Generated on Sun Jul 14 15:53:04 2013 by
539
+ Generated on Sat Jul 20 10:18:19 2013 by
540
540
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
541
541
  0.8.6.2 (ruby-1.9.3).
542
542
  </div>
@@ -121,7 +121,7 @@
121
121
  </div>
122
122
 
123
123
  <div id="footer">
124
- Generated on Sun Jul 14 15:53:02 2013 by
124
+ Generated on Sat Jul 20 10:18:18 2013 by
125
125
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
126
126
  0.8.6.2 (ruby-1.9.3).
127
127
  </div>
@@ -321,7 +321,7 @@
321
321
  </div>
322
322
 
323
323
  <div id="footer">
324
- Generated on Sun Jul 14 15:53:02 2013 by
324
+ Generated on Sat Jul 20 10:18:18 2013 by
325
325
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
326
326
  0.8.6.2 (ruby-1.9.3).
327
327
  </div>
@@ -2039,7 +2039,7 @@
2039
2039
  </div>
2040
2040
 
2041
2041
  <div id="footer">
2042
- Generated on Sun Jul 14 15:53:03 2013 by
2042
+ Generated on Sat Jul 20 10:18:18 2013 by
2043
2043
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2044
2044
  0.8.6.2 (ruby-1.9.3).
2045
2045
  </div>
@@ -213,7 +213,7 @@ Pathname.new("/usr/bin/ruby").components
213
213
  </div>
214
214
 
215
215
  <div id="footer">
216
- Generated on Sun Jul 14 15:53:04 2013 by
216
+ Generated on Sat Jul 20 10:18:19 2013 by
217
217
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
218
218
  0.8.6.2 (ruby-1.9.3).
219
219
  </div>
@@ -2405,7 +2405,7 @@
2405
2405
  </div>
2406
2406
 
2407
2407
  <div id="footer">
2408
- Generated on Sun Jul 14 15:53:04 2013 by
2408
+ Generated on Sat Jul 20 10:18:19 2013 by
2409
2409
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2410
2410
  0.8.6.2 (ruby-1.9.3).
2411
2411
  </div>
@@ -563,7 +563,7 @@
563
563
  </div>
564
564
 
565
565
  <div id="footer">
566
- Generated on Sun Jul 14 15:53:02 2013 by
566
+ Generated on Sat Jul 20 10:18:18 2013 by
567
567
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
568
568
  0.8.6.2 (ruby-1.9.3).
569
569
  </div>
@@ -1663,7 +1663,7 @@
1663
1663
  </div>
1664
1664
 
1665
1665
  <div id="footer">
1666
- Generated on Sun Jul 14 15:53:03 2013 by
1666
+ Generated on Sat Jul 20 10:18:19 2013 by
1667
1667
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1668
1668
  0.8.6.2 (ruby-1.9.3).
1669
1669
  </div>
@@ -1015,7 +1015,7 @@ DateTime.parameterize_zone(ActiveSupport::TimeZone["Pacific Time (US &amp; Canad
1015
1015
  </div>
1016
1016
 
1017
1017
  <div id="footer">
1018
- Generated on Sun Jul 14 15:53:03 2013 by
1018
+ Generated on Sat Jul 20 10:18:19 2013 by
1019
1019
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1020
1020
  0.8.6.2 (ruby-1.9.3).
1021
1021
  </div>
@@ -149,7 +149,7 @@
149
149
 
150
150
  </div>
151
151
  </dt>
152
- <dd><pre class="code"><span class='int'>5</span></pre></dd>
152
+ <dd><pre class="code"><span class='int'>6</span></pre></dd>
153
153
 
154
154
  <dt id="STRING-constant" class="">STRING =
155
155
  <div class="docstring">
@@ -180,7 +180,7 @@
180
180
  </div>
181
181
 
182
182
  <div id="footer">
183
- Generated on Sun Jul 14 15:53:03 2013 by
183
+ Generated on Sat Jul 20 10:18:18 2013 by
184
184
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
185
185
  0.8.6.2 (ruby-1.9.3).
186
186
  </div>
@@ -333,7 +333,7 @@
333
333
  </div>
334
334
 
335
335
  <div id="footer">
336
- Generated on Sun Jul 14 15:53:02 2013 by
336
+ Generated on Sat Jul 20 10:18:17 2013 by
337
337
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
338
338
  0.8.6.2 (ruby-1.9.3).
339
339
  </div>
@@ -105,7 +105,7 @@ See documentation for more informations.</p>
105
105
  </div></div>
106
106
 
107
107
  <div id="footer">
108
- Generated on Sun Jul 14 15:53:02 2013 by
108
+ Generated on Sat Jul 20 10:18:17 2013 by
109
109
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
110
110
  0.8.6.2 (ruby-1.9.3).
111
111
  </div>
@@ -105,7 +105,7 @@ See documentation for more informations.</p>
105
105
  </div></div>
106
106
 
107
107
  <div id="footer">
108
- Generated on Sun Jul 14 15:53:02 2013 by
108
+ Generated on Sat Jul 20 10:18:17 2013 by
109
109
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
110
110
  0.8.6.2 (ruby-1.9.3).
111
111
  </div>
@@ -103,7 +103,7 @@
103
103
  </div>
104
104
 
105
105
  <div id="footer">
106
- Generated on Sun Jul 14 15:53:02 2013 by
106
+ Generated on Sat Jul 20 10:18:17 2013 by
107
107
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
108
108
  0.8.6.2 (ruby-1.9.3).
109
109
  </div>
@@ -16,7 +16,7 @@ module Lazier
16
16
  MINOR = 2
17
17
 
18
18
  # The patch version.
19
- PATCH = 5
19
+ PATCH = 6
20
20
 
21
21
  # The current version of lazier.
22
22
  STRING = [MAJOR, MINOR, PATCH].compact.join(".")
@@ -65,35 +65,35 @@ describe Lazier::DateTime do
65
65
 
66
66
  describe ".list_timezones" do
67
67
  it "should forward to ActiveSupport::TimeZone" do
68
- ::ActiveSupport::TimeZone.should_receive(:list_all)
68
+ expect(::ActiveSupport::TimeZone).to receive(:list_all)
69
69
  ::DateTime.list_timezones
70
70
  end
71
71
  end
72
72
 
73
73
  describe ".find_timezone" do
74
74
  it "should forward to ActiveSupport::TimeZone" do
75
- ::ActiveSupport::TimeZone.should_receive(:find)
75
+ expect(::ActiveSupport::TimeZone).to receive(:find)
76
76
  ::DateTime.find_timezone(reference_zone.name)
77
77
  end
78
78
  end
79
79
 
80
80
  describe ".rationalize_offset" do
81
81
  it "should return the correct rational value" do
82
- ::ActiveSupport::TimeZone.should_receive(:rationalize_offset)
82
+ expect(::ActiveSupport::TimeZone).to receive(:rationalize_offset)
83
83
  ::DateTime.rationalize_offset(0)
84
84
  end
85
85
  end
86
86
 
87
87
  describe ".parameterize_zone" do
88
88
  it "should forward to ActiveSupport::TimeZone" do
89
- ::ActiveSupport::TimeZone.should_receive(:parameterize_zone)
89
+ expect(::ActiveSupport::TimeZone).to receive(:parameterize_zone)
90
90
  ::DateTime.parameterize_zone(reference_zone)
91
91
  end
92
92
  end
93
93
 
94
94
  describe ".unparameterize_zone" do
95
95
  it "should forward to ActiveSupport::TimeZone" do
96
- ::ActiveSupport::TimeZone.should_receive(:unparameterize_zone)
96
+ expect(::ActiveSupport::TimeZone).to receive(:unparameterize_zone)
97
97
  ::DateTime.unparameterize_zone(reference_zone)
98
98
  end
99
99
  end
@@ -276,7 +276,7 @@ describe Lazier::TimeZone do
276
276
  it "should correctly return current zone alias or the first one" do
277
277
  zone = ActiveSupport::TimeZone["America/Halifax"]
278
278
  expect(zone.current_alias).to eq("America/Halifax")
279
- zone.tzinfo.stub(:identifier).and_return("INVALID")
279
+ allow(zone.tzinfo).to receive(:identifier).and_return("INVALID")
280
280
  expect(zone.current_alias).to eq("America/Atlantic Time (Canada)")
281
281
  end
282
282
  end
@@ -6,17 +6,18 @@
6
6
 
7
7
  require "spec_helper"
8
8
 
9
- class Container
10
- include Lazier::I18n
11
- end
12
-
13
9
  describe Lazier::I18n do
14
- let(:object) { Container.new }
10
+ let(:object) {
11
+ c = Object.new
12
+ c.class_eval { include Lazier::I18n }
13
+ c
14
+ }
15
+
15
16
  let(:root_path) { ::File.absolute_path(::Pathname.new(::File.dirname(__FILE__)).to_s + "/../../locales/") }
16
17
 
17
18
  before(:each) do
18
19
  ENV["LANG"] = "en"
19
- ::R18n::I18n.stub(:system_locale).and_return("en")
20
+ allow(::R18n::I18n).to receive(:system_locale).and_return("en")
20
21
  end
21
22
 
22
23
  describe "#i18n_setup" do
@@ -30,14 +31,14 @@ describe Lazier::I18n do
30
31
  describe "#i18n" do
31
32
  it "should call the private method if nothing is set" do
32
33
  object.instance_variable_set(:@i18n, nil)
33
- object.should_receive(:i18n_load_locale)
34
+ expect(object).to receive(:i18n_load_locale)
34
35
  object.i18n
35
36
  end
36
37
  end
37
38
 
38
39
  describe "#i18n=" do
39
40
  it "should call the private method if nothing is set" do
40
- object.should_receive(:i18n_load_locale).and_return("LOCALE")
41
+ expect(object).to receive(:i18n_load_locale).and_return("LOCALE")
41
42
  object.i18n = :en
42
43
  expect(object.instance_variable_get(:@i18n)).to eq("LOCALE")
43
44
  end
@@ -46,34 +47,34 @@ describe Lazier::I18n do
46
47
  describe "#i18n_load_locale" do
47
48
  it "should set using system locale if called without arguments" do
48
49
  object.i18n_setup("lazier", root_path)
49
- ::R18n::I18n.should_receive(:new).with([ENV["LANG"]].compact.uniq, root_path).and_call_original
50
+ expect(::R18n::I18n).to receive(:new).with([ENV["LANG"]].compact.uniq, root_path).and_call_original
50
51
  object.i18n = nil
51
52
  end
52
53
 
53
54
  it "should set the requested locale" do
54
55
  object.i18n_setup("lazier", root_path)
55
- ::R18n::I18n.should_receive(:new).with(["it", ENV["LANG"]].compact.uniq, root_path).and_call_original
56
+ expect(::R18n::I18n).to receive(:new).with(["it", ENV["LANG"]].compact.uniq, root_path).and_call_original
56
57
  object.i18n = :it
57
58
  end
58
59
 
59
60
  it "should call the root" do
60
61
  Lazier.load!
61
62
  t = ::Object.new
63
+ expect_any_instance_of(::R18n::I18n).to receive(:t).and_return(t)
64
+ expect(t).to receive("ROOT")
62
65
  object.i18n_setup("ROOT", root_path)
63
- ::R18n::I18n.any_instance.should_receive(:t).and_return(t)
64
- t.should_receive("ROOT")
65
66
  object.i18n = :it
66
67
  end
67
68
 
68
69
  it "should only pass valid translations" do
69
70
  object.i18n_setup("lazier", root_path)
70
- ::R18n::I18n.should_receive(:new).with([ENV["LANG"]].compact.uniq, root_path).and_call_original
71
+ expect(::R18n::I18n).to receive(:new).with([ENV["LANG"]].compact.uniq, root_path).and_call_original
71
72
  object.i18n = "INVALID"
72
73
  end
73
74
 
74
75
  it "should raise an exception if no valid translation are found" do
75
76
  ENV["LANG"] = "INVALID"
76
- ::R18n::I18n.stub(:system_locale).and_return("INVALID")
77
+ allow(::R18n::I18n).to receive(:system_locale).and_return("INVALID")
77
78
  object.i18n_setup("ROOT", "/dev/")
78
79
  expect { object.i18n = "INVALID" }.to raise_error(::Lazier::Exceptions::MissingTranslation)
79
80
  end
@@ -9,14 +9,14 @@ require "spec_helper"
9
9
  describe Lazier::Localizer do
10
10
  describe "#initialize" do
11
11
  it "should call i18n_setup and then i18n=" do
12
- ::Lazier::Localizer.any_instance.should_receive(:i18n_setup).with("ROOT", "PATH")
13
- ::Lazier::Localizer.any_instance.should_receive(:i18n=).with(:it)
12
+ expect_any_instance_of(::Lazier::Localizer).to receive(:i18n_setup).with("ROOT", "PATH")
13
+ expect_any_instance_of(::Lazier::Localizer).to receive(:i18n=).with(:it)
14
14
  ::Lazier::Localizer.new("ROOT", "PATH", :it)
15
15
  end
16
16
 
17
17
  it "should setup default arguments" do
18
- ::Lazier::Localizer.any_instance.should_receive(:i18n_setup).with(:lazier, ::File.absolute_path(::Pathname.new(::File.dirname(__FILE__)).to_s + "/../../locales/"))
19
- ::Lazier::Localizer.any_instance.should_receive(:i18n=).with(nil)
18
+ expect_any_instance_of(::Lazier::Localizer).to receive(:i18n_setup).with(:lazier, ::File.absolute_path(::Pathname.new(::File.dirname(__FILE__)).to_s + "/../../locales/"))
19
+ expect_any_instance_of(::Lazier::Localizer).to receive(:i18n=).with(nil)
20
20
  ::Lazier::Localizer.new
21
21
  end
22
22
  end
@@ -24,19 +24,21 @@ describe Lazier::Localizer do
24
24
  describe ".localize" do
25
25
  it "should create a new localizer and forward the message" do
26
26
  obj = ::Object.new
27
- obj.should_receive(:string).with("ARGUMENT")
28
- ::Lazier::Localizer.should_receive(:new).and_call_original
29
- ::Lazier::Localizer.any_instance.should_receive(:i18n).and_return(obj)
30
- ::Lazier::Localizer.localize(:string, "ARGUMENT")
27
+ expect(obj).to receive(:string).with("ARGUMENT")
28
+
29
+ expect(::Lazier::Localizer).to receive(:new).and_call_original
30
+ expect_any_instance_of(::Lazier::Localizer).to receive(:i18n).and_return(obj)
31
+ ::Lazier::Localizer.localize_on_locale(:it, :string, "ARGUMENT")
31
32
  end
32
33
  end
33
34
 
34
35
  describe ".localize" do
35
36
  it "should create a new localizer and forward the message" do
36
37
  obj = ::Object.new
37
- obj.should_receive(:string).with("ARGUMENT")
38
- ::Lazier::Localizer.should_receive(:new).with(nil, nil, :it).and_call_original
39
- ::Lazier::Localizer.any_instance.should_receive(:i18n).and_return(obj)
38
+ expect(obj).to receive(:string).with("ARGUMENT")
39
+
40
+ expect(::Lazier::Localizer).to receive(:new).with(nil, nil, :it).and_call_original
41
+ expect_any_instance_of(::Lazier::Localizer).to receive(:i18n).and_return(obj)
40
42
  ::Lazier::Localizer.localize_on_locale(:it, :string, "ARGUMENT")
41
43
  end
42
44
  end
@@ -23,7 +23,7 @@ describe Lazier::Math do
23
23
  end
24
24
 
25
25
  it "should return nil for an empty array" do
26
- expect(::Math.min()).to be_nil
26
+ expect(::Math.min).to be_nil
27
27
  end
28
28
  end
29
29
 
@@ -35,7 +35,7 @@ describe Lazier::Math do
35
35
  end
36
36
 
37
37
  it "should return nil for an empty array" do
38
- expect(::Math.max()).to be_nil
38
+ expect(::Math.max).to be_nil
39
39
  end
40
40
  end
41
41
  end
@@ -23,7 +23,7 @@ describe Lazier::Settings do
23
23
 
24
24
  it "should always return the same instance" do
25
25
  instance = ::Lazier::Settings.instance
26
- ::Lazier::Settings.should_not_receive(:new)
26
+ expect(::Lazier::Settings).not_to receive(:new)
27
27
  expect(::Lazier::Settings.instance).to eq(instance)
28
28
  end
29
29
 
@@ -90,7 +90,7 @@ describe Lazier::Settings do
90
90
  expect(date_reference.lstrftime("ct_date")).to eq("ct_date")
91
91
  expect(date_reference.lstrftime(:c1)).to eq(date_reference.year.to_s)
92
92
 
93
- reference.setup_date_formats()
93
+ reference.setup_date_formats
94
94
  expect(date_reference.lstrftime(:ct_date)).to eq(date_reference.strftime("%Y-%m-%d"))
95
95
  expect(date_reference.lstrftime("c1")).to eq(date_reference.year.to_s)
96
96
 
@@ -45,10 +45,8 @@ describe Lazier do
45
45
  end
46
46
 
47
47
  describe ".find_class" do
48
- module LazierTest
49
- class TestClass
50
-
51
- end
48
+ before(:each) do
49
+ stub_const("::LazierTest::TestClass", Class.new)
52
50
  end
53
51
 
54
52
  it "should return a valid class" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazier
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.5
4
+ version: 3.2.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-14 00:00:00.000000000 Z
12
+ date: 2013-07-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  version: '0'
192
192
  segments:
193
193
  - 0
194
- hash: -1664302566483008563
194
+ hash: 4413349439810427105
195
195
  requirements: []
196
196
  rubyforge_project: lazier
197
197
  rubygems_version: 1.8.25