core_ext 0.0.3 → 0.0.4

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
  SHA1:
3
- metadata.gz: 297a3cb7c67067243ab2c8e92a08a2bfc6e00610
4
- data.tar.gz: f2931377ecad3567c6f3777505cdc55d738ae085
3
+ metadata.gz: 65bef674a3f30a7d453c6daf9c001da0ad8ce670
4
+ data.tar.gz: 4091487a2288aeeb53d9a65f16b64bd91e71962a
5
5
  SHA512:
6
- metadata.gz: cd8b33df10e3c2e4b713cdbf8103e60a78c1e6d552c863f3e7c32d1aae9a8639a132f4b69bd1eea3690c29b05d1680abc179d17d71bb8ec53909511f84316aab
7
- data.tar.gz: 985d562e5c71958e65de5c93923932c0510f1c9aa7ad5dba26916146258765425007e4f97cd6c3a282e1be4ae8550272734abf9d32410f41cd26396617e17ffe
6
+ metadata.gz: c4eedaeea00537d6013ce8a4e4176b219bc20894776a27241c6781c611382f92753923d75604ca6d2d7bcb6748dce6d2580993aeceb763b209601d4e846bd95e
7
+ data.tar.gz: 8c7e8c31d381fcfa7511f98a5764fed0fe449bfc1b524cd3968c3766ff05f59751d5686b51f016ff79f76f9475fc56b10f9a12bcf4fd8e98c15c97e430854aad
@@ -127,7 +127,7 @@ module CoreExt
127
127
 
128
128
  # Reads and writes attributes from a configuration <tt>OrderedHash</tt>.
129
129
  #
130
- # require 'active_support/configurable'
130
+ # require 'core_ext/configurable'
131
131
  #
132
132
  # class User
133
133
  # include CoreExt::Configurable
@@ -4,12 +4,12 @@ module CoreExt
4
4
  # \Deprecation specifies the API used by Rails to deprecate methods, instance
5
5
  # variables, objects and constants.
6
6
  class Deprecation
7
- # active_support.rb sets an autoload for CoreExt::Deprecation.
7
+ # core_ext.rb sets an autoload for CoreExt::Deprecation.
8
8
  #
9
9
  # If these requires were at the top of the file the constant would not be
10
10
  # defined by the time their files were loaded. Since some of them reopen
11
11
  # CoreExt::Deprecation its autoload would be triggered, resulting in
12
- # a circular require warning for active_support/deprecation.rb.
12
+ # a circular require warning for core_ext/deprecation.rb.
13
13
  #
14
14
  # So, we define the constant first, and load dependencies later.
15
15
  require 'core_ext/deprecation/instance_delegator'
@@ -21,18 +21,13 @@ module CoreExt
21
21
  if defined?(Rails.logger) && Rails.logger
22
22
  Rails.logger
23
23
  else
24
- require 'active_support/logger'
24
+ require 'core_ext/logger'
25
25
  CoreExt::Logger.new($stderr)
26
26
  end
27
27
  logger.warn message
28
28
  logger.debug callstack.join("\n ") if debug
29
29
  },
30
30
 
31
- notify: ->(message, callstack) {
32
- CoreExt::Notifications.instrument("deprecation.rails",
33
- :message => message, :callstack => callstack)
34
- },
35
-
36
31
  silence: ->(message, callstack) {},
37
32
  }
38
33
 
@@ -43,7 +38,6 @@ module CoreExt
43
38
  # [+raise+] Raise <tt>CoreExt::DeprecationException</tt>.
44
39
  # [+stderr+] Log all deprecation warnings to +$stderr+.
45
40
  # [+log+] Log all deprecation warnings to +Rails.logger+.
46
- # [+notify+] Use +CoreExt::Notifications+ to notify +deprecation.rails+.
47
41
  # [+silence+] Do nothing.
48
42
  #
49
43
  # Setting behaviors only affects deprecations that happen after boot time.
@@ -65,7 +59,6 @@ module CoreExt
65
59
  # [+raise+] Raise <tt>CoreExt::DeprecationException</tt>.
66
60
  # [+stderr+] Log all deprecation warnings to +$stderr+.
67
61
  # [+log+] Log all deprecation warnings to +Rails.logger+.
68
- # [+notify+] Use +CoreExt::Notifications+ to notify +deprecation.rails+.
69
62
  # [+silence+] Do nothing.
70
63
  #
71
64
  # Setting behaviors only affects deprecations that happen after boot time.
@@ -1,4 +1,4 @@
1
- # in case active_support/inflector is required without the rest of active_support
1
+ # in case core_ext/inflector is required without the rest of core_ext
2
2
  require 'core_ext/inflector/inflections'
3
3
  require 'core_ext/inflector/transliterate'
4
4
  require 'core_ext/inflector/methods'
@@ -199,7 +199,7 @@ module CoreExt
199
199
  # Accepts an optional <tt>format</tt>:
200
200
  # * <tt>:default</tt> - default value, mimics Ruby Time#to_s format.
201
201
  # * <tt>:db</tt> - format outputs time in UTC :db time. See Time#to_formatted_s(:db).
202
- # * Any key in <tt>Time::DATE_FORMATS</tt> can be used. See active_support/core_ext/time/conversions.rb.
202
+ # * Any key in <tt>Time::DATE_FORMATS</tt> can be used. See core_ext/core_ext/time/conversions.rb.
203
203
  def to_s(format = :default)
204
204
  if format == :db
205
205
  utc.to_s(format)
@@ -418,8 +418,9 @@ module CoreExt
418
418
 
419
419
  # Available so that TimeZone instances respond like TZInfo::Timezone
420
420
  # instances.
421
+ # https://github.com/tzinfo/tzinfo/issues/32
421
422
  def period_for_local(time, dst=true)
422
- tzinfo.period_for_local(time, dst)
423
+ tzinfo.period_for_local(time, dst) { |results| results.first }
423
424
  end
424
425
 
425
426
  def periods_for_local(time) #:nodoc:
@@ -1,3 +1,3 @@
1
1
  module CoreExt
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: core_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Panachi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-19 00:00:00.000000000 Z
11
+ date: 2015-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake