minidsl 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +48 -41
- data/lib/minidsl/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0b0b55326e59aca4041b6b913815834fd28e37a
|
4
|
+
data.tar.gz: 2e9ab4c8b8cf612daa346237c17defd2628a0055
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a69c0bd699d93f6df23327027b97f381500df0da3c2982bfb55539ea5b356ef393e47895e5d52500e6e87383d9efebf526c83fa82d67296ac23c7b3c9677305
|
7
|
+
data.tar.gz: 6fc397e298bd0487993e124e3c6381581c5e68fe618d8eef0172fd97cb7ab4d634dca7fed9fc6169121ecc4a8f25e864864fc2c530fcab6dc82c7259703eb832
|
data/README.md
CHANGED
@@ -1,41 +1,48 @@
|
|
1
|
-
# Minidsl
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
1
|
+
# Minidsl
|
2
|
+
|
3
|
+
Minidsl is an DSL way to generate mainly codes.
|
4
|
+
|
5
|
+
```ruby
|
6
|
+
$: << "lib"
|
7
|
+
require 'minidsl'
|
8
|
+
|
9
|
+
include Minidsl
|
10
|
+
r = Scope.push_context :Writer
|
11
|
+
|
12
|
+
|
13
|
+
class Test
|
14
|
+
def int(opt = {})
|
15
|
+
opt.map{|k, v|
|
16
|
+
"int #{k} = #{v};"
|
17
|
+
}
|
18
|
+
end
|
19
|
+
def println(str)
|
20
|
+
"System.out.println(#{str.inspect});"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
s = pure_proxy Test.new
|
25
|
+
s.instance_eval{
|
26
|
+
int a: 3, b: 5
|
27
|
+
println "Hello world"
|
28
|
+
}
|
29
|
+
|
30
|
+
puts r.result
|
31
|
+
|
32
|
+
```
|
33
|
+
would generate
|
34
|
+
|
35
|
+
```java
|
36
|
+
int a = 3;
|
37
|
+
int b = 5;
|
38
|
+
System.out.println("Hello world");
|
39
|
+
```
|
40
|
+
## Contributing
|
41
|
+
|
42
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/RGSS3/minidsl.
|
43
|
+
|
44
|
+
|
45
|
+
## License
|
46
|
+
|
47
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
48
|
+
|
data/lib/minidsl/version.rb
CHANGED