pidgin 0.0.1.pre → 0.0.2.pre
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/README.md +83 -0
- data/lib/pidgin/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: 39d2433891bc3c62f922ca889d7309a68820765f
|
4
|
+
data.tar.gz: 60ed1cb56ec6af0bdf2187b3e2fc7383b2194734
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bb3ff985339d82aafda30e2b068b7a559de8754563e3966948dd41ccd6546f2f75fc77acf88deb185ecd0cf197d4724dff3f2ff7772d218a57fc10bb5aac11c
|
7
|
+
data.tar.gz: d7f5a85ec4b18ff7c0f689800267dee995cf3e27eb64c913ca0897f0dfdff31b4cb7efb77013bd00783655c40df4a72e1eedfe307b45372280eca800d984f4b2
|
data/README.md
CHANGED
@@ -4,3 +4,86 @@
|
|
4
4
|
[](https://travis-ci.org/mtwilliams/pidgin)
|
5
5
|
[](https://codeclimate.com/github/mtwilliams/pidgin)
|
6
6
|
[](https://gemnasium.com/mtwilliams/pidgin)
|
7
|
+
|
8
|
+
Pidgin is a framework for building domain-specific languages quickly and easily. It was cobbled together for [Ryb](https://github.com/mtwilliams/ryb), a project file generator similar to Premake.
|
9
|
+
|
10
|
+
It's straight-forward to use. You define your domain-specific language, composed of objects and properties and so forth:
|
11
|
+
|
12
|
+
```Ruby
|
13
|
+
module Ryb
|
14
|
+
module DomainSpecificLanguage
|
15
|
+
include Pidgin::DomainSpecificLanguage
|
16
|
+
collection :project, Ryb::Project
|
17
|
+
end
|
18
|
+
|
19
|
+
class Project
|
20
|
+
include Pidgin::Object
|
21
|
+
property :name, String, :inline => true
|
22
|
+
collection :library, Ryb::Library, :plural => :libraries
|
23
|
+
end
|
24
|
+
|
25
|
+
class Library
|
26
|
+
include Pidgin::Object
|
27
|
+
property :name, String, :inline => true
|
28
|
+
enum :linkage, [:static, :dynamic], :default => :static
|
29
|
+
flag :gen_debug_symbols
|
30
|
+
property :files, Array, :appendable => true
|
31
|
+
# ...
|
32
|
+
end
|
33
|
+
end
|
34
|
+
```
|
35
|
+
|
36
|
+
Then you use it by calling `Pidgin::DomainSpecificLanguage.eval`, in this case through `Ryb::DomainSpecificLanguage`:
|
37
|
+
|
38
|
+
```Ruby
|
39
|
+
# Rybfile
|
40
|
+
project :name => 'vanguard' do
|
41
|
+
library :name => 'yeti' do
|
42
|
+
linkage :dynamic
|
43
|
+
|
44
|
+
configuration :name => 'debug' do
|
45
|
+
# ...
|
46
|
+
end
|
47
|
+
|
48
|
+
files ["src/yeti.cc",
|
49
|
+
"src/yeti/core/console.cc",
|
50
|
+
...]
|
51
|
+
|
52
|
+
# ...
|
53
|
+
|
54
|
+
target :name => 'windows' do
|
55
|
+
files ["src/yeti/win32_window.cc",
|
56
|
+
"src/yeti/gfx/d3d11_*.cc",
|
57
|
+
...]
|
58
|
+
end
|
59
|
+
|
60
|
+
# ...
|
61
|
+
end
|
62
|
+
end
|
63
|
+
```
|
64
|
+
|
65
|
+
```Ruby
|
66
|
+
rybfile = Ryb::DomainSpecificLanguage.eval(File.read("Rybfile"))
|
67
|
+
```
|
68
|
+
|
69
|
+
Then use your object hierarchy how you see fit:
|
70
|
+
|
71
|
+
```Ruby
|
72
|
+
rybfile[:projects].each do |project|
|
73
|
+
Ryb::XCode4.gen_project_files_for project
|
74
|
+
end
|
75
|
+
```
|
76
|
+
|
77
|
+
---
|
78
|
+
|
79
|
+
Pidgin was written quick 'n' dirty, as a result it has some warts:
|
80
|
+
|
81
|
+
1. It doesn't handle errors well.
|
82
|
+
2. It doesn't validate it's assumptions.
|
83
|
+
3. It doesn't let you specify custom validation logic.
|
84
|
+
4. It doesn't generate DSLs with the best possible syntax.
|
85
|
+
5. It has duplicated code that is quite complex in some places.
|
86
|
+
6. It has no automated testing suite.
|
87
|
+
7. There's not documentation.
|
88
|
+
|
89
|
+
I'll eventually loop-back and fix these, but that may be a while. If you want to see Pidgin become something more you'll have to contribute.
|
data/lib/pidgin/version.rb
CHANGED