Commit Graph

3 Commits

Author SHA1 Message Date
Kouhei Sutou
88979eb39b Suppress "already initialized constant KEYS" warning
`Class.new {...}` uses a closure to define a class. Closure keeps
environment that includes local variables and so on. Assignment changes
the environment. So `klass = Class.new { KEYS = [] }` doesn't define
`klass::KEYS`. It defines `Object::KEYS`.

    a = 1
    Class.new do
      a = 2
      X = 3
    end
    p a # => 2
    p X # => 3

We need to use `const_set` to define a constant in `Class.new {...}`.
2014-10-05 15:53:44 +09:00
uu59
b36b3eb483 Add <secondary> for out_forward 2014-07-17 16:33:54 +09:00
uu59
1e0d51050c Add spec for Fluentd::Setting::Common 2014-07-17 15:43:45 +09:00