klases 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 666483125ee33a0559f72a5f12716f2a29d94610
4
- data.tar.gz: 01b7e50c8275f182bbbbf4cdc498614f2a357fa9
3
+ metadata.gz: c40f838d857ab5199124fb426f078eb2586bed12
4
+ data.tar.gz: 0d58c2088e92a932c292c895d9f2fe27c74c9414
5
5
  SHA512:
6
- metadata.gz: a4281a166aa7fd16115be485916a313cc289051c79142452e4b710a6ab043de2ac27e27e3aeb7f48c53ea955feacd8c93bb01f92e073fdd44827c50e776e7bb2
7
- data.tar.gz: f79aab2b945b77f94cb61f87fdadae06cb50615a90dcaec4ea61b641db41eab74dd454a7009ded18705bdf3f455e7dde5f32af4578cda056d216666af63cf92f
6
+ metadata.gz: 22b01a827ce131d7582ae4a7a3967d86892b4346413516884729fbbc24ba0be039f5b24edfbae497eae10962ad33058d7bce262de21ead360972fe09de961bd0
7
+ data.tar.gz: e0effd26d4d4b321d253805babd52ed9af8ae6af600aecda7f626e196363dbe19db208573aedca2ecf9100a68218cbca16ff4a1298de9ffc72b558e551ce53cf
data/klases.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "klases"
3
- spec.version = "0.1.2"
3
+ spec.version = "0.1.3"
4
4
  spec.authors = ["mosop"]
5
5
  spec.email = ["mosop@a.b.com"]
6
6
 
@@ -0,0 +1,26 @@
1
+ autoload :Mutex, 'mutex'
2
+
3
+ module Klases
4
+ class AnonymousConstSet
5
+ def self.mutex
6
+ @mutex ||= ::Mutex.new
7
+ end
8
+
9
+ def self.next_index
10
+ mutex.synchronize do
11
+ @index ||= 0
12
+ @index += 1
13
+ end
14
+ end
15
+
16
+ def self.consts
17
+ @consts ||= []
18
+ end
19
+
20
+ def self.<<(const)
21
+ const_set "C#{next_index}", const
22
+ const.name # fix const name
23
+ consts << const
24
+ end
25
+ end
26
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: klases
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mosop
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-06 00:00:00.000000000 Z
11
+ date: 2015-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: quir
@@ -111,6 +111,7 @@ files:
111
111
  - bin/setup
112
112
  - klases.gemspec
113
113
  - lib/klases.rb
114
+ - lib/klases/anonymous_const_set.rb
114
115
  - lib/klases/argset.rb
115
116
  homepage: https://github.com/mosop/klases
116
117
  licenses: []