rucy 0.1.42 → 0.1.43
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 +4 -4
- data/ChangeLog.md +6 -0
- data/VERSION +1 -1
- data/include/rucy/value.h.erb +21 -3
- data/src/value.cpp.erb +23 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fcc95c0c21d04de4f53c9caed38d7d6b86090836c91385e8534c867e385df93
|
4
|
+
data.tar.gz: f374debe70e1a8640adbd45080164f660e4dfc229124ab0bf4fe48eaf571ce2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb25b0053607a9aece7c77d551918e3068a159ea614e03cf82e181c2b7d6fb07f9c526b5a115ec1d066f438e8d43ef64a0e713bba4f68b05db64f9fec20f9e7c
|
7
|
+
data.tar.gz: b9f3979051fd8c8e19e656f9f0a8df01a33202a76d3650c56fbf1973733c56a3f299919ce6ca702548774b748c5af5f9c10c88c9cabaf34845d3491ed5b4dea1
|
data/ChangeLog.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.43
|
data/include/rucy/value.h.erb
CHANGED
@@ -112,6 +112,10 @@ namespace Rucy
|
|
112
112
|
|
113
113
|
Value inspect () const;
|
114
114
|
|
115
|
+
// String
|
116
|
+
|
117
|
+
const char* c_str () const;
|
118
|
+
|
115
119
|
// Array
|
116
120
|
|
117
121
|
Value push (Value obj);
|
@@ -126,16 +130,20 @@ namespace Rucy
|
|
126
130
|
|
127
131
|
const Value& operator [] (size_t i) const;
|
128
132
|
|
129
|
-
//
|
133
|
+
// Hash
|
130
134
|
|
131
|
-
|
135
|
+
void set (Value key, Value value);
|
132
136
|
|
133
|
-
|
137
|
+
Value get (Value key) const;
|
138
|
+
|
139
|
+
// String / Array
|
134
140
|
|
135
141
|
int length () const;
|
136
142
|
|
137
143
|
int size () const;
|
138
144
|
|
145
|
+
// String / Array / Hash
|
146
|
+
|
139
147
|
bool empty () const;
|
140
148
|
|
141
149
|
protected:
|
@@ -145,6 +153,16 @@ namespace Rucy
|
|
145
153
|
};// Value
|
146
154
|
|
147
155
|
|
156
|
+
class Hash : public Value
|
157
|
+
{
|
158
|
+
|
159
|
+
public:
|
160
|
+
|
161
|
+
Hash ();
|
162
|
+
|
163
|
+
};// Hash
|
164
|
+
|
165
|
+
|
148
166
|
class GlobalValue : public Value
|
149
167
|
{
|
150
168
|
|
data/src/value.cpp.erb
CHANGED
@@ -321,6 +321,12 @@ namespace Rucy
|
|
321
321
|
return call(inspect);
|
322
322
|
}
|
323
323
|
|
324
|
+
const char*
|
325
|
+
Value::c_str () const
|
326
|
+
{
|
327
|
+
return as_s(true);
|
328
|
+
}
|
329
|
+
|
324
330
|
Value
|
325
331
|
Value::push (Value obj)
|
326
332
|
{
|
@@ -357,10 +363,18 @@ namespace Rucy
|
|
357
363
|
return const_cast<Value*>(this)->operator[](i);
|
358
364
|
}
|
359
365
|
|
360
|
-
|
361
|
-
Value::
|
366
|
+
void
|
367
|
+
Value::set (Value key, Value value)
|
362
368
|
{
|
363
|
-
|
369
|
+
RUCY_SYMBOL(array_set, "[]=");
|
370
|
+
call(array_set, key, value);
|
371
|
+
}
|
372
|
+
|
373
|
+
Value
|
374
|
+
Value::get (Value key) const
|
375
|
+
{
|
376
|
+
RUCY_SYMBOL(array_get, "[]");
|
377
|
+
return call(array_get, key);
|
364
378
|
}
|
365
379
|
|
366
380
|
static int
|
@@ -395,6 +409,12 @@ namespace Rucy
|
|
395
409
|
}
|
396
410
|
|
397
411
|
|
412
|
+
Hash::Hash ()
|
413
|
+
: Value(rb_hash_new())
|
414
|
+
{
|
415
|
+
}
|
416
|
+
|
417
|
+
|
398
418
|
GlobalValue::GlobalValue ()
|
399
419
|
{
|
400
420
|
init(false);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rucy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.43
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xordog
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xot
|